:root {
  --canvas: #070b12;
  --ink: #f4f7fb;
  --silver: #c5d0dc;
  --mute: #9aa8b8;
  --line: rgba(154, 168, 184, 0.55);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--canvas);
  color: var(--ink);
  font-family: Inter, system-ui, sans-serif;
}

body {
  overflow: hidden;
  min-height: 100dvh;
}

button, a { -webkit-tap-highlight-color: transparent; }

#app {
  position: fixed;
  inset: 0;
  height: 100dvh;
  height: 100svh;
}

#stage {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

.scrim {
  pointer-events: none;
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, #070b12 0%, rgba(7, 11, 18, 0.82) 12%, rgba(7, 11, 18, 0.32) 30%, transparent 48%),
    radial-gradient(ellipse at 50% 38%, transparent 0%, rgba(7, 11, 18, 0.12) 60%, rgba(7, 11, 18, 0.72) 100%);
}

@property --a {
  syntax: "<color>";
  inherits: true;
  initial-value: #f2c766;
}

@property --b {
  syntax: "<color>";
  inherits: true;
  initial-value: #fff1c8;
}

@property --glow {
  syntax: "<color>";
  inherits: true;
  initial-value: rgba(255, 196, 100, 0.5);
}

.chrome {
  --a: #f2c766;
  --b: #fff1c8;
  --glow: rgba(255, 196, 100, 0.5);
  transition: --a 0.8s var(--ease), --b 0.8s var(--ease), --glow 0.8s var(--ease);
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7rem;
  padding:
    0.5rem
    max(1rem, env(safe-area-inset-right))
    max(0.85rem, env(safe-area-inset-bottom))
    max(1rem, env(safe-area-inset-left));
  pointer-events: none;
}

.wordmark, .tagline, .controls, .segs { pointer-events: auto; }

.wordmark {
  margin: 0;
  max-width: min(92vw, 18em);
  text-align: center;
  font-family: Syncopate, Inter, sans-serif;
  font-weight: 700;
  font-size: clamp(0.98rem, 3.6vw, 1.85rem);
  line-height: 1.12;
  padding: 0.04em 0 0.06em;
  letter-spacing: 0.28em;
  background-image:
    linear-gradient(108deg, transparent 38%, rgba(255, 255, 255, 0.95) 47%, transparent 56%),
    linear-gradient(180deg, var(--b) 0%, var(--a) 100%);
  background-image:
    linear-gradient(108deg, transparent 38%, rgba(255, 255, 255, 0.95) 47%, transparent 56%),
    linear-gradient(180deg, var(--b) 0%, var(--a) 58%, color-mix(in srgb, var(--a) 70%, #000) 100%);
  background-size: 250% 100%, 100% 100%;
  background-position: 120% 0, 0 0;
  background-repeat: no-repeat;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-wrap: balance;
  filter: drop-shadow(0 0 14px var(--glow)) drop-shadow(0 1px 0 rgba(0, 0, 0, 0.6));
  animation: sheen 7s var(--ease) infinite;
}

.wordmark.swap {
  animation: sheen 7s var(--ease) infinite, reveal 0.9s var(--ease) both;
}

.tagline.swap { animation: lift 0.7s var(--ease) 0.12s both; }

@keyframes sheen {
  0%, 30% { background-position: 120% 0, 0 0; }
  70%, 100% { background-position: -30% 0, 0 0; }
}

@keyframes reveal {
  from {
    opacity: 0;
    letter-spacing: 0.62em;
    filter: blur(10px) drop-shadow(0 0 0 transparent);
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    filter: blur(0) drop-shadow(0 0 14px var(--glow)) drop-shadow(0 1px 0 rgba(0, 0, 0, 0.6));
    transform: none;
  }
}

@keyframes lift {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: none; }
}

.wordmark[data-long="true"] {
  font-size: clamp(0.86rem, 3.4vw, 1.7rem);
  letter-spacing: 0.16em;
  white-space: nowrap;
}

.tagline {
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  max-width: 92vw;
  color: #bfb5a2;
  font-size: clamp(0.62rem, 1.5vw, 0.72rem);
  font-weight: 500;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  text-align: center;
}

.tagline::before,
.tagline::after {
  content: "";
  width: clamp(1.25rem, 8vw, 4.2rem);
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--a));
  opacity: 0.8;
  flex: 0 0 auto;
}

.tagline::after { transform: scaleX(-1); }

.controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  width: min(100%, 34rem);
}

.arrow, .visit, .seg {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.arrow {
  width: 3rem;
  height: 3rem;
  min-width: 44px;
  min-height: 44px;
  border: 0;
  padding: 0;
  background: transparent;
  color: #e9dcc2;
  display: grid;
  place-items: center;
  transition: color 0.3s var(--ease), transform 0.3s var(--ease);
}

.arrow svg { width: 1.35rem; height: 1.35rem; }

.arrow:active { transform: scale(0.92); }

.arrow:focus-visible, .visit:focus-visible, .seg:focus-visible {
  outline: 1px solid rgba(255, 217, 140, 0.8);
  outline-offset: 3px;
}

.visit {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  min-width: 9.2rem;
  min-height: 44px;
  padding: 0.8rem 1.35rem;
  text-decoration: none;
  letter-spacing: 0.36em;
  font-size: 0.62rem;
  font-weight: 500;
  text-transform: uppercase;
  color: #f7efe0;
  background: linear-gradient(180deg, rgba(40, 34, 24, 0.82), rgba(7, 11, 18, 0.88));
  border: 1px solid rgba(232, 196, 120, 0.72);
  box-shadow:
    inset 0 0 0 3px rgba(7, 11, 18, 0.85),
    inset 0 0 0 4px rgba(240, 201, 120, 0.24),
    0 12px 32px -14px rgba(255, 190, 90, 0.45);
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.visit svg {
  width: 1rem;
  height: 0.62rem;
  color: var(--a);
  filter: drop-shadow(0 0 4px var(--glow));
  transition: transform 0.3s var(--ease);
}

.segs {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.2rem 0 0.15rem;
}

.seg {
  width: 1.7rem;
  height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  display: grid;
  place-items: center;
}

.seg::before {
  content: "";
  width: 0.7rem;
  height: 2px;
  background: #4f5560;
  transition: width 0.35s var(--ease), background 0.35s var(--ease);
}

.seg[aria-current="true"]::before {
  width: 2.15rem;
  background: linear-gradient(90deg, transparent, var(--a) 30%, var(--b) 50%, var(--a) 70%, transparent);
  box-shadow: 0 0 12px var(--glow);
}

.fallback {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 3;
  margin: 0;
  padding: max(1.5rem, env(safe-area-inset-top)) 1.25rem 1.5rem;
  list-style: none;
  overflow: auto;
  background: var(--canvas);
}

body.flat .fallback { display: block; }
body.flat #stage,
body.flat .scrim,
body.flat .chrome { display: none; }

.fallback a {
  display: block;
  padding: 1rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--ink);
  text-decoration: none;
  font-family: Syncopate, Inter, sans-serif;
  letter-spacing: 0.12em;
  font-size: 0.95rem;
}

.fallback a span {
  display: block;
  margin-top: 0.35rem;
  font-family: Inter, sans-serif;
  letter-spacing: 0;
  font-size: 0.85rem;
  color: var(--mute);
}

@media (hover: hover) and (pointer: fine) {
  .arrow:hover { color: #ffd98a; }
  .visit:hover {
    border-color: #ffd98a;
    color: #fff;
    background: linear-gradient(180deg, rgba(62, 50, 30, 0.86), rgba(7, 11, 18, 0.86));
    box-shadow:
      inset 0 0 0 3px rgba(7, 11, 18, 0.85),
      inset 0 0 0 4px rgba(255, 217, 140, 0.45),
      0 14px 36px -12px rgba(255, 190, 90, 0.6);
  }
  .visit:hover svg { transform: translateX(3px); }
  .seg:hover::before { background: #8a7a5c; }
  .seg[aria-current="true"]:hover::before { background: linear-gradient(90deg, transparent, var(--a) 30%, var(--b) 50%, var(--a) 70%, transparent); }
}

@media (max-height: 520px) {
  .chrome { gap: 0.35rem; }
  .tagline::before, .tagline::after { width: 1rem; }
  .wordmark,
  .wordmark[data-long="true"] {
    font-size: clamp(0.95rem, 4.2vh, 1.55rem);
    letter-spacing: 0.08em;
  }
}

@media (max-height: 430px) {
  .chrome { gap: 0.22rem; padding-top: 0; }
  .wordmark,
  .wordmark[data-long="true"] {
    font-size: clamp(0.85rem, 3.5vh, 1.2rem);
  }
}

@media (min-width: 900px) and (min-height: 700px) {
  .chrome { gap: 0.95rem; padding-bottom: max(1.4rem, env(safe-area-inset-bottom)); }
  .visit { min-width: 11.5rem; min-height: 46px; font-size: 0.66rem; letter-spacing: 0.38em; }
  .arrow { width: 3.4rem; height: 3.4rem; }
}

@media (min-width: 1800px) and (min-height: 1000px) {
  .wordmark { font-size: 2.3rem; }
  .wordmark[data-long="true"] { font-size: 2.1rem; }
  .tagline { font-size: 0.82rem; }
  .visit { min-width: 13rem; min-height: 52px; font-size: 0.74rem; }
  .arrow { width: 3.8rem; height: 3.8rem; }
  .arrow svg { width: 1.55rem; height: 1.55rem; }
  .seg { width: 2rem; }
}

@media (prefers-reduced-motion: reduce) {
  .visit, .visit svg, .arrow, .seg::before { transition: none; }
  .wordmark, .wordmark.swap, .tagline.swap { animation: none; }
  .chrome { transition: none; }
}
