/* ==========================================================================
   Asim Dumre — portfolio
   Design: warm paper + deep forest green, serif display (Fraunces) + Inter.
   ========================================================================== */

@font-face { font-family: "Fraunces"; src: url("../fonts/fraunces-latin-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Fraunces"; src: url("../fonts/fraunces-latin-wght-italic.woff2") format("woff2"); font-weight: 100 900; font-style: italic; font-display: swap; }
@font-face { font-family: "Inter"; src: url("../fonts/inter-latin-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }

:root {
  --bg: #f7f4ec;
  --bg-alt: #efeadb;
  --surface: #fffdf8;
  --surface-2: #f3eee0;
  --ink: #17251c;
  --ink-2: #44554a;
  --muted: #6f7d73;
  --line: #e2dccb;
  --brand: #2f5d3f;
  --brand-2: #4d8a5a;
  --brand-ink: #ffffff;
  --brand-soft: #e3eddf;
  --accent: #b8651f;
  --accent-soft: #f4e3cd;
  --danger: #b3382c;
  --danger-soft: #f8dedb;
  --ok: #2f7a45;
  --shadow-sm: 0 1px 2px rgba(23, 37, 28, .06), 0 1px 1px rgba(23, 37, 28, .04);
  --shadow: 0 8px 24px -8px rgba(23, 37, 28, .18), 0 2px 6px rgba(23, 37, 28, .06);
  --shadow-lg: 0 24px 48px -16px rgba(23, 37, 28, .28);
  --radius: 16px;
  --radius-sm: 10px;
  --font-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --container: 1120px;
  --header-h: 68px;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0d1611;
  --bg-alt: #111d16;
  --surface: #14211a;
  --surface-2: #1a2c22;
  --ink: #e9f0ea;
  --ink-2: #b6c5ba;
  --muted: #84978b;
  --line: #243a2d;
  --brand: #86c795;
  --brand-2: #5fa874;
  --brand-ink: #0d1611;
  --brand-soft: #1b3326;
  --accent: #e8a05b;
  --accent-soft: #3a2a18;
  --danger: #ef7d70;
  --danger-soft: #3a1e1b;
  --ok: #7fd197;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow: 0 10px 28px -10px rgba(0, 0, 0, .6);
  --shadow-lg: 0 28px 56px -16px rgba(0, 0, 0, .7);
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { 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-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
img, svg { max-width: 100%; display: block; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.01em; color: var(--ink); }
h1 { font-size: clamp(2.4rem, 5.5vw, 4rem); }
h2 { font-size: clamp(1.7rem, 3.2vw, 2.4rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 20px; }
@media (min-width: 720px) { .container { padding: 0 32px; } }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand-2) 70%, transparent); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--brand-soft); color: var(--ink); }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--brand); color: var(--brand-ink); padding: 10px 16px; border-radius: 8px; z-index: 200; }
.skip-link:focus { left: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.icon { display: inline-block; vertical-align: -.2em; width: 1.15em; height: 1.15em; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- Reveal on scroll ---------- */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s cubic-bezier(.2, .7, .2, 1); }
.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- Buttons & chips ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  font: inherit; font-weight: 600; font-size: .98rem; line-height: 1;
  padding: .9em 1.4em; border-radius: 999px; border: 1.5px solid transparent;
  cursor: pointer; transition: transform .15s ease, background .15s ease, box-shadow .15s ease, border-color .15s;
  text-decoration: none !important;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: var(--brand-ink); box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: color-mix(in srgb, var(--brand) 88%, black); box-shadow: var(--shadow); }
:root[data-theme="dark"] .btn-primary:hover { background: color-mix(in srgb, var(--brand) 88%, white); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-sm { padding: .6em 1em; font-size: .88rem; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

.chip {
  display: inline-flex; align-items: center; gap: .35em;
  font-size: .82rem; font-weight: 500; padding: .35em .85em; border-radius: 999px;
  background: var(--brand-soft); color: var(--brand); border: 1px solid transparent; white-space: nowrap;
}
button.chip { cursor: pointer; font-family: inherit; }
button.chip:hover { border-color: var(--brand-2); }
.chip.is-active { background: var(--brand); color: var(--brand-ink); }
.chip-plain { background: var(--surface-2); color: var(--ink-2); }
.badge { display: inline-block; font-size: .72rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; padding: .25em .7em; border-radius: 6px; background: var(--surface-2); color: var(--ink-2); }
.badge-reading, .badge-watching { background: var(--accent-soft); color: var(--accent); }
.badge-finished, .badge-completed, .badge-published { background: var(--brand-soft); color: var(--brand); }
.badge-want, .badge-planned, .badge-draft { background: var(--surface-2); color: var(--muted); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100; height: var(--header-h);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent; transition: border-color .2s, box-shadow .2s;
}
.site-header.scrolled { border-bottom-color: var(--line); box-shadow: var(--shadow-sm); }
.nav { height: var(--header-h); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-family: var(--font-display); font-weight: 600; font-size: 1.2rem; text-decoration: none !important; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; }
.brand-mark .icon { width: 20px; height: 20px; }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a { color: var(--ink-2); font-weight: 500; font-size: .96rem; padding: .5em .9em; border-radius: 999px; text-decoration: none !important; transition: background .15s, color .15s; }
.nav-links a:hover { background: var(--surface-2); color: var(--ink); }
.nav-links a.active { background: var(--brand-soft); color: var(--brand); }
.nav-actions { display: flex; align-items: center; gap: 6px; }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: transparent; border: 1px solid transparent; color: var(--ink-2); cursor: pointer; transition: background .15s, color .15s; }
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.nav-burger { display: none; }
.theme-icon-moon { display: none; }
:root[data-theme="dark"] .theme-icon-sun { display: none; }
:root[data-theme="dark"] .theme-icon-moon { display: block; }

@media (max-width: 860px) {
  .nav-burger { display: grid; }
  .nav-links {
    position: absolute; left: 12px; right: 12px; top: calc(var(--header-h) - 4px);
    flex-direction: column; align-items: stretch; gap: 2px; padding: 10px;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg);
    opacity: 0; visibility: hidden; transform: translateY(-8px); transition: opacity .18s, transform .18s, visibility .18s;
  }
  .site-header.open .nav-links { opacity: 1; visibility: visible; transform: none; }
  .nav-links a { padding: .85em 1em; border-radius: 10px; }
}

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; padding: clamp(40px, 8vw, 96px) 0 clamp(40px, 6vw, 72px); }
.contours {
  position: absolute; inset: 0; pointer-events: none; opacity: .13; background: var(--brand);
  -webkit-mask: url("../img/contours.svg") center / cover no-repeat; mask: url("../img/contours.svg") center / cover no-repeat;
}
.hero-grid { position: relative; display: grid; gap: 48px; align-items: center; }
@media (min-width: 900px) { .hero-grid { grid-template-columns: 1.25fr .75fr; gap: 64px; } }
.eyebrow { display: inline-flex; align-items: center; gap: .55em; font-size: .85rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--brand); margin-bottom: 1.1rem; }
.hero h1 { margin-bottom: .45em; text-wrap: balance; }
.hero h1 em { font-style: italic; color: var(--brand); font-weight: 500; }
.lead { font-size: clamp(1.1rem, 1.6vw, 1.3rem); color: var(--ink-2); max-width: 56ch; text-wrap: pretty; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin: 1.8rem 0 1.6rem; }
.socials { display: flex; flex-wrap: wrap; gap: 8px; }
.socials a { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; color: var(--ink-2); border: 1px solid var(--line); background: var(--surface); transition: transform .15s, color .15s, border-color .15s; }
.socials a:hover { color: var(--brand); border-color: var(--brand-2); transform: translateY(-2px); }

.hero-art { position: relative; justify-self: center; width: min(78vw, 340px); }
.avatar-arch {
  position: relative; aspect-ratio: 4 / 5; border-radius: 999px 999px 28px 28px; overflow: hidden;
  background: linear-gradient(160deg, var(--brand) 0%, color-mix(in srgb, var(--brand) 55%, #05120a) 100%);
  box-shadow: var(--shadow-lg); display: grid; place-items: center;
}
.avatar-arch::after { content: ""; position: absolute; inset: 0; background: var(--brand-ink); opacity: .08; -webkit-mask: url("../img/contours.svg") center / cover; mask: url("../img/contours.svg") center / cover; }
.avatar-arch img { width: 100%; height: 100%; object-fit: cover; }
.avatar-initials { font-family: var(--font-display); font-weight: 600; font-size: clamp(4rem, 10vw, 6rem); color: var(--brand-ink); opacity: .92; position: relative; z-index: 1; }
.hero-art::before { content: ""; position: absolute; inset: -14px -14px 14px 14px; border: 2px dashed color-mix(in srgb, var(--brand) 45%, transparent); border-radius: 999px 999px 32px 32px; z-index: -1; }
.float-card {
  position: absolute; left: -22px; bottom: 28px; display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; box-shadow: var(--shadow); font-size: .85rem; max-width: 230px;
}
.float-card .icon { color: var(--accent); width: 1.4em; height: 1.4em; }
.float-card b { display: block; font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.float-card span { display: block; line-height: 1.25; font-weight: 600; }
@media (max-width: 899px) { .float-card { left: 8px; } }

/* ---------- Sections ---------- */
.section { padding: clamp(48px, 7vw, 88px) 0; }
.section.alt { background: var(--bg-alt); }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 32px; }
.section-head h2 { margin: 0; }
.section-head .eyebrow { margin-bottom: .6rem; }
.link-arrow { display: inline-flex; align-items: center; gap: .4em; font-weight: 600; }
.link-arrow .icon { transition: transform .15s; }
.link-arrow:hover .icon { transform: translateX(3px); }

.now-grid { display: grid; gap: 16px; }
@media (min-width: 760px) { .now-grid { grid-template-columns: repeat(3, 1fr); } }
.now-card { display: flex; gap: 14px; align-items: center; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); transition: transform .2s, box-shadow .2s; color: inherit; text-decoration: none !important; min-width: 0; }
a.now-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.now-icon { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); flex: none; }
.now-card small { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 600; color: var(--muted); }
.now-card strong { display: block; font-weight: 600; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.now-card span.sub { color: var(--muted); font-size: .88rem; }

.about-grid { display: grid; gap: 40px; }
@media (min-width: 900px) { .about-grid { grid-template-columns: 1.3fr 1fr; gap: 64px; } }
.fact-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-sm); }
.fact-list { list-style: none; margin: 0 0 20px; padding: 0; display: grid; gap: 14px; }
.fact-list li { display: flex; gap: 12px; align-items: flex-start; }
.fact-list .icon { color: var(--brand); margin-top: .2em; }
.fact-list small { display: block; color: var(--muted); font-size: .76rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }

.split { display: grid; gap: 48px; }
@media (min-width: 900px) { .split { grid-template-columns: 1fr 1.2fr; gap: 72px; } }
.skill { margin-bottom: 18px; }
.skill-top { display: flex; justify-content: space-between; font-weight: 600; font-size: .95rem; margin-bottom: 6px; }
.skill-top span:last-child { color: var(--muted); font-weight: 500; }
.bar { height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.alt .bar { background: color-mix(in srgb, var(--line) 80%, transparent); }
.bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--brand-2), var(--brand)); border-radius: 999px; transition: width 1.1s cubic-bezier(.2, .7, .2, 1); }
.in .bar i, .bar.in i { width: var(--w); }
.timeline { position: relative; list-style: none; margin: 0; padding: 0 0 0 28px; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 2px; background: var(--line); }
.timeline li { position: relative; padding-bottom: 28px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before { content: ""; position: absolute; left: -28px; top: 7px; width: 16px; height: 16px; border-radius: 50%; background: var(--bg); border: 3px solid var(--brand); }
.alt .timeline li::before { background: var(--bg-alt); }
.timeline .when { font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.timeline h3 { margin: .15em 0 .25em; font-size: 1.15rem; }
.timeline p { margin: 0; color: var(--ink-2); }

/* ---------- Cards / grids ---------- */
.grid { display: grid; gap: 24px; }
.grid-posts { grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); transition: transform .25s, box-shadow .25s; display: flex; flex-direction: column; }
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.card-cover { display: block; aspect-ratio: 16 / 9; overflow: hidden; position: relative; background-size: cover; }
.card-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.card:hover .card-cover img { transform: scale(1.04); }
.cover-fallback { position: absolute; inset: 0; display: grid; place-items: center; color: color-mix(in srgb, white 80%, transparent); }
.cover-fallback .icon { width: 44px; height: 44px; opacity: .55; stroke-width: 1.5; }
.cover-fallback::before { content: ""; position: absolute; inset: 0; background: #fff; opacity: .07; -webkit-mask: url("../img/contours.svg") center / cover; mask: url("../img/contours.svg") center / cover; }
.card-body { padding: 20px 22px 24px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: .4em .9em; font-size: .85rem; color: var(--muted); }
.meta > span { display: inline-flex; align-items: center; gap: .4em; }
.meta .dot::before { content: "·"; margin-right: .5em; }
.card h3 { margin: 0; font-size: 1.3rem; }
.card h3 a { color: var(--ink); }
.card h3 a:hover { color: var(--brand); text-decoration: none; }
.card p { margin: 0; color: var(--ink-2); font-size: .98rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card .chips { margin-top: auto; padding-top: 10px; }

.shelf { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); }
.media-card { all: unset; box-sizing: border-box; display: flex; flex-direction: column; gap: 10px; cursor: pointer; text-align: left; border-radius: var(--radius-sm); }
.media-card:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand-2) 70%, transparent); outline-offset: 4px; }
.cover { position: relative; aspect-ratio: 2 / 3; border-radius: 6px 12px 12px 6px; overflow: hidden; box-shadow: var(--shadow); transition: transform .25s, box-shadow .25s; }
.media-card:hover .cover { transform: translateY(-5px) rotate(-.6deg); box-shadow: var(--shadow-lg); }
.cover img { width: 100%; height: 100%; object-fit: cover; }
.cover.book::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 7px; background: linear-gradient(90deg, rgba(0, 0, 0, .28), rgba(255, 255, 255, .1) 60%, transparent); }
.cover-title { position: absolute; inset: 0; padding: 14px 12px 14px 18px; display: flex; flex-direction: column; justify-content: space-between; color: #fff; z-index: 1; }
.cover-title strong { font-family: var(--font-display); font-size: 1.05rem; line-height: 1.2; font-weight: 600; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.cover-title span { font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; opacity: .75; }
.cover .badge { position: absolute; top: 8px; right: 8px; z-index: 2; box-shadow: var(--shadow-sm); }
.media-info small.badge { display: block; width: fit-content; margin: 0 0 6px; }
.media-info strong { display: block; font-weight: 600; font-size: .95rem; line-height: 1.3; color: var(--ink); }
.media-info span { display: block; font-size: .84rem; color: var(--muted); }
.stars { color: var(--accent); letter-spacing: .1em; font-size: .92rem; }

.shelf-block + .shelf-block { margin-top: 48px; }
.shelf-block h3 { display: flex; align-items: center; gap: .5em; font-size: 1.15rem; margin-bottom: 18px; }
.shelf-block h3 .icon { color: var(--brand); }

/* ---------- Page header / controls ---------- */
.page-hero { position: relative; overflow: hidden; padding: clamp(40px, 6vw, 72px) 0 clamp(24px, 4vw, 40px); }
.page-hero .container { position: relative; }
.page-hero h1 { font-size: clamp(2.2rem, 4.6vw, 3.4rem); margin-bottom: .3em; }
.page-hero p { color: var(--ink-2); max-width: 60ch; font-size: 1.12rem; margin: 0; }
.controls { display: flex; flex-wrap: wrap; gap: 14px 18px; align-items: center; justify-content: space-between; margin-bottom: 28px; }
.search { position: relative; flex: 1 1 260px; max-width: 380px; }
.search .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.input, .select, .textarea {
  width: 100%; font: inherit; font-size: 1rem; color: var(--ink); background: var(--surface);
  border: 1.5px solid var(--line); border-radius: 12px; padding: .75em 1em; transition: border-color .15s, box-shadow .15s;
}
.search .input { padding-left: 42px; border-radius: 999px; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--brand-2); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand-2) 22%, transparent); }
.textarea { min-height: 140px; resize: vertical; line-height: 1.55; }
.tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-bottom: 32px; }
@media (min-width: 720px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.stat b { font-family: var(--font-display); font-size: 1.9rem; font-weight: 600; display: block; line-height: 1.1; color: var(--brand); }
.stat span { font-size: .82rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }

.empty { text-align: center; padding: 56px 20px; border: 2px dashed var(--line); border-radius: var(--radius); color: var(--muted); }
.empty .icon { width: 40px; height: 40px; margin: 0 auto 10px; opacity: .6; }
.empty h3 { color: var(--ink-2); margin-bottom: .3em; }
.load-more { display: flex; justify-content: center; margin-top: 36px; }

/* Skeletons */
.skeleton { position: relative; overflow: hidden; background: var(--surface-2); border-radius: 10px; min-height: 16px; }
.skeleton::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--surface) 70%, transparent), transparent); transform: translateX(-100%); animation: shimmer 1.3s infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }
.sk-card { height: 300px; border-radius: var(--radius); }

/* ---------- Modal (native dialog) ---------- */
dialog { border: none; padding: 0; background: transparent; color: inherit; max-width: 100vw; max-height: 100dvh; }
dialog::backdrop { background: rgba(8, 16, 11, .6); backdrop-filter: blur(4px); }
.modal { width: min(560px, calc(100vw - 24px)); background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow-lg); overflow: hidden; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 22px 24px 0; }
.modal-head h3 { margin: 0; font-size: 1.5rem; }
.modal-body { padding: 14px 24px 26px; max-height: 70dvh; overflow: auto; }
.modal-media { display: flex; gap: 18px; align-items: flex-start; }
.modal-media .cover { width: 110px; flex: none; }
@media (max-width: 480px) { .modal-media { flex-direction: column; } .modal-media .cover { width: 120px; } }

/* ---------- Article ---------- */
.progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: var(--brand-2); z-index: 300; }
.article-head { padding: clamp(36px, 6vw, 72px) 0 24px; }
.narrow { max-width: 740px; margin: 0 auto; padding: 0 20px; }
@media (min-width: 720px) { .narrow { padding: 0 32px; } }
.article-head h1 { font-size: clamp(2rem, 4.8vw, 3.2rem); text-wrap: balance; }
.article-head .lead { font-size: 1.2rem; }
.back-link { display: inline-flex; align-items: center; gap: .45em; font-weight: 600; font-size: .92rem; margin-bottom: 22px; color: var(--ink-2); }
.article-cover { max-width: 980px; margin: 8px auto 40px; padding: 0 20px; }
.article-cover img, .article-cover .ph { width: 100%; border-radius: var(--radius); box-shadow: var(--shadow); aspect-ratio: 16 / 8; object-fit: cover; }
.prose { font-size: 1.14rem; line-height: 1.8; color: var(--ink); }
.prose > * + * { margin-top: 1.3em; }
.prose h2 { font-size: 1.75rem; margin-top: 2.1em; }
.prose h3 { font-size: 1.35rem; margin-top: 1.8em; }
.prose a { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
.prose blockquote { margin-left: 0; padding: .3em 0 .3em 1.3em; border-left: 4px solid var(--brand-2); font-family: var(--font-display); font-style: italic; font-size: 1.3rem; line-height: 1.5; color: var(--ink-2); }
.prose img { border-radius: var(--radius-sm); margin: 1.8em auto; box-shadow: var(--shadow-sm); }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li + li { margin-top: .4em; }
.prose code { font-size: .88em; background: var(--surface-2); padding: .15em .45em; border-radius: 6px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.prose pre { background: #0f1b14; color: #e3efe5; padding: 18px 20px; border-radius: 12px; overflow-x: auto; font-size: .92rem; line-height: 1.6; }
.prose pre code { background: none; padding: 0; color: inherit; }
.prose hr { border: none; height: 1px; background: var(--line); margin: 2.4em 0; }
.prose table { border-collapse: collapse; width: 100%; font-size: .98rem; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--line); padding: .6em .9em; text-align: left; }
.prose th { background: var(--surface-2); }
.article-foot { margin-top: 48px; padding-top: 28px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; align-items: center; }
.post-nav { display: grid; gap: 16px; margin: 56px 0 0; }
@media (min-width: 720px) { .post-nav { grid-template-columns: 1fr 1fr; } }
.post-nav a { display: block; padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: inherit; transition: border-color .15s, transform .15s; text-decoration: none !important; }
.post-nav a:hover { border-color: var(--brand-2); transform: translateY(-2px); }
.post-nav small { display: block; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-size: .72rem; font-weight: 600; }
.post-nav strong { font-family: var(--font-display); font-size: 1.1rem; font-weight: 600; }
.post-nav .next { text-align: right; }

/* ---------- Contact ---------- */
.contact-grid { display: grid; gap: 40px; align-items: start; }
@media (min-width: 900px) { .contact-grid { grid-template-columns: .9fr 1.1fr; gap: 64px; } }
.form-card { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: clamp(20px, 4vw, 34px); box-shadow: var(--shadow); }
.field { display: grid; gap: 6px; margin-bottom: 18px; }
.field label { font-weight: 600; font-size: .92rem; }
.field .hint { font-size: .82rem; color: var(--muted); }
.hp { position: absolute; left: -5000px; height: 0; overflow: hidden; }
.alert { padding: 14px 16px; border-radius: 12px; font-size: .95rem; margin-bottom: 18px; }
.alert-ok { background: var(--brand-soft); color: var(--brand); }
.alert-err { background: var(--danger-soft); color: var(--danger); }
.contact-list { list-style: none; padding: 0; margin: 24px 0; display: grid; gap: 16px; }
.contact-list li { display: flex; align-items: center; gap: 14px; }
.contact-list .now-icon { width: 44px; height: 44px; }

/* ---------- CTA band + footer ---------- */
.cta-band { position: relative; overflow: hidden; background: var(--brand); color: var(--brand-ink); border-radius: 28px; padding: clamp(32px, 6vw, 64px); text-align: center; margin: 0 auto; }
.cta-band::before { content: ""; position: absolute; inset: 0; background: #fff; opacity: .07; -webkit-mask: url("../img/contours.svg") center / cover; mask: url("../img/contours.svg") center / cover; }
.cta-band > * { position: relative; }
.cta-band h2 { color: inherit; }
.cta-band p { max-width: 50ch; margin: 0 auto 1.5rem; opacity: .9; }
.cta-band .btn { background: var(--brand-ink); color: var(--brand); }
:root[data-theme="dark"] .cta-band .btn { background: #0d1611; color: var(--brand); }

.site-footer { border-top: 1px solid var(--line); background: var(--bg-alt); margin-top: 72px; }
.footer-grid { display: grid; gap: 28px; padding-top: 44px; padding-bottom: 28px; }
@media (min-width: 760px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; } }
.footer-grid h4 { font-family: var(--font-body); font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }
.footer-links { display: grid; gap: 6px; }
.footer-links a { color: var(--ink-2); width: fit-content; }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; padding-top: 18px; padding-bottom: 28px; border-top: 1px solid var(--line); color: var(--muted); font-size: .88rem; }
.footer-bottom a { color: var(--muted); }

/* Demo ribbon */
.demo-bar { background: var(--accent-soft); color: var(--accent); font-size: .85rem; text-align: center; padding: 8px 16px; font-weight: 500; }
.demo-bar a { color: inherit; font-weight: 700; text-decoration: underline; }

/* Toasts */
#toasts { position: fixed; z-index: 500; bottom: 20px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; width: min(420px, calc(100vw - 24px)); pointer-events: none; }
.toast { background: var(--ink); color: var(--bg); padding: 12px 16px; border-radius: 12px; box-shadow: var(--shadow-lg); font-size: .94rem; opacity: 0; transform: translateY(10px); transition: opacity .25s, transform .25s; }
.toast.in { opacity: 1; transform: none; }
.toast-err { background: var(--danger); color: #fff; }

/* 404 */
.notfound { text-align: center; padding: 14vh 20px; }
.notfound .big { font-family: var(--font-display); font-size: clamp(5rem, 18vw, 10rem); line-height: 1; color: var(--brand); opacity: .9; margin: 0; }

@media print {
  .site-header, .site-footer, .progress, .article-foot .btn, .post-nav { display: none !important; }
  body { background: #fff; color: #000; }
}
