/* --------------------------------------------------
   BASE
-------------------------------------------------- */

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  min-height: 100%;
}

body {
  background: #a2bff2;
  color: #000;
  font-family: Helvetica, Arial, sans-serif;
}


/* --------------------------------------------------
   PAGE
-------------------------------------------------- */

.page {
  position: relative;

  width: 100%;
  min-height: 100vh;

  padding:
    clamp(80px, 24vh, 280px) clamp(60px, 11vw, 180px) clamp(40px, 9vw, 140px);

  display: flex;
  align-items: flex-start;
}


/* --------------------------------------------------
   MAIN IDENTITY
-------------------------------------------------- */

.identity {
  width: 100%;
  max-width: 1100px;
}


/* --------------------------------------------------
   NAME
-------------------------------------------------- */

h1 {
  margin: 0;

  font-family: "Arial Black", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: clamp(50px, 6.5vw, 105px);
  font-weight: 900;

  line-height: 0.78;
  letter-spacing: -0.08em;

  /* Optical alignment with text below */
  margin-left: -0.075em;
}


/* --------------------------------------------------
   LOCATION
-------------------------------------------------- */

.location {
  margin: 10px 0 0;

  font-size: clamp(12px, 1.15vw, 16px);
  line-height: 1;
}


/* --------------------------------------------------
   DESCRIPTION
-------------------------------------------------- */

.description {

  margin: 40px 0 0;

  font-size: clamp(21px, 2.35vw, 34px);

  font-weight: 500;

  line-height: 0.94;

  letter-spacing: -0.04em;

}


/* --------------------------------------------------
   LINKS
-------------------------------------------------- */

.links {

  margin-top: 30px;

  display: flex;

  flex-direction: column;

  align-items: flex-start;

}

.links a {
  color: #000;
  text-decoration: none;

  font-size: clamp(18px, 1.8vw, 26px);
  font-weight: 400;
  line-height: 1.1;

  letter-spacing: -0.025em;
}

.links a:hover {
  font-weight: 700;
}


/* --------------------------------------------------
   PATCH CABLE MENUS
-------------------------------------------------- */

.route-menu {
  position: relative;
  width: fit-content;
}

.route-menu summary {
  display: flex;
  align-items: center;
  gap: 9px;

  width: fit-content;

  cursor: pointer;
  list-style: none;

  font-size: clamp(18px, 1.8vw, 26px);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.025em;
}

.route-menu summary::marker {
  content: "";
}

.route-menu summary::-webkit-details-marker {
  display: none;
}

.route-menu summary:hover {
  font-weight: 700;
}

/* Physical jacks */

.route-menu .jack {
  display: inline-block;
  flex: 0 0 9px;

  width: 9px;
  height: 9px;

  border: 1px solid #000;
  border-radius: 50%;

  background: #a2bff2;

  position: relative;
  z-index: 2;
}

/* Parent jack is filled when patched */

.route-menu[open] summary .jack {
  background: #000;
}

.source-jacks {
  display: none;
  gap: 5px;
  align-items: center;
}

.route-menu[open] .source-jacks {
  display: flex;
}

.route-menu[open] summary .source-jacks .jack {
  background: #000;
}

/* Destinations */

.route-options {
  position: relative;
  display: flex;
  flex-direction: column;
  width: fit-content;
  padding: 4px 0 12px 80px;
}

.route-options a,
.route-options button {
  display: flex;
  align-items: center;
  gap: 9px;

  width: fit-content;

  margin: 0;
  padding: 0;

  border: none;
  background: transparent;
  color: #000;

  font-family: Helvetica, Arial, sans-serif;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.6;
  letter-spacing: -0.025em;

  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.route-options a:hover,
.route-options button:hover {
  font-weight: 700;
}

.route-options a:hover .jack,
.route-options button:hover .jack {
  background: #000;
}

/* SVG cable layer */

.patch-cables {
  position: absolute;
  inset: 0;

  width: 100%;
  height: 100%;

  overflow: visible;

  pointer-events: none;
  z-index: 1;
}

.patch-cables path {
  fill: none;
  stroke: rgba(0, 0, 0, 0.8);
  stroke-width: 0.5;
  stroke-linecap: round;
}

/* Opening animation */

:root {
  interpolate-size: allow-keywords;
}

.route-menu::details-content {
  height: 0;
  overflow: clip;
  transition:
    height 0.25s ease,
    content-visibility 0.25s ease allow-discrete;
}

.route-menu[open]::details-content {
  height: auto;
}

.route-menu[open] .route-options {
  animation: route-reveal 0.25s ease-out;
}

@keyframes route-reveal {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}


/* --------------------------------------------------
   AVAILABILITY REQUEST
-------------------------------------------------- */

.availability {
  position: absolute;

  right: clamp(30px, 5vw, 80px);
  bottom: clamp(30px, 5vw, 70px);

  width: min(460px, calc(100vw - 60px));

  text-align: right;
}

/* Toggle */

.availability summary {
  display: inline-block;

  cursor: pointer;
  list-style: none;

  font-size: clamp(18px, 1.7vw, 24px);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.025em;
}

.availability summary::marker {
  content: "";
}

.availability summary::-webkit-details-marker {
  display: none;
}

.availability summary:hover {
  font-weight: 700;
}

/* Form opens upward */

.availability[open] .availability-content {
  position: absolute;

  bottom: calc(100% + 25px);
  right: 0;

  width: 100%;

  max-height: calc(100dvh - 160px);
  overflow-y: auto;

  padding: 20px;

  background: #a2bff2;
  z-index: 10;

  text-align: left;
}

/* Form */

#availability-form {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

#availability-form[hidden] {
  display: none;
}

#availability-form input,
#availability-form textarea,
#availability-form select {
  width: 100%;
  min-width: 0;

  margin: 0;
  padding: 15px 0;

  border: none;
  border-bottom: 1px solid rgba(0, 0, 0, 0.55);
  border-radius: 0;

  background: transparent;
  color: #000;

  font-family: Helvetica, Arial, sans-serif;
  font-size: 17px;
  font-weight: 400;
  line-height: 1.3;

  outline: none;
}

#availability-form textarea {
  resize: vertical;
  min-height: 80px;
}

#availability-form input:focus,
#availability-form textarea:focus,
#availability-form select:focus {
  border-bottom-width: 2px;
}

#availability-form input::placeholder,
#availability-form textarea::placeholder {
  color: rgba(0, 0, 0, 0.65);
  opacity: 1;
}

#availability-form select:invalid {
  color: rgba(0, 0, 0, 0.65);
}

#availability-form select option {
  color: #000;
}

/* Submit */

.submit-inquiry {
  align-self: flex-start;

  margin-top: 35px;
  padding: 0;

  border: none;
  background: none;
  color: #000;

  font-family: inherit;
  font-size: 22px;
  font-weight: 600;

  cursor: pointer;
}

.submit-inquiry:hover {
  font-weight: 800;
}

.submit-inquiry:disabled {
  opacity: 0.5;
  cursor: wait;
}

/* Messages */

.availability-note {
  margin-top: 20px;

  font-size: 12px;
  line-height: 1.4;
  opacity: 0.65;
}

.form-feedback {
  margin-top: 25px;
  font-size: 16px;
  line-height: 1.4;
}

.form-feedback[hidden] {
  display: none;
}



/* --------------------------------------------------
   MAYSUN
-------------------------------------------------- */

.links .maysun {
  position: relative;

  margin-top: 20px;

  color: #000;
  text-decoration: none;

  font-size: 13px;
  font-weight: 400;

  letter-spacing: -0.02em;
  line-height: 1;

  opacity: 0.4;

  transition: opacity 0.2s ease;
}

/* Cross-out */

.maysun::after {
  content: "";

  position: absolute;

  left: -10%;
  top: 50%;

  width: 120%;
  height: 2px;

  background: #000;

  transform: rotate(-7deg);

  pointer-events: none;
}

/* Hover */

.links .maysun:hover {
  opacity: 1;
  font-weight: 700;
}

.maysun:hover::after {
  display: none;
}

/* Mobile availability link: hidden on desktop */

.availability-mobile {
  display: none;
}

/* --------------------------------------------------
   MOBILE
-------------------------------------------------- */

@media (max-width: 600px) {

  .page {
    padding: 35px 24px 60px;
    display: block;
  }

  .identity {
    margin-top: 5vh;
    transform: none;
  }

  header {
    width: fit-content;
    margin: 0 auto;
  }

  h1 {
    font-size: clamp(34px, 10.5vw, 46px);
    line-height: 0.8;
    letter-spacing: -0.08em;
    margin-left: -0.075em;
  }

  .location {
    margin-top: 3px;
    font-size: 12px;
    text-align: left;
  }

  .description {
    margin-top: 30px;
    font-size: 23px;
    text-align: center;
    line-height: 1.02;
  }

  .links {
    margin-top: 80px;
    align-items: center;
    width: 100%;
  }

  .links a {
    font-size: 21px;
  }


  .links .maysun {
    margin-top: 10px;
    font-size: 12px;
  }

  /* Hide desktop dropdown */

  .availability {
    display: none;
  }

  /* Mobile link in normal page flow */

  .availability-mobile {
    display: block;

    width: fit-content;
    margin: max(100px, 25vh) auto 0;

    color: #000;
    text-decoration: none;

    font-size: 18px;
    font-weight: 600;
    letter-spacing: -0.025em;
    line-height: 1.2;

    text-align: center;
  }

  .availability-mobile:hover {
    font-weight: 700;
  }

  .route-menu summary {

    font-size: 21px;

  }

  .route-options {
    padding: 14px 0 18px 45px;
  }


  .route-options a,

  .route-options button {

    font-size: 16px;

  }

}

@media (prefers-reduced-motion: reduce) {

  .route-menu::details-content {

    transition: none;

  }

  .route-menu[open] .route-options {

    animation: none;

  }

}

.route-menu summary:focus-visible,
.route-options a:focus-visible,
.route-options button:focus-visible,
.links .maysun:focus-visible,
.availability summary:focus-visible,
.availability-mobile:focus-visible,
.submit-inquiry:focus-visible {
  outline: 2px solid #000;
  outline-offset: 4px;
}

/* --------------------------------------------------
   FILM GRAIN
-------------------------------------------------- */

.grain-overlay {
  position: fixed;
  inset: 0;

  background-image: url("assets/images/misc/grain.gif");
  background-repeat: repeat;

  opacity: 0.08;
  mix-blend-mode: soft-light;

  pointer-events: none;
  z-index: 9999;
}