/* ============================================================================
   Paperi — paper as a play button.
   Dark editorial "ink" canvas · optical serif display (Fraunces) + Spline Sans
   body · a disciplined spectral play-sheet motif as the single signature.
   ========================================================================== */
:root {
  --ink:    #0a0a0e;   /* near-black, faint blue */
  --ink-2:  #111119;   /* raised panel */
  --ink-3:  #17171f;   /* hover / inset */
  --line:   #24232e;   /* hairlines */
  --paper:  #f3efe4;   /* warm paper white (headings) */
  --text:   #d9d6cc;   /* body */
  --muted:  #8a8898;   /* secondary */
  --amber:  #f0b34a;   /* single warm accent (links, focus) */
  --ok:     #5fd0a0;
  --warn:   #f0b34a;
  --err:    #f0726a;
  /* the spectrum — used ONLY on the prism ray, primary CTA, progress, active edge */
  --spectrum: linear-gradient(90deg, #f6c453 0%, #ee7a59 26%, #e85d9a 52%, #8f6cf0 74%, #4cc9f0 100%);
  /* same palette mirrored (…→cyan→…) so it tiles seamlessly AND every transition is
     between adjacent brand colours — no muddy cyan→yellow blend at the loop point */
  --spectrum-loop: linear-gradient(90deg,
    #f6c453 0%, #ee7a59 12.5%, #e85d9a 25%, #8f6cf0 37.5%, #4cc9f0 50%,
    #8f6cf0 62.5%, #e85d9a 75%, #ee7a59 87.5%, #f6c453 100%);
  --radius: 16px;
  --maxw: 1080px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: "Spline Sans", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* atmosphere: a soft spectral bloom top-right + grain overlay ------------- */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background:
    radial-gradient(60rem 40rem at 82% -8%, rgba(232,93,154,.10), transparent 60%),
    radial-gradient(50rem 38rem at 78% -2%, rgba(76,201,240,.08), transparent 60%),
    radial-gradient(40rem 30rem at 95% 4%, rgba(246,196,83,.07), transparent 60%);
}
.grain {
  position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
/* the refraction ray: a thin white beam entering, splitting into spectrum */
.ray {
  position: fixed; top: -12vh; right: 8vw; width: 2px; height: 60vh; z-index: -1;
  pointer-events: none; transform: rotate(19deg); transform-origin: top;
  background: linear-gradient(#efe9dd, rgba(239,233,221,0) 38%);
  filter: blur(.3px);
}
.ray::after {
  content: ""; position: absolute; top: 38%; left: 0; width: 2px; height: 62%;
  background: var(--spectrum); transform: rotate(8deg) translateX(2px); transform-origin: top;
  filter: blur(.4px); opacity: .8;
}

a { color: var(--amber); text-decoration: none; }
a:hover { color: var(--paper); }

/* header --------------------------------------------------------------------*/
.nav {
  display: flex; align-items: center; justify-content: space-between;
  max-width: var(--maxw); margin: 0 auto; width: 100%;
  padding: 1.4rem 1.6rem;
}
.brand { display: inline-flex; align-items: center; gap: .6rem; color: var(--paper); }
.brand:hover { color: var(--paper); }
.brand span {
  font-family: "Fraunces", serif; font-weight: 800; font-size: 1.45rem;
  letter-spacing: -.01em;
}
.brand-mark { width: 34px; height: 34px; border-radius: 8px; flex-shrink: 0; }
.nav nav a { color: var(--muted); margin-left: 1.6rem; font-size: .95rem; }
.nav nav a:hover { color: var(--paper); }

main { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 1.5rem 1.6rem 4rem; flex: 1; }

/* footer --------------------------------------------------------------------*/
.foot {
  border-top: 1px solid var(--line); color: var(--muted);
  max-width: var(--maxw); margin: 0 auto; width: 100%;
  padding: 1.6rem; display: flex; gap: 1rem; justify-content: space-between; flex-wrap: wrap;
  font-size: .9rem;
}
.foot-mark { font-family: "Fraunces", serif; font-weight: 600; color: var(--text); }

/* typographic scale ---------------------------------------------------------*/
h1, h2, h3 { font-family: "Fraunces", serif; color: var(--paper); line-height: 1.05; letter-spacing: -.015em; }
h1 { font-size: clamp(2.4rem, 6vw, 4.4rem); font-weight: 800; margin: .2rem 0 .6rem; }
h2 { font-size: 1.7rem; font-weight: 600; margin: 2.4rem 0 1rem; }
h3 { font-size: 1.1rem; font-weight: 600; margin: 0; }
.eyebrow {
  font-family: "Spline Sans Mono", monospace; text-transform: uppercase;
  letter-spacing: .22em; font-size: .72rem; color: var(--amber);
}

/* hero ----------------------------------------------------------------------*/
.hero { padding: 3.5rem 0 2rem; max-width: 760px; }
.hero h1 .spectral {
  background: var(--spectrum); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.hero p { font-size: 1.2rem; color: var(--muted); max-width: 56ch; margin: 0 0 1.8rem; }
.hero .sub { font-family: "Spline Sans Mono", monospace; font-size: .82rem; color: var(--muted); margin-top: 1.1rem; letter-spacing: .04em; }

/* buttons -------------------------------------------------------------------*/
.btn {
  display: inline-flex; align-items: center; gap: .5rem; cursor: pointer;
  font-family: "Spline Sans", sans-serif; font-weight: 600; font-size: 1rem;
  padding: .85rem 1.5rem; border-radius: 999px; border: 1px solid transparent;
  color: #15131a; background: var(--spectrum); background-size: 160% 100%;
  background-position: 0% 0; transition: background-position .5s ease, transform .15s ease, filter .2s;
}
.btn:hover { background-position: 100% 0; color: #15131a; transform: translateY(-1px); }
.btn.secondary { background: transparent; color: var(--text); border-color: var(--line); }
.btn.secondary:hover { background: var(--ink-3); color: var(--paper); border-color: #34333f; }
.btn.block { display: flex; width: 100%; justify-content: center; }
.btn:disabled { opacity: .55; cursor: default; transform: none; }

/* panels & cards ------------------------------------------------------------*/
.panel {
  background: linear-gradient(180deg, var(--ink-2), rgba(17,17,25,.6));
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.6rem 1.7rem; margin: 1.4rem 0;
}

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.3rem; }
.card {
  position: relative; background: var(--ink-2); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; transition: transform .18s ease, border-color .18s;
}
.card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: var(--spectrum); opacity: 0; transition: opacity .2s;
}
.card:hover { transform: translateY(-3px); border-color: #34333f; }
.card:hover::before { opacity: 1; }
.card video { width: 100%; display: block; background: #000; aspect-ratio: 16/9; }
.card .meta { padding: .9rem 1.1rem 1.1rem; }
.card .meta h3 { font-size: 1.02rem; margin-bottom: .25rem; }
.card .meta p { margin: 0; color: var(--muted); font-size: .85rem; font-family: "Spline Sans Mono", monospace; }

/* feature row ---------------------------------------------------------------*/
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.3rem; }
.feature { padding: 1.4rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--ink-2); }
.feature .n { font-family: "Fraunces", serif; font-size: 1.4rem; color: var(--paper); }
.feature .n::first-letter { color: var(--amber); }
.feature p { margin: .4rem 0 0; color: var(--muted); font-size: .95rem; }

/* KPIs (confirm / account) --------------------------------------------------*/
.kpis { display: flex; flex-wrap: wrap; gap: 2.2rem; margin: 1.2rem 0; }
.kpi .v { font-family: "Fraunces", serif; font-size: 1.9rem; color: var(--paper); }
.kpi .l { font-family: "Spline Sans Mono", monospace; font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }

/* forms ---------------------------------------------------------------------*/
label { display: block; margin: 1.1rem 0 .4rem; font-weight: 500; color: var(--text); }
label .muted { font-weight: 400; }
.field-label { margin-top: 1.25rem; }
input[type=email], input[type=text], input[type=password] {
  width: 100%; padding: .8rem 1rem; border-radius: 12px; border: 1px solid var(--line);
  background: var(--ink); color: var(--paper); font-size: 1rem; font-family: inherit;
}
input:focus { outline: none; border-color: var(--amber); box-shadow: 0 0 0 3px rgba(240,179,74,.15); }

.segset {
  --selected-index: 1;
  position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0; margin: .45rem 0 1rem; padding: 4px;
  border: 1px solid var(--line); border-radius: 999px; background: rgba(10,10,14,.72);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}
.segset:has(input[value="general"]:checked) { --selected-index: 0; }
.segset:has(input[value="student"]:checked) { --selected-index: 1; }
.segset:has(input[value="expert"]:checked) { --selected-index: 2; }
.segset::before {
  content: ""; position: absolute; top: 4px; bottom: 4px; left: 4px; z-index: 0;
  width: calc((100% - 8px) / 3); border-radius: 999px;
  background: var(--spectrum); transform: translateX(calc(var(--selected-index) * 100%));
  transition: transform .2s cubic-bezier(.2,.7,.2,1), filter .2s ease;
  box-shadow: 0 6px 18px rgba(0,0,0,.28);
}
.seg-option { position: relative; margin: 0; min-width: 0; }
.seg-option input {
  position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.seg-option span {
  position: relative; z-index: 1; display: flex; min-height: 58px; padding: .55rem .65rem;
  border-radius: 999px; cursor: pointer; flex-direction: column; align-items: center;
  justify-content: center; text-align: center; transition: color .16s ease;
}
.seg-option strong {
  display: block; color: var(--paper); font-size: .96rem; line-height: 1.15;
}
.seg-option small {
  display: block; color: var(--muted); font-family: "Spline Sans Mono", monospace;
  font-size: .66rem; letter-spacing: .04em; line-height: 1.2; margin-top: .22rem;
}
.seg-option input:checked + span {
  color: #15131a;
}
.seg-option input:checked + span strong,
.seg-option input:checked + span small {
  color: #15131a;
}
.seg-option input:focus-visible + span {
  outline: 2px solid var(--amber); outline-offset: 2px;
}

.dropzone {
  display: block; border: 1.5px dashed #34333f; border-radius: var(--radius);
  padding: 3rem 1.5rem; text-align: center; background:
    radial-gradient(30rem 12rem at 50% 0%, rgba(246,196,83,.06), transparent 70%), var(--ink-2);
  cursor: pointer; transition: border-color .18s, background .18s;
}
.dropzone:hover, .dropzone.drag { border-color: var(--amber); }
.dropzone input { display: none; }
.dropzone .big { font-family: "Fraunces", serif; font-size: 1.4rem; color: var(--paper); }
.dropzone .sub { font-family: "Spline Sans Mono", monospace; font-size: .8rem; color: var(--muted); margin-top: .5rem; }

/* notices -------------------------------------------------------------------*/
.notice {
  --notice-accent: #4cc9f0;
  position: relative; overflow: hidden; padding: .95rem 1.1rem .95rem 1.25rem;
  border-radius: 12px; margin: 1.1rem 0; border: 1px solid rgba(76,201,240,.30);
  background: linear-gradient(90deg, rgba(76,201,240,.10), rgba(76,201,240,.04));
  color: var(--text);
}
.notice::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--notice-accent);
}
.notice strong { color: var(--paper); }
.notice.err  {
  --notice-accent: var(--err);
  background: linear-gradient(90deg, rgba(240,114,106,.12), rgba(240,114,106,.04));
  border-color: rgba(240,114,106,.36);
}
.notice.warn {
  --notice-accent: var(--warn);
  background: linear-gradient(90deg, rgba(240,179,74,.12), rgba(240,179,74,.04));
  border-color: rgba(240,179,74,.36);
}
.notice.ok {
  --notice-accent: var(--ok);
  background: linear-gradient(90deg, rgba(95,208,160,.12), rgba(95,208,160,.04));
  border-color: rgba(95,208,160,.36);
}

/* progress ------------------------------------------------------------------*/
.progress {
  height: 10px; background: var(--ink-3); border-radius: 999px;
  overflow: hidden; margin: 1rem 0; border: 1px solid var(--line);
}
.progress > span {
  display: block; height: 100%; width: var(--p, 0%); max-width: 100%; border-radius: 999px;
  background: var(--spectrum-loop); background-size: 200% 100%;
  animation: progress-flow 3s linear infinite;
  transition: width .6s ease;
}
@keyframes progress-flow {
  to { background-position: -200% 0; }
}

.steps { display: flex; gap: .5rem; flex-wrap: wrap; font-family: "Spline Sans Mono", monospace; font-size: .8rem; color: var(--muted); margin: .4rem 0 .2rem; }
.steps .on { color: var(--amber); }

.spinner { width: 16px; height: 16px; border: 2px solid var(--line); border-top-color: var(--amber); border-radius: 50%; animation: spin 1s linear infinite; display: inline-block; vertical-align: -3px; margin-right: .4rem; }
@keyframes spin { to { transform: rotate(360deg); } }

video.player { width: 100%; border-radius: var(--radius); background: #000; border: 1px solid var(--line); }

.row { display: flex; gap: .8rem; flex-wrap: wrap; align-items: center; }
.badge { font-family: "Spline Sans Mono", monospace; font-size: .7rem; padding: .2rem .55rem; border-radius: 999px; background: var(--ink-3); color: var(--muted); border: 1px solid var(--line); }
.muted { color: var(--muted); }
.center { text-align: center; }

/* pricing -------------------------------------------------------------------*/
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.3rem; margin-top: 1.4rem; }
.plan { position: relative; padding: 1.7rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--ink-2); }
.plan.featured { border-color: transparent; background:
  linear-gradient(var(--ink-2), var(--ink-2)) padding-box,
  var(--spectrum) border-box; border: 1.5px solid transparent; }
.plan .price { font-family: "Fraunces", serif; font-size: 2.4rem; color: var(--paper); }
.plan .price small { font-size: .9rem; color: var(--muted); font-family: "Spline Sans Mono", monospace; }
.plan .tag { font-family: "Spline Sans Mono", monospace; font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: var(--amber); }
.plan ul { list-style: none; padding: 0; margin: 1rem 0 1.3rem; color: var(--muted); font-size: .92rem; }
.plan li { padding: .25rem 0; }
.plan li::before { content: "→ "; color: var(--amber); }

/* invite landing — a focused card, centred as a whole block -----------------*/
.invite { max-width: 620px; margin-inline: auto; }
.invite-credits {
  background: var(--spectrum); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
/* the shared code, carried on a spectrum-refracted edge */
.invite-code {
  display: flex; align-items: baseline; gap: .8rem; flex-wrap: wrap;
  margin: 1.4rem 0 .2rem; padding: .95rem 1.2rem; border-radius: 12px;
  background:
    linear-gradient(var(--ink), var(--ink)) padding-box,
    var(--spectrum) border-box;
  border: 1.5px solid transparent;
}
.invite-code__label {
  font-family: "Spline Sans Mono", monospace; font-size: .64rem;
  letter-spacing: .16em; text-transform: uppercase; color: var(--muted);
}
.invite-code__value {
  font-family: "Spline Sans Mono", monospace; font-size: 1.25rem;
  letter-spacing: .06em; color: var(--paper);
}

/* staggered page-load reveal -----------------------------------------------*/
.reveal > * { opacity: 0; transform: translateY(14px); animation: rise .7s cubic-bezier(.2,.7,.2,1) forwards; }
.reveal > *:nth-child(1) { animation-delay: .04s; }
.reveal > *:nth-child(2) { animation-delay: .12s; }
.reveal > *:nth-child(3) { animation-delay: .20s; }
.reveal > *:nth-child(4) { animation-delay: .28s; }
.reveal > *:nth-child(5) { animation-delay: .36s; }
@keyframes rise { to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .reveal > * { animation: none; opacity: 1; transform: none; }
  .progress > span, .segset::before { animation: none; transition: none; }
}

@media (max-width: 640px) {
  .features { grid-template-columns: 1fr; }
  .segset { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .seg-option span { min-height: 48px; padding: .45rem .35rem; }
  .seg-option small { display: none; }
  .nav nav a { margin-left: 1rem; }
}
