/* Klugg landing: shared tokens, type, components and illustrations.
   tour.css adds the tour's layout and motion on top. */

@font-face {
  font-family: "Hanken Grotesk";
  src: url("/fonts/hanken-grotesk.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Source Serif 4";
  src: url("/fonts/source-serif-4.woff2") format("woff2");
  font-weight: 200 900;
  font-display: swap;
}
@font-face {
  font-family: "Source Serif 4";
  src: url("/fonts/source-serif-4-italic.woff2") format("woff2");
  font-weight: 200 900;
  font-style: italic;
  font-display: swap;
}

/* Registered so world changes can fade instead of snapping. */
@property --bg {
  syntax: "<color>";
  inherits: true;
  initial-value: #f6f5f2;
}
@property --fg {
  syntax: "<color>";
  inherits: true;
  initial-value: #1c1b19;
}
@property --fg-2 {
  syntax: "<color>";
  inherits: true;
  initial-value: #5b5852;
}
@property --accent {
  syntax: "<color>";
  inherits: true;
  initial-value: #1f3fae;
}
@property --line {
  syntax: "<color>";
  inherits: true;
  initial-value: #e4e2dc;
}
@property --card {
  syntax: "<color>";
  inherits: true;
  initial-value: #ffffff;
}
@property --card-fg {
  syntax: "<color>";
  inherits: true;
  initial-value: #1c1b19;
}
@property --card-fg-2 {
  syntax: "<color>";
  inherits: true;
  initial-value: #6b6862;
}

:root {
  /* The app's palette (apps/web/src/styles/tokens.css): paper, ink, one blue, a warm highlight. */
  --ink: #1c1b19;
  --blue: #1f3fae;
  --blue-deep: #14297a;
  --marker: #fbe3a6;
  --logo-k: #1f3fae;
  --font-sans: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-mono: ui-monospace, "SFMono-Regular", "SF Mono", Menlo, Consolas, monospace;
  --radius: 14px;
  --radius-small: 10px;
  --shadow: 0 1px 2px rgb(28 27 25 / 6%), 0 12px 32px -12px rgb(28 27 25 / 20%);
  --gutter: clamp(16px, 4vw, 56px);
  --max: 1240px;
  --header: 64px;
  color-scheme: light;
}

/* Worlds: color themes. Each section that sets one paints its own. */
:root,
[data-world="blueprint"],
[data-world="page"] {
  --bg: #f6f5f2;
  --fg: #1c1b19;
  --fg-2: #5b5852;
  --accent: #1f3fae;
  --line: #e4e2dc;
  --card: #ffffff;
  --card-fg: #1c1b19;
  --card-fg-2: #6b6862;
}
[data-world="blueprint"] {
  --bg: #e6ecfb;
  --fg-2: #474b57;
  --line: #cbd5ef;
}
[data-world="page"] {
  --bg: #edebe5;
  --line: #d6d3cb;
  --card: #fffdf9;
}
[data-world="electric"] {
  --bg: #1f3fae;
  --fg: #ffffff;
  --fg-2: #dbe3fb;
  --accent: #fbe3a6;
  --line: #3a57c0;
  --card: #ffffff;
  --card-fg: #1c1b19;
  --card-fg-2: #6b6862;
}
[data-world="night"],
[data-world="ink"] {
  --logo-k: #6aa3ff;
  --bg: #141412;
  --fg: #edebe5;
  --fg-2: #a8a59d;
  --accent: #6aa3ff;
  --line: #2e2d29;
  --card: #1c1c19;
  --card-fg: #edebe5;
  --card-fg-2: #a8a59d;
}
[data-world="ink"] {
  --bg: #1c1b19;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header) + 16px);
}
@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 400 1.0625rem / 1.6 var(--font-sans);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
main > [data-world]:not(.waitlist) {
  background: var(--bg);
  color: var(--fg);
}
h1,
h2,
h3,
p,
ul,
ol,
figure {
  margin: 0;
}
ul,
ol {
  padding: 0;
  list-style: none;
}
a {
  color: inherit;
}
/* Clip decorative overflow without creating a scroll container, so sticky still works. */
main {
  overflow-x: clip;
}
img,
svg {
  display: block;
  max-width: 100%;
}
::selection {
  background: var(--marker);
  color: var(--ink);
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}
.skip {
  position: fixed;
  left: 16px;
  top: -60px;
  z-index: 50;
  padding: 10px 16px;
  border-radius: var(--radius-small);
  background: var(--ink);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
}
.skip:focus {
  top: 12px;
}

/* Type */
.serif-accent {
  display: inline-block;
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 560;
  letter-spacing: -0.03em;
  color: var(--blue);
  padding-bottom: 0.08em;
}
h2 {
  font-weight: 800;
  font-size: clamp(2rem, 1.1rem + 3.2vw, 3.6rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
  text-wrap: balance;
}
h3 {
  font-size: 1.3rem;
  line-height: 1.2;
  letter-spacing: -0.015em;
  font-weight: 750;
}
.label,
.eyebrow,
.k {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.label,
.eyebrow {
  color: var(--accent);
}
.reading {
  font-family: var(--font-serif);
  font-size: 1.125rem;
  line-height: 1.55;
}
.lead {
  font-size: clamp(1.0625rem, 1rem + 0.35vw, 1.25rem);
  color: var(--fg-2);
  max-width: 36rem;
}

/* Header */
.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 20;
  height: var(--header);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 var(--gutter);
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  backdrop-filter: blur(14px) saturate(1.3);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
  color: var(--fg);
}
.brand {
  display: inline-flex;
  flex: none;
  margin-inline-end: auto;
  border-radius: 8px;
}
/* Two masks over one box: the K takes the brand blue and "lugg" the world's text color,
   so the logo stays readable when a section or scroll world turns dark. */
.wordmark {
  position: relative;
  display: block;
  width: calc(34px * 756.03 / 340);
  height: 34px;
}
.wordmark > span {
  position: absolute;
  inset: 0;
  mask: url("/brand/wordmark-k.svg") left center / auto 100% no-repeat;
  background: var(--logo-k);
}
.wordmark > .wordmark-lugg {
  mask-image: url("/brand/wordmark-lugg.svg");
  background: var(--fg);
}
@media (forced-colors: active) {
  .wordmark > span {
    background: CanvasText;
    forced-color-adjust: none;
  }
}
.site-header nav {
  display: flex;
  align-items: center;
  gap: clamp(8px, 2vw, 24px);
}
.nav-link {
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9375rem;
}
.nav-link:hover {
  color: var(--accent);
}
.language-switch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  min-width: 44px;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: inherit;
  font: 700 0.8125rem var(--font-mono);
  cursor: pointer;
}
.language-switch:hover {
  border-color: var(--fg);
}
@media (max-width: 720px) {
  .nav-link {
    display: none;
  }
}

/* Buttons */
.button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 0 26px;
  border: 0;
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
  text-decoration: none;
  font: 700 1rem / 1 var(--font-sans);
  cursor: pointer;
  box-shadow: 0 10px 24px -12px rgb(28 27 25 / 45%);
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    background-color 180ms ease;
}
.button:hover {
  transform: translateY(-2px);
  background: var(--blue-deep);
  box-shadow: 0 14px 28px -12px rgb(28 27 25 / 50%);
}
.button:active {
  transform: translateY(0);
}
.button:disabled {
  opacity: 0.7;
  cursor: progress;
}
.button-small {
  min-height: 40px;
  padding: 0 16px;
  font-size: 0.875rem;
  box-shadow: none;
}
.button-light {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 10px 24px -12px rgb(28 27 25 / 40%);
}
.button-light:hover {
  background: #fff;
}

/* Pills and topic states (match the app's TopicState labels) */
.pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font: 700 0.75rem / 1.5 var(--font-sans);
  white-space: nowrap;
  background: #edebe5;
  color: #55524c;
}
.pill.s-prac {
  background: #fbebd0;
  color: #7a4a00;
}
.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid #d6d3cb;
  background: #fff;
  flex: none;
}
.dot.s-prac {
  background: #bf7f17;
  border-color: #bf7f17;
}

.card {
  background: var(--card);
  color: var(--card-fg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
}
.card .k {
  color: var(--card-fg-2);
  display: block;
  margin-bottom: 8px;
  font-size: 0.72rem;
}

/* ---------- Illustrations ---------- */

/* Goal becomes a path */
.path {
  position: relative;
  display: grid;
  gap: 8px;
  padding-left: 0;
}
.path::before {
  content: "";
  position: absolute;
  left: 25px;
  top: 22px;
  bottom: 22px;
  width: 2px;
  background: var(--blue);
  transform-origin: top;
}
.path li {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  color: var(--card-fg);
  border-radius: var(--radius-small);
  box-shadow: var(--shadow);
  padding: 11px 14px 11px 20px;
  font-weight: 650;
  font-size: 0.975rem;
}
.path li .pill {
  margin-left: auto;
}
.path li.next {
  outline: 2px solid var(--blue);
  outline-offset: -2px;
}
.version {
  margin-top: 12px;
  text-align: right;
  font: 600 0.8125rem var(--font-mono);
  color: var(--fg-2);
}

/* Source becomes an explanation */
.pdf {
  background: #fffefa;
  color: #1c1b19;
  border-radius: 6px;
  padding: 18px 20px 20px;
  box-shadow:
    0 1px 0 #e6dfcc,
    0 18px 40px -18px rgb(60 45 10 / 35%);
  display: grid;
  gap: 9px;
  max-width: 400px;
}
.pdf figcaption {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font: 600 0.75rem var(--font-mono);
  color: #6b6862;
  margin-bottom: 4px;
}
.pdf .line {
  display: block;
  height: 7px;
  border-radius: 4px;
  background: #e9e3d3;
}
.pdf .line.short {
  width: 62%;
}
.passage {
  font-family: var(--font-serif);
  font-size: 1rem;
  line-height: 1.55;
}
.passage mark {
  color: inherit;
  background:
    linear-gradient(transparent 12%, var(--marker) 12%, var(--marker) 88%, transparent 88%)
    no-repeat 0 0 / 100% 100%;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  padding: 0 2px;
}
.explain {
  background: var(--card);
  color: var(--card-fg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 22px;
  margin-left: clamp(0px, 8vw, 90px);
}
.cite {
  display: inline-flex;
  align-items: center;
  padding: 1px 8px;
  border-radius: 6px;
  background: #e6ecfb;
  color: #1f3fae;
  font: 700 0.8rem / 1.6 var(--font-mono);
  white-space: nowrap;
}

/* Attempt becomes evidence */
.answer {
  font-size: 0.975rem;
  padding: 10px 12px;
  border-radius: var(--radius-small);
  background: #edebe5;
  color: #3b3934;
}
.feedback p {
  position: relative;
  padding-left: 26px;
  font-size: 0.95rem;
}
.feedback p + p {
  margin-top: 6px;
}
.feedback p::before {
  position: absolute;
  left: 0;
  top: 0;
  font-weight: 800;
}
.feedback .ok::before,
.feedback .gap::before {
  content: "";
  top: 0.2em;
  width: 1.1em;
  height: 1.1em;
  background: #2e8b57;
  mask: url("/icons/check.svg") center / contain no-repeat;
}
.feedback .gap::before {
  background: #7a4a00;
  mask-image: url("/icons/plus.svg");
}

/* Cards become memory */
.deck {
  position: relative;
}
.ghost {
  position: absolute;
  inset: 0;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.ghost.g1 {
  transform: rotate(-3deg) translate(-6px, 8px);
}
.ghost.g2 {
  transform: rotate(4deg) translate(10px, 12px);
  opacity: 0.8;
}
.flash {
  position: relative;
  background: var(--card);
  color: var(--card-fg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 22px;
}
.flash .reading {
  font-size: 1.25rem;
  font-weight: 600;
}
.plan strong {
  display: block;
  font-size: 1.15rem;
  margin-bottom: 10px;
}
.plan > span:last-child {
  font-size: 0.9rem;
  color: var(--card-fg-2);
}
.bar {
  display: block;
  height: 8px;
  border-radius: 999px;
  background: #edebe5;
  margin-bottom: 10px;
  overflow: hidden;
}
.bar i {
  display: block;
  height: 100%;
  width: 38%;
  border-radius: inherit;
  background: var(--blue);
  transform-origin: left;
}

/* Topics become a map */
.map {
  width: 100%;
  height: auto;
  overflow: visible;
}
.map .n circle {
  fill: #6aa3ff;
  stroke: #141412;
  stroke-width: 3;
}
.map text {
  fill: #edebe5;
  font: 600 14px var(--font-sans);
  text-anchor: middle;
}
.map text.start {
  text-anchor: start;
}
.map text.end {
  text-anchor: end;
}
.map-note {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
  font-weight: 650;
  color: var(--fg-2);
}
.legend {
  display: grid;
  gap: 8px;
  margin-top: 22px;
  font-weight: 600;
  font-size: 0.95rem;
}
.legend li {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ---------- Sections after the story ---------- */
.band {
  padding: clamp(80px, 12vw, 160px) max(var(--gutter), calc((100% - var(--max)) / 2));
}
.band > h2 {
  max-width: 18ch;
  margin: 12px 0 clamp(32px, 5vw, 56px);
}

.run-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.run-card {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 22px;
  border-radius: 18px;
  background: color-mix(in srgb, var(--card) 88%, transparent);
  border: 1px solid var(--line);
  color: var(--card-fg);
  transition:
    transform 220ms ease,
    border-color 220ms ease;
}
.run-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
}
.run-card p {
  color: var(--card-fg-2);
  font-size: 0.975rem;
}
.run-card h3 {
  margin-top: 6px;
}
.mini-window {
  min-height: 132px;
  margin: 0;
  border-radius: 12px;
  overflow: hidden;
  background: #0f0f0d;
  border: 1px solid #2e2d29;
}
.mini-window {
  display: grid;
  align-content: start;
  gap: 6px;
  padding-bottom: 16px;
}
.mini-window .k {
  padding: 10px 14px 0;
  margin: 0;
  color: #8fbcff;
}
.mini-title {
  padding: 0 14px;
  font: 600 1.15rem / 1.3 var(--font-serif);
  color: #fff;
}
.bar-dots {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 12px;
  border-bottom: 1px solid #2e2d29;
}
.bar-dots i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #3a3934;
}
.bar-dots b {
  margin-left: 8px;
  font: 500 0.75rem var(--font-mono);
  color: #a8a59d;
}

/* Tabs */
.story {
  font-size: 1.1875rem;
  line-height: 1.6;
  color: var(--card-fg);
}
.does {
  display: grid;
  gap: 12px;
  align-content: start;
}
.does li {
  position: relative;
  padding: 12px 14px 12px 40px;
  border-radius: 12px;
  background: #edebe5;
  font-weight: 650;
  font-size: 0.975rem;
  color: #1c1b19;
}
.does li::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 50%;
  width: 14px;
  height: 14px;
  margin-top: -7px;
  border-radius: 50%;
  background: var(--blue);
}

/* What Klugg will not do */
.nots > h2 {
  margin-top: 0;
}
.not-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.not-list li {
  display: grid;
  gap: 10px;
  align-content: start;
  padding: 26px 24px;
  border-radius: 18px;
  border: 1px solid var(--line);
}
.not-list strong {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  line-height: 1.2;
  font-weight: 600;
}
.not-list span {
  color: var(--fg-2);
}

/* Waitlist */
.waitlist {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 32px 64px;
  align-items: end;
  padding: clamp(80px, 12vw, 150px) max(var(--gutter), calc((100vw - var(--max)) / 2));
  background: var(--blue);
  color: #fff;
}
.waitlist::before {
  content: "";
  position: absolute;
  z-index: -1;
  right: 4%;
  top: 50%;
  height: 130%;
  aspect-ratio: 246 / 355;
  transform: translateY(-50%);
  background: url("/brand/mark-white.svg") no-repeat center / contain;
  opacity: 0.08;
}
.waitlist .label {
  color: #fff;
  opacity: 0.9;
}
.waitlist h2 {
  margin: 12px 0 16px;
}
.waitlist-copy p:last-child {
  color: #dbe3fb;
  max-width: 32rem;
  font-size: 1.125rem;
}
.waitlist-form {
  display: grid;
  gap: 10px;
}
.waitlist-form label {
  font-weight: 700;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.form-row {
  display: flex;
  gap: 10px;
}
.form-row input {
  flex: 1;
  min-width: 0;
  min-height: 52px;
  padding: 0 20px;
  border: 2px solid transparent;
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font: 500 1rem var(--font-sans);
}
.form-row input::placeholder {
  color: #6b6862;
}
.form-row input:focus-visible {
  outline: 3px solid var(--marker);
  outline-offset: 2px;
}
.waitlist .button-light:focus-visible {
  outline-color: var(--marker);
}
.form-note {
  font-size: 0.9rem;
  color: #dbe3fb;
}
.form-message {
  min-height: 1.6em;
  font-weight: 700;
}
.form-message[data-state="error"] {
  color: var(--marker);
}
.honeypot {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  opacity: 0;
}
/* The hero form sits on paper, not on the blue band. */
.hero-form {
  width: min(100%, 36rem);
}
.hero-form .form-row input {
  border-color: var(--line);
  box-shadow: var(--shadow);
}
.hero-form .form-row input:focus-visible {
  outline-color: var(--blue);
}
.hero-form .form-note {
  color: var(--fg-2);
}
.hero-form .form-message[data-state="error"] {
  color: #9a2a1f;
}
@media (max-width: 860px) {
  .waitlist {
    grid-template-columns: 1fr;
  }
  .run-grid,
  .not-list {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 480px) {
  .form-row {
    flex-direction: column;
  }
}

/* Footer */
.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 28px;
  padding: 28px max(var(--gutter), calc((100vw - var(--max)) / 2)) 40px;
  background: var(--ink);
  color: #fff;
  font-size: 0.95rem;
}
.site-footer span:last-child {
  margin-left: auto;
}
.site-footer a {
  font-weight: 700;
  text-underline-offset: 4px;
}
.footer-mark {
  width: 28px;
  height: auto;
}
.site-footer a:focus-visible {
  outline-color: var(--marker);
}
