/* Hallmark · macrostructure: Marquee Hero · genre: atmospheric · tone: technical · anchor hue: signal orange · pre-emit critique: P5 H5 E4 S5 R4 V4 */
/* ==========================================================================
   PERENNOS H.Y.W.I. — T.W.I.Y. System CSS
   Palette: Carbon #07080a, Bone #e9e6df, Steel #8b949b, Line #262b30, Signal #ff5b1f
   ========================================================================== */

@font-face {
  font-family: 'Archivo';
  src: url('/fonts/archivo-latin-variable.woff2') format('woff2');
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: 'Instrument Serif';
  src: url('/fonts/instrument-serif-italic-latin.woff2') format('woff2');
  font-style: italic;
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('/fonts/jetbrains-mono-latin-700.woff2') format('woff2');
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: 'HYWI Heavy Fallback';
  src: local('Arial Bold');
  font-weight: 800 900;
  size-adjust: 101.4358%;
  ascent-override: 86.5572%;
  descent-override: 20.7028%;
  line-gap-override: 0%;
}
@font-face {
  font-family: 'HYWI Body Fallback';
  src: local('Arial');
  size-adjust: 101.4358%;
  ascent-override: 86.5572%;
  descent-override: 20.7028%;
  line-gap-override: 0%;
}
@font-face {
  font-family: 'HYWI Human Fallback';
  src: local('Times New Roman Italic');
  font-weight: 400;
  font-style: italic;
  size-adjust: 87.7159%;
  ascent-override: 112.8642%;
  descent-override: 35.3414%;
  line-gap-override: 0%;
}
@font-face {
  font-family: 'HYWI Mono Fallback';
  src: local('Courier New Bold');
  font-weight: 700;
  size-adjust: 99.98373%;
  ascent-override: 102.0166%;
  descent-override: 30.0049%;
  line-gap-override: 0%;
}

:root {
  --carbon: #07080a;
  --bone: #e9e6df;
  --steel: #8b949b;
  --line: #262b30;
  --signal: #ff5b1f;
  --ice: #a9c3cf;
  --carbon-surface: #0f1114;
  --shadow-black-95: rgb(0 0 0 / 95%);
  --shadow-black-52: rgb(0 0 0 / 52%);
  --shadow-tag: 0 4px 20px var(--shadow-black-95), 0 0 0 1px var(--carbon);
  --shadow-panel: 0 18px 64px var(--shadow-black-52);

  --f-display: 'Archivo', 'HYWI Heavy Fallback', 'HYWI Body Fallback', 'Arial Narrow', 'Arial Black', Impact, sans-serif;
  --f-serif: 'Instrument Serif', 'HYWI Human Fallback', 'Times New Roman', Georgia, serif;
  --f-mono: 'JetBrains Mono', 'HYWI Mono Fallback', 'SF Mono', Consolas, 'Courier New', monospace;

  color-scheme: dark;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  min-height: 100%;
  overflow-x: clip;
  background-color: var(--carbon);
  color: var(--bone);
  font-family: var(--f-display);
  scrollbar-width: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html {
  scroll-behavior: smooth;
  scroll-padding-block: 1rem;
}

main {
  position: relative;
  width: 100%;
}

.pin-track {
  position: relative;
  width: 100%;
  height: 350svh;
}

.pin-hero {
  position: sticky;
  top: 0;
  z-index: 6;
  width: 100%;
  height: 100svh;
}

.hero-overlays {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100svh;
  z-index: 6;
  pointer-events: none;
  opacity: var(--hero-alpha, 1);
  transform: translate3d(0, var(--hero-lift, 0px), 0);
  transition: opacity 180ms linear, transform 180ms linear;
  will-change: opacity, transform;
}

.hero-overlays.is-faded { visibility: hidden; }

html::-webkit-scrollbar {
  display: none;
}

/* 3D WebGL Canvas */
#stage {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100svh;
  display: block;
  z-index: 1;
}

/* Live Grain Overlay */
.grain {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100svh;
  pointer-events: none;
  z-index: 3;
  opacity: 0.08;
  mix-blend-mode: screen;
}

/* Scanlines */
.scan {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.18) 0 1px,
    transparent 1px 3px
  );
}

/* Cinema Letterbox Bands */
.lb {
  position: fixed;
  left: 0;
  right: 0;
  height: 4.2svh;
  background: var(--carbon);
  z-index: 4;
  pointer-events: none;
}
.lb.t { top: 0; }
.lb.b { bottom: 0; }

/* Corner Brackets */
.frame {
  position: fixed;
  inset: calc(4.2svh + 14px) max(18px, env(safe-area-inset-right, 0px)) calc(4.2svh + 14px) max(18px, env(safe-area-inset-left, 0px));
  pointer-events: none;
  z-index: 5;
}
.frame i {
  position: absolute;
  width: 18px;
  height: 18px;
  border-color: var(--steel);
  border-style: solid;
  opacity: 0.7;
}
.frame i:nth-child(1) { left: 0; top: 0; border-width: 1px 0 0 1px; }
.frame i:nth-child(2) { right: 0; top: 0; border-width: 1px 1px 0 0; }
.frame i:nth-child(3) { left: 0; bottom: 0; border-width: 0 0 1px 1px; }
.frame i:nth-child(4) { right: 0; bottom: 0; border-width: 0 1px 1px 0; }

/* Header Navigation Bar */
header {
  position: fixed;
  top: calc(4.2svh + 22px);
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 max(44px, env(safe-area-inset-right, 0px)) 16px max(44px, env(safe-area-inset-left, 0px));
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.brand {
  color: var(--bone);
  text-decoration: none;
  display: flex;
  align-items: center;
  transition: color 0.2s ease;
}

.brand:hover, .brand:focus-visible {
  color: var(--signal);
}

.brand:focus-visible, .pill:focus-visible, .choice:focus-visible {
  outline: 2px solid var(--bone);
  outline-offset: 3px;
}

.brand-wordmark {
  height: 18px;
  width: auto;
  display: block;
}

nav {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-pills {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pill {
  all: unset;
  cursor: pointer;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.28em;
  color: var(--bone);
  padding: 8px 14px;
  border: 1px solid var(--line);
  display: flex;
  gap: 10px;
  align-items: center;
  text-decoration: none;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.pill em {
  font-family: var(--f-serif);
  font-style: italic;
  letter-spacing: 0;
  font-size: 14px;
  color: var(--steel);
  text-transform: none;
}

.pill.active {
  border-color: rgba(233, 230, 223, 0.55);
}

.pill.active em {
  color: var(--bone);
}

.pill:hover, .pill:focus-visible {
  border-color: var(--signal);
}

.pill.opt {
  cursor: default;
  color: var(--steel);
  letter-spacing: 0.18em;
}

/* Progress / Altitude Rail */
.altrail {
  position: fixed;
  right: 44px;
  top: 30svh;
  height: 40svh;
  width: 1px;
  background: var(--line);
  z-index: 6;
  pointer-events: none;
}

.altrail i {
  position: absolute;
  left: -3px;
  top: var(--rail-progress, 0%);
  width: 7px;
  height: 1px;
  background: var(--signal);
}

/* Bottom Left Hero Content */
.hero-left {
  position: fixed;
  left: max(44px, env(safe-area-inset-left, 0px));
  bottom: calc(4.2svh + 26px);
  z-index: 6;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  max-width: min(600px, 80%);
  padding: 8px;
  border-radius: 4px;
}

.kicker {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.24em;
  color: var(--steel);
  text-transform: uppercase;
  margin-bottom: 12px;
}

.human-line {
  margin: 0 0 24px 0;
  line-height: 0.90;
  letter-spacing: -0.025em;
  min-width: 0;
  overflow-wrap: anywhere;
}

.human-line em {
  font-family: var(--f-serif);
  font-weight: 400;
  font-style: italic;
  font-size: clamp(54px, 7.6vw, 112px);
  color: var(--bone);
  text-wrap: pretty;
}

/* HUD Readouts */
.hud {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--steel);
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
  line-height: 1.5;
  pointer-events: none;
}

.hud b {
  color: var(--bone);
  font-weight: 500;
}

.hud .sig {
  color: var(--signal);
}

.hud.bl {
  margin-top: 4px;
}

/* Bottom Right Hero Content */
.hero-right {
  position: fixed;
  right: max(44px, env(safe-area-inset-right, 0px));
  bottom: calc(4.2svh + 26px);
  z-index: 6;
  display: flex;
  pointer-events: auto;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
  padding: 8px;
  border-radius: 4px;
}

.hero-left, .hero-right {
  text-shadow:
    0 0 2px rgba(7, 8, 10, 0.9),
    0 0 10px rgba(7, 8, 10, 0.48);
}

.choices {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 22px;
  pointer-events: auto;
  min-width: 250px;
}

.choice {
  all: unset;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  font-family: var(--f-mono);
  font-size: 11.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bone);
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.choice:first-child {
  border-top: 1px solid var(--line);
}

.choice .choice-arrow {
  color: var(--steel);
  font-family: var(--f-mono);
  font-size: 13px;
  transition: transform 0.2s ease, color 0.2s ease;
}

.choice:hover, .choice:focus-visible, .choice.active {
  color: var(--signal);
  border-bottom-color: var(--signal);
}

.choice:hover:first-child, .choice:focus-visible:first-child, .choice.active:first-child {
  border-top-color: var(--signal);
}

.choice:hover .choice-arrow, .choice:focus-visible .choice-arrow, .choice.active .choice-arrow {
  transform: translateX(4px);
  color: var(--signal);
}

.choice:active {
  color: var(--bone);
}

.hud.br {
  text-align: right;
}

/* 3D Anchored Labels (Tags) with Crisp Leader Lines */
#tags {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 7;
  opacity: var(--hero-alpha, 1);
}

#tags.is-section { opacity: 1; }

#tagHybrid {
  min-width: 176px;
  color: var(--steel);
}

.tag {
  position: fixed;
  left: 50%;
  top: 50%;
  max-width: calc(100% - 32px);
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--steel);
  text-transform: uppercase;
  white-space: normal;
  pointer-events: none;
  transform: translate(-50%, -100%);
  margin-top: -14px;
  padding: 6px 14px;
  background: var(--carbon);
  border: 1px solid var(--line);
  opacity: 0;
  transition: opacity 0.4s ease;
  line-height: 1.4;
  text-align: center;
  box-shadow: var(--shadow-tag);
  z-index: 10;
}

.tag::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 1px;
  height: 8px;
  background: var(--signal);
}

.tag.visible {
  opacity: 1;
}

.tag b {
  display: block;
  font-family: var(--f-display);
  font-variation-settings: 'wdth' 125;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.04em;
  color: var(--bone);
}

.tag.sig b {
  color: var(--signal);
}

.mode-section {
  position: relative;
  z-index: 5;
  width: 100%;
  min-height: 100svh;
  display: flex;
  padding: clamp(28px, 7vw, 112px);
  color: var(--bone);
}

.section-sovereign { align-items: flex-end; justify-content: flex-start; }
.section-offsite { align-items: flex-end; justify-content: flex-end; }
.section-hybrid { align-items: flex-start; justify-content: flex-start; padding-top: clamp(112px, 14svh, 160px); }

.mode-copy {
  width: min(560px, 100%);
  padding: clamp(22px, 4vw, 46px);
  background: var(--carbon-surface);
  box-shadow: var(--shadow-panel);
}

.mode-copy h2 {
  margin-bottom: 18px;
  color: var(--bone);
  font-size: clamp(28px, 4.4vw, 58px);
  line-height: 0.98;
  letter-spacing: -0.035em;
  overflow-wrap: anywhere;
}

.mode-copy p {
  max-width: 48ch;
  color: var(--bone);
  font-family: var(--f-display);
  font-size: clamp(16px, 1.45vw, 19px);
  line-height: 1.55;
}

/* Mobile Layout (390x844) */
@media (max-width: 768px) {
  header {
    padding-left: max(18px, env(safe-area-inset-left, 0px));
    padding-right: max(18px, env(safe-area-inset-right, 0px));
  }

  .brand-wordmark {
    height: 15px;
  }

  .nav-pills .pill em,
  .nav-pills .pill.opt {
    display: none;
  }

  .altrail {
    right: 16px;
  }

  .hero-left {
    left: max(18px, env(safe-area-inset-left, 0px));
    right: max(18px, env(safe-area-inset-right, 0px));
    bottom: calc(4.2svh + 174px);
    max-width: none;
    padding: 0;
  }

  .human-line {
    margin-bottom: 10px;
  }

  .human-line em {
    font-size: clamp(34px, 9.5vw, 48px);
  }

  .kicker {
    font-size: 7px;
    letter-spacing: 0.08em;
    white-space: nowrap;
  }

  .hud.bl {
    font-size: 9px;
  }

  .hero-right {
    left: max(18px, env(safe-area-inset-left, 0px));
    right: max(18px, env(safe-area-inset-right, 0px));
    bottom: calc(4.2svh + 16px);
    align-items: stretch;
    width: auto;
    padding: 0;
  }

  .choices {
    width: 100%;
    min-width: 0;
    margin-bottom: 8px;
  }

  .choice {
    padding: 9px 0;
    font-size: 10.5px;
  }

  .hud.br {
    width: 100%;
    font-size: 9px;
    display: flex;
    justify-content: space-between;
    text-align: left;
  }

  .tag {
    font-size: 8.5px;
    padding: 3px 6px;
  }
  .tag b {
    font-size: 11px;
  }

  .mode-section {
    min-height: 100svh;
    padding: max(20px, env(safe-area-inset-top, 0px)) max(18px, env(safe-area-inset-right, 0px)) max(26px, env(safe-area-inset-bottom, 0px)) max(18px, env(safe-area-inset-left, 0px));
  }

  .section-sovereign { align-items: flex-end; }
  .section-offsite { align-items: flex-end; justify-content: flex-end; }
  .section-hybrid { align-items: flex-start; padding-top: max(112px, env(safe-area-inset-top, 0px)); }

  .mode-copy {
    width: min(440px, 100%);
    padding: 22px;
  }

  .mode-copy h2 {
    margin-bottom: 12px;
    font-size: clamp(26px, 8vw, 36px);
  }

  .mode-copy p {
    font-size: 16px;
  }
}

@media (max-width: 359px) {
  header {
    display: grid;
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 0 max(13px, env(safe-area-inset-right, 0px)) 8px max(8px, env(safe-area-inset-left, 0px));
  }

  header > nav {
    justify-self: end;
  }
}

/* Reduced Motion Mode */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .pin-track { height: 100svh; }
  .pin-hero { position: relative; height: 100svh; }
  .hero-overlays { position: absolute; transition: none; transform: none; opacity: 1; }
  .hero-left, .hero-right, .altrail, #tags, .tag { position: absolute; }
  .mode-section { scroll-margin-block-start: 0; }
  .grain {
    display: none;
  }
  .choice, .choice-arrow, .pill, .tag, .altrail i {
    transition: none !important;
  }
}

/* S14 exact-address contact route */
.hywi-contact { position: relative; z-index: 5; padding: clamp(28px, 7vw, 112px); background: var(--carbon); }
.hywi-contact a { display: inline-flex; align-items: center; min-block-size: 44px; max-inline-size: 100%; color: var(--bone); font: inherit; white-space: nowrap; }
.hywi-contact a:hover { color: var(--signal); }
.hywi-contact a:focus-visible { outline: 3px solid var(--bone); outline-offset: 4px; }
.hywi-contact a:active { opacity: .8; }
