/* Folderplane site. Colours and type follow the app's own tokens (web/src/styles/tokens.css). */

:root {
  color-scheme: dark;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
  --font-code: ui-monospace, /* taste-skill-ignore: code blocks only */ "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;

  --bg: #09090b;
  --bg-2: #111113;
  --tile: #161619;
  --tile-2: #1d1d21;
  --ink: #f4f4f5;
  --muted: #a1a1aa;
  --primary: #f4f4f5;
  --primary-on: #0b0b0d;
  --accent: #3b8bff;
  --accent-on: #ffffff;
  --accent-fill: #1a66e0;
  --grid-dot: rgb(255 255 255 / 0.07);
  --ui-line: rgb(255 255 255 / 0.08);
  --ui-field: rgb(255 255 255 / 0.055);

  --type-image: #3ecf8e;
  --type-video: #b27cff;
  --type-audio: #ff6fa8;
  --type-archive: #d9a35b;
  --type-code: #9fd35a;
  --type-document: #ef5b4c;
  --type-text: #9b9ba5;

  --step-xs: 13px;
  --step-sm: 16px;
  --step-body: 18px;
  --step-statement: clamp(20px, 1.8vw, 24px);
  --step-display: clamp(36px, 4.2vw, 64px);
  --step-word: clamp(56px, 10vw, 168px);

  --margin: clamp(16px, 2.2vw, 32px);
  --gap-section: clamp(112px, 12vw, 200px);
  --radius: 6px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: #f2f2f4;
    --bg-2: #e8e8ec;
    --tile: #ffffff;
    --tile-2: #f7f7f9;
    --ink: #18181b;
    --muted: #55555d;
    --primary: #18181b;
    --primary-on: #ffffff;
    --accent: #1f74ff;
    --accent-fill: #1a66e0;
    --grid-dot: rgb(0 0 0 / 0.08);
    --ui-line: rgb(0 0 0 / 0.08);
    --ui-field: rgb(0 0 0 / 0.045);
    --type-image: #12a26a;
    --type-video: #8a4dff;
    --type-audio: #e5397f;
    --type-archive: #b97a2a;
    --type-code: #5f9e1c;
    --type-document: #e0442f;
    --type-text: #7b7b85;
  }
}
:root[data-theme="dark"] { color-scheme: dark; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--step-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3, p, figure, ul, ol, pre { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
::selection { background: var(--accent); color: var(--accent-on); }

h1, h2 {
  font-size: var(--step-display);
  line-height: 1.04;
  letter-spacing: -0.03em;
  font-weight: 600;
  text-wrap: balance;
}

.button {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0 22px;
  border-radius: var(--radius);
  background: var(--primary);
  color: var(--primary-on);
  font-size: var(--step-sm);
  font-weight: 600;
  text-decoration: none;
  transition: transform 120ms var(--ease-out), background-color 160ms;
}
.button:hover { background: var(--accent-fill); color: var(--accent-on); }
.button:active { transform: scale(0.96); }
.text-link {
  font-size: var(--step-sm);
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
  transition: color 160ms;
}
.text-link:hover { color: var(--accent); }

/* ---------- Hero ---------- */

.hero { padding: var(--margin); padding-bottom: 0; }
.hero-top { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: var(--step-sm);
  text-decoration: none;
}
.hero-copy {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 24px;
  align-items: end;
  margin-top: clamp(40px, 6vw, 96px);
}
.hero h1 { grid-column: 1 / span 7; font-size: clamp(40px, 5.6vw, 88px); line-height: 0.98; }
.hero-side { grid-column: 8 / -1; padding-bottom: 6px; }
.masked .line { display: block; overflow: hidden; padding-bottom: 0.08em; margin-bottom: -0.08em; }
.masked .line > span { display: block; }
.lede { max-width: 42ch; }
.actions { margin-top: 28px; display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }

/* ---------- Try the board ---------- */

main > section { padding: 0 var(--margin); margin-top: var(--gap-section); }
main > .try { margin-top: clamp(40px, 5vw, 72px); }
.try-head {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 24px;
  align-items: baseline;
  margin-bottom: 24px;
}
.try-head h2 { grid-column: 1 / span 5; font-size: var(--step-statement); letter-spacing: -0.015em; }
.try-foot {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 24px;
  margin-top: 28px;
  align-items: start;
}
.hints { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; font-size: var(--step-sm); color: var(--muted); }
.hints b { color: var(--ink); font-weight: 600; }
/* Hints name the visitor's own input: mouse and keyboard, or touch. */
.for-touch { display: none; }
@media (hover: none) and (pointer: coarse) {
  .for-mouse { display: none; }
  li.for-touch { display: list-item; }
}
.try-head-side { grid-column: 8 / -1; display: grid; gap: 10px; justify-items: start; }
.try-head-side p { max-width: 46ch; color: var(--muted); font-size: var(--step-sm); }
.reset { background: none; border: 0; padding: 0; cursor: pointer; color: var(--ink); }

/* ---------- Features ---------- */

.features { display: grid; grid-template-columns: repeat(12, 1fr); gap: 24px; align-items: start; }
.features h2 { grid-column: 1 / -1; margin-bottom: 24px; }
.feature-lead {
  grid-column: 1 / span 6;
  display: grid;
  gap: 32px;
  padding: 32px 32px 0;
  border-radius: var(--radius);
  background: var(--accent-fill);
  color: var(--accent-on);
  overflow: hidden;
  position: sticky;
  top: 32px;
}
.feature-lead p, .feature-list p { font-size: var(--step-statement); line-height: 1.32; letter-spacing: -0.012em; }
.feature-lead img {
  width: calc(100% + 32px);
  max-width: none;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: 34% 18%;
  border-radius: 8px 0 0 0;
}
.feature-list { grid-column: 8 / -1; display: grid; gap: 40px; padding-top: 8px; }
.feature-list p { max-width: 34ch; }
.feature-lead b, .feature-list b { font-weight: 650; }
.slot {
  display: inline-block;
  width: 1.9em;
  height: 1em;
  vertical-align: -0.14em;
  border-radius: 0.18em;
  overflow: hidden;
  background: #000;
}
.slot img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Run (drag through the stages) ---------- */

.run {
  padding: 0 !important;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-rows: 1fr auto;
  min-height: 88svh;
}
.run-text { background: var(--bg-2); padding: clamp(32px, 4vw, 64px) var(--margin); display: flex; flex-direction: column; gap: 40px; }
.run-text h2 { font-size: var(--step-statement); letter-spacing: -0.015em; }
.stages { display: grid; }
.clause {
  grid-area: 1 / 1;
  font-size: var(--step-display);
  line-height: 1.04;
  letter-spacing: -0.03em;
  font-weight: 600;
  max-width: 12ch;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 200ms, transform 300ms var(--ease-out);
  visibility: hidden;
}
.clause.active { opacity: 1; transform: none; visibility: visible; }
.run-note { margin-top: auto; max-width: 46ch; }
.run-fragment { background: var(--tile); display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; padding: 48px var(--margin); min-width: 0; }
.pane {
  grid-area: 1 / 1;
  width: min(100%, 480px);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity 200ms, transform 300ms var(--ease-out);
}
.pane.active { opacity: 1; visibility: visible; transform: none; }
.pane pre {
  font-family: var(--font-code);
  font-size: 16px;
  line-height: 1.7;
  padding: 24px;
  border-radius: 12px;
  background: #0d0d0f;
  color: #e4e4e7;
  overflow-x: auto;
  border: 1px solid rgb(255 255 255 / 0.08);
}
.pane pre .c { color: #8b8b94; }
.pane-shot { border-radius: 10px; width: min(100%, 560px); }
.pane:has(.pane-shot) { width: min(100%, 560px); }
.activate {
  display: grid;
  gap: 14px;
  padding: 28px;
  border-radius: 16px;
  background: var(--bg-2);
  border: 1px solid var(--ui-line);
  font-size: 14px;
}
.activate b { font-size: 20px; letter-spacing: -0.01em; }
.activate label { display: grid; gap: 6px; color: var(--muted); font-size: 13px; }
.activate input {
  height: 38px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid var(--ui-line);
  background: var(--ui-field);
  color: var(--ink);
  font-size: 14px;
}
.activate-btn {
  display: grid;
  place-items: center;
  height: 40px;
  border-radius: 999px;
  background: var(--primary);
  color: var(--primary-on);
  font-weight: 600;
}
.run-slider { grid-column: 1 / -1; padding: 28px var(--margin) 36px; background: var(--bg-2); }
.run-slider input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 32px;
  background: transparent;
  cursor: pointer;
  --p: 0%;
}
.run-slider input[type="range"]::-webkit-slider-runnable-track {
  height: 8px;
  background: linear-gradient(to right, var(--ink) var(--p), var(--tile-2) var(--p)); /* taste-skill-ignore: two flat fills on a range track */
}
.run-slider input[type="range"]::-moz-range-track { height: 8px; background: var(--tile-2); }
.run-slider input[type="range"]::-moz-range-progress { height: 8px; background: var(--ink); }
.run-slider input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 32px;
  height: 32px;
  margin-top: -12px;
  background: var(--accent);
  border: 0;
  transition: transform 120ms;
}
.run-slider input[type="range"]::-moz-range-thumb { width: 32px; height: 32px; background: var(--accent); border: 0; border-radius: 0; }
.run-slider input[type="range"]:active::-webkit-slider-thumb { transform: scale(1.12); }
.stage-names { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 12px; font-size: var(--step-sm); color: var(--muted); }
.stage-names li:nth-child(2) { text-align: center; transform: translateX(-16%); }
.stage-names li:nth-child(3) { text-align: center; transform: translateX(16%); }
.stage-names li:last-child { text-align: right; }
.stage-names li.on { color: var(--ink); font-weight: 600; }

/* ---------- FAQ ---------- */

.faq { display: grid; grid-template-columns: repeat(12, 1fr); gap: 24px; align-items: start; }
.faq h2 { grid-column: 1 / span 4; }
.faq-list { grid-column: 5 / -1; display: grid; gap: 8px; }
.faq details { background: var(--tile); border-radius: var(--radius); transition: background-color 200ms, color 200ms; overflow: hidden; }
.faq details p { transition: opacity 240ms var(--ease-out); }
.faq details[data-closing] p { opacity: 0; }
.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 72px;
  padding: 16px 24px;
  padding-right: 72px;
  position: relative;
  font-size: var(--step-body);
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before,
.faq summary::after {
  content: "";
  position: absolute;
  right: 24px;
  top: 50%;
  width: 16px;
  height: 3px;
  margin-top: -1.5px;
  background: currentColor;
  transition: transform 240ms var(--ease-out);
}
.faq summary::after { transform: rotate(90deg); }
.faq details:hover:is(:not([open]), [data-closing]) { background: var(--tile-2); }
.faq details[open]:not([data-closing]) { background: var(--accent-fill); color: var(--accent-on); }
.faq details[open]:not([data-closing]) summary::after { transform: rotate(180deg); }
.faq details p { padding: 0 24px 28px; max-width: 52ch; font-size: var(--step-body); }
.faq summary:focus-visible { outline: 2px solid currentColor; outline-offset: -6px; border-radius: var(--radius); }
/* A click opens the answer; the ring is for keyboard users only. */
.faq summary:focus:not(:focus-visible), [data-pointer] .faq summary:focus-visible { outline: none; }

/* ---------- Footer ---------- */

.footer {
  margin-top: var(--gap-section);
  padding: 0 var(--margin) var(--margin);
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 8px;
}
.tile {
  background: var(--tile);
  border-radius: var(--radius);
  padding: 24px;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  text-decoration: none;
}
.tile small { font-size: var(--step-xs); color: var(--muted); }
.t-statement { grid-column: 1 / span 4; }
.t-statement p { font-size: var(--step-statement); line-height: 1.25; letter-spacing: -0.015em; }
.t-statement a { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; transition: color 160ms; }
.t-statement a:hover { color: var(--accent); }
.t-nav { grid-column: 5 / span 3; justify-content: flex-start; }
.t-nav li + li { margin-top: 6px; }
.t-nav a { font-size: var(--step-sm); text-decoration: none; transition: color 160ms; }
.t-nav a:hover { color: var(--accent); }
.t-status { grid-column: 8 / span 2; }
.t-status p { font-size: var(--step-statement); font-weight: 600; }
.t-issues { grid-column: 10 / span 3; transition: background-color 200ms; }
.t-issues span { font-size: var(--step-statement); font-weight: 600; }
.t-issues small { font-size: var(--step-sm); color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }
.t-issues:hover { background: var(--tile-2); }
.t-word {
  grid-column: 1 / span 8;
  min-height: 320px;
  background: #1a1a1d;
  color: #f4f4f5;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 2vw;
}
.t-word img { width: clamp(56px, 8vw, 128px); height: auto; }
.t-word span { font-size: clamp(44px, 7.4vw, 124px); font-weight: 650; letter-spacing: -0.045em; line-height: 1; }
.t-cta {
  grid-column: 9 / span 4;
  min-height: 320px;
  background: var(--accent-fill);
  color: var(--accent-on);
  transition: transform 200ms var(--ease-out);
}
.t-cta span { font-size: var(--step-statement); font-weight: 600; letter-spacing: -0.02em; }
.t-cta svg { align-self: flex-end; transition: transform 240ms var(--ease-out); }
.t-cta:hover svg { transform: translate(6px, -6px); }
.t-cta:active { transform: scale(0.985); }

/* ---------- Phone and tablet ---------- */

@media (max-width: 900px) {
  .hero-copy, .try-head, .try-foot { grid-template-columns: 1fr; gap: 20px; }
  .hero h1, .hero-side, .try-head h2, .try-head-side, .hints { grid-column: 1; }
  .hero h1 { font-size: clamp(40px, 11vw, 64px); }
  .hints { grid-template-columns: 1fr 1fr; }

  .features, .faq { grid-template-columns: 1fr; }
  .features h2, .faq h2, .faq-list { grid-column: 1; }
  .feature-lead, .feature-list { grid-column: 1; position: static; }
  .feature-lead { padding: 24px 24px 0; }
  .feature-lead img { width: calc(100% + 24px); }
  .feature-list { gap: 28px; padding-top: 16px; }
  .faq h2 { position: static; }

  .run { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto auto; min-height: 0; }
  .pane pre { font-size: 13px; padding: 16px; }
  .run-text { order: 1; padding: 32px var(--margin) 24px; gap: 20px; }
  .run-fragment { order: 2; min-height: 0; padding: 24px var(--margin); }
  .run-slider { order: 3; padding: 20px var(--margin) 28px; }
  .run-slider input[type="range"]::-webkit-slider-thumb { width: 36px; height: 36px; margin-top: -14px; }
  .run-note { margin-top: 0; font-size: var(--step-sm); }
  .clause { font-size: clamp(30px, 8.4vw, 44px); }
  .stage-names { font-size: 14px; }
  .hints { grid-template-columns: 1fr; gap: 16px; }

  .footer { grid-template-columns: 1fr 1fr; gap: 6px; }
  .tile { padding: 20px; min-height: 160px; }
  .t-word { grid-column: 1 / -1; order: -2; min-height: 160px; }
  .t-cta { grid-column: 1 / -1; order: -1; min-height: 160px; }
  .t-nav, .t-issues, .t-status, .t-statement { grid-column: span 1; }
  .t-statement { grid-column: 1 / -1; }
}

/* ---------- Motion ---------- */

.js .masked .line > span { transform: translateY(105%); animation: rise 900ms var(--ease-out) forwards; }
.js .masked .line:nth-child(2) > span { animation-delay: 110ms; }
.js .reveal-late { opacity: 0; animation: fade-up 700ms var(--ease-out) 520ms forwards; }
@keyframes rise { to { transform: none; } }
@keyframes fade-up { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity 700ms var(--ease-out), transform 700ms var(--ease-out); transition-delay: var(--d, 0ms); }
.js .reveal.in { opacity: 1; transform: none; }
.js .faq-list details.enter, .js .tile.enter, .js .hints li.enter { opacity: 0; transform: translateY(16px); }
/* The stagger delays only the entrance, never hover or open colours. */
.js .faq-list details, .js .tile, .js .hints li { transition: background-color 200ms, opacity 600ms var(--ease-out) var(--d, 0ms), transform 600ms var(--ease-out) var(--d, 0ms); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .masked .line > span, .js .reveal-late { animation: none; transform: none; opacity: 1; }
  .js .reveal,   .clause, .pane { transition: opacity 120ms; transform: none; }
}

/* ---------- 404 ---------- */
.notfound { min-height: 100svh; display: flex; flex-direction: column; justify-content: space-between; padding: var(--margin); }
.notfound h1 { max-width: 14ch; }
