/* Through Time — Ad Astra through the ages of the web
   Owned surface: /through-time/  Cache: 20260809d */

:root {
  --tt-safe-top: env(safe-area-inset-top, 0px);
  --tt-safe-bottom: env(safe-area-inset-bottom, 0px);
  --tt-safe-left: env(safe-area-inset-left, 0px);
  --tt-safe-right: env(safe-area-inset-right, 0px);
  --tt-ease: cubic-bezier(0.2, 0.72, 0.2, 1);
  --tt-rail: 56px;
  --tt-focus: #79bdf1;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
html { background: #000; }
body.tt-body {
  min-height: 100svh;
  min-height: 100dvh;
  overflow: hidden;
  color: #eee;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-text-size-adjust: 100%;
}
body.tt-body.tt-scroll-lock { overflow: hidden; height: 100svh; height: 100dvh; }

.tt-sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* Chrome */
.tt-chrome {
  position: fixed; z-index: 100; left: 0; right: 0; top: 0;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: calc(8px + var(--tt-safe-top)) 12px 8px;
  padding-left: calc(12px + var(--tt-safe-left));
  padding-right: calc(12px + var(--tt-safe-right));
  pointer-events: none;
}
.tt-chrome > * { pointer-events: auto; }
.tt-chrome__brand {
  display: inline-flex; align-items: center; gap: 8px;
  text-decoration: none; color: inherit; font-size: 11px; letter-spacing: 0.14em;
  text-transform: uppercase; opacity: 0.85;
}
.tt-chrome__brand img { width: 18px; height: 22px; display: block; }
.tt-chrome__actions { display: flex; gap: 8px; align-items: center; }
.tt-chrome__btn {
  appearance: none; border: 1px solid rgba(255,255,255,0.28);
  background: rgba(0,0,0,0.45); color: #fff; border-radius: 999px;
  min-height: 36px; min-width: 36px; padding: 0 12px;
  font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  cursor: pointer;
}
.tt-chrome__btn:focus-visible { outline: 2px solid var(--tt-focus); outline-offset: 2px; }
.tt-chrome__btn[aria-pressed="true"] { background: rgba(121,189,241,0.25); border-color: #79bdf1; }

/* Stage host */
.tt-stage-host {
  position: relative;
  height: 100svh; height: 100dvh;
  overflow: hidden;
}
.tt-stage {
  position: absolute; inset: 0;
  opacity: 0; visibility: hidden; pointer-events: none;
  transform: translate3d(0, 12px, 0);
  transition: opacity 0.45s var(--tt-ease), transform 0.45s var(--tt-ease), visibility 0.45s;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(var(--tt-rail) + var(--tt-safe-bottom) + 72px);
}
.tt-stage.is-active {
  opacity: 1; visibility: visible; pointer-events: auto;
  transform: none; z-index: 2;
}
.tt-stage__inner {
  width: min(1120px, 100%);
  max-width: 100%;
  margin: 0 auto;
  padding: calc(58px + var(--tt-safe-top)) 14px 48px;
  box-sizing: border-box;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Timeline rail */
.tt-rail {
  position: fixed; z-index: 90; left: 0; right: 0; bottom: 0;
  height: calc(var(--tt-rail) + var(--tt-safe-bottom));
  padding: 6px 8px calc(6px + var(--tt-safe-bottom));
  background: linear-gradient(180deg, transparent, rgba(0,0,0,0.82) 28%, rgba(0,0,0,0.94));
  display: flex; align-items: center; gap: 6px;
  overflow-x: auto; overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.tt-rail::-webkit-scrollbar { display: none; }
.tt-rail__tick {
  flex: 0 0 auto; min-width: 72px; min-height: 40px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(12,16,22,0.78); color: #d7e8f8;
  border-radius: 10px; padding: 4px 8px; cursor: pointer;
  font-size: 10px; line-height: 1.15; text-align: left;
}
.tt-rail__tick strong { display: block; font-size: 10px; letter-spacing: 0.04em; }
.tt-rail__tick span { opacity: 0.65; font-size: 9px; }
.tt-rail__tick[aria-current="true"] {
  border-color: #79bdf1; box-shadow: 0 0 0 1px rgba(121,189,241,0.35);
  background: rgba(30,60,90,0.9);
}
.tt-rail__tick:focus-visible { outline: 2px solid var(--tt-focus); outline-offset: 2px; }

/* CTA bar */
.tt-cta-bar {
  position: fixed; z-index: 95;
  left: calc(12px + var(--tt-safe-left));
  right: calc(12px + var(--tt-safe-right));
  bottom: calc(var(--tt-rail) + var(--tt-safe-bottom) + 10px);
  display: flex; gap: 8px; justify-content: flex-end;
  pointer-events: none;
}
.tt-cta-bar > * { pointer-events: auto; }
.tt-cta {
  appearance: none; border: 0; cursor: pointer;
  min-height: 44px; min-width: 44px; padding: 0 14px;
  border-radius: 999px; font-weight: 650; letter-spacing: 0.08em;
  text-transform: uppercase; font-size: 11px;
  background: #f4f8fc; color: #0a1018;
  box-shadow: 0 10px 28px rgba(0,0,0,0.35);
  max-width: min(52vw, 220px);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tt-cta:focus-visible { outline: 2px solid var(--tt-focus); outline-offset: 3px; }
.tt-cta--ghost {
  background: rgba(0,0,0,0.45); color: #fff;
  border: 1px solid rgba(255,255,255,0.28); box-shadow: none;
}
.tt-cta[hidden] { display: none !important; }

/* ========== ERA 1: TERMINAL SIGNAL ========== */
.tt-stage[data-era="signal"] {
  background: #001100;
  color: #33ff66;
  font-family: "Courier New", Courier, ui-monospace, monospace;
}
.tt-stage[data-era="signal"] .tt-stage__inner { max-width: 720px; }
.tt-term {
  border: 2px solid #1a7a3a;
  background: #000a00;
  box-shadow: 0 0 40px rgba(51,255,102,0.08), inset 0 0 60px rgba(0,40,0,0.4);
  padding: 16px 12px 20px;
  position: relative;
  max-width: 100%;
  overflow-x: hidden;
}
.tt-term::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0,0,0,0.12) 3px);
  opacity: 0.35;
}
.tt-term__banner {
  white-space: pre-wrap; font-size: clamp(10px, 2.6vw, 13px); line-height: 1.35;
  margin: 0 0 14px; color: #66ff99;
}
.tt-term h1 {
  margin: 0 0 8px; font-size: clamp(1.1rem, 4.2vw, 1.55rem);
  font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
}
.tt-term__status { margin: 0 0 14px; font-size: 12px; color: #22cc55; opacity: 0.9; }
.tt-term__menu { list-style: none; margin: 0; padding: 0; }
.tt-term__menu li { margin: 0 0 8px; }
.tt-term__menu button {
  appearance: none; border: 0; background: transparent; color: #33ff66;
  font: inherit; cursor: pointer; text-align: left; padding: 6px 0; min-height: 36px;
  width: 100%;
}
.tt-term__menu button:hover, .tt-term__menu button:focus-visible {
  background: #33ff66; color: #001100; outline: none; padding-left: 6px;
}
.tt-term__body { font-size: 13px; line-height: 1.55; margin: 14px 0; overflow-wrap: anywhere; word-break: break-word; }
.tt-term__body p { margin: 0 0 10px; }
.tt-term, .tt-term__menu button { overflow-wrap: anywhere; word-break: break-word; white-space: normal; }
.tt-term__banner {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-all;
  max-width: 100%;
  overflow-x: hidden;
}
.tt-term__prompt { margin-top: 16px; display: flex; gap: 8px; align-items: center; font-size: 13px; }
.tt-term__cursor {
  display: inline-block; width: 0.6em; height: 1.1em; background: #33ff66;
  animation: tt-blink 1.05s steps(1) infinite; vertical-align: text-bottom;
}
@keyframes tt-blink { 50% { opacity: 0; } }
.tt-term__mark {
  width: 28px; height: 34px; margin: 0 0 10px;
  filter: brightness(0) saturate(100%) invert(64%) sepia(92%) saturate(404%) hue-rotate(79deg) brightness(1.05) drop-shadow(0 0 6px #33ff66);
}

/* ========== ERA 2: STARFIELD HOMESTEAD ========== */
.tt-stage[data-era="homestead"] {
  background: #000033 url("/assets/public/through-time/starfield-tile.svg") repeat;
  color: #ffffcc;
  font-family: "Comic Sans MS", "Comic Sans", "Chalkboard SE", cursive, system-ui, sans-serif;
}
.tt-geo {
  background: rgba(0,0,51,0.72);
  border: 4px ridge #c0c0c0;
  padding: 12px;
  max-width: 100%;
  overflow-x: hidden;
}
.tt-geo__top {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}
.tt-geo h1 {
  margin: 0; font-size: clamp(1.4rem, 5vw, 2.2rem); color: #ff66ff;
  text-shadow: 2px 2px 0 #000, 0 0 12px #ff00ff;
}
.tt-geo__marquee {
  overflow: hidden; background: #000080; color: #ffff00;
  border: 2px solid #fff; padding: 6px 8px; margin: 8px 0 12px; font-size: 12px;
  line-height: 1.35;
}
.tt-geo__marquee span {
  display: inline-block;
  white-space: nowrap;
  padding-left: 100%;
  animation: tt-marquee 22s linear infinite;
}
@keyframes tt-marquee { to { transform: translateX(-100%); } }
@media (max-width: 520px) {
  .tt-geo__marquee span {
    white-space: normal;
    padding-left: 0;
    animation: none;
  }
}
.tt-geo__grid {
  display: grid; grid-template-columns: 1fr; gap: 12px;
}
@media (min-width: 720px) {
  .tt-geo__grid { grid-template-columns: 180px 1fr 160px; }
}
.tt-geo__panel {
  background: #000066; border: 3px outset #9999ff; padding: 10px; font-size: 13px; line-height: 1.45;
  color: #ccffff; overflow-wrap: anywhere; word-break: break-word;
}
.tt-geo h1, .tt-geo__panel p, .tt-geo table { overflow-wrap: anywhere; word-break: break-word; }
.tt-geo__panel h2 { margin: 0 0 8px; color: #ffff00; font-size: 15px; }
.tt-geo__panel ul { margin: 0; padding-left: 18px; }
.tt-geo__panel a { color: #00ffff; }
.tt-geo__badges { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; align-items: center; }
.tt-geo__blink { animation: tt-blink 1.2s steps(1) infinite; color: #ff3333; font-weight: 700; }
.tt-geo table { width: 100%; border-collapse: collapse; font-size: 12px; }
.tt-geo td { border: 1px solid #6666aa; padding: 6px; vertical-align: top; }

/* ========== ERA 3: DIRECTORY NEXUS ========== */
.tt-stage[data-era="portal"] {
  background: linear-gradient(180deg, #dce6f2 0%, #f4f7fb 40%, #ffffff 100%);
  color: #1a1a2e;
  font-family: Tahoma, Verdana, "Segoe UI", Arial, sans-serif;
}
.tt-portal-wrap { color: #1a1a2e; }
.tt-portal-banner {
  background: linear-gradient(90deg, #003399, #0066cc 40%, #3399ff);
  color: #fff; padding: 10px 12px; border: 1px solid #002266;
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between;
}
.tt-portal-banner h1 { margin: 0; font-size: clamp(1.1rem, 3.5vw, 1.6rem); font-weight: 700; }
.tt-portal-search {
  display: flex; gap: 6px; flex: 1 1 220px; max-width: 420px;
}
.tt-portal-search input {
  flex: 1; min-height: 32px; border: 1px solid #6688aa; padding: 4px 8px; font: inherit;
}
.tt-portal-search button {
  min-height: 32px; border: 1px solid #334466; background: #e8eef8; padding: 0 10px; cursor: pointer;
}
.tt-portal-cols {
  display: grid; gap: 10px; margin-top: 10px;
  grid-template-columns: 1fr;
}
@media (min-width: 800px) {
  .tt-portal-cols { grid-template-columns: 1.2fr 1fr 1fr; }
}
.tt-portal-box {
  background: #fff; border: 1px solid #99aacc; box-shadow: 2px 2px 0 #ccd6e8;
  max-width: 100%; overflow-wrap: anywhere; word-break: break-word;
}
.tt-portal-box h2 {
  margin: 0; padding: 6px 10px; font-size: 13px; color: #fff;
  background: linear-gradient(180deg, #4a6fa5, #2f4f7f);
}
.tt-portal-box .body { padding: 10px; font-size: 12.5px; line-height: 1.45; overflow-wrap: anywhere; word-break: break-word; }
.tt-portal-box ul { margin: 0; padding-left: 16px; }
.tt-portal-box li { margin-bottom: 6px; }
.tt-portal-box a { color: #0033cc; }
.tt-portal-ticker {
  margin-top: 10px; background: #ffffee; border: 1px solid #cccc88;
  padding: 6px 10px; font-size: 12px;
}

/* ========== ERA 4: CONNECTED GLOSS ========== */
.tt-stage[data-era="gloss"] {
  background: linear-gradient(165deg, #1a2744 0%, #2b4570 45%, #1e3358 100%);
  color: #f5f8fc;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}
.tt-gloss-hero {
  text-align: center; padding: 28px 12px 18px;
  background: radial-gradient(ellipse at 50% 0%, rgba(120,180,255,0.25), transparent 55%);
}
.tt-gloss-hero h1 {
  margin: 0; font-size: clamp(1.8rem, 6vw, 3rem); letter-spacing: -0.03em;
  text-shadow: 0 2px 0 rgba(0,0,0,0.25);
}
.tt-gloss-hero p { max-width: 36ch; margin: 12px auto 0; opacity: 0.88; line-height: 1.5; }
.tt-gloss-badge {
  display: inline-block; margin-top: 14px; padding: 4px 12px; border-radius: 999px;
  background: linear-gradient(180deg, #7ec8ff, #3a8fd4); color: #04203a;
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.55), 0 2px 8px rgba(0,0,0,0.25);
}
.tt-gloss-grid {
  display: grid; gap: 14px; grid-template-columns: 1fr; margin-top: 8px;
}
@media (min-width: 700px) {
  .tt-gloss-grid { grid-template-columns: repeat(3, 1fr); }
}
.tt-gloss-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.18), rgba(255,255,255,0.08));
  border: 1px solid rgba(255,255,255,0.28);
  border-radius: 14px; padding: 16px;
  box-shadow: 0 10px 24px rgba(0,0,0,0.18), inset 0 1px 0 rgba(255,255,255,0.35);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.tt-gloss-card h2 { margin: 0 0 8px; font-size: 1.05rem; }
.tt-gloss-card p { margin: 0; font-size: 0.92rem; line-height: 1.5; opacity: 0.9; }
.tt-gloss-feed {
  margin-top: 16px; border-radius: 12px; overflow: hidden;
  border: 1px solid rgba(255,255,255,0.2); background: rgba(0,0,0,0.18);
}
.tt-gloss-feed header {
  padding: 8px 12px; font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase;
  background: rgba(255,255,255,0.08);
}
.tt-gloss-feed article {
  padding: 10px 12px; border-top: 1px solid rgba(255,255,255,0.1);
  font-size: 13px; line-height: 1.45;
}

/* ========== ERA 5: HANDSET ========== */
.tt-stage[data-era="hand"] {
  background: #f6f7f9; color: #12141a;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
}
.tt-hand-app {
  max-width: min(420px, 100%); margin: 0 auto;
  background: #fff; border-radius: 22px;
  box-shadow: 0 18px 50px rgba(15,20,40,0.12);
  overflow: visible; border: 1px solid rgba(0,0,0,0.06);
}
.tt-hand-status {
  display: flex; justify-content: space-between; padding: 10px 16px 4px;
  font-size: 12px; font-weight: 600; color: #111;
}
.tt-hand-body { padding: 8px 18px 22px; }
.tt-hand-body h1 {
  margin: 8px 0 6px; font-size: clamp(1.7rem, 7vw, 2.1rem);
  letter-spacing: -0.035em; line-height: 1.05; font-weight: 700;
}
.tt-hand-body p { margin: 0 0 14px; color: #4a5160; line-height: 1.5; font-size: 0.98rem; }
.tt-hand-tiles {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
.tt-hand-tile {
  background: #f0f3f8; border-radius: 16px; padding: 14px; min-height: 96px;
}
.tt-hand-tile strong { display: block; font-size: 0.92rem; margin-bottom: 4px; }
.tt-hand-tile span { font-size: 0.78rem; color: #5b6472; line-height: 1.35; }
.tt-hand-bar {
  margin-top: 16px; display: flex; justify-content: space-around;
  border-top: 1px solid #e6e9ef; padding-top: 12px; font-size: 10px;
  letter-spacing: 0.06em; text-transform: uppercase; color: #6b7280;
}
.tt-hand-bar span[aria-current="true"] { color: #0b5fff; font-weight: 700; }

/* ========== ERA 6: BUSINESS CARD (present) ========== */
.tt-stage[data-era="card"] {
  background: #050b12; color: #f4f8fc;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
}
.tt-card {
  min-height: calc(100svh - 120px);
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  text-align: center; padding: 24px 16px 40px;
}
.tt-card h1 {
  margin: 0; font-size: clamp(2.4rem, 10vw, 4.6rem);
  line-height: 0.96; letter-spacing: -0.045em; font-weight: 520;
}
.tt-card h1 span { display: block; }
.tt-card__support {
  max-width: 34ch; margin: 22px auto 0; color: rgba(222,233,244,0.72);
  font-size: clamp(1rem, 2.6vw, 1.2rem); line-height: 1.5; font-weight: 380;
}
.tt-card__bridge {
  margin: 28px 0 0; letter-spacing: 0.16em; font-size: 0.72rem; font-weight: 650;
  color: rgba(201,222,240,0.58);
}
.tt-card__toward {
  margin-top: 28px; display: inline-flex; flex-direction: column; align-items: center;
  text-decoration: none; color: inherit; gap: 10px;
}
.tt-card__toward img { width: min(220px, 58vw); height: auto; }
.tt-card__toward-rule {
  width: 48px; height: 1px; background: rgba(191,220,246,0.28);
}
.tt-card__next-hint {
  margin-top: 40px; font-size: 0.78rem; letter-spacing: 0.18em;
  text-transform: uppercase; color: rgba(169,220,255,0.72);
}

/* ========== ERA 7: MASS DRIVER / FUTURE ========== */
.tt-stage[data-era="launch"] {
  background: #02050a; color: #e8f4ff;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
  overflow: hidden;
}
.tt-launch {
  position: relative; min-height: calc(100svh - 100px);
  display: grid; place-items: center; padding: 20px 12px 36px;
}
.tt-launch__canvas-wrap {
  position: absolute; inset: 0; z-index: 0; overflow: hidden;
}
.tt-launch__canvas-wrap canvas {
  width: 100%; height: 100%; display: block;
}
.tt-launch__copy {
  position: relative; z-index: 2; text-align: center; max-width: 28rem;
  padding: 20px 14px; border-radius: 18px;
  background: rgba(2,8,16,0.55); border: 1px solid rgba(140,200,255,0.18);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.tt-launch__kicker {
  margin: 0 0 10px; color: #8fd0ff; letter-spacing: 0.22em;
  font-size: 0.68rem; text-transform: uppercase; font-weight: 650;
}
.tt-launch h1 {
  margin: 0; font-size: clamp(2rem, 8vw, 3.4rem);
  letter-spacing: -0.04em; line-height: 0.98; font-weight: 520;
}
.tt-launch p {
  margin: 14px auto 0; max-width: 34ch; color: rgba(210,230,248,0.78);
  line-height: 1.55; font-size: 1rem;
}
.tt-launch__list {
  list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 8px; text-align: left;
}
.tt-launch__list li {
  padding: 10px 12px; border-radius: 12px;
  background: rgba(255,255,255,0.04); border: 1px solid rgba(150,200,255,0.12);
  font-size: 0.9rem; line-height: 1.4;
}
.tt-launch__list strong { color: #b7e0ff; font-weight: 650; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .tt-stage { transition: opacity 0.01ms; transform: none; }
  .tt-term__cursor, .tt-geo__blink { animation: none; }
  .tt-geo__marquee span { animation: none; padding-left: 0; white-space: normal; }
}

/* Print / noscript note */
.tt-noscript {
  padding: 24px; background: #111; color: #eee; font-family: system-ui, sans-serif;
}
