/* memochu product site — light page, one dark walkthrough plate */

:root {
  --ground: #f9fafb;
  --paper: #ffffff;
  --ink: #1d2731;
  --ink-soft: #4a5866;
  --ink-faint: #5d6975;
  --rule: #dde3e7;
  --rule-strong: #c4ccd2;

  --rose: #d97d7d;
  --cornflower: #769bd5;
  --sky: #8bc7e9;
  --sage: #84a9a2;

  --rose-ink: #9f4547;
  --cornflower-ink: #3a5d9c;
  --sky-ink: #23678c;
  --sage-ink: #43675f;

  --rose-tint: #faeded;
  --cornflower-tint: #eaf0f9;
  --sky-tint: #e9f5fb;
  --sage-tint: #eaf1ef;

  --alert: #a3391d;
  --alert-tint: #fbebe4;

  /* Dark plate (walkthrough, code) */
  --night: var(--ink);
  --night-raised: #243240;
  --night-line: rgb(255 255 255 / 0.1);
  --night-text: #e8edf1;
  --night-soft: #aab6c1;

  --font: "Inter", "Helvetica Neue", Arial, sans-serif;
  --display: "Overpass", "Inter", "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --gutter: clamp(16px, 4vw, 40px);
  --max: 1200px;
  --section: clamp(88px, 11vw, 152px);
  --radius: 16px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  color-scheme: light;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 84px;
  scrollbar-color: var(--rule-strong) var(--ground);
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-feature-settings: "kern", "liga";
  caret-color: var(--cornflower-ink);
  overflow-x: hidden;
}

::selection {
  background: var(--sky);
  color: var(--ink);
}

img,
svg {
  display: block;
  max-width: 100%;
}

figure {
  margin: 0;
}

a {
  color: var(--cornflower-ink);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--ink);
}

:focus-visible {
  outline: 3px solid var(--cornflower);
  outline-offset: 3px;
  border-radius: 6px;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--display);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

h2 {
  font-size: clamp(2rem, 4vw, 3.25rem);
  max-width: 20ch;
}

h3 {
  font-size: 1.2rem;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

strong,
b {
  font-weight: 500;
}

p {
  margin: 0;
  text-wrap: pretty;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

code,
pre,
.mono {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--ink);
  color: var(--paper);
  border-radius: 8px;
}

.skip-link:focus {
  top: 12px;
}

.wrap {
  width: 100%;
  max-width: calc(var(--max) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Line colours ---------- */

[data-line="1"] { --line: var(--rose); --line-ink: var(--rose-ink); --line-tint: var(--rose-tint); }
[data-line="2"] { --line: var(--cornflower); --line-ink: var(--cornflower-ink); --line-tint: var(--cornflower-tint); }
[data-line="3"] { --line: var(--sky); --line-ink: var(--sky-ink); --line-tint: var(--sky-tint); }
[data-line="4"] { --line: var(--sage); --line-ink: var(--sage-ink); --line-tint: var(--sage-tint); }

.roundel {
  display: inline-block;
  flex: none;
  width: 0.95em;
  height: 0.95em;
  border: 0.24em solid var(--line, var(--ink));
  border-radius: 50%;
  background: var(--paper);
}

/* ---------- Header ---------- */

.site-header {
  --h-bg: rgb(249 250 251 / 0.86);
  --h-ink: var(--ink);
  --h-soft: var(--ink-soft);
  --h-line: var(--rule);
  --h-raised: var(--paper);
  --h-hover: var(--paper);
  --h-current: var(--ink);
  --h-current-ink: var(--paper);
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--h-bg);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s, background-color 0.3s;
}

/* On the dark hero the header is dark too; it turns light once the page scrolls or the menu opens */
.site-header--dark {
  /* Solid, so the dark hero does not grey the light bar while scrolling over it */
  --h-bg: var(--ground);
}

.site-header--dark:not(.is-scrolled):not(.is-menu-open) {
  --h-bg: transparent;
  --h-ink: var(--night-text);
  --h-soft: var(--night-soft);
  --h-line: var(--night-line);
  --h-raised: rgb(255 255 255 / 0.06);
  --h-hover: rgb(255 255 255 / 0.08);
  --h-current: var(--night-text);
  --h-current-ink: var(--night);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.site-header--dark:not(.is-scrolled):not(.is-menu-open) :focus-visible {
  outline-color: var(--sky);
}

.site-header.is-scrolled {
  border-bottom-color: var(--rule);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 68px;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--h-ink, var(--ink));
  transition: color 0.3s;
  text-decoration: none;
  font-weight: 500;
  font-size: 1.3rem;
  letter-spacing: -0.03em;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
}

.site-nav a:not(.button) {
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--h-soft);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: background-color 0.2s, color 0.2s;
}

.site-nav a:not(.button):hover {
  background: var(--h-hover);
  color: var(--h-ink);
}

.site-nav .nav-cta,
.menu-toggle {
  display: none;
}

.menu-toggle {
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid var(--h-line);
  border-radius: 999px;
  background: var(--h-raised);
  color: var(--h-ink);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.3s, background-color 0.3s, border-color 0.3s;
}

.menu-toggle svg {
  width: 18px;
  height: 18px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.lang-switch {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--h-line, var(--rule));
  border-radius: 999px;
  background: var(--h-raised, var(--paper));
  transition: background-color 0.3s, border-color 0.3s;
  font-size: 0.82rem;
  font-weight: 500;
}

.lang-switch a,
.lang-switch span {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 12px;
  border-radius: 999px;
  text-decoration: none;
  color: var(--h-soft, var(--ink-soft));
}

.lang-switch [aria-current="true"] {
  background: var(--h-current, var(--ink));
  color: var(--h-current-ink, var(--paper));
}

/* Header call to action: light on the dark header */
.site-header .header-cta {
  background: var(--h-current);
  color: var(--h-current-ink);
}

.site-header .header-cta:hover {
  color: var(--h-current-ink);
}

/* ---------- Buttons ---------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px 22px;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font: inherit;
  font-weight: 500;
  font-size: 1rem;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out), background-color 0.2s;
}

.button:hover {
  color: var(--paper);
  transform: translateY(-1px);
  box-shadow: 0 10px 24px -12px rgb(29 39 49 / 0.6);
}

.button:active {
  transform: translateY(0);
}

.button[disabled] {
  opacity: 0.55;
  cursor: progress;
  transform: none;
  box-shadow: none;
}

.button--small {
  min-height: 40px;
  padding: 8px 16px;
  font-size: 0.92rem;
}

.button svg {
  width: 18px;
  height: 18px;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 2px solid var(--rule-strong);
  padding-bottom: 2px;
  transition: border-color 0.2s;
}

.text-link:hover {
  border-color: var(--ink);
}

.chip-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 6px 14px 6px 10px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink-soft);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.chip-button:hover {
  border-color: var(--rule-strong);
  color: var(--ink);
}

.chip-button svg {
  width: 14px;
  height: 14px;
}

/* ---------- Reveal ---------- */

.js [data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
}

.js [data-reveal].is-shown {
  opacity: 1;
  transform: none;
}

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

.hero {
  --header-h: 69px;
  /* Runs under the transparent header so the dark plate starts at the top of the page */
  margin-top: calc(-1 * var(--header-h));
  padding-block: calc(var(--header-h) + clamp(40px, 6vw, 88px)) clamp(72px, 9vw, 128px);
  background:
    radial-gradient(50% 55% at 84% 52%, rgb(118 155 213 / 0.16), transparent 72%),
    radial-gradient(40% 50% at 4% 100%, rgb(217 125 125 / 0.1), transparent 72%),
    var(--night);
  color: var(--night-text);
}

/* Memory network behind the hero (drawn by site.js); fades under the text so it never competes with it */
.hero {
  position: relative;
  isolation: isolate;
}

.hero-net {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(90deg, rgb(0 0 0 / 0.35), rgb(0 0 0 / 0.5) 36%, #000 50%);
  mask-image: linear-gradient(90deg, rgb(0 0 0 / 0.35), rgb(0 0 0 / 0.5) 36%, #000 50%);
}

@media (max-width: 900px) {
  .hero-net {
    -webkit-mask-image: linear-gradient(180deg, rgb(0 0 0 / 0.4), rgb(0 0 0 / 0.55) 40%, #000 60%);
    mask-image: linear-gradient(180deg, rgb(0 0 0 / 0.4), rgb(0 0 0 / 0.55) 40%, #000 60%);
  }
}

.hero-copy :focus-visible {
  outline-color: var(--sky);
}

.hero .button {
  background: var(--paper);
  color: var(--ink);
}

.hero .button:hover {
  color: var(--ink);
  box-shadow: 0 12px 28px -12px rgb(0 0 0 / 0.7);
}

.hero .text-link {
  color: var(--night-text);
  border-bottom-color: rgb(255 255 255 / 0.3);
}

.hero .text-link:hover {
  border-bottom-color: var(--night-text);
}

.hero .wrap {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
  gap: clamp(36px, 6vw, 96px);
  align-items: center;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
  padding: 6px 14px 6px 8px;
  border: 1px solid var(--night-line);
  border-radius: 999px;
  background: rgb(255 255 255 / 0.05);
  font-size: 0.88rem;
  color: var(--night-soft);
}

.status strong {
  color: var(--night-text);
}

.status-dot {
  position: relative;
  flex: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgb(132 169 162 / 0.25);
}

.status-dot::after {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background: var(--sage);
}

.hero h1 {
  font-size: clamp(2.6rem, 6vw, 5rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
  max-width: 13ch;
}

.hero-lead {
  margin-top: 28px;
  max-width: 46ch;
  font-size: 1.2rem;
  color: var(--night-soft);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 28px;
  margin-top: 40px;
}

/* Story card: two sessions joined by one memory */

.story {
  position: relative;
  padding: 18px 20px 16px;
  border: 1px solid transparent;
  border-radius: 24px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 40px 80px -40px rgb(0 0 0 / 0.75);
}

.story-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 36px;
  margin-bottom: 10px;
}

.story-tag {
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.02em;
  color: var(--ink-faint);
}

.story-body {
  --station-y: 20px;
  --gap: 14px;
  display: grid;
  gap: var(--gap);
}

.story-step {
  position: relative;
  padding-left: 34px;
}

.story-step > .stop {
  position: absolute;
  left: 2px;
  top: calc(var(--station-y) - 9px);
  width: 18px;
  height: 18px;
  border: 4px solid var(--ink);
  border-radius: 50%;
  background: var(--paper);
  z-index: 1;
}

/* The segment from this step's stop to the next step's stop */
.story-step > .seg {
  position: absolute;
  left: 8px;
  top: var(--station-y);
  bottom: calc(-1 * (var(--gap) + var(--station-y)));
  width: 6px;
  border-radius: 6px;
  background: var(--line);
  transform-origin: top center;
}

.session {
  padding: 12px 14px 14px;
  border: 1px solid var(--rule);
  border-radius: 16px;
  background: var(--ground);
}

.session-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  font-size: 0.8rem;
  color: var(--ink-faint);
}

.session-head strong {
  color: var(--ink);
}

.bubble {
  width: fit-content;
  max-width: 34ch;
  padding: 8px 12px;
  border-radius: 14px 14px 14px 4px;
  background: var(--paper);
  border: 1px solid var(--rule);
  font-size: 0.93rem;
  line-height: 1.45;
}

.bubble + .bubble,
.recall + .bubble {
  margin-top: 8px;
}

.bubble--agent {
  margin-left: auto;
  border-radius: 14px 14px 4px 14px;
  background: var(--cornflower-tint);
  border-color: transparent;
}

.memory {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  min-height: 40px;
}

.memory-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--rose-tint);
  color: var(--rose-ink);
  font-size: 0.88rem;
}

.memory-chip strong {
  color: var(--ink);
}

.memory-gap {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--ink-faint);
}

.recall {
  display: grid;
  gap: 2px;
  margin-top: 8px;
  padding: 8px 12px;
  border: 1.5px dashed var(--cornflower);
  border-radius: 12px;
  background: var(--paper);
  font-size: 0.86rem;
}

.recall > span {
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--ink-soft);
}

.story figcaption {
  margin-top: 12px;
  font-size: 0.78rem;
  color: var(--ink-faint);
}

/* Earlier sessions: each thing the user said once, and what memochu kept */
.session--past {
  padding-bottom: 12px;
}

.session--past .session-head {
  margin-bottom: 8px;
}

.session-head span {
  font-family: var(--mono);
  font-size: 0.72rem;
}

.said {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.said-item {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  column-gap: 8px;
  align-items: start;
}

.said-item time {
  padding-top: 7px;
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--ink-faint);
  white-space: nowrap;
}

.said-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
}

.said .bubble {
  max-width: none;
  padding: 5px 10px;
  font-size: 0.86rem;
  transition: opacity 0.6s var(--ease-out);
}

.said-old {
  text-decoration-line: line-through;
  text-decoration-color: transparent;
  text-decoration-thickness: 1.5px;
  transition: text-decoration-color 0.6s var(--ease-out);
}

/* The update replaces the Ankara fact: its message fades and the old city is struck through */
html:not(.js) .said-item--old .bubble,
.said-item--old:has(.saved--old.is-on) .bubble {
  opacity: 0.55;
}

html:not(.js) .said-old,
.said-item--old:has(.saved--old.is-on) .said-old {
  text-decoration-color: currentColor;
}

.saved-stack {
  display: inline-grid;
}

.saved-stack > * {
  grid-area: 1 / 1;
}

.saved {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  padding: 2px 9px 2px 7px;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 0.7rem;
  line-height: 1.5;
  white-space: nowrap;
}

.saved::before {
  content: "";
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.saved--pref {
  background: var(--rose-tint);
  color: var(--rose-ink);
}

.saved--fact {
  background: var(--cornflower-tint);
  color: var(--cornflower-ink);
}

.saved--old {
  background: var(--paper);
  color: var(--ink-faint);
  box-shadow: inset 0 0 0 1px var(--rule);
}

/* New session: what memochu brought, and the answer built from it */
.story .recall {
  position: relative;
  margin-top: 14px;
  padding-top: 12px;
}

/* Sits on the dashed border like a legend */
.recall-title {
  position: absolute;
  top: 0;
  left: 10px;
  margin: 0;
  padding: 0 6px;
  transform: translateY(-55%);
  background: var(--ground);
  font-family: var(--mono);
  font-size: 0.72rem;
  line-height: 1.4;
  color: var(--cornflower-ink);
}

.recall-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.recall-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 8px;
}

.recall-text {
  font-weight: 500;
}

.recall-src {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--ink-soft);
  white-space: nowrap;
}

/* Narrow cards: label and source on one line, the record below */
.recall-list {
  container-type: inline-size;
}

@container (max-width: 370px) {
  .recall-list li {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas: "tag src" "text text";
  }

  .recall-list .saved {
    grid-area: tag;
  }

  .recall-text {
    grid-area: text;
  }

  .recall-src {
    grid-area: src;
    justify-self: end;
  }
}

@media (max-width: 560px) {
  .said-item {
    grid-template-columns: 38px minmax(0, 1fr);
  }
}

.reply {
  display: grid;
  margin-top: 8px;
}

.reply > * {
  grid-area: 1 / 1;
}

.typing {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  justify-self: end;
  align-self: start;
  height: 34px;
  padding: 0 14px;
  border-radius: 14px 14px 4px 14px;
  background: var(--cornflower-tint);
}

.typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cornflower-ink);
  opacity: 0.3;
}

.typing.is-on span {
  animation: typing 1.1s ease-in-out infinite;
}

.typing.is-on span:nth-child(2) {
  animation-delay: 0.15s;
}

.typing.is-on span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes typing {
  0%, 60%, 100% { opacity: 0.3; transform: none; }
  30% { opacity: 0.9; transform: translateY(-2px); }
}

/* Words in the answer that came from memory, in the colour of their record */
.hl {
  padding: 0 2px;
  border-radius: 3px;
  background: linear-gradient(transparent 30%, var(--hl) 30%, var(--hl) 92%, transparent 92%) no-repeat;
  background-size: 100% 100%;
  color: inherit;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.hl--pref {
  --hl: rgb(217 125 125 / 0.32);
}

.hl--fact {
  --hl: rgb(118 155 213 / 0.34);
}

.reply .bubble--agent {
  max-width: 42ch;
}

.story-result {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  margin-top: 12px;
  padding: 9px 12px;
  border-radius: 12px;
  background: var(--sage-tint);
  color: var(--sage-ink);
  font-size: 0.86rem;
  line-height: 1.45;
}

.story-result svg {
  flex: none;
  width: 16px;
  height: 16px;
}

.story-result-meta {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 0.7rem;
  white-space: nowrap;
}

.story-result strong {
  color: var(--ink);
}

/* Story playback */
.js .story [data-at] {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}

.js .story .seg[data-at] {
  transform: scaleY(0);
  transition: transform 0.9s var(--ease-out), opacity 0.2s;
}

.js .story [data-at].is-on {
  opacity: 1;
  transform: none;
}

.js .story .session.is-past {
  opacity: 0.6;
}

.js .story .hl[data-at] {
  opacity: 1;
  transform: none;
  background-size: 0% 100%;
  transition: background-size 0.7s var(--ease-out);
}

.js .story .hl[data-at].is-on {
  background-size: 100% 100%;
}

/* Shown only for a moment while playing; without JavaScript the final state needs neither */
html:not(.js) .story [data-until] {
  display: none;
}

.story-replay[hidden] {
  display: none;
}

/* ---------- Sections ---------- */

.section {
  padding-block: var(--section);
}

.section--paper {
  background: var(--paper);
}

.section + .section {
  border-top: 1px solid var(--rule);
}

.section-head {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 24px clamp(32px, 5vw, 72px);
  align-items: end;
  margin-bottom: clamp(40px, 6vw, 72px);
}

.section-head p {
  max-width: 48ch;
  color: var(--ink-soft);
  font-size: 1.08rem;
}

/* ---------- How it works: boundary split ---------- */

.split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: clamp(32px, 4vw, 48px);
}

.split-col {
  padding: 22px 24px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--paper);
}

.split-col h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.1rem;
}

.split-col h3 img {
  width: 22px;
  height: 22px;
}

.split-col h3 .agent-mark {
  width: 22px;
  height: 22px;
  border: 2px solid var(--ink);
  border-radius: 7px;
}

.split-col ul {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.split-col li {
  display: flex;
  gap: 10px;
  color: var(--ink-soft);
  font-size: 0.97rem;
}

.split-col li::before {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  margin-top: 0.55em;
  border-radius: 50%;
  background: var(--rule-strong);
}

.split-col--memochu li::before {
  background: var(--cornflower);
}

/* ---------- Walkthrough plate ---------- */

.walk {
  position: relative;
  border-radius: 28px;
  background: var(--night);
  color: var(--night-text);
  padding: clamp(18px, 2.6vw, 32px);
  box-shadow: 0 40px 80px -50px rgb(29 39 49 / 0.7);
}

.walk-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: clamp(18px, 2.4vw, 28px);
}

.walk-tab {
  --fill: 0;
  position: relative;
  display: grid;
  gap: 2px;
  padding: 12px 2px 4px;
  border: 0;
  background: none;
  color: var(--night-soft);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.walk-tab::before,
.walk-tab::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  height: 3px;
  border-radius: 3px;
}

.walk-tab::before {
  right: 0;
  background: var(--night-line);
}

.walk-tab::after {
  width: calc(var(--fill) * 100%);
  background: var(--line);
  transition: width 0.5s var(--ease-out);
}

.walk-tab .n {
  font-family: var(--mono);
  font-size: 0.72rem;
}

.walk-tab .t {
  font-weight: 500;
  font-size: 0.98rem;
}

.walk-tab[aria-selected="true"] {
  color: var(--paper);
}

.walk-tab:hover {
  color: var(--paper);
}

.walk-body {
  display: grid;
  grid-template-columns: minmax(0, 3.4fr) minmax(0, 8.6fr);
  gap: clamp(18px, 2.4vw, 28px);
  align-items: stretch;
}

.walk-chapter {
  display: flex;
  flex-direction: column;
  padding: 22px;
  border: 1px solid var(--night-line);
  border-radius: 20px;
  background: var(--night-raised);
}

.js .walk.is-ready .walk-chapter:not(.is-current) {
  display: none;
}

.walk-chapter h3 {
  font-size: 1.3rem;
  color: var(--paper);
}

.walk-chapter > p {
  margin-top: 10px;
  color: var(--night-soft);
  font-size: 0.95rem;
}

.walk-pick {
  margin-top: 18px;
  padding: 10px;
  border: 1px solid var(--night-line);
  border-radius: 14px;
}

.walk-pick-title {
  display: block;
  padding: 2px 8px 8px;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--night-soft);
}

.walk-cases {
  display: grid;
  gap: 2px;
}

.walk-case {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 10px;
  background: none;
  color: var(--night-soft);
  font: inherit;
  font-size: 0.9rem;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
}

.walk-case::before {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  margin-top: 0.5em;
  border: 1.5px solid currentColor;
  border-radius: 50%;
}

.walk-case:hover {
  color: var(--paper);
}

.walk-case[aria-pressed="true"] {
  background: rgb(255 255 255 / 0.07);
  color: var(--paper);
}

.walk-case[aria-pressed="true"]::before {
  border-color: var(--line);
  background: var(--line);
}

/* Without JS the cases are a plain list with their results */
.walk-cases li > span {
  display: block;
  margin-top: 2px;
  font-size: 0.85rem;
  color: var(--night-soft);
}

.js .walk.is-ready .walk-cases li > span {
  display: none;
}

.walk-note {
  margin-top: 16px;
  font-size: 0.85rem;
  color: var(--night-soft);
}

.walk-next {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding: 18px 0 0;
  border: 0;
  background: none;
  color: var(--paper);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
}

.walk-next svg {
  width: 16px;
  height: 16px;
  transition: transform 0.2s var(--ease-out);
}

.walk-next:hover svg {
  transform: translateX(3px);
}

.walk-view {
  display: none;
  min-width: 0;
}

.js .walk.is-ready .walk-view {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.js .walk.is-ready .walk-chapters {
  display: contents;
}

.walk-chapters {
  display: grid;
  gap: 16px;
  grid-column: 1 / -1;
}

/* Stage: agents → memochu → the user's memory */

.stage {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr) minmax(0, 2.1fr);
  grid-template-areas:
    "agents core store"
    "agents jobs other";
  gap: 18px clamp(24px, 3vw, 44px);
  align-items: center;
  padding: clamp(18px, 2.4vw, 28px);
  border: 1px solid var(--night-line);
  border-radius: 20px;
  background:
    radial-gradient(circle at 1px 1px, rgb(255 255 255 / 0.06) 1px, transparent 0) 0 0 / 22px 22px,
    #18212a;
  min-height: 360px;
}

.stage-wires {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
  z-index: 0;
}

.stage > :not(.stage-wires):not(.stage-badge) {
  position: relative;
  z-index: 1;
}

.wire {
  fill: none;
  stroke: var(--line);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.9;
}

.wire--ghost {
  stroke: #e0806b;
  stroke-dasharray: 2 8;
  opacity: 0.85;
}

.packet {
  fill: var(--paper);
  stroke: var(--line);
  stroke-width: 4;
  opacity: 0;
  transition: opacity 0.2s;
}

.packet.is-moving {
  opacity: 1;
}

.stage-agents {
  grid-area: agents;
  display: grid;
  gap: 48px;
  align-content: center;
}

.stage-core {
  grid-area: core;
}

.stage-jobs {
  grid-area: jobs;
  align-self: start;
}

.stage-store {
  grid-area: store;
}

.stage-other {
  grid-area: other;
  align-self: start;
}

.node {
  display: grid;
  gap: 2px;
  padding: 12px 14px;
  border: 1.5px solid rgb(255 255 255 / 0.18);
  border-radius: 14px;
  background: var(--night-raised);
  transition: border-color 0.35s, box-shadow 0.35s, opacity 0.35s, background-color 0.35s;
}

.node-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  font-size: 0.92rem;
  color: var(--paper);
}

.node-title img {
  width: 18px;
  height: 18px;
}

.node-sub {
  font-size: 0.75rem;
  color: var(--night-soft);
}

.node--core {
  border-radius: 999px;
  padding: 12px 18px;
  text-align: center;
  justify-items: center;
}

.jobs {
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border: 1px dashed rgb(255 255 255 / 0.2);
  border-radius: 14px;
  transition: opacity 0.35s, border-color 0.35s;
}

.jobs-title {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--night-soft);
}

.job {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 8px;
  font-size: 0.78rem;
  color: var(--night-text);
}

.state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgb(255 255 255 / 0.06);
  color: var(--night-soft);
  font-family: var(--mono);
  font-size: 0.7rem;
  white-space: nowrap;
}

.state::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.state[data-state="running"] {
  color: var(--cornflower);
}

.state[data-state="running"]::before {
  animation: blink 1s steps(2, start) infinite;
}

.state[data-state="ready"] {
  color: #a9cdc6;
  background: rgb(132 169 162 / 0.16);
}

.state[data-state="failed"] {
  color: #f2a48f;
  background: rgb(163 57 29 / 0.28);
}

@keyframes blink {
  to { visibility: hidden; }
}

.store {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1.5px solid rgb(255 255 255 / 0.22);
  border-radius: 18px;
  transition: border-color 0.35s, box-shadow 0.35s;
}

.store-title {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 0 4px;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--night-text);
}

.store-title span {
  font-family: var(--mono);
  font-weight: 400;
  color: var(--night-soft);
}

.area {
  padding: 10px;
  border-radius: 12px;
  background: rgb(255 255 255 / 0.04);
  border: 1.5px solid transparent;
  transition: border-color 0.35s, background-color 0.35s, opacity 0.35s;
}

.area-title {
  display: block;
  margin-bottom: 8px;
  font-size: 0.74rem;
  color: var(--night-soft);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid rgb(255 255 255 / 0.16);
  border-radius: 8px;
  background: #1e2a35;
  color: var(--night-text);
  font-size: 0.75rem;
  white-space: nowrap;
  transition: border-color 0.35s, background-color 0.35s, color 0.35s, opacity 0.5s, transform 0.5s var(--ease-out);
}

.chip--fact {
  border-style: dashed;
}

.chip--current::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--sage);
}

.chip .v {
  display: none;
  padding: 0 4px;
  border-radius: 4px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--mono);
  font-size: 0.65rem;
}

.other {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1.5px dashed rgb(255 255 255 / 0.16);
  border-radius: 12px;
  color: var(--night-soft);
  font-size: 0.75rem;
  transition: border-color 0.35s, opacity 0.35s;
}

.other .lock {
  width: 14px;
  height: 14px;
}

/* Part states, set by the walkthrough */
.stage .is-quiet {
  opacity: 0.35;
}

.node.is-lit,
.store.is-lit {
  border-color: var(--line);
  box-shadow: 0 0 0 4px rgb(255 255 255 / 0.04), 0 0 24px -6px var(--line);
}

.area.is-lit,
.area.is-ok {
  border-color: var(--line);
  background: rgb(255 255 255 / 0.07);
}

.chip.is-lit,
.chip.is-picked {
  border-color: var(--line);
  background: var(--line);
  color: var(--ink);
}

.chip.is-new {
  border-color: var(--line);
  background: var(--line);
  color: var(--ink);
  animation: pop 0.5s var(--ease-out);
}

.chip.is-aging {
  border-color: var(--line);
}

.chip.is-gone {
  opacity: 0.25;
  text-decoration: line-through;
  transform: scale(0.94);
}

.chip.is-v2 .v {
  display: inline-block;
}

.node.is-fail,
.store.is-fail,
.area.is-denied,
.other.is-denied {
  border-color: #e0806b;
  box-shadow: 0 0 22px -8px #e0806b;
}

.area.is-denied,
.other.is-denied {
  border-style: dashed;
}

.jobs.is-lit {
  border-color: var(--line);
}

@keyframes pop {
  from { transform: scale(0.6); opacity: 0; }
  to { transform: none; opacity: 1; }
}

.stage-badge {
  position: absolute;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px 5px 8px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 500;
  white-space: nowrap;
  box-shadow: 0 8px 20px -8px rgb(0 0 0 / 0.6);
  transform: translateY(-50%);
  animation: badge-in 0.4s var(--ease-out);
}

.stage-badge[hidden] {
  display: none;
}

.stage-badge::before {
  font-weight: 700;
}

.stage-badge[data-tone="ok"] {
  background: var(--sage);
  color: var(--ink);
}

.stage-badge[data-tone="ok"]::before {
  content: "✓";
}

.stage-badge[data-tone="fail"] {
  background: var(--alert);
  color: var(--paper);
}

.stage-badge[data-tone="fail"]::before {
  content: "✕";
}

.stage-badge[data-tone="info"] {
  background: var(--line);
  color: var(--ink);
}

@keyframes badge-in {
  from { opacity: 0; transform: translateY(-30%); }
  to { opacity: 1; transform: translateY(-50%); }
}

.walk-log {
  min-height: 62px;
  padding: 12px 16px;
  border: 1px solid var(--night-line);
  border-radius: 14px;
  background: #151d25;
  font-family: var(--mono);
  font-size: 0.8rem;
  line-height: 1.6;
  color: var(--night-soft);
}

.walk-log p {
  animation: log-in 0.35s var(--ease-out);
}

.walk-log p:first-child {
  color: var(--night-text);
}

.walk-log p::before {
  content: "› ";
  color: var(--line);
}

@keyframes log-in {
  from { opacity: 0; transform: translateX(-4px); }
  to { opacity: 1; transform: none; }
}

.walk-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.82rem;
  color: var(--night-soft);
}

.walk-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 6px 14px;
  border: 1px solid rgb(255 255 255 / 0.18);
  border-radius: 999px;
  background: none;
  color: var(--night-text);
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
}

.walk-toggle:hover {
  border-color: rgb(255 255 255 / 0.4);
}

.walk-toggle[hidden] {
  display: none;
}

.walk :focus-visible {
  outline-color: var(--sky);
}

/* ---------- Use cases ---------- */

.cases {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.case {
  display: flex;
  flex-direction: column;
  padding: 26px 24px 24px;
  border: 1px solid var(--rule);
  border-radius: 20px;
  background: var(--paper);
  transition: border-color 0.3s, transform 0.4s var(--ease-out);
}

.case:hover {
  border-color: var(--rule-strong);
  transform: translateY(-2px);
}

.case h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.3rem;
}

.case > p {
  margin-top: 10px;
  color: var(--ink-soft);
  font-size: 0.98rem;
}

.case .recall {
  margin-top: auto;
  padding-top: 10px;
}

.case-spacer {
  flex: 1 1 18px;
  min-height: 18px;
}

/* ---------- White-label ---------- */

.brands {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
  gap: clamp(36px, 6vw, 96px);
  align-items: center;
}

.brands-intro > p {
  margin-top: 20px;
  color: var(--ink-soft);
  max-width: 50ch;
}

.settings {
  margin-top: 28px;
  border-top: 1px solid var(--rule);
}

.settings li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--rule);
  font-size: 0.95rem;
}

.settings .when {
  flex: none;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--sage-tint);
  color: var(--sage-ink);
  font-size: 0.78rem;
  font-weight: 500;
}

.settings .when--later {
  background: var(--ground);
  color: var(--ink-faint);
  border: 1px dashed var(--rule-strong);
}

.brand-demo {
  display: grid;
  gap: 16px;
  justify-items: center;
}

.brand-picker {
  display: inline-flex;
  padding: 4px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--paper);
}

.brand-picker button {
  padding: 6px 14px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--ink-soft);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
}

.brand-picker button[aria-pressed="true"] {
  background: var(--ink);
  color: var(--paper);
}

.sign {
  --brand: var(--cornflower);
  --brand-ink: var(--cornflower-ink);
  --brand-tint: var(--cornflower-tint);
  width: min(100%, 380px);
  border-radius: 22px;
  background: var(--paper);
  border: 1px solid var(--rule);
  overflow: hidden;
  box-shadow: 0 30px 60px -40px rgb(29 39 49 / 0.45);
}

.sign[data-brand="pera"] {
  --brand: var(--rose);
  --brand-ink: var(--rose-ink);
  --brand-tint: var(--rose-tint);
}

.sign-top {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 18px;
  background: var(--brand);
  color: var(--ink);
  font-weight: 500;
  transition: background-color 0.5s var(--ease-out);
}

.sign-logo {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--paper);
  display: grid;
  place-items: center;
  color: var(--brand-ink);
  font-size: 0.95rem;
}

.sign-body {
  display: grid;
  gap: 10px;
  padding: 18px;
  min-height: 150px;
}

.sign-body .bubble {
  max-width: 30ch;
  background: var(--ground);
}

.sign-body .bubble--agent {
  background: var(--brand-tint);
  transition: background-color 0.5s var(--ease-out);
}

.sign-foot {
  padding: 10px 18px;
  border-top: 1px solid var(--rule);
  font-size: 0.78rem;
  color: var(--ink-faint);
}

.js .sign.is-switching .sign-body,
.js .sign.is-switching .sign-top > span:last-child,
.js .sign.is-switching .sign-logo,
.js .sign.is-switching .sign-foot {
  opacity: 0;
  transform: translateY(4px);
}

.sign-body,
.sign-top > span:last-child,
.sign-logo,
.sign-foot {
  transition: opacity 0.3s var(--ease-out), transform 0.3s var(--ease-out);
}

.brand-note {
  font-size: 0.8rem;
  color: var(--ink-faint);
}

/* ---------- Trust: roles and retention ---------- */

.trust {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: start;
}

.trust h3 {
  font-size: 1.05rem;
  margin-bottom: 14px;
}

.roles {
  border-top: 1px solid var(--rule-strong);
}

.roles li {
  display: grid;
  gap: 2px;
  padding: 14px 0;
  border-bottom: 1px solid var(--rule);
}

.roles span {
  font-size: 0.93rem;
  color: var(--ink-soft);
}

.timetable {
  padding: clamp(18px, 3vw, 28px);
  border: 1px solid var(--rule);
  border-radius: 20px;
  background: var(--paper);
}

.timetable-row {
  display: grid;
  grid-template-columns: minmax(140px, 4fr) minmax(0, 8fr);
  gap: 16px;
  align-items: center;
  padding: 11px 0;
}

.timetable-row + .timetable-row {
  border-top: 1px dashed var(--rule);
}

.timetable-row dt {
  font-weight: 500;
  font-size: 0.95rem;
  line-height: 1.3;
}

.timetable-row dt span {
  display: block;
  font-weight: 400;
  font-size: 0.8rem;
  color: var(--ink-faint);
}

.timetable-row dd {
  position: relative;
  margin: 0 136px 0 0;
  height: 28px;
}

.bar {
  position: absolute;
  top: 7px;
  left: 0;
  height: 14px;
  width: var(--w);
  border-radius: 7px;
  background: var(--sage);
  transform-origin: left center;
}

.bar--rose { background: var(--rose); }
.bar--sky { background: var(--sky); }
.bar--cornflower { background: var(--cornflower); }

.bar-value {
  position: absolute;
  top: 2px;
  left: calc(var(--w) + 10px);
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 500;
  white-space: nowrap;
  line-height: 24px;
}

.js .timetable .bar {
  transform: scaleX(0);
  transition: transform 1.2s var(--ease-out);
}

.js .timetable.is-shown .bar {
  transform: scaleX(1);
}

.js .timetable.is-shown .timetable-row:nth-child(2) .bar { transition-delay: 0.1s; }
.js .timetable.is-shown .timetable-row:nth-child(3) .bar { transition-delay: 0.2s; }
.js .timetable.is-shown .timetable-row:nth-child(4) .bar { transition-delay: 0.3s; }
.js .timetable.is-shown .timetable-row:nth-child(5) .bar { transition-delay: 0.4s; }

.timetable figcaption {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--rule);
  font-size: 0.8rem;
  color: var(--ink-faint);
}

/* ---------- Developers ---------- */

.dev-details {
  border: 1px solid var(--rule);
  border-radius: 22px;
  background: var(--paper);
}

.section--compact {
  padding-block: clamp(56px, 7vw, 96px);
}

.dev-details summary {
  display: block;
  padding: clamp(20px, 3vw, 32px);
  cursor: pointer;
  list-style: none;
}

.dev-details summary::-webkit-details-marker {
  display: none;
}

.dev-title {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 24px;
  align-items: center;
  max-width: none;
  font-size: clamp(1.6rem, 2.6vw, 2.1rem);
}

.dev-note {
  grid-column: 1;
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0;
  color: var(--ink-soft);
}

.dev-toggle {
  grid-column: 2;
  grid-row: 1 / span 2;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  background: var(--paper);
  font-family: var(--font);
  font-size: 0.95rem;
  letter-spacing: 0;
  transition: border-color 0.2s;
}

.dev-details summary:hover .dev-toggle {
  border-color: var(--ink);
}

.dev-details summary svg {
  flex: none;
  width: 20px;
  height: 20px;
  transition: transform 0.3s var(--ease-out);
}

.dev-details[open] summary svg {
  transform: rotate(180deg);
}

.dev-body {
  display: grid;
  gap: clamp(32px, 4vw, 48px);
  padding: 0 clamp(20px, 3vw, 32px) clamp(24px, 3vw, 36px);
}

.dev-body > * {
  min-width: 0;
}

.arch {
  border: 1px solid var(--rule);
  border-radius: 18px;
  background: var(--ground);
  padding: clamp(16px, 3vw, 32px);
}

.arch svg {
  width: 100%;
  height: auto;
}

.arch-node {
  fill: var(--paper);
  stroke: var(--ink);
  stroke-width: 2;
}

.arch-title {
  font-family: var(--font);
  font-size: 16px;
  font-weight: 500;
  fill: var(--ink);
}

.arch-text {
  font-family: var(--font);
  font-size: 13px;
  fill: var(--ink-soft);
}

.arch-code {
  font-family: var(--mono);
  font-size: 12px;
  fill: var(--ink-faint);
}

.arch-flow {
  fill: none;
  stroke-width: 5;
  stroke-linecap: round;
}

.js .arch-flow--moving {
  stroke-dasharray: 10 12;
  animation: flow 1.6s linear infinite;
}

@keyframes flow {
  to { stroke-dashoffset: -44; }
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--rule);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  font-weight: 500;
}

.scroll-x {
  overflow-x: auto;
  scrollbar-width: thin;
}

.arch-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px 32px;
}

.arch-facts h3 {
  font-size: 1rem;
}

.arch-facts p {
  margin-top: 8px;
  font-size: 0.93rem;
  color: var(--ink-soft);
}

.dev {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 6fr);
  gap: clamp(32px, 5vw, 64px);
  align-items: start;
}

.code {
  margin: 0;
  border-radius: 16px;
  background: var(--ink);
  color: var(--night-text);
  overflow: hidden;
}

.code-top {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--night-line);
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--night-soft);
}

.code-top b {
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--cornflower);
  color: var(--ink);
}

.code pre {
  margin: 0;
  padding: 18px 16px 20px;
  overflow-x: auto;
  font-size: 0.84rem;
  line-height: 1.65;
}

.code .h { color: var(--night-soft); }
.code .k { color: var(--sky); }
.code .s { color: #f0b9b9; }
.code .n { color: #b9d4cf; }

.contract {
  border-top: 1px solid var(--rule-strong);
}

.contract li {
  display: grid;
  grid-template-columns: 9.5rem minmax(0, 1fr);
  gap: 16px;
  padding: 13px 0;
  border-bottom: 1px solid var(--rule);
  font-size: 0.93rem;
}

.contract code {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--cornflower-ink);
}

.contract span {
  color: var(--ink-soft);
}

/* ---------- Roadmap ---------- */

.route {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
}

.route::before {
  content: "";
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  height: 6px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--rose) 0 37%, var(--rule) 37% 100%);
}

.route li {
  position: relative;
  padding-top: 48px;
}

.route li::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 0;
  width: 24px;
  height: 24px;
  border: 4px solid var(--rule-strong);
  border-radius: 50%;
  background: var(--paper);
}

.route li.is-done::before {
  border-color: var(--ink);
  background: var(--ink);
}

.route li.is-here::before {
  border-color: var(--rose-ink);
  box-shadow: 0 0 0 6px var(--rose-tint);
}

.route h3 {
  font-size: 1.15rem;
}

.route p {
  margin-top: 8px;
  font-size: 0.95rem;
  color: var(--ink-soft);
}

.route .tag,
.here {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 500;
}

.route .tag {
  margin-top: 10px;
  background: var(--ground);
  color: var(--ink-soft);
  font-family: var(--mono);
}

.here {
  margin-bottom: 8px;
  background: var(--rose-tint);
  color: var(--rose-ink);
}

.later {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  margin-top: clamp(40px, 5vw, 56px);
  padding-top: 20px;
  border-top: 1px dashed var(--rule-strong);
  font-size: 0.92rem;
  color: var(--ink-soft);
}

.later strong {
  color: var(--ink);
  margin-right: 4px;
}

.later span {
  padding: 5px 12px;
  border: 1px dashed var(--rule-strong);
  border-radius: 999px;
  background: var(--paper);
}

/* ---------- Pilot ---------- */

.pilot {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: start;
}

.pilot-intro h2 {
  max-width: 14ch;
}

.pilot-intro > p {
  margin-top: 20px;
  color: var(--ink-soft);
}

.pilot-intro h3 {
  margin-top: 36px;
  font-size: 1.05rem;
}

.measures {
  margin-top: 14px;
}

.measures li {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--rule);
  font-size: 0.95rem;
}

.measures li::before {
  content: "";
  flex: none;
  width: 10px;
  height: 10px;
  margin-top: 0.45em;
  border: 2.5px solid var(--ink);
  border-radius: 50%;
}

.pilot-note {
  margin-top: 12px;
  font-size: 0.88rem;
  color: var(--ink-faint);
}

.form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 16px;
  padding: clamp(20px, 3vw, 36px);
  border: 1px solid var(--rule);
  border-radius: 24px;
  background: var(--paper);
  box-shadow: 0 30px 60px -44px rgb(29 39 49 / 0.45);
}

.field {
  display: grid;
  align-content: start;
  gap: 6px;
}

.field--full {
  grid-column: 1 / -1;
}

.field label,
.field legend {
  font-size: 0.9rem;
  font-weight: 500;
}

.field .optional {
  font-weight: 400;
  color: var(--ink-faint);
}

.field input,
.field textarea {
  width: 100%;
  min-height: 48px;
  padding: 11px 14px;
  border: 1.5px solid var(--rule-strong);
  border-radius: 12px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.field textarea {
  min-height: 120px;
  resize: vertical;
}

.field input::placeholder,
.field textarea::placeholder {
  color: #6f7c88;
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--cornflower-ink);
  box-shadow: 0 0 0 4px var(--cornflower-tint);
}

.field [aria-invalid="true"] {
  border-color: var(--alert);
}

.field-label-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

.counter {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--ink-faint);
}

.counter.is-near {
  color: var(--alert);
}

.field-error {
  font-size: 0.85rem;
  color: var(--alert);
}

.field-error:empty {
  display: none;
}

fieldset.field {
  margin: 0;
  padding: 0;
  border: 0;
}

.choices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 6px;
}

.choice {
  position: relative;
}

.choice input {
  position: absolute;
  opacity: 0;
  inset: 0;
  margin: 0;
  cursor: pointer;
}

.choice span {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 10px 14px;
  border: 1.5px solid var(--rule-strong);
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 500;
  transition: border-color 0.2s, background-color 0.2s;
}

.choice span::before {
  content: "";
  flex: none;
  width: 16px;
  height: 16px;
  border: 2.5px solid var(--ink);
  border-radius: 50%;
  background: var(--paper);
  transition: background-color 0.2s, box-shadow 0.2s;
}

.choice input:checked + span {
  border-color: var(--cornflower-ink);
  background: var(--cornflower-tint);
}

.choice input:checked + span::before {
  background: var(--ink);
  box-shadow: inset 0 0 0 3px var(--paper);
}

.choice input:focus-visible + span {
  outline: 3px solid var(--cornflower);
  outline-offset: 2px;
}

.trap {
  position: absolute;
  left: -9999px;
}

.form-foot {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
}

.form-foot small {
  flex: 1 1 240px;
  color: var(--ink-faint);
  font-size: 0.82rem;
}

.form-status {
  grid-column: 1 / -1;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 0.95rem;
}

.form-status:empty {
  display: none;
}

.form-status[data-kind="success"] {
  background: var(--sage-tint);
  color: var(--sage-ink);
}

.form-status[data-kind="error"] {
  background: var(--alert-tint);
  color: var(--alert);
}

/* Shared form service pieces: server errors, KVKK box, Turnstile */

.form-errors {
  grid-column: 1 / -1;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--alert-tint);
  color: var(--alert);
  font-size: 0.95rem;
}

.form-errors:focus {
  outline: 3px solid var(--alert);
  outline-offset: 2px;
}

.form-errors p {
  margin: 0;
  font-weight: 500;
}

.form-errors ul {
  margin: 8px 0 0;
  padding-left: 20px;
}

.form-errors a {
  color: inherit;
  text-underline-offset: 3px;
}

.form .privacy-acknowledgment {
  color: var(--ink);
}

.form .privacy-acknowledgment input[type="checkbox"] {
  margin-top: 10px;
  accent-color: var(--ink);
}

.form .privacy-acknowledgment .privacy-acknowledgment-row label {
  font-size: 0.9rem;
  line-height: 1.6;
}

.form .privacy-acknowledgment a {
  color: var(--cornflower-ink);
}

.form .privacy-acknowledgment .privacy-required {
  color: var(--ink-faint);
}

.form .privacy-acknowledgment .privacy-field-error {
  margin: 2px 0 0 32px;
  color: var(--alert);
  font-size: 0.85rem;
}

.form .privacy-acknowledgment .privacy-field-error:empty {
  display: none;
}

.form .privacy-acknowledgment :focus-visible,
.form [data-turnstile] :focus-visible {
  outline: 3px solid var(--cornflower);
  outline-offset: 2px;
}

.form [data-turnstile] > p {
  font-size: 0.9rem;
}

.form [data-turnstile] > p:first-child {
  font-weight: 500;
}

.form [data-turnstile] .turnstile-retry {
  border-radius: 12px;
}

.form-foot .button[aria-disabled="true"] {
  opacity: 0.7;
  cursor: progress;
}

/* ---------- Thank-you page ---------- */

.thanks {
  min-height: calc(100vh - 220px);
  display: flex;
  align-items: center;
}

.thanks-body {
  display: grid;
  justify-items: start;
  gap: 20px;
}

.thanks-body h1 {
  max-width: 16ch;
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  letter-spacing: -0.03em;
}

.thanks-body p {
  max-width: 56ch;
  margin: 0;
  color: var(--ink-soft);
  font-size: 1.1rem;
}

.thanks-body .eyebrow {
  color: var(--cornflower-ink);
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.site-footer .wrap > .footer-base:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

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

.site-footer {
  padding-block: 56px 40px;
  border-top: 1px solid var(--rule);
  background: var(--paper);
  font-size: 0.92rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 32px;
  align-items: start;
}

.footer-grid p {
  margin-top: 12px;
  max-width: 40ch;
  color: var(--ink-soft);
}

.footer-lines {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 24px;
}

.footer-lines a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
}

.footer-lines a:hover {
  color: var(--cornflower-ink);
}

.footer-base {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--rule);
  color: var(--ink-faint);
  font-size: 0.85rem;
}

.footer-base > span a {
  color: inherit;
  text-underline-offset: 3px;
}

.footer-base > span a:hover {
  color: var(--ink);
}

.footer-legal {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 20px;
}

.footer-legal a,
.footer-legal button.cookie-settings {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0;
  color: inherit;
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.footer-legal a:hover,
.footer-legal button.cookie-settings:hover {
  color: var(--ink);
}

/* ---------- Responsive ---------- */

@media (max-width: 1080px) {
  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 12px var(--gutter) 20px;
    background: var(--ground);
    border-bottom: 1px solid var(--rule);
    box-shadow: 0 16px 24px -20px rgb(29 39 49 / 0.35);
  }

  .site-nav.is-open {
    display: flex;
  }

  .site-nav a:not(.button) {
    padding: 12px 8px;
    border-radius: 10px;
    font-size: 1.05rem;
  }

  .site-nav .nav-cta {
    display: inline-flex;
    margin-top: 10px;
  }

  .menu-toggle {
    display: inline-flex;
  }

  .header-actions {
    margin-left: auto;
  }

  .arch-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .walk-body {
    grid-template-columns: minmax(0, 1fr);
  }

  .walk-chapter {
    padding: 18px;
  }
}

@media (max-width: 900px) {
  .hero .wrap,
  .section-head,
  .brands,
  .trust,
  .dev,
  .pilot,
  .footer-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .cases {
    grid-template-columns: minmax(0, 1fr);
  }

  .route {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }

  .route::before {
    top: 12px;
    bottom: 12px;
    left: 9px;
    right: auto;
    width: 6px;
    height: auto;
    background: linear-gradient(180deg, var(--rose) 0 37%, var(--rule) 37% 100%);
  }

  .route li {
    padding: 0 0 28px 44px;
  }

  .route li:last-child {
    padding-bottom: 0;
  }

  .route li::before {
    top: 0;
  }

  .arch .scroll-x svg {
    min-width: 760px;
  }
}

@media (max-width: 720px) {
  .stage {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas:
      "agents agents"
      "core jobs"
      "store store"
      "other other";
    gap: 30px 14px;
    min-height: 0;
    padding: 16px 14px;
  }

  .stage-agents {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

  .stage-jobs {
    align-self: center;
  }

  .walk-tabs {
    gap: 8px;
  }

  .walk-tab .t {
    font-size: 0.85rem;
  }

  .split {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 600px) {
  body {
    font-size: 1rem;
  }

  .header-cta {
    display: none;
  }

  .hero-lead {
    font-size: 1.08rem;
  }

  .story {
    padding: 14px 14px 12px;
  }

  .form,
  .choices,
  .arch-facts,
  .footer-lines {
    grid-template-columns: minmax(0, 1fr);
  }

  .timetable-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
  }

  .timetable-row dd {
    height: 48px;
    margin-right: 0;
  }

  .bar-value {
    top: 24px;
    left: 0;
  }

  .contract li {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
  }

  .dev-title {
    grid-template-columns: minmax(0, 1fr);
  }

  .dev-toggle {
    grid-column: 1;
    grid-row: auto;
    justify-self: start;
  }

  .walk {
    border-radius: 22px;
    padding: 14px;
    margin-inline: calc(var(--gutter) * -0.5);
  }

  .walk-tab .n {
    display: none;
  }

  .walk-log {
    font-size: 0.74rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
  }
}

/* Without JS the walkthrough is a plain stack of chapters */
.walk:not(.is-ready) .walk-tabs,
.walk:not(.is-ready) .walk-pick-title,
.walk:not(.is-ready) .walk-next {
  display: none;
}

.walk-case small {
  font-size: 0.8em;
  color: var(--night-soft);
}

.story-step[data-line="2"] > .stop {
  border-color: var(--rose-ink);
}

.story-step:last-child > .stop {
  border-color: var(--cornflower-ink);
}
