/* root2.in — global stylesheet
   White paper, black ink, one accent. */

:root {
  --ink: #111114;
  --paper: #ffffff;
  --accent: #3437e0;
  --muted: #6b6b73;
  --faint: #9a9aa2;
  --hair: #ececef;
  --hair2: #dcdce0;
  --wash: #f7f7f9;
  --pill: #ececfb;
  --max: 1080px;
  --read: 720px;
  --nav-h: 62px;
  --pad: 28px;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

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

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

a:hover {
  text-decoration: underline;
}

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

/* ---------- layout ---------- */
.wrap {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--pad);
}

.read {
  max-width: var(--read);
  margin: 0 auto;
}

main {
  display: block;
  flex: 1 0 auto;
}

section {
  padding-top: 56px;
}

/* Anthropic-style section divider + symmetric spacing.
   Uses its own class so it beats .wrap's `padding: 0 …` shorthand
   (equal specificity, later in source order wins). */
.section-divide {
  margin-top: 60px;
  padding-top: 60px;
  border-top: 1px solid var(--hair);
}

.eyebrow {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
  margin: 0 0 18px;
}

.serif {
  font-family: "Source Serif 4", Georgia, "Times New Roman", serif;
}

.b {
  color: var(--accent);
}

/* ---------- nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--hair);
}

.nav .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.wordmark {
  font-weight: 600;
  font-size: 19px;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.wordmark:hover {
  text-decoration: none;
}

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

.nav-links {
  display: flex;
  align-items: center;
  gap: 22px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  color: var(--muted);
  font-size: 15px;
  font-weight: 500;
}

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

.nav-toggle {
  display: none;
}

/* ---------- hero (home) ---------- */
.hero {
  padding-top: 44px;
  padding-bottom: 8px;
}

.hero h1 {
  font-size: clamp(40px, 7vw, 76px);
  font-weight: 600;
  line-height: 1.03;
  letter-spacing: -0.035em;
  margin: 0 0 22px;
  max-width: 15ch;
}

.hero .lede {
  font-size: 20px;
  color: var(--muted);
  max-width: 600px;
  margin: 0;
}

/* animated banner */
.banner {
  position: relative;
  margin-top: 28px;
  height: clamp(240px, 44vw, 460px);
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid var(--hair2);
  background: linear-gradient(120deg, #eef0ff 0%, #f7f7f9 45%, #eaf0ff 100%);
  isolation: isolate;
}

.banner .blob {
  position: absolute;
  width: 46%;
  aspect-ratio: 1;
  border-radius: 50%;
  filter: blur(48px);
  opacity: 0.55;
  will-change: transform;
}

.banner .blob.b1 {
  left: 8%;
  top: 12%;
  background: radial-gradient(circle at 50% 50%, #3437e0, transparent 68%);
  animation: drift1 20s ease-in-out infinite alternate;
}

.banner .blob.b2 {
  right: 6%;
  bottom: 6%;
  background: radial-gradient(circle at 50% 50%, #8a8dff, transparent 66%);
  animation: drift2 24s ease-in-out infinite alternate;
}

.banner .blob.b3 {
  left: 40%;
  top: 44%;
  width: 34%;
  background: radial-gradient(circle at 50% 50%, #c9d0ff, transparent 70%);
  animation: drift3 28s ease-in-out infinite alternate;
}

.banner .banner-mark {
  position: absolute;
  right: 22px;
  bottom: 18px;
  font-size: 14px;
  font-style: italic;
  color: rgba(52, 55, 224, 0.55);
}

@keyframes drift1 {
  from {
    transform: translate(0, 0) scale(1);
  }
  to {
    transform: translate(18%, 12%) scale(1.15);
  }
}

@keyframes drift2 {
  from {
    transform: translate(0, 0) scale(1.05);
  }
  to {
    transform: translate(-14%, -10%) scale(0.9);
  }
}

@keyframes drift3 {
  from {
    transform: translate(0, 0) scale(1);
  }
  to {
    transform: translate(-10%, 8%) scale(1.2);
  }
}

@media (prefers-reduced-motion: reduce) {
  .banner .blob {
    animation: none;
  }
}

/* ---------- section headings ---------- */
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 26px;
}

.section-head h2 {
  font-size: clamp(24px, 3.2vw, 32px);
  font-weight: 600;
  letter-spacing: -0.03em;
  margin: 0;
}

.section-head .more {
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
}

/* ---------- page intro (sub pages) ---------- */
.page-intro {
  padding-top: 76px;
  padding-bottom: 12px;
}

.page-intro h1 {
  font-size: clamp(34px, 5.4vw, 56px);
  font-weight: 600;
  letter-spacing: -0.035em;
  margin: 0 0 16px;
}

.page-intro p {
  font-size: 19px;
  color: var(--muted);
  max-width: 640px;
  margin: 0;
}

/* ---------- writings list ---------- */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 8px 0 30px;
}

.chip {
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  background: none;
  border: 1px solid var(--hair2);
  border-radius: 999px;
  padding: 8px 16px;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.chip:hover {
  border-color: var(--accent);
  color: var(--ink);
}

.chip[aria-pressed="true"] {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

.deck-links {
  list-style: none;
  margin: 0;
  padding: 0;
}

.deck-links li {
  border-top: 1px solid var(--hair);
}

.deck-links li:last-child {
  border-bottom: 1px solid var(--hair);
}

.deck-links a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 2px;
  color: var(--ink);
}

.deck-links a:hover {
  text-decoration: none;
}

.deck-links a:hover .dl-title {
  color: var(--accent);
}

.dl-topic {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}

.dl-title {
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.015em;
  transition: color 0.15s ease;
}

.dl-summary {
  display: block;
  font-size: 15px;
  color: var(--muted);
  font-weight: 400;
  margin-top: 5px;
}

.dl-meta {
  font-size: 13px;
  color: var(--faint);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.empty {
  color: var(--faint);
  font-style: italic;
  padding: 24px 2px;
}

/* ---------- medium-style deck (article) ---------- */
.article-head {
  padding-top: 60px;
  padding-bottom: 8px;
}

.article-head .subtitle {
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 20px;
  color: var(--muted);
  margin: 0 0 16px;
}

.article-head .tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.tag {
  background: var(--wash);
  border: 1px solid var(--hair);
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  padding: 6px 13px;
  border-radius: 999px;
}

.article-head h1 {
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin: 0 0 14px;
}

.article-head .meta {
  font-size: 14px;
  color: var(--faint);
  margin: 0;
  font-variant-numeric: tabular-nums;
}

.chapter {
  padding: 44px 0;
}

.chapter-visual {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--hair2);
  background: linear-gradient(120deg, #eef0ff 0%, #f7f7f9 50%, #eaf0ff 100%);
  margin-bottom: 28px;
}

.chapter-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.chapter-visual .rootlabel {
  position: absolute;
  top: 14px;
  left: 16px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  background: rgba(255, 255, 255, 0.7);
  padding: 3px 9px;
  border-radius: 999px;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.chapter-statement {
  font-size: clamp(24px, 3.4vw, 34px);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 0 0 16px;
}

.chapter-text p {
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 19px;
  line-height: 1.7;
  color: var(--ink);
  margin: 0 0 18px;
}

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

/* ---------- lab grid ---------- */
.lab-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.lab-card {
  border: 1px solid var(--hair2);
  border-radius: 14px;
  padding: 22px 24px;
  transition: border-color 0.18s ease;
  color: inherit;
  display: block;
}

.lab-card:hover {
  border-color: var(--accent);
  text-decoration: none;
}

.lab-card .status {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 10px;
}

.lab-card h3 {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 6px;
}

.lab-card p {
  font-size: 15px;
  color: var(--muted);
  margin: 0;
}

/* ---------- about ---------- */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
}

.about .lead-line {
  font-family: "Inter", system-ui, sans-serif;
  font-weight: 600;
  font-size: clamp(22px, 3vw, 28px);
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0 0 24px;
}

.col-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
  margin: 0 0 18px;
}

.about p {
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 18px;
  line-height: 1.64;
  color: var(--ink);
  margin: 0 0 22px;
}

.link-list {
  list-style: none;
  margin: 0 0 26px;
  padding: 0;
}

.link-list li {
  border-top: 1px solid var(--hair);
}

.link-list li:last-child {
  border-bottom: 1px solid var(--hair);
}

.link-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 2px;
  color: var(--ink);
  font-weight: 500;
  font-size: 16px;
}

.link-list a:hover {
  color: var(--accent);
  text-decoration: none;
}

.link-list a .arr {
  color: var(--faint);
}

.link-list a:hover .arr {
  color: var(--accent);
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--ink);
  color: #fff;
  font-size: 15px;
  font-weight: 500;
  padding: 12px 20px;
  border-radius: 10px;
  transition: background 0.18s ease;
}

.btn:hover {
  background: var(--accent);
  text-decoration: none;
}

/* ---------- footer ---------- */
.site-foot {
  flex-shrink: 0;
  margin-top: 60px;
  border-top: 1px solid var(--hair);
  padding: 28px 0 40px;
}

.site-foot .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.site-foot a {
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
}

.site-foot a.wordmark {
  color: var(--ink);
}

.site-foot a:hover {
  color: var(--ink);
  text-decoration: none;
}

.site-foot .copyright {
  font-size: 13px;
  color: var(--faint);
}

.site-foot .copyright:hover {
  color: var(--faint);
}

/* ---------- scroll reveal ---------- */
.fade {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade.in {
  opacity: 1;
  transform: none;
}

.rise {
  opacity: 0;
  transform: translateY(24px) scale(0.985);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.rise.in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .fade,
  .rise {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ---------- responsive ---------- */
@media (max-width: 820px) {
  .lab-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .split {
    grid-template-columns: 1fr;
    gap: 40px;
  }
}

@media (max-width: 560px) {
  :root {
    --pad: 20px;
  }

  section {
    padding-top: 64px;
  }

  .deck-links a {
    flex-direction: column;
    gap: 8px;
  }

  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin: -8px -8px -8px 0;
    background: none;
    border: 0;
    color: var(--ink);
    cursor: pointer;
  }

  .nav-links {
    position: absolute;
    top: var(--nav-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--hair);
    padding: 8px 0;
    display: none;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a {
    padding: 12px var(--pad);
    font-size: 17px;
  }
}
