/* Trama — stealth landing.
   One dark viewport, one living gradient. The aurora recipe (magenta bed,
   blue counterweight, lavender glow that travels) comes from the product's
   auth screen; the composition — sparse chrome, blob centre-stage — follows
   the moodboard. The glow is pointer-magnetic (aurora.js). */

@font-face {
  font-family: 'Test Söhne';
  src: url('./fonts/sohne-buch.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Test Söhne';
  src: url('./fonts/sohne-kraftig.woff2') format('woff2');
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: 'Test Söhne';
  src: url('./fonts/sohne-halbfett.woff2') format('woff2');
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: 'Test Söhne Mono';
  src: url('./fonts/sohne-mono-buch.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Signifier';
  src: url('./fonts/signifier-regular.ttf') format('truetype');
  font-weight: 400;
  font-display: swap;
}

:root {
  --bg: #1a1a22;
  --bg-deep: #141417;
  --text: #ffffff;
  --text-2: #7a7a7a;
  --text-3: #606060;
  --magenta: #be3e82;
  --lavender: #b48ee0;
  --blue: #459ada;

  --font-ui: 'Test Söhne', 'Inter', -apple-system, sans-serif;
  --font-mono: 'Test Söhne Mono', ui-monospace, 'SF Mono', monospace;
  --font-display: 'Signifier', Georgia, serif;

  --ease-out-quint: cubic-bezier(0.23, 1, 0.32, 1);
  --pad: clamp(20px, 3.5vw, 40px);
}

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

/* The hidden attribute comes from the UA sheet, so any author rule that sets
   display outranks it — .form { display: flex } kept the form on screen after
   form.hidden = true. State it once with enough weight to hold. */
[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  overflow: hidden;
  background: linear-gradient(to bottom, var(--bg) 55%, var(--bg-deep));
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* The whole scene recedes when the contact sheet covers it — the sheet
   travels 100%, the page ~9%, and that difference is the parallax. */
.page {
  height: 100%;
  display: flex;
  flex-direction: column;
  transition: transform 0.45s var(--ease-out-quint), opacity 0.45s var(--ease-out-quint);
}
body.contact-open .page {
  transform: translateY(-9vh) scale(0.985);
  opacity: 0.55;
  transition-duration: 0.65s;
}

/* ── Chrome ── */

.top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: var(--pad);
}

.brand {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.18em;
  color: var(--text);
}

/* The bracket badge rides the wordmark — same voice as contact, [ soon ]
   and [ close ]: the site's machine language. */
.mode .tok { display: inline-block; }

.mode {
  display: inline-block;
  white-space: nowrap; /* wraps under the wordmark as one piece on tiny screens */
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--text-2);
}

.tag {
  margin-top: 6px;
  font-size: 13px;
  color: var(--text-2);
}

.contact {
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--text-2);
  text-decoration: none;
  transition: color 0.15s ease;
}
.contact:hover { color: var(--text); }
.contact::after {
  content: ' ↗';
  display: inline-block;
  transition: transform 0.18s var(--ease-out-quint);
}
.contact:hover::after { transform: translate(2px, -2px); }

/* ── Stage ── */

.stage {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.aurora {
  position: relative;
  width: min(860px, 90vw);
  height: min(400px, 46vh);
  isolation: isolate;
  animation: bloom 1.8s var(--ease-out-quint) 0.15s both;
}

/* Parallax carriers — aurora.js translates these, the CSS drift below keeps
   animating the blobs inside them, so the two motions compose. */
.blob-wrap {
  position: absolute;
  inset: 0;
  will-change: transform;
}

.blob {
  position: absolute;
  mix-blend-mode: screen;
  filter: blur(clamp(16px, 2.6vw, 30px));
  will-change: transform;
}

/* Geometry borrowed from the moodboard's resting state: two circles leading
   a long pill. Luminous variants of the brand hues — on a dark canvas the
   product tokens read muted, so each gains a little light. */

/* Ambient bed so the whole organism sits in a soft haze. */
.blob-bed {
  left: 2%;
  top: 4%;
  width: 96%;
  height: 92%;
  border-radius: 999px;
  filter: blur(clamp(48px, 8vw, 80px));
  background: linear-gradient(100deg, rgba(224, 85, 158, 0.34), rgba(201, 162, 245, 0.3) 55%, rgba(95, 168, 239, 0.3));
  animation: drift-a 26s ease-in-out infinite alternate;
}

.blob-magenta {
  left: 5%;
  top: 25%;
  width: 23%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(closest-side, #e0559e 42%, rgba(190, 62, 130, 0.55) 72%, transparent);
  animation: drift-b 20s ease-in-out infinite alternate;
}

.blob-lavender {
  left: 26%;
  top: 28%;
  width: 20%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(closest-side, #c9a2f5 40%, rgba(180, 142, 224, 0.5) 72%, transparent);
  animation: drift-b 24s ease-in-out infinite alternate-reverse;
}

.blob-pill {
  left: 45%;
  top: 24%;
  width: 52%;
  height: 52%;
  border-radius: 999px;
  background: linear-gradient(100deg, #d94a90, #b48ee0 48%, #5fa8ef 82%, #7db8f2);
  animation: drift-a 18s ease-in-out infinite alternate;
}

/* The travelling glow. Centred at rest; aurora.js owns its transform —
   chasing the pointer, or swimming its own slow path when left alone. */
.blob-orbit {
  left: 33%;
  top: 20%;
  width: 34%;
  height: 60%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(201, 162, 245, 0.5), rgba(190, 62, 130, 0.18) 58%, transparent 74%);
}

@keyframes drift-a {
  from { transform: translate(-2.5%, -2%) rotate(-1.5deg) scale(1, 1.03); }
  to   { transform: translate(2.5%, 2.5%) rotate(1.5deg) scale(1.06, 0.94); }
}
@keyframes drift-b {
  from { transform: translate(-14%, 4%) scale(0.94); }
  to   { transform: translate(16%, -5%) scale(1.12); }
}
@keyframes bloom {
  from { opacity: 0; transform: scale(0.94); }
  to   { opacity: 1; transform: scale(1); }
}

/* ── The loom: redacted lines under processing ── */

.dossier {
  position: absolute;
  left: clamp(24px, 22vw, 300px);
  bottom: clamp(16px, 9vh, 84px);
}

.redacted {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.redacted li {
  display: flex;
  align-items: center;
  gap: 10px;
}

.idx {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-2);
  transition: color 0.3s ease;
}

/* Each bar is sliced into 6px pixels (the mask cuts bar + sheen alike) and
   a brightness wave churns through — data being processed under redaction. */
.bar {
  position: relative;
  overflow: hidden;
  width: var(--w, 100px);
  height: 9px;
  background: rgba(255, 255, 255, 0.13);
  -webkit-mask: repeating-linear-gradient(90deg, #000 0 6px, transparent 6px 9px);
          mask: repeating-linear-gradient(90deg, #000 0 6px, transparent 6px 9px);
  transition: background 0.3s ease;
}
.bar::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 25%, rgba(255, 255, 255, 0.45) 50%, transparent 75%);
  transform: translateX(-100%);
  animation: churn 2.8s linear infinite;
}
.redacted li:nth-child(2) .bar::after { animation-delay: 0.9s; }
.redacted li:nth-child(3) .bar::after { animation-delay: 1.8s; }

@keyframes churn {
  to { transform: translateX(100%); }
}

/* The line the loom is currently "thinking about". */
.redacted li.is-live .idx { color: var(--text); }
.redacted li.is-live .bar { background: rgba(255, 255, 255, 0.24); }

/* The thinking line — shimmer verb + a clock that never finishes. */
.loom {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-top: 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
}

.verb {
  background: linear-gradient(90deg, var(--text-2) 38%, #fff 50%, var(--text-2) 62%) 100% 0 / 220% 100%;
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
  animation: shimmer 2.2s linear infinite;
}
.verb.is-soon {
  background: none;
  color: var(--text);
}

@keyframes shimmer {
  from { background-position: 200% 0; }
  to   { background-position: -100% 0; }
}

.clock {
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

/* ── Foot ── */

.foot {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: var(--pad);
}

.year, .copy {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-3);
}

/* ── Entrances ── */

.rise { animation: rise 0.6s var(--ease-out-quint) var(--d, 0ms) both; }

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

/* ── Small screens ── */

@media (max-width: 680px) {
  .aurora { height: 34vh; }
  .dossier { left: var(--pad); bottom: 4vh; }
}

/* ── Contact sheet ── */

.sheet {
  position: fixed;
  inset: 0;
  z-index: 10;
  background: #fff;
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -24px 80px rgba(0, 0, 0, 0.45);
  transform: translateY(100%);
  visibility: hidden;
  /* Exit ~70% of the enter time; visibility flips after the ride down. */
  transition: transform 0.45s var(--ease-out-quint),
              border-radius 0.45s var(--ease-out-quint),
              visibility 0s 0.45s;
}
body.contact-open .sheet {
  transform: translateY(0);
  border-radius: 0;
  visibility: visible;
  transition: transform 0.65s var(--ease-out-quint),
              border-radius 0.65s var(--ease-out-quint);
}

/* Sheet interior — ink on white, same voices: mono for machine text,
   Signifier for the one hero moment, numbered fields echoing the loom's
   redacted 01/ 02/ 03/ (here, finally readable). */

.sheet {
  overflow-y: auto;
}

.sheet-body {
  min-height: 100%;
  max-width: 620px;
  margin: 0 auto;
  padding: calc(var(--pad) + 40px) var(--pad) var(--pad);
  display: flex;
  flex-direction: column;
}
/* Centering rides auto margins, not justify-content — when a short viewport
   (open keyboard, landscape) makes the form overflow, autos collapse to 0
   and everything stays reachable by scroll instead of clipping at the top. */
.sheet-body > :first-child { margin-top: auto; }
.sheet-body > :last-child { margin-bottom: auto; }

/* Content drifts up as the sheet settles, staggered. */
body.contact-open .sheet-body > * {
  animation: rise 0.55s var(--ease-out-quint) both;
}
body.contact-open .sheet-body > :nth-child(1) { animation-delay: 0.30s; }
body.contact-open .sheet-body > :nth-child(2) { animation-delay: 0.36s; }
body.contact-open .sheet-body > :nth-child(3) { animation-delay: 0.42s; }
body.contact-open .sheet-body > :nth-child(4),
body.contact-open .sheet-body > :nth-child(5) { animation-delay: 0.50s; }

.form-kicker {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: rgba(20, 20, 23, 0.45);
}

.form-title {
  margin-top: 14px;
  font-family: var(--font-display);
  font-size: clamp(34px, 4.6vw, 52px);
  line-height: 1.05;
  font-weight: 400;
  color: var(--bg-deep);
}

.form-sub {
  margin-top: 10px;
  font-size: 14px;
  color: rgba(20, 20, 23, 0.55);
}

.form {
  margin-top: 44px;
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.flabel {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: rgba(20, 20, 23, 0.45);
}

.field input,
.field textarea {
  padding: 8px 0 10px;
  border: 0;
  border-bottom: 1px solid rgba(20, 20, 23, 0.18);
  border-radius: 0;
  background: none;
  font-family: var(--font-ui);
  font-size: 16px;
  color: var(--bg-deep);
  caret-color: var(--magenta);
  transition: border-color 0.2s ease;
}
.field textarea {
  resize: vertical;
  min-height: 92px;
}
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--magenta);
}

/* The honeypot: off-screen rather than hidden, because a bot that reads the
   stylesheet skips display: none — and [hidden] is already spoken for above. */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.consent {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: rgba(20, 20, 23, 0.55);
  cursor: pointer;
  user-select: none;
}
.consent input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.consent .box {
  position: relative;
  width: 15px;
  height: 15px;
  border: 1px solid rgba(20, 20, 23, 0.35);
  border-radius: 3px;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.consent .box::after {
  content: '';
  position: absolute;
  left: 4px;
  top: 1px;
  width: 4px;
  height: 8px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) scale(0);
  transition: transform 0.18s var(--ease-out-quint);
}
.consent input:checked + .box {
  background: var(--magenta);
  border-color: var(--magenta);
}
.consent input:checked + .box::after { transform: rotate(45deg) scale(1); }
.consent input:focus-visible + .box {
  outline: 2px solid rgba(190, 62, 130, 0.5);
  outline-offset: 2px;
}

.form-foot {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 4px;
}

.send {
  padding: 11px 24px;
  border: 1px solid rgba(20, 20, 23, 0.85);
  border-radius: 999px;
  background: none;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--bg-deep);
  cursor: pointer;
  transition: background 0.18s var(--ease-out-quint),
              color 0.18s var(--ease-out-quint),
              transform 0.1s ease-out;
}
.send:hover { background: var(--bg-deep); color: #fff; }
.send:active { transform: scale(0.97); }
.send:disabled { opacity: 0.5; cursor: default; }

.alt-mail {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: rgba(20, 20, 23, 0.45);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.15s ease;
}
.alt-mail:hover { color: var(--bg-deep); }

.sent,
.handoff { margin-top: 44px; }
.handoff-badge:focus-visible {
  outline: 2px solid rgba(20, 20, 23, 0.4);
  outline-offset: 2px;
}
.draft {
  margin: 18px 0 0;
  padding: 14px 16px;
  max-height: 190px;
  overflow: auto;
  border: 1px solid rgba(20, 20, 23, 0.12);
  border-radius: 8px;
  background: rgba(20, 20, 23, 0.03);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.7;
  color: rgba(20, 20, 23, 0.7);
  white-space: pre-wrap;
  overflow-wrap: break-word;
}
.copy-draft { margin-top: 18px; }
.sent-badge {
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: 0.08em;
  color: var(--bg-deep);
}
.sent-note {
  margin-top: 10px;
  font-size: 14px;
  color: rgba(20, 20, 23, 0.55);
}

.sheet-close {
  position: absolute;
  top: var(--pad);
  right: var(--pad);
  padding: 0;
  border: 0;
  background: none;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: rgba(20, 20, 23, 0.55);
  cursor: pointer;
  transition: color 0.15s ease;
}
.sheet-close:hover { color: var(--bg-deep); }

@media (prefers-reduced-motion: reduce) {
  .rise, .aurora, .blob, .bar::after, .verb { animation: none; }
  body.contact-open .sheet-body > * { animation: none; }
  .verb { background: none; color: var(--text-2); }
  .contact:hover::after { transform: none; }
  .page, .sheet { transition: none; }
}
