:root {
  color-scheme: light;
  --bg: #f6f5f2;
  --paper: #ffffff;
  --ink: #1c1c1a;
  --muted: #6e6c66;
  --line: #e6e4de;
  --teal: #1f6f78;
  --shadow: 0 10px 30px rgba(28, 28, 26, 0.06);
  --sans: "Segoe UI", "Avenir Next", ui-sans-serif, system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
}
a { color: inherit; }
img { max-width: 100%; display: block; }
button, input, textarea { font: inherit; color: inherit; }
.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  background: var(--ink);
  color: var(--bg);
  padding: 0.5rem 0.8rem;
}
.skip:focus { top: 0.5rem; z-index: 20; }

.wrap { width: min(1080px, calc(100% - 2rem)); margin: 0 auto; }
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(246, 245, 242, 0.92);
  backdrop-filter: blur(14px);
}
.header-row, .footer-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.header-row { min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 0.55rem; text-decoration: none; font-weight: 650; letter-spacing: -0.04em; font-size: 1.05rem; }
.brand img { width: 40px; height: 40px; border-radius: 12px; object-fit: cover; background: #f3f1ec; }
.nav { display: flex; gap: 1.1rem; align-items: center; }
.nav a { text-decoration: none; color: var(--muted); font-size: 0.92rem; }
.nav a:hover, .nav a:focus-visible { color: var(--ink); }
.search { display: flex; gap: 0.35rem; align-items: center; }
.search input, .field input, .field textarea {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.55rem 0.75rem;
}
.search input { width: min(240px, 34vw); }
.field textarea { width: 100%; min-height: 120px; }
.field { display: grid; gap: 0.35rem; margin-bottom: 0.9rem; }
.button, button.button {
  border: 0;
  background: var(--ink);
  color: #f7f6f3;
  border-radius: 12px;
  padding: 0.7rem 0.95rem;
  font-weight: 650;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.button.secondary { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

.ask { padding: 4.2rem 0 1.2rem; text-align: center; }
.ask h1, .hero h1, h2, h3 { font-weight: 560; letter-spacing: -0.04em; line-height: 1.08; }
.ask h1, .hero h1 { font-size: clamp(2.1rem, 4.4vw, 3.15rem); margin: 0 0 0.8rem; }
h2 { font-size: clamp(1.35rem, 2vw, 1.7rem); margin: 0; }
.kicker { color: var(--teal); font-size: 0.78rem; font-weight: 650; letter-spacing: 0.04em; text-transform: uppercase; margin: 0 0 0.7rem; }
.lede { color: var(--muted); max-width: 40rem; }
.ask .lede, .ask .suggest, .ask .countline { margin-left: auto; margin-right: auto; }
.countline { color: var(--muted); font-size: 0.92rem; }
.ask-box {
  width: min(680px, 100%);
  margin: 0.2rem auto 0;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 0.35rem 0.35rem 0.35rem 1rem;
}
.ask-box input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 0.8rem 0;
  font-size: 1.05rem;
  border-radius: 0;
}
.ask-box input:focus { outline: none; }
.ask-box:focus-within { border-color: #b7d5d8; box-shadow: 0 0 0 4px rgba(31, 111, 120, 0.12), var(--shadow); }
.suggest, .chips { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-top: 0.95rem; align-items: center; }
.chips + .chips { margin-top: 0.45rem; }
.chip-label { font-size: 0.78rem; color: var(--muted); margin-right: 0.15rem; }
.ask .suggest { justify-content: center; }
.suggest a, .chips a {
  text-decoration: none;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: 0.38rem 0.72rem;
  font-size: 0.92rem;
}
.suggest a:hover, .chips a:hover, .chips a[aria-current="page"] {
  color: var(--ink);
  background: var(--paper);
  border-color: #d5d2cb;
}
.chips a[aria-current="page"] { color: #f7f6f3; background: var(--ink); border-color: var(--ink); }

.hero { padding: 2.2rem 0 0.4rem; }
.hero.compact { padding-top: 1.8rem; }
.hero.profile { display: grid; grid-template-columns: auto 1fr; gap: 1.1rem; align-items: center; }
.section { padding: 0.4rem 0 2rem; }
.section-head { display: flex; justify-content: space-between; gap: 1rem; align-items: end; margin-bottom: 0.85rem; }
.section-head a { color: var(--teal); text-decoration: none; }

.discover { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.75rem; }
.cover {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 18px;
  min-height: 220px;
  text-decoration: none;
  color: #f7f4ef;
  background: #1c1c1a;
}
.cover img { width: 100%; height: 220px; object-fit: cover; }
.cover span {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: block;
  padding: 2.4rem 0.9rem 0.85rem;
  background: linear-gradient(transparent, rgba(18, 16, 14, 0.78));
}
.cover strong { display: block; font-size: 1.02rem; color: #fff; }
.cover em { color: rgba(255, 255, 255, 0.82); font-style: normal; font-size: 0.78rem; }
.cover.compact { min-height: 168px; }
.cover.compact img { height: 168px; }
.cover:hover img { transform: scale(1.03); }
.cover img { transition: transform 180ms ease; }
.category-banner { margin: 0 0 1rem; }
.category-banner img { width: 100%; height: min(42vw, 280px); object-fit: cover; border-radius: 18px; display: block; background: #e7e4dc; }
.statline { display: flex; flex-wrap: wrap; gap: 0.45rem; margin: 0.2rem 0 0.8rem; }
.statline span { border: 1px solid var(--line); border-radius: 999px; padding: 0.28rem 0.7rem; background: #f7f6f3; font-size: 0.86rem; }
.button.on { background: var(--teal); color: white; }

.faces { display: flex; gap: 0.85rem; overflow: auto; padding-bottom: 0.35rem; }
.face { width: 96px; flex: 0 0 auto; text-align: center; text-decoration: none; }
.face img { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; margin: 0 auto; background: #e7e4dc; }
.face strong { display: block; margin-top: 0.4rem; font-size: 0.82rem; font-weight: 650; }
.face span { color: var(--muted); font-size: 0.75rem; }

.sources { display: grid; gap: 0.55rem; }
.source {
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  gap: 0.8rem;
  align-items: center;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0.7rem 0.85rem;
  text-decoration: none;
}
.source:hover { border-color: #c5dddf; }
.pos { color: var(--muted); font-variant-numeric: tabular-nums; min-width: 1.4rem; }
.avatar { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; background: #e7e4dc; }
.avatar.xl { width: 96px; height: 96px; }
.source strong { display: block; }
.snip, .muted, .score span { color: var(--muted); }
.snip { display: block; font-size: 0.92rem; }
.score { text-align: right; white-space: nowrap; }
.score span { display: block; font-size: 0.75rem; }
.tags { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.35rem; }
.tags i {
  font-style: normal;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.1rem 0.45rem;
  color: var(--muted);
  font-size: 0.75rem;
}
.topic-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.7rem; }
.topic {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0.9rem 1rem;
  text-decoration: none;
  min-height: 108px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.topic:hover { border-color: #c5dddf; }
.topic em { font-style: normal; color: var(--teal); font-size: 0.78rem; }
.creator-hero { display: grid; grid-template-columns: 1.3fr 0.7fr; gap: 0.8rem; padding-bottom: 1rem; }
.creator-card, .panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1rem 1.1rem;
}
.platform { display: flex; justify-content: space-between; gap: 1rem; padding: 0.75rem 0; border-top: 1px solid var(--line); }
.platform a { color: var(--teal); }
.prose { max-width: 42rem; }
.prose p, .prose li { color: var(--muted); }
.catalog h2, .catalog h3 { margin: 1.1rem 0 0.35rem; }
.catalog ol, .catalog ul { margin: 0.2rem 0 0.8rem; padding-left: 1.2rem; }
.catalog li { margin: 0.12rem 0; }
.catalog code { font-size: 0.92em; }
.pager { display: flex; gap: 0.6rem; margin: 1rem 0 1.4rem; }
.crumbs { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; color: var(--muted); font-size: 0.86rem; margin: 0 0 0.7rem; }
.crumbs a { color: var(--teal); text-decoration: none; }
.desk { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem; }
.desk a, .ways a, .stats a { display: block; background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: 1rem 1.05rem; text-decoration: none; }
.desk strong { display: block; font-size: 2rem; letter-spacing: -0.04em; margin: 0.2rem 0; }
.ways strong { display: block; font-size: 1.35rem; letter-spacing: -0.04em; margin: 0.2rem 0; }
.desk span, .ways span, .stats span { color: var(--muted); font-size: 0.92rem; }
.stats, .ways { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.75rem; }
.ways.two { grid-template-columns: 1fr 1fr; }
.stats a strong { display: block; font-size: clamp(1.6rem, 3vw, 2.2rem); letter-spacing: -0.05em; }
.stats a:hover, .ways a:hover { border-color: #c5dddf; }
.letters { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.letters a { width: 2.4rem; height: 2.4rem; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; background: var(--paper); font-weight: 650; }
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; }
.compare-form { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: end; margin-top: 0.8rem; }
.compare-form label { display: grid; gap: 0.3rem; color: var(--muted); font-size: 0.85rem; }
.compare-form input { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 0.55rem 0.75rem; }
.steps strong { color: var(--ink); }
.scoreboard, .sample, .method-steps article, .left-out article {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
}
.scoreboard { padding: 1.3rem 1.4rem 1.15rem; }
.equation { display: flex; align-items: stretch; gap: 0.7rem; margin: 0.2rem 0 1rem; }
.equation > div { flex: 1; min-width: 0; }
.equation b { display: block; font-size: clamp(2.4rem, 6vw, 4.4rem); letter-spacing: -0.06em; font-weight: 560; line-height: 0.95; }
.equation span, .sample em, .ladder em, .left-out span { color: var(--muted); }
.equation i { align-self: center; font-style: normal; color: var(--teal); font-size: 1.8rem; }
.equation .total b { color: var(--teal); }
.mixbar { display: flex; height: 2.6rem; border-radius: 999px; overflow: hidden; font-size: 0.86rem; font-weight: 650; }
.mixbar span { display: grid; place-items: center; }
.mixbar .fit { width: 62%; background: var(--ink); color: #f7f6f3; }
.mixbar .reach { width: 38%; background: #d7ecee; color: #14555c; }
.method-steps, .left-out { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem; }
.method-steps article, .left-out article { padding: 1.05rem 1.1rem 1.15rem; box-shadow: none; }
.method-steps p:last-child, .left-out span { color: var(--muted); }
.method-steps h2 { margin: 0.15rem 0 0.45rem; }
.sample { display: grid; grid-template-columns: 1fr 1fr 1.15fr; overflow: hidden; }
.sample > div { padding: 1.15rem 1.2rem; border-left: 1px solid var(--line); }
.sample > div:first-child { border-left: 0; }
.sample span { display: block; color: var(--teal); font-size: 0.78rem; font-weight: 650; letter-spacing: 0.04em; text-transform: uppercase; }
.sample strong { display: block; font-size: clamp(2rem, 4vw, 3rem); letter-spacing: -0.05em; font-weight: 560; margin: 0.15rem 0; }
.sample .result { background: #f3fafb; }
.sample .result strong { color: var(--teal); }
.ladder { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.7rem; align-items: end; min-height: 220px; }
.ladder a { display: flex; flex-direction: column; justify-content: end; min-height: 220px; text-decoration: none; }
.ladder span { display: block; border-radius: 16px 16px 8px 8px; background: linear-gradient(180deg, #1f6f78, #163e44); min-height: 28px; }
.ladder a:nth-child(odd) span { background: linear-gradient(180deg, #2a2a27, #1c1c1a); }
.ladder strong { margin-top: 0.55rem; }
.ladder em { font-style: normal; font-size: 0.85rem; }
.left-out strong { display: block; margin-bottom: 0.3rem; }
.stats { margin: 0 0 1rem; }
.stats div { background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: 0.9rem 1rem; }
.stats div strong { display: block; font-size: 1.45rem; letter-spacing: -0.04em; }
.faqs { display: grid; gap: 0.75rem; }
.faqs article { background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: 1rem 1.1rem; }
.faqs h3 { margin: 0 0 0.35rem; font-size: 1.05rem; }
.faqs p { margin: 0; color: var(--muted); }
.table-wrap { overflow-x: auto; }
table.measures { width: 100%; border-collapse: collapse; background: var(--paper); }
table.measures caption { text-align: left; font-weight: 650; padding: 0 0 0.7rem; }
table.measures th, table.measures td { text-align: left; padding: 0.7rem 0.85rem; border-top: 1px solid var(--line); vertical-align: top; }
table.measures thead th { color: var(--muted); font-size: 0.78rem; font-weight: 650; letter-spacing: 0.04em; text-transform: uppercase; }
.site-footer { border-top: 1px solid var(--line); padding: 1.6rem 0 2rem; color: var(--muted); }
.foot { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 1.2rem; }
.foot a { display: block; color: var(--ink); text-decoration: none; margin: 0.25rem 0; }
.foot .brand { margin-bottom: 0.4rem; }
select { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 0.55rem 0.75rem; }
.note { font-size: 0.92rem; color: var(--muted); }
form .hp { position: absolute; left: -9999px; }

.tool-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.7rem; }
.tool-grid .topic { min-height: 132px; }
.tool-grid .snip { margin-top: 0.45rem; }
.calc { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 0.8rem; align-items: start; }
.tool-form { display: grid; grid-template-columns: 1fr 1fr; gap: 0.15rem 0.75rem; }
.tool-form .span-2 { grid-column: 1 / -1; }
.tool-form .field { margin-bottom: 0.35rem; }
.tool-form input, .tool-form select, .tool-form textarea { width: 100%; }
.tool-result h2 { margin-bottom: 0.7rem; }
.tool-result h3 { font-size: 1.02rem; margin: 0.9rem 0 0.25rem; }
.figure { margin: 0.1rem 0 0.85rem; }
.figure strong { display: block; font-size: clamp(1.8rem, 4vw, 2.6rem); letter-spacing: -0.045em; font-weight: 560; line-height: 1.05; }
.figure span, .metric small { color: var(--muted); }
.metric { display: flex; justify-content: space-between; gap: 1rem; border-top: 1px solid var(--line); padding: 0.55rem 0; }
.metric span { color: var(--muted); }
.metric small { display: block; font-size: 0.78rem; }
.metric strong { font-variant-numeric: tabular-nums; text-align: right; }
.band { margin: 0.7rem 0 0; }
.doc { width: 100%; min-height: 320px; font-family: ui-monospace, "Cascadia Code", monospace; font-size: 0.86rem; line-height: 1.45; white-space: pre-wrap; }
.sheet-wrap { overflow-x: auto; margin: 0.4rem 0 0.2rem; }
table.sheet { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
table.sheet th, table.sheet td { text-align: left; padding: 0.45rem 0.35rem; border-bottom: 1px solid var(--line); vertical-align: top; }
table.sheet th { color: var(--muted); font-weight: 650; font-size: 0.78rem; }

.gate {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(28, 28, 26, 0.46);
  display: grid;
  place-items: center;
  padding: 1rem;
}
.gate[hidden] { display: none; }
.gate-card {
  width: min(440px, 100%);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 1.3rem;
  box-shadow: var(--shadow);
}
.gate-card h2 { font-size: 1.7rem; margin: 0.2rem 0 0.6rem; }
.gate-actions { display: flex; gap: 0.6rem; margin-top: 1rem; }

@media (max-width: 900px) {
  .discover, .topic-grid, .tool-grid { grid-template-columns: repeat(2, 1fr); }
  .creator-hero { grid-template-columns: 1fr; }
  .cover, .cover.compact { min-height: 180px; }
  .cover img, .cover.compact img { height: 180px; }
}
@media (max-width: 720px) {
  body.ask .header-search { display: none; }
  .header-row { flex-wrap: wrap; padding: 0.7rem 0; }
  .nav { order: 3; width: 100%; overflow: auto; }
  .search { width: 100%; }
  .search input { width: 100%; }
  .hero.profile { grid-template-columns: 1fr; }
  .desk, .foot, .compare, .calc, .tool-form, .tool-grid, .method-steps, .left-out, .sample, .ways.two { grid-template-columns: 1fr; }
  .tool-form .span-2 { grid-column: auto; }
  .stats, .ways { grid-template-columns: 1fr 1fr; }
  .sample > div { border-left: 0; border-top: 1px solid var(--line); }
  .sample > div:first-child { border-top: 0; }
  .equation { flex-wrap: wrap; }
  .equation i { display: none; }
  .ladder { grid-template-columns: repeat(5, 1fr); gap: 0.35rem; min-height: 160px; }
  .ladder a { min-height: 160px; }
  .ladder em { font-size: 0.72rem; }
  .source { grid-template-columns: auto 1fr; }
  .pos { display: none; }
  .score { grid-column: 2; text-align: left; }
}
