:root {
  --bg: #0C0C0E;
  --card: hsl(240 4% 7%);
  --card-grad: linear-gradient(135deg, hsl(240 4% 8%), hsl(240 4% 6%));
  --border: hsl(240 5% 14%);
  --border-strong: hsl(240 5% 22%);
  --text: hsl(240 5% 96%);
  --muted: hsl(240 5% 65%);
  --primary: #2F5BFF;
  --glow: hsl(226 100% 68%);
  --light: #9DB2FF;
  --warm: #FF8B70;
  --ok: #5BD6A0;
  --btn-grad: linear-gradient(135deg, rgb(94,130,255), rgb(47,91,255), rgb(27,62,217));
  --radius: .875rem;
  --head: 'Space Grotesk', system-ui, sans-serif;
  --body: 'Plus Jakarta Sans', system-ui, sans-serif;
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 84px; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--body); font-size: 16px; line-height: 1.6;
  overflow-x: hidden;
}
img, iframe { max-width: 100%; }
a { color: var(--light); text-underline-offset: 3px; }
a:hover { color: #fff; }
:focus-visible { outline: 2px solid var(--glow); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3, h4 { font-family: var(--head); font-weight: 700; line-height: 1.15; letter-spacing: -0.01em; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 6vw, 3.2rem); }
h2 { font-size: clamp(1.4rem, 3.6vw, 1.9rem); }
h3 { font-size: 1.15rem; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--primary); color: #fff; padding: 8px 14px; border-radius: 999px; z-index: 100; }
.skip:focus { left: 16px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.eyebrow {
  font-family: var(--head); font-size: .75rem; font-weight: 700; letter-spacing: .16em;
  text-transform: uppercase; color: var(--light); margin: 0 0 .6rem;
}
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.wrap-read { max-width: 800px; margin: 0 auto; padding: 0 16px 48px; }
@media (min-width: 768px) { .wrap, .wrap-read { padding-left: 32px; padding-right: 32px; } }

/* Top bar */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(12,12,14,.82); backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner { max-width: 1240px; margin: 0 auto; padding: 0 16px; height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); min-width: 0; }
.brand-mark { width: 30px; height: 30px; border-radius: 9px; background: var(--btn-grad); box-shadow: 0 0 22px hsl(226 100% 59% / .45); flex: none; position: relative; }
.brand-mark::after { content: ""; position: absolute; inset: 8px; border: 2px solid rgba(255,255,255,.9); border-radius: 50%; border-right-color: transparent; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-family: var(--head); font-weight: 700; font-size: 1rem; white-space: nowrap; }
.brand-sub { font-family: var(--head); font-size: .68rem; letter-spacing: .18em; text-transform: uppercase; color: var(--light); }
.menu-btn { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--border); background: var(--card); color: var(--text); cursor: pointer; }
.bars, .bars::before, .bars::after { display: block; width: 18px; height: 2px; background: currentColor; border-radius: 2px; position: relative; transition: transform .2s; }
.bars::before, .bars::after { content: ""; position: absolute; left: 0; }
.bars::before { top: -6px; } .bars::after { top: 6px; }
.menu-btn[aria-expanded="true"] .bars { background: transparent; }
.menu-btn[aria-expanded="true"] .bars::before { transform: translateY(6px) rotate(45deg); }
.menu-btn[aria-expanded="true"] .bars::after { transform: translateY(-6px) rotate(-45deg); }
.nav { display: none; }
.nav.open {
  display: flex; flex-direction: column; position: absolute; top: 64px; left: 0; right: 0;
  background: rgba(12,12,14,.97); border-bottom: 1px solid var(--border); padding: 8px 16px 16px;
}
.nav a { color: var(--muted); text-decoration: none; font-weight: 600; font-size: .95rem; padding: 12px 10px; border-radius: 10px; }
.nav a:hover { color: var(--text); background: hsl(240 4% 10%); }
.nav a[aria-current="page"] { color: var(--text); background: hsl(226 100% 59% / .14); }
@media (min-width: 1080px) {
  .menu-btn { display: none; }
  .nav, .nav.open { display: flex; flex-direction: row; position: static; background: none; border: 0; padding: 0; gap: 2px; }
  .nav a { padding: 8px 12px; font-size: .9rem; }
}

/* Hero / page head */
.hero, .page-head { position: relative; }
.hero { text-align: center; padding: 72px 16px 48px; background: radial-gradient(ellipse 80% 60% at 50% -10%, hsl(226 100% 59% / .22) 0%, transparent 60%); }
.hero h1 { max-width: 16ch; margin: 0 auto .4em; }
.hero .lede { margin: 0 auto; }
.page-head { padding-top: 56px; padding-bottom: 24px; }
.page-head::before { content: ""; position: absolute; inset: -60px 0 auto; height: 360px; z-index: -1; background: radial-gradient(ellipse 80% 60% at 50% -10%, hsl(226 100% 59% / .22) 0%, transparent 60%); pointer-events: none; }
.lede { color: var(--muted); font-size: 1.1rem; max-width: 62ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.hero .hero-actions { justify-content: center; }
.note-banner { display: inline-block; padding: 10px 14px; border: 1px solid hsl(226 100% 59% / .35); background: hsl(226 100% 59% / .08); border-radius: 12px; color: var(--text); font-size: .95rem; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px;
  padding: 10px 22px; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--btn-grad); color: #fff; font-family: var(--body); font-weight: 700; font-size: .95rem; text-decoration: none;
  box-shadow: 0 8px 28px hsl(226 100% 59% / .32), inset 0 1px 0 rgba(255,255,255,.22);
  transition: transform .15s, box-shadow .15s;
}
.btn:hover { color: #fff; transform: translateY(-1px); box-shadow: 0 12px 34px hsl(226 100% 59% / .42), inset 0 1px 0 rgba(255,255,255,.22); }
.btn-ghost { background: transparent; border: 1px solid var(--border-strong); box-shadow: none; color: var(--text); }
.btn-ghost:hover { background: hsl(240 4% 10%); box-shadow: none; }
.btn-small { min-height: 36px; padding: 6px 16px; font-size: .85rem; }

/* Cards */
.card { background: var(--card-grad); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.grid-3 { display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 18px; }
@media (min-width: 720px) { .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }
.card h3 { margin-bottom: .4em; }
.card p:last-child { margin-bottom: 0; }
.card-link { position: relative; display: block; text-decoration: none; color: var(--text); transition: border-color .15s, transform .15s; }
.card-link:hover { color: var(--text); border-color: hsl(226 100% 59% / .55); transform: translateY(-2px); }
.card-link .arrow { position: absolute; top: 18px; right: 20px; color: var(--light); font-size: 1.1rem; }
.section-title { margin: 44px 0 16px; }

/* Progress */
.progress-card { margin: 4px 0 18px; }
.progress-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.big { font-family: var(--head); font-weight: 700; font-size: 2rem; margin: 0; line-height: 1; }
.bar { height: 10px; border-radius: 999px; background: hsl(240 5% 12%); overflow: hidden; }
.bar span { display: block; height: 100%; border-radius: inherit; background: var(--btn-grad); box-shadow: 0 0 14px hsl(226 100% 68% / .6); transition: width .4s ease; }
.week-mini { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 16px; }
@media (min-width: 720px) { .week-mini { grid-template-columns: repeat(4, 1fr); } }
.week-mini div { font-size: .85rem; color: var(--muted); }
.week-mini strong { color: var(--text); font-family: var(--head); }
.week-mini .bar { height: 6px; margin-top: 6px; }

/* Timeline */
.timeline { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.timeline li { display: flex; gap: 14px; align-items: baseline; background: var(--card-grad); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 18px; }
.timeline .date { flex: none; min-width: 68px; font-family: var(--head); font-weight: 700; color: var(--warm); }

/* Tasks */
.toolbar { display: flex; flex-wrap: wrap; gap: 16px 28px; align-items: flex-end; margin-bottom: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-label { font-size: .75rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
select, input, textarea {
  font: inherit; color: var(--text); background: hsl(240 4% 9%); border: 1px solid var(--border-strong);
  border-radius: 10px; padding: 10px 12px; min-height: 44px; max-width: 100%;
}
select { padding-right: 32px; }
input::placeholder { color: hsl(240 5% 45%); }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button { font: inherit; font-size: .88rem; font-weight: 600; color: var(--muted); background: transparent; border: 1px solid var(--border-strong); border-radius: 999px; padding: 8px 14px; min-height: 40px; cursor: pointer; }
.seg button[aria-pressed="true"] { color: #fff; background: var(--btn-grad); border-color: transparent; }
.week { margin-top: 26px; }
.week-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.week-head h2 { margin: 0; font-size: 1.35rem; }
.week-head .count { color: var(--muted); font-size: .9rem; }
.week .bar { margin-bottom: 14px; height: 6px; }
.owner-group { margin-bottom: 14px; }
.owner-label { font-size: .75rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--warm); margin: 14px 0 8px; }
.task { display: flex; gap: 14px; align-items: flex-start; background: var(--card-grad); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 8px; transition: border-color .15s, opacity .15s; }
.task.done { border-color: hsl(152 55% 40% / .45); }
.task.done .task-text { color: var(--muted); text-decoration: line-through; text-decoration-color: hsl(240 5% 40%); }
.tick { flex: none; width: 28px; height: 28px; border-radius: 8px; border: 2px solid var(--border-strong); background: transparent; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; margin-top: 1px; padding: 0; }
.tick:hover { border-color: var(--glow); }
.tick svg { width: 16px; height: 16px; opacity: 0; }
.task.done .tick { background: var(--btn-grad); border-color: transparent; }
.task.done .tick svg { opacity: 1; }
.tick[disabled] { opacity: .5; cursor: progress; }
.task-body { flex: 1; min-width: 0; }
.task-text { margin: 0; overflow-wrap: anywhere; }
.task-meta { margin: 6px 0 0; font-size: .82rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 12px; }
.task-meta .who { color: var(--ok); }
.tag { font-size: .7rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--light); border: 1px solid hsl(226 100% 68% / .35); border-radius: 999px; padding: 1px 8px; }
.task-note { margin: 8px 0 0; font-size: .9rem; color: var(--text); background: hsl(240 4% 10%); border-left: 3px solid var(--warm); padding: 6px 10px; border-radius: 0 8px 8px 0; overflow-wrap: anywhere; }
.link-btn { font: inherit; font-size: .82rem; color: var(--light); background: none; border: 0; padding: 4px 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.note-form { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.note-form input { flex: 1 1 200px; min-height: 40px; }
.note-form .btn { min-height: 40px; padding: 6px 16px; font-size: .85rem; }
.add-task { margin-top: 26px; }
.add-task summary { cursor: pointer; font-family: var(--head); font-weight: 700; font-size: 1.05rem; }
.add-form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; align-items: end; }
.add-form .field-wide { grid-column: 1 / -1; }
.add-form .btn { grid-column: 1 / -1; justify-self: start; }
@media (min-width: 800px) { .add-form { grid-template-columns: 140px 170px 1fr auto; } .add-form .field-wide { grid-column: auto; } .add-form .btn { grid-column: auto; } }
.status { color: var(--muted); }
.status:empty { display: none; }
.locked { text-align: center; padding: 28px 16px; }
.locked p { color: var(--muted); }

/* Activity */
.activity { list-style: none; margin: 0; padding: 0; }
.activity li { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: .92rem; }
.activity li:last-child { border-bottom: 0; }
.activity .when { flex: none; width: 112px; color: var(--muted); font-size: .82rem; }
.activity .what { min-width: 0; overflow-wrap: anywhere; }
.activity .act { font-weight: 700; }
.activity .act-done { color: var(--ok); }
.activity .act-undone { color: var(--warm); }
.empty { color: var(--muted); margin: 0; }

/* Long-form reading */
.read-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; padding-bottom: 48px; }
.read-layout .prose { max-width: 72ch; }
@media (min-width: 1080px) {
  .read-layout { grid-template-columns: 250px minmax(0, 1fr); }
  .toc { position: sticky; top: 84px; align-self: start; max-height: calc(100vh - 100px); overflow: auto; }
}
.toc { padding: 16px; }
.toc p { margin: 0 0 8px; }
.toc ol { list-style: none; margin: 0; padding: 0; }
.toc li a { display: block; padding: 5px 8px; border-radius: 8px; color: var(--muted); text-decoration: none; font-size: .88rem; line-height: 1.35; }
.toc li a:hover { color: var(--text); background: hsl(240 4% 10%); }
.toc li.sub a { padding-left: 20px; font-size: .82rem; }
@media (max-width: 1079px) { .toc details summary { cursor: pointer; font-weight: 700; } }

.prose { font-size: 1.02rem; line-height: 1.72; max-width: 72ch; overflow-wrap: break-word; }
.prose h2 { margin-top: 2em; padding-top: .4em; border-top: 1px solid var(--border); }
.prose > h2:first-child { margin-top: 0; border-top: 0; }
.prose h3 { margin-top: 1.6em; color: var(--text); }
.prose h4 { margin-top: 1.4em; }
.prose p, .prose ul, .prose ol { margin: 0 0 1em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin-bottom: .35em; }
.prose li > ul, .prose li > ol { margin-top: .35em; }
.prose strong { color: #fff; }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 2.2em 0; }
.prose code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .86em; background: hsl(240 4% 11%); border: 1px solid var(--border); border-radius: 6px; padding: .1em .4em; overflow-wrap: anywhere; }
.prose pre { position: relative; background: hsl(240 4% 6%); border: 1px solid var(--border); border-radius: 12px; padding: 16px; overflow-x: auto; }
.prose pre code { background: none; border: 0; padding: 0; overflow-wrap: normal; }
.table-scroll, .prose .table-wrap { overflow-x: auto; margin: 0 0 1.4em; border: 1px solid var(--border); border-radius: 12px; }
.prose table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.prose th { text-align: left; font-family: var(--head); font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--light); background: hsl(240 4% 9%); }
.prose th, .prose td { padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
.prose tr:last-child td { border-bottom: 0; }
.prose ul.task-list, .prose ul:has(> li > input[type=checkbox]) { list-style: none; padding-left: 0; }
.prose li:has(> input[type=checkbox]) { position: relative; padding-left: 32px; }
.prose li > input[type=checkbox] {
  position: absolute; left: 0; top: .25em; appearance: none; -webkit-appearance: none; width: 20px; height: 20px; margin: 0;
  border: 2px solid var(--border-strong); border-radius: 6px; background: transparent; min-height: 0; padding: 0;
}
.prose blockquote { margin: 0 0 1.2em; padding: 0; }

/* Copyable templates */
.template, .prose blockquote.copyable {
  position: relative; background: hsl(240 4% 8%); border: 1px solid var(--border); border-left: 3px solid var(--primary);
  border-radius: 12px; padding: 44px 16px 14px; margin: 0 0 1.2em; color: var(--text);
}
.template > :last-child, .prose blockquote.copyable > :last-child { margin-bottom: 0; }
.template-subject { padding-top: 12px; padding-right: 92px; }
.tpl-label { font-size: .72rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 1.2em 0 .4em !important; }
.copy-btn {
  position: absolute; top: 8px; right: 8px; font: inherit; font-size: .78rem; font-weight: 700; letter-spacing: .04em;
  color: var(--text); background: hsl(240 4% 12%); border: 1px solid var(--border-strong); border-radius: 999px;
  padding: 5px 12px; min-height: 30px; cursor: pointer;
}
.copy-btn:hover { border-color: var(--glow); }
.copy-btn.copied { color: #fff; background: var(--btn-grad); border-color: transparent; }

/* Lead magnet frame */
.frame-wrap { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--bg); box-shadow: 0 30px 80px rgba(0,0,0,.45); margin-bottom: 12px; }
.frame-wrap iframe { display: block; width: 100%; height: 80vh; min-height: 560px; border: 0; }

/* Dialog + toast */
dialog { border: 1px solid var(--border); border-radius: var(--radius); background: var(--card-grad); background-color: var(--card); color: var(--text); padding: 24px; width: min(440px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(0,0,0,.65); backdrop-filter: blur(4px); }
.pass-form { display: grid; gap: 12px; }
.pass-form h2 { margin: 0; font-size: 1.4rem; }
.pass-form p { margin: 0; }
.error { color: var(--warm); min-height: 1.2em; font-size: .9rem; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translate(-50%, 20px); background: hsl(240 4% 12%); border: 1px solid var(--border-strong); color: var(--text); padding: 10px 16px; border-radius: 999px; font-size: .9rem; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.footer { border-top: 1px solid var(--border); margin-top: 48px; padding: 24px 0 40px; color: var(--muted); font-size: .85rem; }
.view { animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
