/* Page shell: outer background, dark canvas, header, floating glass capsule, mobile menu, footer. */

html {
  scroll-behavior: smooth;
}

.outer {
  padding: var(--outer-pad);
}

.canvas {
  position: relative;
  isolation: isolate;
  min-height: calc(100svh - 2 * var(--outer-pad));
  background: var(--bg);
  border-radius: var(--radius-canvas);
  overflow: clip;
  /* thin metallic edge */
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5), 0 40px 120px -40px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

#main {
  display: block;
}

/* shared horizontal rhythm */
.wrap {
  width: 100%;
  max-width: calc(var(--max-w) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ------------------------------------------------------------------ header */
.site-header {
  position: absolute;
  z-index: 30;
  inset: 0 0 auto 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  min-height: calc(var(--nav-h) + 2 * var(--nav-offset));
  padding: var(--nav-offset) var(--gutter);
}
.site-header::after {
  /* keeps the capsule centered even though it is fixed: reserves its width in the grid */
  content: '';
  grid-column: 2;
  grid-row: 1;
  width: clamp(160px, 16vw, 220px);
}

.brand {
  grid-column: 1;
  grid-row: 1;
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  border-radius: 10px;
}
.brand__mark {
  width: 30px;
  height: 30px;
  flex: none;
  transition: transform 0.9s var(--ease);
}
.brand:hover .brand__mark,
.brand:focus-visible .brand__mark {
  transform: rotate(180deg);
}
.brand__text {
  display: grid;
  line-height: 1;
  gap: 5px;
}
.brand__name {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 15px;
  letter-spacing: 0.2em;
  text-indent: 0.02em;
}
.brand__role {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-meta);
  white-space: nowrap;
}

.header-links {
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
  display: flex;
  align-items: center;
  gap: clamp(14px, 2vw, 28px);
}
.ext-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-2);
  transition: color 0.3s var(--ease);
}
.ext-link:hover,
.ext-link:focus-visible {
  color: var(--text);
}
.ext-link .icon {
  width: 13px;
  height: 13px;
  transition: transform 0.45s var(--ease);
}
.ext-link:hover .icon,
.ext-link:focus-visible .icon {
  transform: translate(2px, -2px);
}
/* in-page link: its arrow points down-right, so it nudges the same way */
.ext-link--page:hover .icon,
.ext-link--page:focus-visible .icon {
  transform: translate(2px, 2px);
}

.menu-btn {
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
  display: none;
  align-items: center;
  gap: 10px;
  height: 44px;
  padding: 0 18px;
  border-radius: var(--radius-pill);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  font-size: 13.5px;
  font-weight: 500;
  -webkit-backdrop-filter: blur(var(--glass-blur));
  backdrop-filter: blur(var(--glass-blur));
}
.menu-btn__bars {
  display: grid;
  gap: 4px;
}
.menu-btn__bars i {
  display: block;
  width: 14px;
  height: 1.5px;
  background: currentColor;
  border-radius: 2px;
}

/* ------------------------------------------------------------------ glass capsule */
.capsule {
  position: fixed;
  z-index: 60;
  top: calc(var(--outer-pad) + var(--nav-offset));
  left: 50%;
  translate: -50% 0;
  display: flex;
  align-items: center;
  height: var(--nav-h);
  padding: 4px;
  border-radius: var(--radius-pill);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.03)), rgba(20, 20, 20, 0.5);
  border: 1px solid var(--glass-border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), inset 0 -1px 0 rgba(0, 0, 0, 0.35), 0 10px 34px -6px rgba(0, 0, 0, 0.55);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(150%);
  backdrop-filter: blur(var(--glass-blur)) saturate(150%);
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease);
}
.capsule__ind {
  position: absolute;
  z-index: 0;
  top: 4px;
  bottom: 4px;
  left: 0;
  width: var(--w, 0px);
  transform: translateX(var(--x, 0px));
  border-radius: var(--radius-pill);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.09));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 1px 6px rgba(0, 0, 0, 0.4);
  opacity: 0;
  transition: transform 0.55s var(--ease), width 0.55s var(--ease), opacity 0.3s;
  pointer-events: none;
}
.capsule[data-active] .capsule__ind {
  opacity: 1;
}
.capsule a {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  height: 100%;
  padding: 0 clamp(16px, 1.6vw, 22px);
  border-radius: var(--radius-pill);
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: -0.005em;
  color: var(--text-2);
  transition: color 0.3s var(--ease);
}
.capsule a:hover,
.capsule a:focus-visible,
.capsule a[aria-current='true'] {
  color: #fff;
}

/* ------------------------------------------------------------------ mobile menu overlay */
.menu {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: calc(var(--outer-pad) + 14px) calc(var(--outer-pad) + 18px) calc(var(--outer-pad) + 22px);
  background: rgba(8, 8, 8, 0.94);
  -webkit-backdrop-filter: blur(24px);
  backdrop-filter: blur(24px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s var(--ease), visibility 0s linear 0.4s;
  overflow-y: auto;
}
.menu.is-open {
  opacity: 1;
  visibility: visible;
  transition-delay: 0s;
}
.menu__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.menu__close {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 44px;
  padding: 0 18px;
  border-radius: var(--radius-pill);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  font-size: 13.5px;
  font-weight: 500;
}
.menu__links {
  display: grid;
  margin-block: auto;
  padding-block: 32px;
}
.menu__links a {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2.4rem, 12vw, 4.2rem);
  letter-spacing: var(--track-display);
  line-height: 1.05;
  transform: translateY(14px);
  opacity: 0;
  transition: transform 0.7s var(--ease), opacity 0.7s var(--ease), color 0.3s;
  transition-delay: calc(var(--i, 0) * 50ms + 60ms);
}
.menu.is-open .menu__links a {
  transform: none;
  opacity: 1;
}
.menu__links a small {
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: 0.08em;
  color: var(--text-meta);
}
.menu__links a[aria-current='true'] {
  color: var(--text-2);
}
.menu__foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  align-items: center;
  justify-content: space-between;
  color: var(--text-2);
  font-size: var(--fs-small);
}
.menu__foot .ext-link {
  min-height: 40px;
}

/* ------------------------------------------------------------------ section scaffolding */
.section {
  position: relative;
  padding-block: clamp(72px, 11vw, 180px);
}
.section__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
  margin-bottom: clamp(40px, 6vw, 96px);
}
.section__title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--fs-h2);
  line-height: 0.95;
  letter-spacing: var(--track-display);
  text-wrap: balance;
}
.section__title .accent {
  font-size: 1.04em;
  letter-spacing: -0.02em;
}

/* ------------------------------------------------------------------ availability + clock */
.status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 28px;
  padding: 0 14px 0 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-2);
  white-space: nowrap;
}
.status__dot {
  position: relative;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #f5f5f5;
  flex: none;
}
.status[data-state='available'] .status__dot::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.55);
  animation: ping 2.6s var(--ease) infinite;
}
.status[data-state='limited'] .status__dot {
  background: linear-gradient(90deg, #f5f5f5 50%, transparent 50%);
  box-shadow: inset 0 0 0 1px #f5f5f5;
}
.status[data-state='unavailable'] .status__dot {
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--text-3);
}
@keyframes ping {
  0% {
    transform: scale(0.6);
    opacity: 1;
  }
  80%,
  100% {
    transform: scale(1.5);
    opacity: 0;
  }
}
html:not(.anim) .status__dot::after {
  animation: none;
  opacity: 0;
}

.clock {
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-meta);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ------------------------------------------------------------------ footer */
.site-footer {
  position: relative;
  padding: clamp(40px, 6vw, 96px) 0 0;
  overflow: clip;
}
.footer__top {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--col-gap);
  align-items: end;
  padding-bottom: clamp(40px, 6vw, 88px);
}
.footer__cta {
  grid-column: 1 / span 7;
}
.footer__cta p {
  max-width: 28ch;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--fs-h3);
  line-height: 1.05;
  letter-spacing: -0.035em;
  text-wrap: balance;
}
.footer__cta .accent {
  font-size: 1.05em;
}
.footer__nav {
  grid-column: 9 / span 4;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 24px;
}
.footer__col {
  display: grid;
  align-content: start;
  gap: 2px;
}
.footer__col h2 {
  margin-bottom: 12px;
}
.footer__col a,
.footer__col button {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  justify-self: start;
  font-size: 0.9375rem;
  color: var(--text-2);
  transition: color 0.3s var(--ease);
}
.footer__col a:hover,
.footer__col a:focus-visible,
.footer__col button:hover,
.footer__col button:focus-visible {
  color: var(--text);
}

.footer__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 24px;
  padding-block: 20px;
  border-top: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-meta);
}
.footer__bar-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 22px;
}
.to-top {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 4px;
  color: var(--text-2);
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  transition: color 0.3s var(--ease);
}
.to-top:hover,
.to-top:focus-visible {
  color: var(--text);
}
.to-top__circle {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  transition: transform 0.5s var(--ease), background-color 0.3s, color 0.3s;
}
.to-top:hover .to-top__circle,
.to-top:focus-visible .to-top__circle {
  transform: translateY(-3px);
  background: #f5f5f5;
  color: #080808;
}
.to-top .icon {
  width: 14px;
  height: 14px;
}

.footer__word {
  position: relative;
  margin-top: -0.02em;
  font-family: var(--font-display);
  font-weight: 500;
  /* sized so the word spans exactly the content width (the word is ~4.2em wide), capped on huge screens */
  font-size: clamp(3.5rem, calc((100vw - 2 * var(--outer-pad) - 2 * var(--gutter)) / 4.2), 26rem);
  line-height: 0.74;
  letter-spacing: -0.06em;
  text-indent: -0.08em; /* optical centering: the R has a wider left bearing than the P has on the right */
  white-space: nowrap;
  text-align: center;
  user-select: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92) 0%, rgba(255, 255, 255, 0.16) 70%, rgba(255, 255, 255, 0) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: rgba(255, 255, 255, 0.3);
  /* background-clip:text only paints inside the box, and the box is shorter than the capitals:
     give the glyph tops room so they are not sliced flat, and pull the box back up by the same amount */
  padding-top: 0.07em;
  margin-top: -0.09em;
  padding-bottom: 0.08em;
}

/* ------------------------------------------------------------------ responsive */
@media (max-width: 900px) {
  :root {
    --nav-offset: 14px;
  }
  .header-links {
    display: none;
  }
  .menu-btn {
    display: inline-flex;
  }
  .site-header::after {
    display: none;
  }
  .site-header {
    grid-template-columns: 1fr auto;
  }
  .brand__role {
    display: none;
  }
  /* the capsule moves into thumb reach */
  .capsule {
    top: auto;
    bottom: calc(max(env(safe-area-inset-bottom), 0px) + var(--outer-pad) + 14px);
  }
  .site-footer {
    padding-bottom: 88px;
  }
  .footer__cta,
  .footer__nav {
    grid-column: 1 / -1;
  }
  .footer__nav {
    margin-top: 24px;
  }
}
@media (max-width: 520px) {
  :root {
    --radius-canvas: 24px;
  }
  .brand__name {
    font-size: 14px;
  }
}

/* ------------------------------------------------------------------ error + not-found states */
.fatal,
.nf {
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 22px;
  min-height: calc(100svh - 2 * var(--outer-pad));
  padding-top: calc(var(--nav-h) + 2 * var(--nav-offset) + 24px);
  padding-bottom: 72px;
}
.fatal__title,
.nf__title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--fs-display);
  line-height: 0.95;
  letter-spacing: var(--track-display);
  text-wrap: balance;
}
.fatal__text,
.nf__text {
  max-width: 46ch;
  color: var(--text-2);
  font-size: var(--fs-lead);
  line-height: 1.35;
}
.nf__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* on small screens the Menu button floats like the capsule, so it stays reachable while scrolling */
@media (max-width: 900px) {
  .menu-btn {
    position: fixed;
    z-index: 60;
    top: calc(var(--outer-pad) + var(--nav-offset));
    right: calc(var(--outer-pad) + clamp(12px, 3vw, 24px));
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.03)), rgba(20, 20, 20, 0.5);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 10px 34px -6px rgba(0, 0, 0, 0.55);
  }
}
