/* CasperEdits: timeline-inspired theme. Palette comes from the logo (deep purple, magenta, indigo). */
:root {
  --bg: #0f0818;
  --surface: #1a0f2b;
  --surface-2: #241538;
  --border: #3a2557;
  --text: #f4eefb;
  --muted: #bcaed3;
  --accent: #ff5cc8;
  --accent-ink: #ffffff;
  --accent-bg: #b81c85;
  --accent-bg-hover: #d12497;
  --indigo: #8b7bff;
  --ok: #5fe0a2;
  --warn: #ffcf70;
  --shadow: 0 8px 28px rgba(0, 0, 0, .35);
  --radius: 14px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #faf7fd;
  --surface: #ffffff;
  --surface-2: #f1eaf9;
  --border: #d9c9ee;
  --text: #22093a;
  --muted: #5d4a78;
  --accent: #a3167a;
  --accent-bg: #a3167a;
  --accent-bg-hover: #86105f;
  --indigo: #4b3bc4;
  --ok: #11724a;
  --warn: #7a4a00;
  --shadow: 0 6px 20px rgba(60, 20, 100, .12);
  color-scheme: light;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #faf7fd; --surface: #ffffff; --surface-2: #f1eaf9; --border: #d9c9ee;
    --text: #22093a; --muted: #5d4a78; --accent: #a3167a; --accent-bg: #a3167a; --accent-bg-hover: #86105f;
    --indigo: #4b3bc4; --ok: #11724a; --warn: #7a4a00; --shadow: 0 6px 20px rgba(60, 20, 100, .12);
    color-scheme: light;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 5rem; }
body { margin: 0; background: var(--bg); color: var(--text); font: 1.0625rem/1.65 var(--font); }
img { max-width: 100%; height: auto; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--indigo); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .6em; letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 5.5vw, 3.2rem); }
h2 { font-size: clamp(1.45rem, 3.6vw, 2rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
kbd { font-family: var(--mono); font-size: .9em; background: var(--surface-2); border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 6px; padding: .05em .45em; white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 0; background: var(--accent-bg); color: var(--accent-ink); padding: .6rem 1rem; z-index: 100; }
.skip-link:focus { left: 8px; top: 8px; }
.wrap { width: min(1160px, 100% - 2rem); margin-inline: auto; }
.muted { color: var(--muted); }
.eyebrow { font-size: .82rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin: 0 0 .6rem; }
.eyebrow a { text-decoration: none; }
.lede { font-size: 1.2rem; color: var(--muted); max-width: 46rem; }
.hint { font-size: .92rem; color: var(--muted); }

/* ---------- header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(10px); }
.header-row { display: flex; align-items: center; gap: 1rem; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--text); }
.brand img { border-radius: 8px; }
.brand-name { font-weight: 800; font-size: 1.3rem; letter-spacing: -.02em; }
.brand-name span { color: var(--accent); }
.site-nav { display: flex; align-items: center; gap: 1rem; margin-left: auto; }
.site-nav ul { display: flex; gap: .25rem; list-style: none; margin: 0; padding: 0; }
.site-nav ul a { display: block; padding: .5rem .8rem; border-radius: 8px; color: var(--text); text-decoration: none; font-weight: 600; font-size: .98rem; }
.site-nav ul a:hover, .site-nav ul a[aria-current="page"] { background: var(--surface-2); color: var(--accent); }
.nav-search { display: flex; gap: .4rem; }
.nav-search input { width: 11rem; }
.nav-toggle { display: none; margin-left: auto; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; width: 46px; height: 46px; cursor: pointer; color: var(--text); }
.nav-bars, .nav-bars::before, .nav-bars::after { display: block; width: 20px; height: 2px; background: currentColor; margin: auto; position: relative; content: ""; }
.nav-bars::before { position: absolute; top: -6px; left: 0; }
.nav-bars::after { position: absolute; top: 6px; left: 0; }
.theme-toggle { background: transparent; border: 1px solid var(--border); border-radius: 8px; color: var(--text); padding: .45rem .8rem; cursor: pointer; font: inherit; font-size: .9rem; }
.theme-toggle:hover { border-color: var(--accent); }

/* ruler: a thin strip of timeline ticks */
.ruler { height: 10px; border-bottom: 1px solid var(--border);
  background: repeating-linear-gradient(90deg, var(--border) 0 1px, transparent 1px 12px),
              repeating-linear-gradient(90deg, var(--muted) 0 1px, transparent 1px 60px);
  background-size: 100% 5px, 100% 10px; background-repeat: repeat-x; background-position: bottom, bottom; opacity: .75; }

/* ---------- forms and buttons ---------- */
input, select, textarea { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: .6rem .8rem; min-height: 44px; width: 100%; }
select { appearance: auto; }
input:focus-visible, select:focus-visible { border-color: var(--indigo); }
label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: .3rem; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: .6rem 1.3rem; border-radius: 10px; border: 2px solid var(--accent-bg); background: var(--accent-bg); color: var(--accent-ink); font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--accent-bg-hover); border-color: var(--accent-bg-hover); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--accent); }
.btn-small { min-height: 40px; padding: .4rem .9rem; font-size: .92rem; }
.field { display: flex; flex-direction: column; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 1rem; }
fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.2rem 1.2rem; margin: 0 0 1rem; background: var(--surface); }
legend { font-weight: 700; padding: 0 .5rem; }

/* ---------- layout blocks ---------- */
.section { padding: 2.2rem 0; }
.page-head { padding: 2.2rem 0 .6rem; }
.crumbs { padding: 1rem 0 0; font-size: .9rem; }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: .3rem; padding: 0; margin: 0; color: var(--muted); }
.crumbs li + li::before { content: "/"; margin-right: .3rem; opacity: .6; }
.crumbs a { color: var(--muted); }
.more { margin-top: 1.6rem; }

.hero { padding: 3rem 0 2rem; background: radial-gradient(900px 400px at 85% -10%, rgba(139, 123, 255, .22), transparent 70%), radial-gradient(700px 360px at 0% 0%, rgba(255, 92, 200, .14), transparent 70%); }
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 2.5rem; align-items: center; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.4rem; }
.timeline-art { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.2rem; box-shadow: var(--shadow); }
.track { display: flex; gap: 6px; height: 34px; margin-bottom: 10px; }
.track span { flex: 0 0 var(--w); border-radius: 6px; }
.t1 span { background: linear-gradient(180deg, #8b7bff, #5c4bd6); }
.t2 span { background: linear-gradient(180deg, #ff5cc8, #b81c85); }
.t3 span { background: linear-gradient(180deg, #4f3a7a, #35224f); }
.playhead { position: absolute; top: 8px; bottom: 8px; left: 58%; width: 2px; background: var(--ok); }
.playhead::before { content: ""; position: absolute; top: -2px; left: -6px; border: 7px solid transparent; border-top-color: var(--ok); }
@media (prefers-reduced-motion: no-preference) { .playhead { animation: scrub 9s ease-in-out infinite alternate; } }
@keyframes scrub { from { left: 12%; } to { left: 88%; } }

.pf-box { display: grid; grid-template-columns: 1fr 1.1fr; gap: 2rem; padding: 1.6rem; border: 1px solid var(--border); border-radius: var(--radius); background: linear-gradient(135deg, var(--surface), var(--surface-2)); box-shadow: var(--shadow); }
.pf-form { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; align-content: start; }
.pf-form .btn { grid-column: 1 / -1; }
.pf-form-wide { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin-bottom: 1.5rem; }
.pf-form-wide .btn { grid-column: auto; align-self: end; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 1.1rem; }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.card, .topic { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.2rem; display: flex; flex-direction: column; position: relative; transition: border-color .15s, transform .15s; }
.card:hover, .topic:hover { border-color: var(--accent); transform: translateY(-2px); }
@media (prefers-reduced-motion: reduce) { .card, .topic { transition: none; } .card:hover, .topic:hover { transform: none; } }
.card-meta { display: flex; align-items: center; gap: .6rem; margin-bottom: .5rem; }
.card-cat { font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.card-title { font-size: 1.15rem; margin: 0 0 .4rem; }
.card-title a { color: var(--text); text-decoration: none; }
.card-title a::after { content: ""; position: absolute; inset: 0; }
.card-text { color: var(--muted); font-size: .98rem; flex: 1; }
.card-why { font-size: .9rem; color: var(--text); background: var(--surface-2); border-radius: 8px; padding: .5rem .7rem; }
.card-foot { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin-top: .4rem; }
.card-time { margin-left: auto; font-size: .85rem; color: var(--muted); }
.step-no { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--accent-bg); color: var(--accent-ink); font-weight: 800; }
.topic { text-decoration: none; color: var(--text); }
.topic h3 { margin-bottom: .3rem; }
.topic p { color: var(--muted); flex: 1; font-size: .98rem; }
.topic-no { font-family: var(--mono); color: var(--accent); font-size: .9rem; }
.topic-count { font-size: .85rem; font-weight: 700; color: var(--indigo); }

.badge { display: inline-block; font-size: .78rem; font-weight: 700; padding: .12rem .55rem; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2); }
.badge-beginner { color: var(--ok); }
.badge-intermediate { color: var(--warn); }
.badge-sw { color: var(--indigo); }
.tag-list { display: flex; flex-wrap: wrap; gap: .5rem; }
.tag { display: inline-block; padding: .25rem .75rem; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); text-decoration: none; font-size: .9rem; }
.tag:hover { border-color: var(--accent); }
.tag-n { color: var(--muted); font-size: .8rem; }
.tag-cloud .tag { font-size: 1rem; }

.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1rem; align-items: end; margin-bottom: 1rem; }
.field-wide { grid-column: 1 / -1; }
.field-actions { flex-direction: row; gap: .6rem; }
.search-big { display: flex; gap: .6rem; max-width: 36rem; margin-top: 1rem; }

.notice { padding: .9rem 1.1rem; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); margin-bottom: 1.2rem; }
.notice-estimate { border-left: 5px solid var(--warn); }
.trust h3 { margin-bottom: .3rem; }

/* ---------- path results ---------- */
.path-result { margin-top: 1.5rem; }
.path-list { list-style: none; margin: 1rem 0; padding: 0 0 0 1.2rem; border-left: 3px solid var(--border); }
.path-stage { font-weight: 800; letter-spacing: .08em; text-transform: uppercase; font-size: .8rem; color: var(--accent); margin: 1.4rem 0 .6rem; }
.path-item { margin-bottom: 1rem; position: relative; }
.path-item::before { content: ""; position: absolute; left: -1.62rem; top: 1.6rem; width: 14px; height: 14px; border-radius: 50%; background: var(--accent-bg); border: 3px solid var(--bg); }
.how { margin-top: 1.2rem; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: .8rem 1rem; }
.how summary { cursor: pointer; font-weight: 700; }

/* ---------- guide page ---------- */
.guide-head { padding: 1.6rem 0 1rem; max-width: 52rem; }
.guide-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; color: var(--muted); font-size: .92rem; }
.guide-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 2.5rem; align-items: start; }
.prose { max-width: 46rem; }
.prose h2 { margin-top: 2rem; padding-top: .4rem; position: relative; }
.prose h2::before { content: ""; display: block; width: 48px; height: 4px; border-radius: 2px; background: linear-gradient(90deg, var(--accent-bg), var(--indigo)); margin-bottom: .7rem; }
.prose li { margin-bottom: .45rem; }
.scope-box { border: 1px solid var(--border); border-left: 5px solid var(--indigo); background: var(--surface); border-radius: 10px; padding: .9rem 1.1rem; margin-bottom: 1.2rem; font-size: .98rem; }
.scope-universal { border-left-color: var(--ok); }
.scope-note { display: block; color: var(--muted); margin-top: .3rem; font-size: .92rem; }
.principle { background: var(--surface-2); border-radius: 10px; padding: 1rem 1.2rem; border: 1px dashed var(--indigo); margin: 1.2rem 0; }
.principle h3 { margin-bottom: .4rem; color: var(--indigo); }
.steps { list-style: none; counter-reset: step; padding: 0; margin: 0; }
.steps > li { counter-increment: step; position: relative; padding: 0 0 1.4rem 3.4rem; margin: 0; border-left: 2px solid var(--border); margin-left: 17px; padding-left: 2.6rem; }
.steps > li::before { content: counter(step); position: absolute; left: -17px; top: 0; width: 32px; height: 32px; border-radius: 50%; background: var(--accent-bg); color: var(--accent-ink); font-weight: 800; display: grid; place-items: center; }
.steps > li:last-child { border-left-color: transparent; }
.steps h3 { margin-top: .1rem; }
.note { background: var(--surface-2); border-radius: 8px; padding: .6rem .8rem; font-size: .96rem; }
.example { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: .9rem 1.1rem 0; margin-bottom: 1rem; }
.mistakes { list-style: none; padding: 0; }
.mistakes li { border-left: 4px solid var(--warn); background: var(--surface); padding: .7rem 1rem; border-radius: 0 10px 10px 0; }
.takeaways { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .2rem 1.4rem 1rem; margin-top: 2rem; }
.guide-side { position: sticky; top: 84px; display: grid; gap: 1.2rem; }
.toc, .side-cta { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.2rem; }
.toc h2, .side-cta h2 { font-size: 1rem; margin-bottom: .6rem; }
.toc ol { margin: 0; padding-left: 1.2rem; }
.toc a { color: var(--text); text-decoration: none; font-size: .95rem; }
.toc a:hover { color: var(--accent); text-decoration: underline; }
.side-cta p { font-size: .95rem; color: var(--muted); }
.related { padding: 2rem 0 3rem; }
.table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; font-size: .98rem; }
.table th, .table td { text-align: left; padding: .65rem .9rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.table thead th { background: var(--surface-2); }
.table-settings th[scope="row"] { width: 28%; }
.src { font-size: .8rem; font-weight: 700; padding: .1rem .5rem; border-radius: 999px; border: 1px solid var(--border); white-space: nowrap; }
.src-published { color: var(--ok); }
.src-suggestion { color: var(--warn); }

/* ---------- tools ---------- */
.calc-wrap { max-width: 760px; }
.calc-result { background: linear-gradient(135deg, var(--surface), var(--surface-2)); border: 1px solid var(--accent); border-radius: var(--radius); padding: 1.2rem 1.4rem; margin: 1.2rem 0 2rem; }
.calc-label { margin: 0; color: var(--muted); font-weight: 700; font-size: .85rem; letter-spacing: .08em; text-transform: uppercase; }
.calc-big { font-size: clamp(2rem, 7vw, 3rem); font-weight: 800; margin: .1rem 0 .6rem; color: var(--accent); }
.calc-detail { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .8rem; margin: 0; }
.calc-detail dt { font-size: .82rem; color: var(--muted); }
.calc-detail dd { margin: 0; font-weight: 700; }
.checklists { display: grid; gap: 1.4rem; max-width: 820px; }
.checklist { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.2rem 1.4rem; }
.progress { font-weight: 700; color: var(--ok); }
.check-items { list-style: none; margin: 0; padding: 0; }
.check-items li { display: flex; gap: .7rem; align-items: flex-start; padding: .45rem 0; border-bottom: 1px solid var(--border); }
.check-items input { width: 22px; height: 22px; min-height: 0; margin-top: .2rem; flex: none; accent-color: var(--accent-bg); }
.check-items label { margin: 0; font-weight: 400; font-size: 1rem; cursor: pointer; }
.check-items input:checked + label { color: var(--muted); text-decoration: line-through; }

/* ---------- footer ---------- */
.site-footer { margin-top: 3rem; background: var(--surface); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 2rem; padding: 2.2rem 0 1.4rem; }
.footer-h { font-size: .85rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: .4rem; }
.site-footer a { color: var(--text); }
.footer-note { color: var(--muted); font-size: .95rem; margin-top: .8rem; max-width: 22rem; }
.footer-legal { border-top: 1px solid var(--border); padding: 1rem 0 2rem; color: var(--muted); font-size: .88rem; }

/* ---------- institutional pages ---------- */
.legal { max-width: 46rem; padding-bottom: 2rem; }
.legal h2 { font-size: 1.4rem; margin-top: 2rem; }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .guide-layout { grid-template-columns: 1fr; }
  .guide-side { position: static; order: -1; }
  .toc { display: none; }
  .hero-grid, .pf-box { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .site-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; flex-direction: column; align-items: stretch; background: var(--bg); border-bottom: 1px solid var(--border); padding: 1rem; gap: .8rem; max-height: calc(100vh - 80px); overflow: auto; }
  .site-nav.open { display: flex; }
  .site-nav ul { flex-direction: column; }
  .site-nav ul a { padding: .8rem; }
  .nav-search input { width: 100%; }
  .nav-search { width: 100%; }
}
@media (max-width: 560px) {
  body { font-size: 1.02rem; }
  .pf-form { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .steps > li { padding-left: 1.8rem; }
  .search-big { flex-direction: column; }
}

@media print {
  .site-header, .site-footer, .no-print, .crumbs, .guide-side { display: none !important; }
  body { background: #fff; color: #000; }
  .checklist { border: 1px solid #999; break-inside: avoid; }
}
