/* Mind Capsule — light beige canvas, pastel red / blue / green doodles.
   Always light. Full-width reading on capsule pages. Bold illustration scale. */

:root {
  color-scheme: light;

  --bg: #f5efe6;
  --bg-warm: #efe6d8;
  --surface: #fffcf7;
  --surface-raised: #ffffff;
  --ink: #2a2622;
  --ink-muted: #5a534c;
  --ink-faint: #8f857a;

  --red: #e25555;
  --red-deep: #c93d3d;
  --red-soft: #fdeaea;
  --blue: #4a7de8;
  --blue-deep: #3568d4;
  --blue-soft: #e8f0fd;
  --green: #45a866;
  --green-deep: #358a52;
  --green-soft: #e6f5ec;

  --accent: var(--red);
  --accent-deep: var(--red-deep);
  --accent-soft: var(--red-soft);
  --rule: rgba(42, 38, 34, 0.08);
  --measure: 46rem;
  --page: 84rem;
  --radius: 24px;
  --radius-sm: 14px;
  --shadow: 0 16px 48px rgba(42, 38, 34, 0.07);
  --shadow-soft: 0 6px 24px rgba(42, 38, 34, 0.05);
  --font: "Plus Jakarta Sans", "Avenir Next", "Segoe UI", sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

[data-capsule="001"] {
  --accent: var(--red);
  --accent-deep: var(--red-deep);
  --accent-soft: var(--red-soft);
}

[data-capsule="002"] {
  --accent: var(--green);
  --accent-deep: var(--green-deep);
  --accent-soft: var(--green-soft);
}

[data-capsule="003"] {
  --accent: var(--blue);
  --accent-deep: var(--blue-deep);
  --accent-soft: var(--blue-soft);
}

[data-capsule="004"] {
  --accent: var(--blue);
  --accent-deep: var(--blue-deep);
  --accent-soft: var(--blue-soft);
}

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

html {
  font-size: 17px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  color-scheme: light;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle 32rem at 0% 0%, color-mix(in srgb, var(--red-soft) 70%, transparent), transparent 72%),
    radial-gradient(circle 28rem at 100% 4%, color-mix(in srgb, var(--blue-soft) 65%, transparent), transparent 70%),
    radial-gradient(circle 26rem at 88% 96%, color-mix(in srgb, var(--green-soft) 60%, transparent), transparent 68%),
    var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-weight: 400;
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
  text-decoration-color: var(--rule);
  transition: text-decoration-color 0.2s var(--ease), color 0.2s var(--ease);
}

a:hover {
  color: var(--accent-deep);
  text-decoration-color: var(--accent);
}

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  background: var(--ink);
  color: var(--bg);
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-sm);
  z-index: 10;
  font-weight: 600;
}

.skip:focus {
  top: 1rem;
}

.wrap {
  width: min(var(--page), calc(100% - 2.5rem));
  margin-inline: auto;
}

/* ——— Site chrome ——— */

.mast {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0.9rem 1.35rem;
  margin-top: 1.25rem;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(12px);
  border: 1px solid var(--rule);
  border-radius: 999px;
  box-shadow: var(--shadow-soft);
}

.wordmark {
  font-weight: 800;
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink);
}

.wordmark:hover {
  color: var(--accent);
}

.nav {
  display: flex;
  gap: 1.35rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink-muted);
}

.nav a {
  text-decoration: none;
}

.nav a:hover,
.nav a[aria-current="page"] {
  color: var(--ink);
}

/* ——— Doodle frames (shared) ——— */

.toc-doodle,
.module-doodle,
.scene-doodle {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
}

.toc-doodle::before,
.module-doodle::before,
.scene-doodle::before {
  content: "";
  position: absolute;
  inset: 2%;
  border-radius: 50%;
  background: var(--accent-soft);
  z-index: 0;
}

.toc-doodle img,
.module-doodle img,
.scene-doodle img {
  position: relative;
  z-index: 1;
  display: block;
  width: 88%;
  height: 88%;
  object-fit: contain;
}

/* ——— Index ——— */

.hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2rem 3rem;
  align-items: center;
  padding: 4rem 0 3.5rem;
}

.hero-copy {
  min-width: 0;
}

.hero-art {
  width: min(11rem, 26vw);
  flex-shrink: 0;
}

.hero-art img {
  display: block;
  width: 100%;
  height: auto;
}

.kicker {
  display: inline-block;
  margin: 0 0 1.1rem;
  padding: 0.4rem 0.85rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-deep);
  background: var(--accent-soft);
  border-radius: 999px;
}

.hero h1.manifesto {
  margin: 0;
  max-width: 38rem;
  font-size: clamp(2rem, 5.2vw, 3.4rem);
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: -0.03em;
  text-wrap: balance;
  color: var(--ink);
}

.manifesto {
  margin: 1.35rem 0 0;
  max-width: 36rem;
  font-size: 1.1rem;
  font-weight: 400;
  line-height: 1.7;
  color: var(--ink-muted);
}

.toc {
  list-style: none;
  margin: 0;
  padding: 0 0 4rem;
  display: grid;
  gap: 1.15rem;
}

.toc li {
  border: none;
}

.toc a {
  display: grid;
  grid-template-columns: 7rem 1fr;
  grid-template-rows: auto auto auto;
  gap: 0.25rem 1.5rem;
  padding: 1.5rem 1.6rem;
  text-decoration: none;
  align-items: start;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), border-color 0.2s var(--ease);
}

.toc li[data-capsule="001"] { --accent-soft: var(--red-soft); }
.toc li[data-capsule="002"] { --accent-soft: var(--green-soft); }
.toc li[data-capsule="003"] { --accent-soft: var(--blue-soft); }
.toc li[data-capsule="004"] { --accent-soft: var(--blue-soft); }

.toc li[data-capsule="001"] a:hover { border-color: color-mix(in srgb, var(--red) 40%, var(--rule)); }
.toc li[data-capsule="002"] a:hover { border-color: color-mix(in srgb, var(--green) 40%, var(--rule)); }
.toc li[data-capsule="003"] a:hover { border-color: color-mix(in srgb, var(--blue) 40%, var(--rule)); }
.toc li[data-capsule="004"] a:hover { border-color: color-mix(in srgb, var(--blue) 40%, var(--rule)); }

.toc-doodle {
  grid-row: 1 / span 3;
  width: 7rem;
  height: 7rem;
  align-self: center;
}

.toc a:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.toc-num {
  grid-column: 2;
  font-variant-numeric: tabular-nums;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--accent);
}

.toc-title {
  grid-column: 2;
  margin: 0;
  font-weight: 700;
  font-size: clamp(1.3rem, 2.8vw, 1.65rem);
  line-height: 1.22;
  letter-spacing: -0.02em;
  text-wrap: balance;
  transition: color 0.2s var(--ease);
}

.toc a:hover .toc-title {
  color: var(--accent-deep);
}

.toc-dek {
  grid-column: 2;
  margin: 0;
  color: var(--ink-muted);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.65;
}

/* ——— Capsule page ——— */

body[data-capsule] main.wrap {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.capsule-head {
  display: grid;
  grid-template-columns: 1fr minmax(8.5rem, 10rem);
  gap: 1rem 2rem;
  padding: 2.75rem 2.5rem;
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.capsule-head .meta,
.capsule-head .thesis,
.capsule-head .dek {
  grid-column: 1;
}

.module-doodle {
  grid-column: 2;
  grid-row: 1 / span 3;
  align-self: center;
  width: 10rem;
  height: 10rem;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.9rem;
  margin: 0 0 1.2rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.thesis {
  margin: 0;
  font-weight: 800;
  font-size: clamp(2.4rem, 5.5vw, 4.25rem);
  line-height: 1.05;
  letter-spacing: -0.035em;
  text-wrap: balance;
  max-width: 48rem;
}

.dek {
  margin: 1.1rem 0 0;
  max-width: 42rem;
  font-size: 1.15rem;
  font-weight: 500;
  line-height: 1.65;
  color: var(--ink-muted);
}

.essay {
  width: 100%;
  padding: 3rem 2.75rem 3.25rem;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  font-size: 1.1rem;
  font-weight: 400;
  line-height: 1.78;
  color: var(--ink);
}

.essay p {
  margin: 0 0 1.15em;
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
  max-width: none;
}

.essay-block {
  display: grid;
  grid-template-columns: minmax(8rem, 10rem) minmax(0, 1fr);
  gap: 0.75rem 2rem;
  align-items: start;
  margin-bottom: 2.25em;
}

.essay-block p {
  margin: 0;
  font-size: 1.1rem;
  line-height: 1.78;
}

.scene-doodle {
  width: 10rem;
  height: 10rem;
  align-self: start;
}

.essay p:last-child {
  margin-bottom: 0;
}

.essay h2 {
  margin: 2em 0 0.65em;
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: -0.01em;
}

.essay ul {
  margin: 0 0 1.15em;
  padding-left: 1.2em;
}

.essay li {
  margin: 0.35em 0;
}

.essay em {
  font-style: italic;
}

.pull {
  margin: 1.8em 0;
  padding: 1.1rem 1.25rem;
  border-left: 5px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--accent-soft);
  color: var(--ink);
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.55;
  text-wrap: pretty;
}

.pager {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  width: 100%;
  margin-bottom: 2rem;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink-muted);
}

.pager a {
  text-decoration: none;
  max-width: 50%;
}

.pager a:hover {
  color: var(--accent-deep);
}

.pager .dir {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.25rem;
  color: var(--ink-faint);
}

.pager .next {
  text-align: right;
  margin-left: auto;
}

.site-foot {
  padding: 1.2rem 0 2.5rem;
  color: var(--ink-faint);
  font-size: 0.82rem;
  font-weight: 500;
}

.site-foot .wrap {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.95rem 1.2rem;
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}

/* ——— About ——— */

.prose-page {
  padding: 2.5rem 2.75rem 3rem;
  width: 100%;
  max-width: var(--measure);
  margin-top: 1rem;
  margin-bottom: 2rem;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  font-size: 1.05rem;
  line-height: 1.78;
}

.prose-page h1 {
  margin: 0 0 1.2rem;
  font-weight: 800;
  font-size: clamp(2rem, 5.5vw, 3rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.prose-page p {
  margin: 0 0 1.1em;
  font-size: inherit;
  line-height: inherit;
}

.prose-page h2 {
  margin: 2em 0 0.65em;
  font-weight: 700;
  font-size: 1.1rem;
}

.colophon-list {
  list-style: none;
  margin: 2rem 0 0;
  padding: 0;
}

.colophon-list li {
  display: grid;
  grid-template-columns: 7rem 1fr;
  gap: 1rem;
  padding: 0.85rem 0;
  border-top: 1px solid var(--rule);
  font-size: 0.98rem;
}

.colophon-list dt,
.colophon-list .label {
  color: var(--ink-faint);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding-top: 0.15rem;
}

@media (max-width: 900px) {
  .capsule-head {
    grid-template-columns: 1fr;
    padding: 2.25rem 1.75rem;
  }

  .module-doodle {
    grid-column: 1;
    grid-row: auto;
    width: 8.5rem;
    height: 8.5rem;
    justify-self: start;
    margin-top: 0.5rem;
  }

  .essay-block {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .scene-doodle {
    width: 9rem;
    height: 9rem;
  }
}

@media (max-width: 720px) {
  html {
    font-size: 16px;
  }

  .wrap {
    width: min(var(--page), calc(100% - 1.25rem));
  }

  .mast {
    border-radius: var(--radius-sm);
    padding-inline: 1rem;
  }

  .hero {
    grid-template-columns: 1fr;
    padding-top: 2.5rem;
  }

  .hero-art {
    width: 9rem;
    justify-self: start;
  }

  .toc a {
    grid-template-columns: 6rem 1fr;
    gap: 0.25rem 1.1rem;
    padding: 1.25rem 1.2rem;
  }

  .toc-doodle {
    width: 6rem;
    height: 6rem;
  }

  .capsule-head,
  .essay {
    padding: 1.75rem 1.25rem;
  }

  .scene-doodle {
    width: 8rem;
    height: 8rem;
  }

  .module-doodle {
    width: 8rem;
    height: 8rem;
  }

  .colophon-list li {
    grid-template-columns: 1fr;
    gap: 0.2rem;
  }

  .pager {
    flex-direction: column;
  }

  .pager a,
  .pager .next {
    max-width: 100%;
    text-align: left;
    margin-left: 0;
  }
}

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

  * {
    transition: none !important;
  }

  .toc a:hover {
    transform: none;
  }
}

@page {
  margin: 22mm;
}

@media print {
  :root {
    --bg: #fff;
    --surface: #fff;
    --ink: #111;
    --ink-muted: #333;
    --accent: #111;
    --shadow: none;
    --shadow-soft: none;
  }

  body {
    background: #fff;
    font-size: 12pt;
  }

  .mast,
  .pager,
  .nav,
  .skip,
  .hero-art {
    display: none;
  }

  .capsule-head,
  .essay,
  .prose-page,
  .toc a {
    box-shadow: none;
    border: none;
    padding-left: 0;
    padding-right: 0;
  }

  a {
    text-decoration: none;
  }
}
