/* CountertopTTX — coming-soon briefing.
   Color/atmosphere matched to the live "Situation Room" landing
   (apps/web/web/app/page.tsx): warm-black ground, cream ink, amber as
   the single accent. Type: Fraunces (display) + IBM Plex Mono (body). */

:root {
  --bg:          #0c0a07;
  --bg-elev:     #15110b;
  --ink:         #ede4d3;
  --ink-dim:     #a8a08e;
  --ink-faint:   #5c554a;
  --hair:        rgba(237, 228, 211, 0.08);
  --hair-strong: rgba(237, 228, 211, 0.16);
  --amber:       #ffb24a;
  --amber-dim:   #9a6a2a;
  --green:       #7cd672;
  --red:         #ff4940;

  --serif: "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --mono:  "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --content-max: 880px;
  --pad-x: clamp(22px, 5vw, 56px);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { background: var(--bg); }

body {
  font-family: var(--mono);
  color: var(--ink);
  font-feature-settings: "ss01" 1, "ss02" 1, "zero" 1, "cv11" 1, "kern" 1;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  background: var(--bg);
}

/* ─── Atmosphere — vignette, grid, grain, drifting scanline ──────────────── */

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.grain::before,
.grain::after,
.grain > i {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* warm vignette */
.grain::before {
  background:
    radial-gradient(ellipse 70% 60% at 80% -10%, rgba(255, 178, 74, 0.10), transparent 55%),
    radial-gradient(ellipse 80% 70% at 10% 110%, rgba(255, 73, 64, 0.08), transparent 55%),
    radial-gradient(ellipse 80% 80% at 50% 50%, transparent 0%, var(--bg) 92%);
}

/* faint grid + a top hairline */
.grain::after {
  background-image:
    linear-gradient(rgba(237, 228, 211, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(237, 228, 211, 0.028) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(ellipse at 50% 30%, #000 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 30%, #000 30%, transparent 80%);
}

/* paper-noise grain layer */
.grain > i {
  background-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
  opacity: 0.07;
}

/* drifting amber scanline (re-using the live site's tt-scan motif) */
.scanline {
  position: fixed;
  inset-inline: 0;
  top: 0;
  height: 1px;
  pointer-events: none;
  z-index: 1;
  background: linear-gradient(90deg, transparent, rgba(255, 178, 74, 0.30), transparent);
  animation: tt-scan 9s linear infinite;
}

@keyframes tt-scan {
  0%   { transform: translateY(-100%); opacity: 0; }
  15%  { opacity: 1; }
  85%  { opacity: 1; }
  100% { transform: translateY(100vh); opacity: 0; }
}

/* ─── Layout shell ────────────────────────────────────────────────────────── */

.briefing {
  position: relative;
  z-index: 2;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: clamp(40px, 8vh, 96px) var(--pad-x) clamp(48px, 10vh, 120px);
  display: grid;
  gap: clamp(36px, 6.5vh, 76px);
}

/* ─── Meta header ─── */
.meta {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.20em;
  text-transform: uppercase;
  color: var(--ink-faint);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px 14px;
  padding: 12px 0 14px;
  border-top: 1px solid var(--hair-strong);
  border-bottom: 1px solid var(--hair);
}

.meta .tab { color: var(--amber); }
.meta .sep { color: var(--ink-faint); }

.meta .stamp {
  color: var(--amber);
  border: 1px solid var(--amber);
  padding: 3px 9px 2px;
  letter-spacing: 0.20em;
  background: rgba(255, 178, 74, 0.06);
  transform: rotate(-1.2deg);
  position: relative;
}

.meta .status-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--green);
  letter-spacing: 0.22em;
  margin-left: auto;
}

.dot {
  display: inline-block;
  height: 6px; width: 6px;
  border-radius: 50%;
  background: currentColor;
}

.dot.pulse {
  animation: tt-pulse 2.2s ease infinite;
}

@keyframes tt-pulse {
  0%, 100% { box-shadow: 0 0 0 0 currentColor, 0 0 10px currentColor; opacity: 1; }
  50%      { box-shadow: 0 0 0 5px transparent, 0 0 10px transparent; opacity: 0.55; }
}

/* ─── Hero ─── */
.hero { display: grid; gap: clamp(20px, 3vh, 32px); }

.brand {
  margin: 0;
  display: grid;
  gap: clamp(12px, 1.6vh, 20px);
  line-height: 0.94;
}

.brand-word {
  font-family: var(--serif);
  font-variation-settings: "opsz" 144, "wght" 440, "SOFT" 100, "WONK" 0;
  font-size: clamp(56px, 13.5vw, 184px);
  letter-spacing: -0.028em;
  display: block;
}

/* Brand wordplay made visual: "Counter" is the loud word, "top" recedes. */
.brand-counter { color: var(--ink); }
.brand-top     { color: var(--ink-dim); }

.brand-label {
  display: inline-flex;
  align-items: center;
  gap: clamp(16px, 1.8vw, 26px);
  font-family: var(--mono);
  font-size: clamp(20px, 2.6vw, 38px);
  font-weight: 600;
  letter-spacing: 0.30em;
  color: var(--amber);
  text-transform: uppercase;
}

.brand-rule {
  display: inline-block;
  width: clamp(56px, 9vw, 124px);
  height: 2px;
  background: var(--amber);
}

.brand-letters { white-space: nowrap; }

.tagline {
  margin: 0;
  font-family: var(--serif);
  font-style: italic;
  font-variation-settings: "opsz" 36, "wght" 360, "SOFT" 100;
  font-size: clamp(22px, 2.6vw, 34px);
  line-height: 1.22;
  color: var(--amber);
  max-width: 22ch;
}

/* "Counter" — lifted from the brand word above: roman, cream ink,
   stamped with an amber under-rule that echoes the bar before T·T·X. */
.tagline .counter {
  font-style: normal;
  font-variation-settings: "opsz" 36, "wght" 520, "SOFT" 100, "WONK" 0;
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--amber);
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
  text-decoration-skip-ink: none;
}

/* ─── Body copy ─── (mono, matches the live site's body voice) */
.body {
  display: grid;
  gap: 18px;
  max-width: 60ch;
}

.body p {
  margin: 0;
  font-family: var(--mono);
  font-size: clamp(13.5px, 1.05vw, 15px);
  line-height: 1.72;
  color: var(--ink-dim);
}

.body p .ink { color: var(--ink); }

/* ─── CTA — bordered console widget with .tt-corner amber brackets ─── */

.cta {
  display: grid;
  gap: 16px;
  max-width: 560px;
}

.cta-head {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.cta-head .roman { color: var(--amber); }

.cta-rule {
  flex: 0 0 36px;
  height: 1px;
  background: var(--hair-strong);
}

.cta h2 {
  margin: 0;
  font: inherit;
  color: var(--ink-dim);
  font-weight: 500;
}

/* corner-bracket frame, mirroring .tt-corner on the live site */
.frame {
  position: relative;
  background: var(--bg-elev);
  box-shadow: inset 0 0 0 1px var(--hair);
}

.frame > .corners,
.frame > .corners::before,
.frame > .corners::after,
.frame::before,
.frame::after {
  pointer-events: none;
}

.frame::before, .frame::after,
.frame > .corners::before, .frame > .corners::after {
  content: "";
  position: absolute;
  width: 10px; height: 10px;
  border: 1px solid var(--amber);
}
.frame::before { top: -1px; left: -1px;  border-right: 0; border-bottom: 0; }
.frame::after  { top: -1px; right: -1px; border-left: 0;  border-bottom: 0; }
.frame > .corners::before { bottom: -1px; left: -1px;  border-right: 0; border-top: 0; }
.frame > .corners::after  { bottom: -1px; right: -1px; border-left: 0;  border-top: 0; }

.signup {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: stretch;
  gap: 0;
  transition: box-shadow .25s ease;
}

.signup:focus-within {
  box-shadow: inset 0 0 0 1px var(--amber);
}

.signup input {
  font-family: var(--mono);
  font-size: 14px;
  background: transparent;
  border: none;
  padding: 16px 18px;
  color: var(--ink);
  outline: none;
  min-width: 0;
  width: 100%;
  letter-spacing: 0.01em;
}

.signup input::placeholder {
  color: var(--ink-faint);
  font-style: italic;
}

.signup button {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  background: var(--amber);
  color: var(--bg);
  border: 0;
  padding: 0 22px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: gap .25s ease, padding-right .25s ease, filter .2s ease;
}

.signup button:hover {
  gap: 14px;
  padding-right: 26px;
  filter: brightness(1.08);
}

.signup button:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: -5px;
}

.signup .arrow {
  width: 22px;
  height: 11px;
  flex: none;
  color: var(--bg);
}

.cta.is-submitting .signup { opacity: 0.6; pointer-events: none; }
.cta.is-success .signup { display: none; }
.cta.is-success .frame::before,
.cta.is-success .frame::after,
.cta.is-success .frame > .corners::before,
.cta.is-success .frame > .corners::after { border-color: var(--green); }

/* With appearance:"interaction-only" the widget stays invisible (the container
   collapses to 0 height) until a challenge is required, at which point Turnstile
   injects its UI here — so we must NOT display:none it, or a challenged visitor
   would be unable to solve it. */
.turnstile-slot:not(:empty) { margin-top: 0.75rem; }

.status {
  margin: 0;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.10em;
  color: var(--ink-faint);
  min-height: 1.2em;
}

.status.is-ok  { color: var(--green); }
.status.is-err { color: var(--red); }

/* ─── Footer ─── */
.foot {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.20em;
  text-transform: uppercase;
  color: var(--ink-faint);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px 14px;
  padding-top: 22px;
  border-top: 1px solid var(--hair);
}

.foot .green { color: var(--green); }
.foot .sep   { color: var(--ink-faint); }

.foot a {
  color: var(--ink-dim);
  text-decoration: none;
  border-bottom: 1px solid var(--hair-strong);
  padding-bottom: 1px;
  transition: color .2s ease, border-color .2s ease;
}
.foot a:hover { color: var(--amber); border-color: var(--amber); }

/* ─── Misc ─── */
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  clip: rect(0 0 0 0);
  overflow: hidden;
  white-space: nowrap;
}

::selection { background: var(--amber); color: var(--bg); }

a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
}

/* ─── Entry choreography ─── */
@media (prefers-reduced-motion: no-preference) {
  .meta,
  .hero .brand-word,
  .hero .brand-label,
  .hero .tagline,
  .body p,
  .cta,
  .foot {
    opacity: 0;
    transform: translateY(10px);
    animation: tt-rise 0.95s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  }

  .meta              { animation-delay: 0.05s; }
  .brand-word        { animation-delay: 0.18s; }
  .brand-label       { animation-delay: 0.42s; }
  .tagline           { animation-delay: 0.58s; }
  .body p:nth-child(1) { animation-delay: 0.70s; }
  .body p:nth-child(2) { animation-delay: 0.82s; }
  .cta               { animation-delay: 0.94s; }
  .foot              { animation-delay: 1.06s; }

  .brand-rule {
    transform-origin: left center;
    transform: scaleX(0);
    animation: tt-wipe 0.7s 0.50s cubic-bezier(0.7, 0, 0.3, 1) forwards;
  }
}

@keyframes tt-rise { to { opacity: 1; transform: translateY(0); } }
@keyframes tt-wipe { to { transform: scaleX(1); } }

/* ─── Small screens ─── */
@media (max-width: 540px) {
  .meta { font-size: 10px; gap: 8px 12px; }
  .meta .status-tag { margin-left: 0; }
  .meta .stamp { padding: 2px 7px 1px; }
  .signup { grid-template-columns: 1fr; }
  .signup input { padding: 14px 16px; }
  .signup button { padding: 14px; justify-content: center; }
  .signup button:hover { padding: 14px; }
  .foot { font-size: 10px; }
}

/* ─── Print: monochrome briefing document ─── */
@media print {
  body { background: white; color: #000; }
  .grain, .scanline { display: none; }
  .briefing { max-width: 100%; padding: 0.6in 0.7in; gap: 0.35in; }
  .meta { border-color: #000; color: #000; }
  .meta .tab, .meta .stamp, .meta .status-tag,
  .brand-label, .brand-rule, .cta-head .roman { color: #000; }
  .meta .stamp { background: none; border-color: #000; transform: none; }
  .brand-rule { background: #000; }
  .brand-word, .body p, .tagline { color: #000; }
  .signup, .status { display: none; }
  .frame, .frame::before, .frame::after,
  .frame > .corners::before, .frame > .corners::after { border-color: #000; background: none; box-shadow: none; }
  .foot { border-color: #000; color: #000; }
  .foot a { color: #000; border-color: #000; }
  @page { margin: 0.5in; }
}
