/* ---------- Tokens ---------- */
@property --p { syntax: "<number>"; inherits: false; initial-value: 0; }

/* Brand: sky #38bdf8, white #f6f8f7, lavender #c4a7ff, mint #2be3a6 on near-black #070b10 */
:root {
  --font: "Avenir Next", "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --sky: #38bdf8; --lav: #c4a7ff; --mint: #2be3a6;
  --bg: #070b10;
  --surface: #0f1620;
  --ink: #f6f8f7;
  --muted: #8fa0b3;
  --line: #1c2735;
  --accent: #38bdf8;
  --btn-bg: #2be3a6; --btn-fg: #04201a;

  --f-bg: #2be3a6;  --f-fg: #04201a;
  --h-bg: #c4a7ff;  --h-fg: #1b0b3d;

  --radius: 22px;
  --wrap: 1120px;
}
:root[data-theme="light"] {
  --bg: #f4f7f6; --surface: #ffffff; --ink: #0a1118; --muted: #536274; --line: #dde5e3;
  --accent: #0369a1;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font); font-size: 1.0625rem; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; display: block; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px; z-index: 50; }
.skip:focus { left: 12px; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 clamp(20px, 4vw, 40px); }
.block { padding-block: clamp(56px, 9vw, 112px); }
.block.tight { padding-block: clamp(32px, 5vw, 56px); }

h1, h2, h3 { font-weight: 800; line-height: 1.04; letter-spacing: -0.04em; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(2.8rem, 7.2vw, 5.4rem); }
h2 { font-size: clamp(2rem, 4.4vw, 3.1rem); }
h3 { font-size: 1.3rem; letter-spacing: -0.02em; line-height: 1.2; }
p { margin: 0; }
.lede { font-size: clamp(1.15rem, 2vw, 1.4rem); line-height: 1.5; color: var(--muted); max-width: 34em; }
.muted { color: var(--muted); }
.small { font-size: 0.92rem; }

/* ---------- Header ---------- */
.site-head {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  -webkit-backdrop-filter: saturate(160%) blur(14px); backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.bar { display: flex; align-items: center; gap: 12px; height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -0.03em; font-size: 1.2rem; color: var(--ink); text-decoration: none; margin-right: auto; }
.brand { font-family: var(--mono); font-weight: 800; letter-spacing: -0.04em; font-size: 1.1rem; white-space: nowrap; }
.brand .br { color: var(--sky); }
.brand .w1 { color: var(--ink); }
.brand .w2 { color: var(--lav); }
.brand .w3 { color: var(--mint); }
.brand .cur { display: inline-block; width: 0.55em; height: 1.05em; background: var(--mint); margin-left: 4px; vertical-align: -0.17em; }
.foot-logo { width: min(100%, 260px); height: auto; border-radius: 12px; }
.nav { display: flex; gap: 4px; }
.nav a { color: var(--muted); text-decoration: none; font-weight: 600; font-size: 0.98rem; padding: 8px 14px; border-radius: 999px; }
.nav a:hover { color: var(--ink); background: var(--surface); }
.nav a[aria-current="page"] { color: var(--ink); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.icon-btn { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; font-size: 1.05rem; display: grid; place-items: center; }
.icon-btn:hover { border-color: var(--ink); }
.menu-btn { display: none; }
@media (max-width: 780px) {
  .menu-btn { display: grid; }
  .nav { display: none; position: absolute; top: 68px; left: 0; right: 0; flex-direction: column; background: var(--bg); border-bottom: 1px solid var(--line); padding: 12px clamp(20px, 4vw, 40px) 20px; }
  .nav.open { display: flex; }
  .nav a { padding: 14px 12px; font-size: 1.1rem; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 24px; border-radius: 999px; font: inherit; font-weight: 700; font-size: 1rem;
  text-decoration: none; cursor: pointer; border: 2px solid var(--ink);
  background: var(--btn-bg); color: var(--btn-fg); border-color: var(--btn-bg);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 8px 0 -2px color-mix(in srgb, var(--btn-bg) 35%, transparent); }
.btn.alt { background: transparent; color: var(--ink); border-color: var(--ink); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }

/* ---------- Hero ---------- */
.hero { padding-block: clamp(40px, 7vw, 88px) clamp(40px, 6vw, 72px); }
.hero-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: clamp(32px, 6vw, 80px); align-items: center; }
.hero h1 { margin-bottom: 24px; }
.hero-art { position: relative; min-height: 520px; }
.hero-art .phone { position: absolute; width: min(62%, 270px); }
.hero-art .phone.back { right: -2%; top: 0; transform: rotate(8deg); }
.hero-art .phone.front { left: -2%; top: 90px; transform: rotate(-4deg); z-index: 2; }
@media (max-width: 880px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-art { min-height: 480px; max-width: 460px; width: 100%; margin: 0 auto; }
}

/* ---------- Phone mockup ---------- */
.phone {
  aspect-ratio: 9 / 18.4; background: #03060a; border-radius: 46px; padding: 10px;
  box-shadow: 0 40px 70px -30px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.14) inset;
  position: relative;
}
.phone::before { content: ""; position: absolute; top: 20px; left: 50%; width: 78px; height: 22px; background: #03060a; border-radius: 99px; transform: translateX(-50%); z-index: 3; }
.screen { height: 100%; border-radius: 37px; padding: 52px 18px 18px; background: #0f1620; color: #f6f8f7; display: flex; flex-direction: column; gap: 16px; overflow: hidden; font-size: 0.85rem; line-height: 1.35; }
.s-top { display: flex; justify-content: space-between; align-items: baseline; }
.s-top b { font-size: 1.15rem; letter-spacing: -0.02em; }
.s-top span { color: #8fa0b3; font-size: 0.78rem; font-weight: 600; }

.ring {
  --p: 72; --track: #1c2735;
  width: 150px; aspect-ratio: 1; margin: 4px auto; border-radius: 50%;
  background: conic-gradient(var(--mint) calc(var(--p) * 1%), var(--track) 0);
  display: grid; place-items: center;
  animation: fill 1.6s cubic-bezier(.2, .8, .2, 1) 0.25s both;
}
.ring-in { width: 118px; aspect-ratio: 1; border-radius: 50%; background: #0f1620; display: grid; place-content: center; text-align: center; }
.ring-in strong { font-size: 1.5rem; letter-spacing: -0.03em; line-height: 1.1; }
.ring-in small { color: #8fa0b3; font-size: 0.72rem; }
@keyframes fill { from { --p: 0; } }

.bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.bars li { display: grid; gap: 5px; font-weight: 600; font-size: 0.8rem; }
.bars li i { display: block; height: 8px; border-radius: 99px; background: #1c2735; position: relative; overflow: hidden; }
.bars li i::after { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--w); background: var(--c, var(--mint)); border-radius: 99px; }

.level { display: grid; gap: 6px; font-weight: 700; }
.level i { display: block; height: 10px; border-radius: 99px; background: #1c2735; position: relative; overflow: hidden; }
.level i::after { content: ""; position: absolute; inset: 0 auto 0 0; width: 62%; background: var(--lav); border-radius: 99px; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile { border-radius: 18px; padding: 14px 12px; display: grid; gap: 2px; font-weight: 700; background: var(--t, #1c2735); }
.tile span { font-size: 1.6rem; line-height: 1; }
.tile small { font-weight: 600; color: #8fa0b3; font-size: 0.74rem; }

/* ---------- App panels ---------- */
.panel {
  display: grid; grid-template-columns: 1fr minmax(240px, 320px); gap: clamp(28px, 5vw, 72px); align-items: center;
  border-radius: 38px; padding: clamp(28px, 5vw, 68px); background: var(--pbg); color: var(--pfg);
}
.panel + .panel { margin-top: 24px; }
.panel.frugal { --pbg: var(--f-bg); --pfg: var(--f-fg); --pa: var(--f-fg); }
.panel.attic  { --pbg: var(--h-bg); --pfg: var(--h-fg); --pa: var(--h-fg); }
.panel.flip { grid-template-columns: minmax(240px, 320px) 1fr; }
.panel.flip .panel-art { order: -1; }
.panel h2 { margin-bottom: 14px; }
.panel .tagline { font-size: 1.25rem; line-height: 1.4; max-width: 28em; opacity: 0.92; }
.panel > div:not(.panel-art) > ul { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 10px; font-weight: 600; }
.panel > div:not(.panel-art) > ul > li { padding-left: 28px; position: relative; }
.panel > div:not(.panel-art) > ul > li::before { content: ""; position: absolute; left: 0; top: 0.5em; width: 14px; height: 14px; border-radius: 50%; background: var(--pa); }
.panel .btn { background: var(--pfg); border-color: var(--pfg); color: var(--pbg); }
.panel .btn.alt { background: transparent; color: var(--pfg); }
.panel-art { display: grid; justify-items: center; }
.panel-art .phone { width: min(100%, 290px); }
@media (max-width: 820px) {
  .panel, .panel.flip { grid-template-columns: 1fr; }
  .panel.flip .panel-art { order: 0; }
}

/* ---------- Two-column text sections ---------- */
.split { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: clamp(28px, 6vw, 88px); align-items: start; }
@media (max-width: 820px) { .split { grid-template-columns: 1fr; } }
.facts { margin: 0; display: grid; gap: 28px; }
.facts dt { font-weight: 800; font-size: 1.25rem; letter-spacing: -0.02em; }
.facts dd { margin: 4px 0 0; color: var(--muted); max-width: 34em; }

.link-list { list-style: none; padding: 0; margin: 24px 0 0; border-top: 1px solid var(--line); }
.link-list li { border-bottom: 1px solid var(--line); }
.link-list a { display: flex; justify-content: space-between; gap: 16px; padding: 16px 4px; text-decoration: none; color: var(--ink); font-weight: 700; }
.link-list a span { color: var(--muted); font-weight: 500; }
.link-list a:hover { color: var(--accent); }

/* ---------- Page headers & prose ---------- */
.page-head { padding-block: clamp(40px, 7vw, 88px) clamp(16px, 3vw, 32px); }
.page-head h1 { font-size: clamp(2.4rem, 6vw, 4.2rem); margin-bottom: 18px; }
.prose { max-width: 68ch; padding-bottom: clamp(56px, 8vw, 104px); }
.prose h2 { font-size: 1.6rem; letter-spacing: -0.03em; margin: 2.2em 0 0.5em; }
.prose h3 { margin: 1.8em 0 0.4em; }
.prose p, .prose li { color: color-mix(in srgb, var(--ink) 86%, var(--bg)); }
.prose p + p { margin-top: 1em; }
.prose ul { padding-left: 1.2em; }
.prose li + li { margin-top: 0.4em; }
.callout { border-radius: 18px; padding: 18px 22px; background: var(--surface); border: 1px solid var(--line); margin: 1.6em 0; }
.callout b { display: block; margin-bottom: 2px; }
.steps { list-style: none; counter-reset: s; padding: 0; margin: 1.6em 0; display: grid; gap: 22px; }
.steps li { counter-increment: s; padding-left: 62px; position: relative; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: -2px; width: 42px; height: 42px; border-radius: 50%; background: var(--ink); color: var(--bg); font-weight: 800; display: grid; place-items: center; }
.steps li b { display: block; font-size: 1.12rem; letter-spacing: -0.01em; color: var(--ink); }

/* ---------- Help ---------- */
.search { width: 100%; max-width: 560px; padding: 16px 22px; font: inherit; border-radius: 999px; border: 2px solid var(--line); background: var(--surface); color: var(--ink); }
.search:focus { outline: none; border-color: var(--accent); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0 8px; }
.chip { font: inherit; font-weight: 700; font-size: 0.95rem; padding: 8px 18px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--muted); cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.guides { list-style: none; padding: 0; margin: 28px 0 0; border-top: 1px solid var(--line); }
.guides li[hidden] { display: none; }
.guides a { display: grid; grid-template-columns: 1fr auto; gap: 4px 20px; padding: 22px 4px; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.guides a:hover h3 { color: var(--accent); }
.guides p { color: var(--muted); grid-column: 1; }
.tag { align-self: start; grid-row: 1; grid-column: 2; font-size: 0.85rem; font-weight: 700; padding: 3px 12px; border-radius: 99px; background: var(--tg, var(--surface)); color: var(--tf, var(--ink)); }
.tag.frugal { --tg: var(--f-bg); --tf: var(--f-fg); }
.tag.attic { --tg: var(--h-bg); --tf: var(--h-fg); }
.empty { padding: 36px 4px; color: var(--muted); }

details { border-bottom: 1px solid var(--line); }
details:first-of-type { border-top: 1px solid var(--line); }
summary { cursor: pointer; list-style: none; padding: 20px 4px; font-weight: 700; display: flex; justify-content: space-between; gap: 16px; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; font-size: 1.5rem; line-height: 1; transition: transform 0.2s ease; }
details[open] summary::after { transform: rotate(45deg); }
details p { padding: 0 4px 22px; color: var(--muted); max-width: 60ch; }

/* ---------- Roadmap ---------- */
.notice { border-radius: 14px; padding: 12px 18px; background: var(--h-bg); color: var(--h-fg); font-weight: 600; font-size: 0.95rem; margin-bottom: 20px; }
.rows { list-style: none; padding: 0; margin: 24px 0 0; border-top: 1px solid var(--line); }
.row { display: grid; grid-template-columns: 72px 1fr auto; gap: 8px 20px; align-items: center; padding: 20px 4px; border-bottom: 1px solid var(--line); }
.vote { width: 64px; padding: 10px 0 8px; border-radius: 16px; border: 2px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-weight: 800; cursor: pointer; display: grid; justify-items: center; line-height: 1.1; transition: transform 0.12s ease; }
.vote:hover:not(:disabled) { border-color: var(--ink); transform: translateY(-2px); }
.vote[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.vote:disabled { opacity: 0.45; cursor: default; }
.vote .n { font-size: 1.2rem; }
.row h3 { margin-bottom: 2px; }
.row p { color: var(--muted); font-size: 0.98rem; }
.status { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 0.92rem; color: var(--muted); white-space: nowrap; }
.status::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--dot); }
.status.idea { --dot: #8fa0b3; }
.status.planned { --dot: var(--sky); }
.status.in_progress { --dot: var(--lav); }
.status.shipped { --dot: var(--mint); }
@media (max-width: 620px) {
  .row { grid-template-columns: 64px 1fr; }
  .row .status { grid-column: 2; }
}

/* ---------- Footer ---------- */
.site-foot { border-top: 1px solid var(--line); margin-top: clamp(24px, 4vw, 48px); padding-block: 56px 40px; }
.foot-grid { display: grid; grid-template-columns: 1.4fr repeat(2, 1fr); gap: 32px; }
.foot-grid h4 { margin: 0 0 12px; font-size: 1rem; }
.foot-grid ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.foot-grid a { color: var(--muted); text-decoration: none; }
.foot-grid a:hover { color: var(--ink); text-decoration: underline; }
.foot-note { margin-top: 40px; color: var(--muted); font-size: 0.92rem; }
@media (max-width: 720px) { .foot-grid { grid-template-columns: 1fr 1fr; } .foot-grid > :first-child { grid-column: 1 / -1; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .ring { animation: none; }
  * { transition: none !important; }
}

.recent { margin: auto 0 0; padding: 12px 0 0; border-top: 1px solid #1c2735; display: grid; gap: 8px; list-style: none; font-weight: 600; font-size: 0.78rem; }
.recent li { display: flex; justify-content: space-between; }
.recent span { color: #8fa0b3; font-weight: 500; }
.theme-ico { width: 18px; height: 18px; }

/* ---------- Blog ---------- */
.guides .when { grid-column: 2; grid-row: 1; color: var(--muted); font-size: 0.9rem; font-weight: 600; white-space: nowrap; }
.prose blockquote { margin: 1.6em 0; padding: 4px 0 4px 22px; border-left: 4px solid var(--accent); font-size: 1.15rem; }
.prose blockquote p { color: var(--ink); }
.prose code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 0.9em; background: var(--surface); border: 1px solid var(--line); padding: 1px 6px; border-radius: 6px; }
.prose pre { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; overflow-x: auto; }
.prose pre code { background: none; border: 0; padding: 0; }
.prose img { border-radius: 16px; margin: 1.6em 0; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.4em 0 1.4em; }

/* Light-theme wordmark: deeper shades so it stays readable on white */
:root[data-theme="light"] .brand .br { color: #0284c7; }
:root[data-theme="light"] .brand .w2 { color: #7a4cf0; }
:root[data-theme="light"] .brand .w3 { color: #0a9a6e; }
:root[data-theme="light"] .brand .cur { background: #0a9a6e; }

/* ---------- Roadmap sections ---------- */
.app-sec { margin-top: 64px; scroll-margin-top: 90px; }
.app-sec:first-child { margin-top: 0; }
.app-band { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px; border-radius: 26px; padding: 22px 30px; background: var(--pbg); color: var(--pfg); }
.app-band.frugal { --pbg: var(--f-bg); --pfg: var(--f-fg); }
.app-band.attic { --pbg: var(--h-bg); --pfg: var(--h-fg); }
.app-band.other { --pbg: var(--surface); --pfg: var(--ink); }
.app-band h2 { font-size: clamp(1.8rem, 4vw, 2.4rem); margin: 0; }
.app-band p { opacity: 0.85; font-weight: 600; flex: 1 1 220px; }
.app-band a { color: var(--pfg); font-weight: 700; }
a.chip { text-decoration: none; display: inline-block; }
a.chip:hover { color: var(--ink); border-color: var(--ink); }
.app-sec .rows { margin-top: 8px; }

/* Small LLC under the wordmark, right-aligned */
.brand { position: relative; }
.brand .llc { position: absolute; right: 0; top: 100%; margin-top: -3px; font-size: 0.5rem; font-weight: 800; letter-spacing: 0.12em; line-height: 1; color: var(--mint); }
:root[data-theme="light"] .brand .llc { color: #0a9a6e; }
