/* ============================================================================
   lycorp.ai — pure monochrome (zero chroma), system theme, hairline system.
   The crescent is the only curve on the page; everything else is 1px rules and
   rectangles. That contrast is the whole visual signature.
   ========================================================================== */

:root {
  color-scheme: light dark;

  --paper:  oklch(0.995 0 0);
  --ink:    oklch(0.160 0 0);
  --muted:  oklch(0.420 0 0);
  --rule:   oklch(0.870 0 0);
  --rule-2: oklch(0.760 0 0);
  --field:  oklch(0.975 0 0);

  --sans: 'Schibsted Grotesk', ui-sans-serif, system-ui, sans-serif;
  --mono: 'Spline Sans Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --col: 33rem;
  --pad: clamp(1.25rem, 0.9rem + 1.8vw, 2rem);
  --bleed: 0.7rem;                 /* how far a hovered row extends past the rules */

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --swift: 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper:  oklch(0.135 0 0);
    --ink:    oklch(0.970 0 0);
    --muted:  oklch(0.660 0 0);
    --rule:   oklch(0.290 0 0);
    --rule-2: oklch(0.400 0 0);
    --field:  oklch(0.175 0 0);
  }
}

/* ============================== reset ==================================== */

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100svh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.5;
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, p { margin: 0; }
a { color: inherit; text-decoration: none; }

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

/* ============================== splash =================================== */
/* Removed by its own CSS animation. JS shortens it; JS failure cannot trap the
   page, because nothing here depends on script to clear. */

.splash {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: var(--paper);
  animation: splash-out 0.42s var(--ease) 0.6s forwards;
}
.splash__moon {
  width: 34px; height: 34px;
  color: var(--ink);
  animation: moon-spin 1.4s linear infinite;
}
@keyframes splash-out { to { opacity: 0; visibility: hidden; } }
@keyframes moon-spin { to { transform: rotate(360deg); } }

/* JS path: explicit final state plus `animation: none` cleanly overrides. */
.splash.is-done {
  animation: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s var(--ease), visibility 0s linear 0.3s;
}

/* ============================== shell ==================================== */

.shell {
  width: 100%;
  max-width: var(--col);
  margin-inline: auto;
  padding: clamp(3.5rem, 2rem + 8vw, 6.5rem) var(--pad) clamp(3rem, 2rem + 5vw, 5rem);
  display: flex;
  flex-direction: column;
  gap: clamp(2.5rem, 1.5rem + 3.5vw, 3.75rem);
}

/* ============================== head ==================================== */

.head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.15rem;
  text-align: center;
}
.mark {
  width: clamp(46px, 11vw, 62px);
  height: auto;
  color: var(--ink);
  animation: mark-in 1.5s var(--ease) 0.15s backwards;
}
@keyframes mark-in {
  from { transform: rotate(-125deg) scale(0.72); opacity: 0; }
  55%  { opacity: 1; }
}
.wordmark {
  font-size: clamp(1.1rem, 1rem + 0.45vw, 1.3rem);
  font-weight: 600;
  letter-spacing: 0.42em;
  text-indent: 0.42em;             /* optically re-centre the tracked word */
  text-transform: uppercase;
  animation: fade-up 0.8s var(--ease) 0.42s backwards;
}
@keyframes fade-up { from { opacity: 0; transform: translateY(8px); } }

/* ============================== index =================================== */

.index { position: relative; }

/* Group top rule + per-row bottom rules together form the full ruling.
   Both draw from the centre outward on load; the base state is drawn, so a
   headless render or reduced-motion client still shows every line. */
.index::before,
.row::after {
  content: '';
  position: absolute;
  left: 0; right: 0;
  height: 1px;
  background: var(--rule);
  transform: scaleX(1);
  animation: rule-in 0.9s var(--ease) backwards;
}
.index::before { top: 0; }
/* Inset by the row's bleed so every rule on the page shares one edge, flush with
   the text column, while the hover inversion still extends past it. */
.row::after { bottom: 0; left: var(--bleed); right: var(--bleed); }
@keyframes rule-in { from { transform: scaleX(0); } }

.index--social { margin-top: -1.15rem; }

.row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  /* Bleed past the text column so the hover inversion reads as deliberate. */
  margin-inline: calc(var(--bleed) * -1);
  padding: 0.92rem var(--bleed);
  font-family: var(--mono);
  font-size: 0.95rem;
  font-weight: 400;
  letter-spacing: -0.02em;
  transition: background var(--swift), color var(--swift);
  animation: fade-up 0.7s var(--ease) backwards;
}
.row__name { flex: 1; min-width: 0; }
.row__glyph { width: 15px; height: 15px; flex: none; opacity: 0.85; }
.row__arrow {
  width: 15px; height: 15px; flex: none;
  color: var(--muted);
  transition: transform var(--swift), color var(--swift);
}

/* The standout move: the whole row inverts. Pure black/white, no colour. */
.row:hover, .row:focus-visible {
  background: var(--ink);
  color: var(--paper);
}
.row:hover .row__arrow, .row:focus-visible .row__arrow {
  color: var(--paper);
  transform: translate(2px, -2px);
}
.row:focus-visible { outline-offset: 0; }

/* stagger: rules and rows cascade down the page */
.index::before          { animation-delay: 0.5s; }
.row:nth-child(1)       { animation-delay: 0.55s; }
.row:nth-child(1)::after{ animation-delay: 0.57s; }
.row:nth-child(2)       { animation-delay: 0.62s; }
.row:nth-child(2)::after{ animation-delay: 0.64s; }
.row:nth-child(3)       { animation-delay: 0.69s; }
.row:nth-child(3)::after{ animation-delay: 0.71s; }
.row:nth-child(4)       { animation-delay: 0.76s; }
.row:nth-child(4)::after{ animation-delay: 0.78s; }
.row:nth-child(5)       { animation-delay: 0.83s; }
.row:nth-child(5)::after{ animation-delay: 0.85s; }
.row:nth-child(6)       { animation-delay: 0.90s; }
.row:nth-child(6)::after{ animation-delay: 0.92s; }
.index--social::before  { animation-delay: 0.97s; }
.index--social .row     { animation-delay: 0.99s; }
.index--social .row::after { animation-delay: 1.01s; }

/* ============================== contact ================================= */

.contact { animation: fade-up 0.8s var(--ease) 1.08s backwards; }
.contact__h {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--rule);
}

.form { display: flex; flex-direction: column; gap: 1.4rem; margin-top: 1.6rem; }

.field { display: flex; flex-direction: column; gap: 0.4rem; }
.field label {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.field input, .field textarea {
  appearance: none;
  width: 100%;
  padding: 0.5rem 0 0.55rem;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--rule-2);
  border-radius: 0;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.95rem;
  letter-spacing: -0.015em;
  transition: border-color var(--swift);
}
.field textarea { resize: vertical; min-height: 5.5rem; line-height: 1.6; }
.field input:hover, .field textarea:hover { border-color: var(--muted); }
.field input:focus, .field textarea:focus {
  outline: none;
  border-color: var(--ink);
  border-bottom-width: 2px;
  padding-bottom: calc(0.55rem - 1px);
}
.field input[aria-invalid='true'], .field textarea[aria-invalid='true'] {
  border-color: var(--ink);
  border-bottom-style: dashed;
}

/* Honeypot: taken out of flow and off-screen, not display:none, so naive bots
   still see a fillable field. Real users never reach it (tabindex -1). */
.decoy {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  pointer-events: none;
}

/* interaction-only: most visitors never get a widget. Collapse the container so it
   contributes no flex gap when empty, and tighten it slightly when a challenge
   does render (bots, or a flagged network). */
.cf-turnstile:empty { display: none; }
.cf-turnstile:not(:empty) { margin-block: -0.2rem; }

.send {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.95rem 1.25rem;
  background: var(--ink);
  color: var(--paper);
  border: 1px solid var(--ink);
  border-radius: 0;
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background var(--swift), color var(--swift), opacity var(--swift);
}
.send:hover { background: transparent; color: var(--ink); }
.send:disabled { cursor: default; opacity: 0.5; }
.send:disabled:hover { background: var(--ink); color: var(--paper); }

.send__spinner { display: none; width: 15px; height: 15px; }
.send.is-sending .send__spinner { display: block; animation: moon-spin 0.9s linear infinite; }

.note {
  min-height: 1.35rem;
  font-family: var(--mono);
  font-size: 0.8rem;
  line-height: 1.55;
  letter-spacing: -0.015em;
  color: var(--muted);
}
.note.is-error { color: var(--ink); }
.note.is-ok { color: var(--ink); font-weight: 500; }

/* Replaces the form on success, so the page ends on a full stop. */
.done {
  display: flex; align-items: baseline; gap: 0.6rem;
  margin-top: 1.6rem;
  padding-block: 0.9rem;
  border-bottom: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 0.95rem;
  letter-spacing: -0.02em;
  animation: fade-up 0.5s var(--ease) backwards;
}
.done__tick { flex: none; width: 15px; height: 15px; }

/* ============================== 404 ==================================== */

.void { text-align: center; display: flex; flex-direction: column; gap: 1.1rem; align-items: center; }
.void h1 { font-size: 1.5rem; font-weight: 600; letter-spacing: -0.02em; }
.void p { color: var(--muted); font-family: var(--mono); font-size: 0.9rem; }
.void a {
  margin-top: 0.6rem;
  font-family: var(--mono); font-size: 0.9rem;
  border-bottom: 1px solid var(--rule-2);
  padding-bottom: 2px;
  transition: border-color var(--swift);
}
.void a:hover { border-color: var(--ink); }

/* ============================== motion opt-out ========================== */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  /* Keep the two genuine loading indicators legible as motion. */
  .splash__moon, .send.is-sending .send__spinner {
    animation: moon-spin 1.6s linear infinite !important;
  }
}
