/* tessera.cam — marketing landing page.
 *
 * Visual system: "The Darkroom", copied from src/styles/tokens.css +
 * base.css (2026-08-01). This page is allowed to drift from the app;
 * tokens are duplicated here on purpose. Fonts are the same self-hosted
 * fontsource woff2 files the app ships (committed under ./fonts/ —
 * source packages: @fontsource-variable/fraunces, @fontsource/
 * schibsted-grotesk, @fontsource/fragment-mono; latin subsets). */

/* ---------- fonts ---------- */

@font-face {
  font-family: "Fraunces Variable";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/fraunces-latin-wght-normal.woff2")
    format("woff2-variations");
}

@font-face {
  font-family: "Schibsted Grotesk";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/schibsted-grotesk-latin-400-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Schibsted Grotesk";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/schibsted-grotesk-latin-700-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Fragment Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/fragment-mono-latin-400-normal.woff2") format("woff2");
}

/* ---------- tokens (verbatim from the app) ---------- */

:root {
  /* ground */
  --bg: #12100d;
  --surface: #1c1915;
  --surface-2: #262119;
  --line: #353026;
  --line-strong: #4a4336;

  /* text on dark */
  --ink: #f0ebdd;
  --ink-dim: #9c9484;
  --ink-faint: #6b6456;

  /* the safelight — the only decorative hue */
  --amber: #e8a33d;
  --amber-bright: #f5b95c;
  --amber-glow: rgba(232, 163, 61, 0.18);

  /* paper (lab tickets) */
  --paper: #f0ebdd;
  --paper-2: #e6dfcc;
  --paper-ink: #1c1915;
  --paper-line: #c9c0a8;

  /* the developing room */
  --develop-glow: #3b0a0a;
  --develop-pulse: #c43a2e;

  /* type */
  --font-display: "Fraunces Variable", Georgia, serif;
  --font-body: "Schibsted Grotesk", system-ui, sans-serif;
  --font-mono: "Fragment Mono", ui-monospace, "Courier New", monospace;

  /* space */
  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 24px;
  --s6: 32px;
  --s7: 48px;
  --s8: 64px;

  /* shape */
  --r-s: 6px;
  --r-m: 12px;
  --r-pill: 999px;

  /* motion */
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --t-micro: 150ms;
  --t-move: 400ms;
}

/* ---------- base ---------- */

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

html {
  scroll-behavior: smooth;
}

body,
h1,
h2,
h3,
p,
ol,
li,
figure {
  margin: 0;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* Site-wide film grain — the entire texture budget. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 999;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%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)'/%3E%3C/svg%3E");
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 580;
  line-height: 1.1;
}

a {
  color: var(--amber);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--amber-bright);
}

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

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

.wrap {
  max-width: 1020px;
  margin-inline: auto;
  padding-inline: var(--s5);
}

.mono-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-dim);
}

.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;
}

/* The safelight lamp — the de-facto logo mark. */
.lamp {
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: var(--r-pill);
  background: var(--amber);
  box-shadow: 0 0 10px 2px var(--amber-glow);
  animation: lamp-breathe 4s var(--ease) infinite;
}

/* Sprocket-hole film strip, used as an in-flow section divider. */
.film-edge {
  height: 24px;
  background: var(--surface-2);
  border-block: 1px solid var(--line);
  position: relative;
}

.film-edge::before {
  content: "";
  position: absolute;
  inset: 7px 0;
  background-image: repeating-linear-gradient(
    90deg,
    var(--bg) 0 10px,
    transparent 10px 26px
  );
}

/* ---------- header ---------- */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s4);
  padding-block: var(--s4);
}

.wordmark {
  display: flex;
  align-items: center;
  gap: var(--s2);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ink-dim);
  text-decoration: none;
}

.wordmark:hover {
  color: var(--ink);
}

.header-login {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.04em;
  text-decoration: none;
}

/* ---------- hero ---------- */

.hero {
  padding-block: clamp(var(--s7), 12vh, 128px) clamp(var(--s7), 10vh, 112px);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s6);
}

.hero .mono-label {
  opacity: 0;
  animation: rise-in 0.6s var(--ease) forwards;
}

.hero-title {
  font-size: clamp(2.5rem, 7.5vw, 4.75rem);
  line-height: 1.12;
  font-variation-settings:
    "SOFT" 0,
    "WONK" 1;
}

.hero-title span {
  display: block;
  opacity: 0;
  animation: rise-in 0.6s var(--ease) forwards;
}

.hero-title span:nth-child(2) {
  animation-delay: 120ms;
}

.hero-title span:nth-child(3) {
  animation-delay: 240ms;
}

.hero-title .accent {
  color: var(--amber);
  animation:
    rise-in 0.6s var(--ease) 120ms forwards,
    safelight-text 5s ease-in-out 1.2s infinite;
}

.hero-sub {
  max-width: 34rem;
  color: var(--ink-dim);
  font-size: 1.0625rem;
  opacity: 0;
  animation: rise-in 0.6s var(--ease) 320ms forwards;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: var(--s5);
  flex-wrap: wrap;
  justify-content: center;
  opacity: 0;
  animation: rise-in 0.6s var(--ease) 400ms forwards;
}

.cta-btn {
  display: inline-block;
  text-decoration: none;
  background: var(--amber);
  color: var(--paper-ink);
  font-weight: 500;
  padding: 0.75rem 1.75rem;
  border-radius: var(--r-s);
  transition: background var(--t-micro) var(--ease);
}

.cta-btn:hover {
  background: var(--amber-bright);
  color: var(--paper-ink);
}

.cta-btn:active {
  transform: translateY(1px);
}

.hero-secondary {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.04em;
}

.hero-note {
  opacity: 0;
  animation: rise-in 0.6s var(--ease) 550ms forwards;
}

/* ---------- how it works ---------- */

.how {
  padding-block: clamp(var(--s7), 10vh, 96px);
}

.how-head {
  text-align: center;
  margin-bottom: var(--s7);
  display: flex;
  flex-direction: column;
  gap: var(--s3);
  align-items: center;
}

.how-head h2 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
}

.tickets {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s5);
  counter-reset: step;
}

/* Paper lab tickets, pinned slightly crooked like prints on a line. */
.ticket {
  background: var(--paper);
  color: var(--paper-ink);
  border: 1px solid var(--paper-line);
  border-radius: var(--r-m);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  padding: var(--s5);
  display: flex;
  flex-direction: column;
  gap: var(--s3);
  transition: transform var(--t-move) var(--ease);
}

.tickets li:nth-child(1) .ticket {
  transform: rotate(-0.4deg);
}

.tickets li:nth-child(2) .ticket {
  transform: rotate(0.3deg) translateY(var(--s3));
}

.tickets li:nth-child(3) .ticket {
  transform: rotate(-0.25deg);
}

.tickets li .ticket:hover {
  transform: rotate(0deg) translateY(-2px);
}

.ticket-step {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
  border-bottom: 1px dashed var(--paper-line);
  padding-bottom: var(--s3);
}

.ticket-step::before {
  counter-increment: step;
  content: "0" counter(step) " — ";
  color: var(--amber);
}

.ticket h3 {
  color: var(--paper-ink);
  font-size: 1.375rem;
}

.ticket p {
  font-size: 0.9375rem;
  color: #4a4336;
}

/* ---------- darkroom band ---------- */

.darkroom {
  position: relative;
  overflow: hidden;
  text-align: center;
  padding-block: clamp(var(--s8), 14vh, 128px);
  border-block: 1px solid var(--line);
  background:
    radial-gradient(
      ellipse 90% 100% at 50% 100%,
      var(--develop-glow) 0%,
      rgba(59, 10, 10, 0.4) 45%,
      transparent 78%
    ),
    var(--surface);
}

.darkroom-status {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-dim);
  margin-bottom: var(--s5);
}

.darkroom-status::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: var(--r-pill);
  background: var(--develop-pulse);
  box-shadow: 0 0 10px 2px rgba(196, 58, 46, 0.35);
  animation: lamp-breathe 2.4s var(--ease) infinite;
}

.darkroom-line {
  font-family: var(--font-display);
  font-weight: 580;
  font-size: clamp(1.625rem, 4.5vw, 2.75rem);
  line-height: 1.2;
  max-width: 22em;
  margin-inline: auto;
  font-variation-settings:
    "SOFT" 0,
    "WONK" 1;
}

/* ---------- closing cta ---------- */

.closing {
  padding-block: clamp(var(--s8), 14vh, 128px);
  display: flex;
  justify-content: center;
}

.closing-ticket {
  max-width: 26rem;
  width: 100%;
  text-align: center;
  transform: rotate(-0.4deg);
  padding: var(--s6) var(--s5);
  gap: var(--s4);
}

.closing-ticket .ticket-step {
  border-bottom: none;
  padding-bottom: 0;
}

.closing-ticket .ticket-step::before {
  content: "";
  counter-increment: none;
}

.closing-ticket h2 {
  color: var(--paper-ink);
  font-size: clamp(1.625rem, 4vw, 2rem);
}

.closing-note {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
}

/* ---------- footer ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  padding-block: var(--s5) calc(var(--s5) + 24px);
}

.footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s4);
  flex-wrap: wrap;
}

.footer-id {
  display: flex;
  align-items: center;
  gap: var(--s3);
  color: var(--ink-dim);
  font-size: 0.875rem;
}

.footer-id img {
  width: 20px;
  height: 20px;
  display: block;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: var(--s5);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
}

.footer-links span {
  color: var(--ink-faint);
}

/* ---------- 404 ---------- */

.notfound {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: var(--s5);
  padding: var(--s5);
}

.notfound h1 {
  font-size: clamp(2.25rem, 6vw, 3.5rem);
  font-variation-settings:
    "SOFT" 0,
    "WONK" 1;
}

/* ---------- keyframes ---------- */

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes safelight-text {
  0%,
  100% {
    text-shadow: 0 0 0 rgba(232, 163, 61, 0);
  }

  50% {
    text-shadow: 0 0 24px rgba(232, 163, 61, 0.45);
  }
}

@keyframes lamp-breathe {
  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.55;
  }
}

/* ---------- responsive ---------- */

@media (max-width: 720px) {
  .tickets {
    grid-template-columns: 1fr;
    max-width: 24rem;
    margin-inline: auto;
  }

  .tickets li:nth-child(2) .ticket {
    transform: rotate(0.3deg);
  }
}

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .hero .mono-label,
  .hero-title span,
  .hero-sub,
  .hero-actions,
  .hero-note {
    opacity: 1;
  }
}
