/* tremaux · sign-up · Operational Grotesk on a Forensic palette
   Dark-first (holding site default per brief); light mode via prefers-color-scheme. */
:root {
  /* Dark mode — default (ink-dominant) */
  --surface:      #161616;  /* ink — dominant surface */
  --surface-raised:#1F1F1F; /* raised ink */
  --ink:          #EBE8E1;  /* soft paper — primary text */
  --muted:        #9A968D;  /* secondary text */
  --line:         #2C2C2C;
  --line-strong:  #3A3A3A;
  --accent:       #A33A3A;  /* iron oxide, lifted — required for dark */
  --on-accent:    #EBE8E1;

  --display: "Hanken Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --sans:    "Hanken Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono:    "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: light) {
  :root {
    --surface:      #F0F1F1;  /* cool paper — no yellow */
    --surface-raised:#FFFFFF;
    --ink:          #161616;
    --muted:        #585A5B;  /* graphite */
    --line:         #DADCDC;  /* cool line */
    --line-strong:  #B9BCBC;
    --accent:       #6E2A2A;  /* iron oxide — deep, for light surfaces */
    --on-accent:    #F0F1F1;
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 56px 24px;
}

.card {
  width: 100%;
  max-width: 520px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

/* ---------- Logo lockup ---------- */
.logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-bottom: 48px;
}

.logo__wordmark {
  margin: 0;
  font-family: var(--display);
  font-weight: 500;
  font-size: 96px;
  line-height: 1;
  color: var(--ink);
  letter-spacing: -0.025em;
  font-stretch: 95%;
  display: inline-flex;
  align-items: baseline;
  min-height: 1em;
}

/* Typewriter caret — sits next to the typed letters. */
.logo__caret {
  display: inline-block;
  width: 0.06em;
  height: 0.85em;
  margin-left: 0.04em;
  background: currentColor;
  transform: translateY(0.06em);
  animation: caret-blink 900ms steps(1, end) infinite;
}

.logo__wordmark.is-done .logo__caret {
  animation: caret-blink 900ms steps(1, end) 4, caret-fade 360ms ease forwards;
  animation-delay: 0s, 3.6s;
}

@keyframes caret-blink {
  0%, 50%      { opacity: 1; }
  50.01%, 100% { opacity: 0; }
}

@keyframes caret-fade {
  to { opacity: 0; transform: translateY(0.06em) scaleY(0.6); }
}

/* Hard-stop square — replaces the logo dot per brief.
   Inline with the wordmark, sits at the baseline like a full stop. */
.logo__stop {
  display: inline-block;
  width: 0.1em;     /* scales with the wordmark — ~9.6px at 96px */
  height: 0.1em;
  margin-left: 0.04em;
  background: var(--accent);
  vertical-align: baseline;
}
.logo__stop--reveal,
.logo__tagline--reveal {
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 360ms ease, transform 360ms ease;
}
.logo__stop--reveal.is-in,
.logo__tagline--reveal.is-in {
  opacity: 1;
  transform: none;
}

.logo__tagline {
  margin: 0;
  width: 360px;
  max-width: 100%;
  font-family: var(--mono);
  font-weight: 500;
  font-size: 11px;
  text-align: center;
  letter-spacing: 0.22em;
  color: var(--muted);
}

/* ---------- Pronunciation ---------- */
.pronunciation {
  margin: 0 0 40px;
  min-height: 1.5em;
  font-family: var(--mono);
  font-weight: 400;
  font-size: 13px;
  letter-spacing: 0.04em;
  line-height: 1.5;
  color: var(--muted);
  text-align: center;
}

/* ---------- Prose ---------- */
.prose {
  margin: 0 0 48px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.prose p {
  margin: 0;
  min-height: 1.65em;
  font-family: var(--sans);
  font-weight: 400;
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  text-align: center;
}
.prose .prose__close {
  margin-top: 6px;
  font-family: var(--sans);
  font-weight: 800;
  letter-spacing: -0.005em;
  color: var(--ink);
}

/* ---------- Typed elements ----------
   Element wrapper stays hidden until JS reveals it, then the per-character
   spans inside fade in one at a time. Layout is computed up-front from the
   full text, so the centred block never shifts as characters appear. */
[data-type] {
  opacity: 0;
}
[data-type].is-typing,
[data-type].is-typed {
  opacity: 1;
}
.tchar {
  position: relative;   /* anchor the absolutely-positioned cursor */
  opacity: 0;
}
.tchar.is-on {
  opacity: 1;
}
/* Cursor floats over the layout (position: absolute) so it never takes
   inline width — characters never shift sideways as the cursor moves. */
.tchar.is-tip::after {
  content: "";
  position: absolute;
  right: -0.1em;
  top: 0.08em;
  width: 0.06em;
  height: 0.85em;
  background: currentColor;
  animation: caret-blink 900ms steps(1, end) infinite;
  pointer-events: none;
}
[data-type].is-typed .tchar.is-tip::after {
  display: none;
}
/* Wordmark: after typing completes, the last cursor blinks a few times
   and then fades out (matches the original brief's cursor behaviour). */
.logo__wordmark.is-done .tchar.is-tip::after {
  animation: caret-blink 900ms steps(1, end) 4,
             caret-fade  360ms ease forwards;
  animation-delay: 0s, 3.6s;
}

/* ---------- Form ---------- */
.form {
  display: flex;
  flex-direction: column;
  gap: 22px;
  position: relative;
}

.form__lead {
  margin: 0 0 4px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
  font-family: var(--sans);
  font-weight: 500;
  font-size: 17px;
  line-height: 1.4;
  letter-spacing: -0.005em;
  color: var(--ink);
}

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

.field label {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--muted);
}

.field input[type="text"],
.field input[type="email"] {
  appearance: none;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line-strong);
  padding: 8px 0 10px;
  font-family: var(--sans);
  font-weight: 400;
  font-size: 17px;
  color: var(--ink);
  outline: none;
  transition: border-color 160ms ease;
}

.field input::placeholder { color: var(--muted); }
.field input:focus { border-bottom-color: var(--ink); }
.field input:invalid:not(:placeholder-shown):not(:focus) { border-bottom-color: var(--accent); }

.field__error {
  margin: 0;
  min-height: 0;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 0.02em;
  visibility: hidden;
}
.field__error.is-visible { visibility: visible; }

/* Honeypot — visually hidden, accessible to bots that auto-fill labelled inputs. */
.honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* ---------- Submit ---------- */
.submit {
  margin-top: 12px;
  appearance: none;
  border: 0;
  background: var(--ink);
  color: var(--surface);
  font-family: var(--mono);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 18px 28px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  transition: background 160ms ease, transform 160ms ease;
}
.submit:hover { filter: brightness(1.1); }
.submit:active { transform: translateY(1px); }
.submit:disabled {
  background: var(--line-strong);
  color: var(--surface);
  cursor: progress;
}
/* Hard-stop square — replaces the dot per brief. */
.submit__dot {
  width: 7px;
  height: 7px;
  background: var(--accent);
  display: inline-block;
}

/* ---------- Success state ---------- */
.form.is-submitted .submit,
.form.is-submitted .field,
.form.is-submitted .form__lead { display: none; }

.success {
  text-align: center;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink);
  padding: 24px 0;
}
.success__tag {
  display: block;
  margin-bottom: 12px;
  font-family: var(--mono);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--accent);
}

/* ---------- Reveal cascade ---------- */
.reveal {
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 480ms ease, transform 480ms ease;
}
.reveal.is-in {
  opacity: 1;
  transform: none;
}
/* Soft fade — used for the form after all typing completes. */
.reveal--soft {
  transform: none;
  transition: opacity 900ms ease;
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .logo__caret { display: none; }
  .logo__stop--reveal,
  .logo__tagline--reveal,
  .reveal,
  [data-type] {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ---------- Small screens ---------- */
@media (max-width: 520px) {
  .logo__wordmark { font-size: 72px; }
  .logo__tagline { width: 280px; font-size: 10px; letter-spacing: 0.2em; }
  .pronunciation { font-size: 12px; }
  .prose p { font-size: 15.5px; }
  .field input { font-size: 16px; }
}

/* Screen-reader only */
.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;
}
