/* =====================================================================
   道易云记工 · 官网前端设计系统 (Premium Rewrite)
   Palette : warm paper + ink, confident teal brand, amber accent
   Features: light/dark via [data-theme], glassmorphism, fluid type,
             scroll reveal, reduced-motion safe, 60fps (transform/opacity).
   ===================================================================== */

/* ---------- Tokens : LIGHT (default) ---------- */
:root {
    --brand: #0e7c6b;
    --brand-strong: #0a5d50;
    --brand-ink: #ffffff;
    --accent: #d98a2b;
    --accent-soft: color-mix(in srgb, var(--accent) 14%, #fff);

    --ink: #1c1a16;
    --ink-soft: #4a463e;
    --muted: #6e675e;
    --faint: #988f82;

    --bg: #f6f3ec;
    --surface: #ffffff;
    --surface-2: #fbf9f3;
    --line: #e8e1d6;
    --line-strong: #d8cfc0;

    --glass-bg: rgba(255, 255, 255, 0.62);
    --glass-brd: rgba(255, 255, 255, 0.55);
    --glass-inset: inset 0 1px 0 rgba(255, 255, 255, 0.7);

    --shadow-sm: 0 1px 2px rgba(28, 26, 22, .05), 0 6px 18px rgba(28, 26, 22, .07);
    --shadow-md: 0 14px 40px rgba(28, 26, 22, .12);
    --shadow-lg: 0 34px 70px rgba(14, 124, 107, .22);
    --shadow-ink: 0 30px 70px rgba(20, 18, 14, .45);

    --radius: 18px;
    --radius-lg: 28px;
    --radius-sm: 12px;
    --maxw: 1180px;

    --ease: cubic-bezier(.16, 1, .3, 1);
    --ease-out: cubic-bezier(.22, 1, .36, 1);

    --font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
        -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --nav-h: 72px;
}

/* ---------- Tokens : DARK (system preference) ---------- */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --brand: #34c2a8;
        --brand-strong: #28a892;
        --brand-ink: #08231e;
        --accent: #eab15f;
        --accent-soft: color-mix(in srgb, var(--accent) 16%, #16140f);

        --ink: #f2ede3;
        --ink-soft: #cdc5b6;
        --muted: #a79e8f;
        --faint: #7d7567;

        --bg: #14120d;
        --surface: #1d1a14;
        --surface-2: #232019;
        --line: #2e2a22;
        --line-strong: #3b362c;

        --glass-bg: rgba(38, 34, 26, 0.55);
        --glass-brd: rgba(255, 255, 255, 0.10);
        --glass-inset: inset 0 1px 0 rgba(255, 255, 255, 0.06);

        --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4), 0 6px 18px rgba(0, 0, 0, .4);
        --shadow-md: 0 14px 40px rgba(0, 0, 0, .55);
        --shadow-lg: 0 34px 70px rgba(0, 0, 0, .6);
        --shadow-ink: 0 30px 70px rgba(0, 0, 0, .6);
    }
}

/* ---------- Tokens : DARK (explicit toggle) ---------- */
[data-theme="dark"] {
    --brand: #34c2a8;
    --brand-strong: #28a892;
    --brand-ink: #08231e;
    --accent: #eab15f;
    --accent-soft: color-mix(in srgb, var(--accent) 16%, #16140f);

    --ink: #f2ede3;
    --ink-soft: #cdc5b6;
    --muted: #a79e8f;
    --faint: #7d7567;

    --bg: #14120d;
    --surface: #1d1a14;
    --surface-2: #232019;
    --line: #2e2a22;
    --line-strong: #3b362c;

    --glass-bg: rgba(38, 34, 26, 0.55);
    --glass-brd: rgba(255, 255, 255, 0.10);
    --glass-inset: inset 0 1px 0 rgba(255, 255, 255, 0.06);

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4), 0 6px 18px rgba(0, 0, 0, .4);
    --shadow-md: 0 14px 40px rgba(0, 0, 0, .55);
    --shadow-lg: 0 34px 70px rgba(0, 0, 0, .6);
    --shadow-ink: 0 30px 70px rgba(0, 0, 0, .6);
}

/* ====================== RESET ====================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
    font-family: var(--font);
    color: var(--ink);
    background: var(--bg);
    line-height: 1.65;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
    overflow-x: hidden;
    transition: background .4s var(--ease), color .4s var(--ease);
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
ul { list-style: none; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; border-radius: 6px; }

.container {
    width: 100%;
    max-width: var(--maxw);
    margin-inline: auto;
    padding-inline: clamp(18px, 4vw, 32px);
}
.container.narrow { max-width: 820px; }

/* ====================== NAV ====================== */
.nav {
    position: fixed; inset: 0 0 auto 0;
    z-index: 100; height: var(--nav-h);
    display: flex; align-items: center;
    transition: background .35s var(--ease), box-shadow .35s var(--ease),
                backdrop-filter .35s var(--ease), border-color .35s var(--ease);
    border-bottom: 1px solid transparent;
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; }

/* transparent over hero */
body.has-hero .nav:not(.scrolled) { background: transparent; }
body.has-hero .nav:not(.scrolled) .logo,
body.has-hero .nav:not(.scrolled) .nav-links a { color: rgba(255, 255, 255, .92); }
body.has-hero .nav:not(.scrolled) .nav-links a:hover { color: #fff; }
body.has-hero .nav:not(.scrolled) .hamburger span { background: #fff; }

/* solid (scrolled or inner pages) */
.nav.scrolled, body:not(.has-hero) .nav {
    background: var(--glass-bg);
    -webkit-backdrop-filter: blur(16px) saturate(160%);
    backdrop-filter: blur(16px) saturate(160%);
    border-bottom-color: var(--line);
    box-shadow: 0 1px 0 rgba(0, 0, 0, .02);
}

.logo { display: inline-flex; align-items: center; gap: 11px; font-weight: 800; font-size: 19px; letter-spacing: .3px; color: var(--ink); transition: color .3s; }
.logo .mark {
    width: 36px; height: 36px; border-radius: 11px; flex: none;
    display: grid; place-items: center; color: #fff; font-size: 18px; font-weight: 900;
    background: linear-gradient(140deg, var(--brand), var(--brand-strong));
    box-shadow: var(--shadow-sm);
}
.nav-links { display: flex; align-items: center; gap: clamp(14px, 2.2vw, 30px); }
.nav-links a { color: var(--muted); font-size: 15px; font-weight: 500; position: relative; transition: color .2s; padding: 4px 0; }
.nav-links a::after {
    content: ""; position: absolute; left: 0; bottom: -2px; height: 2px; width: 0;
    background: var(--brand); border-radius: 2px; transition: width .3s var(--ease);
}
.nav-links a:hover { color: var(--ink); }
.nav-links a:hover::after, .nav-links a.active::after { width: 100%; }
.nav-links a.active { color: var(--brand); }

.nav-right { display: flex; align-items: center; gap: 14px; }

/* theme toggle */
.theme-toggle {
    width: 42px; height: 42px; flex: none; border-radius: 50%;
    border: 1px solid var(--line); background: var(--surface);
    color: var(--ink-soft); display: grid; place-items: center;
    transition: transform .3s var(--ease), border-color .2s, color .2s, background .3s;
}
.theme-toggle:hover { transform: rotate(-12deg) scale(1.06); border-color: var(--brand); color: var(--brand); }
.theme-toggle svg { width: 19px; height: 19px; }
.theme-toggle .i-sun { display: none; }
.theme-toggle .i-moon { display: block; }
[data-theme="dark"] .theme-toggle .i-sun { display: block; }
[data-theme="dark"] .theme-toggle .i-moon { display: none; }

/* hamburger */
.hamburger {
    display: none; width: 44px; height: 44px; border: none; background: transparent;
    flex-direction: column; gap: 5px; justify-content: center; align-items: center;
}
.hamburger span { width: 24px; height: 2px; background: var(--ink); border-radius: 2px; transition: transform .3s var(--ease), opacity .3s; }
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-menu {
    position: fixed; top: var(--nav-h); left: 0; right: 0; z-index: 99;
    background: var(--surface); border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-md);
    padding: 14px clamp(18px, 4vw, 32px) 24px;
    display: grid; gap: 4px;
    transform: translateY(-12px); opacity: 0; visibility: hidden;
    transition: transform .3s var(--ease), opacity .3s var(--ease), visibility .3s;
}
.mobile-menu.open { transform: none; opacity: 1; visibility: visible; }
.mobile-menu a { padding: 13px 6px; font-weight: 500; color: var(--ink); border-bottom: 1px solid var(--line); }
.mobile-menu a:last-of-type { border-bottom: none; }
.mobile-menu .btn { margin-top: 14px; }

/* ====================== BUTTONS ====================== */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 9px;
    padding: 12px 24px; border-radius: 999px; font-size: 15px; font-weight: 600;
    border: 1px solid transparent; white-space: nowrap;
    transition: transform .2s var(--ease), box-shadow .25s var(--ease), background .25s, color .25s, border-color .25s;
    will-change: transform;
}
.btn svg { width: 17px; height: 17px; }
.btn-primary { background: var(--brand); color: var(--brand-ink); box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--brand-strong); box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.btn-ghost { background: transparent; color: var(--brand); border-color: var(--brand); }
.btn-ghost:hover { background: var(--brand-soft); }
.btn-line { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-line:hover { border-color: var(--ink); transform: translateY(-2px); }
body.has-hero .nav:not(.scrolled) .btn-ghost { color: #fff; border-color: rgba(255, 255, 255, .5); }
body.has-hero .nav:not(.scrolled) .btn-ghost:hover { background: rgba(255, 255, 255, .14); }
/* light variant for dark backgrounds (CTA) */
.btn-line.light { color: #fff; border-color: rgba(255, 255, 255, .45); }
.btn-line.light:hover { background: rgba(255, 255, 255, .12); border-color: #fff; }
.btn-lg { padding: 15px 30px; font-size: 16px; }

/* ====================== SECTION SCAFFOLD ====================== */
.section { padding: clamp(64px, 9vw, 104px) 0; }
.section-alt { background: var(--surface-2); }
.section-head { max-width: 720px; margin: 0 auto clamp(40px, 6vw, 60px); text-align: center; }
.section-head.left { text-align: left; margin-inline: 0; }
.eyebrow {
    display: inline-flex; align-items: center; gap: 9px;
    font-size: 13px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
    color: var(--brand);
}
.eyebrow::before { content: ""; width: 22px; height: 2px; border-radius: 2px; background: var(--brand); }
.section-head h2 {
    font-size: clamp(26px, 4.4vw, 40px); line-height: 1.2; font-weight: 800;
    letter-spacing: -.01em; margin: 16px 0 14px; color: var(--ink);
}
.section-head p { color: var(--muted); font-size: clamp(15px, 1.6vw, 18px); }

/* ====================== HERO ====================== */
.hero {
    position: relative; isolation: isolate; overflow: hidden;
    background:
        radial-gradient(120% 90% at 85% -10%, rgba(52, 194, 168, .30), transparent 55%),
        radial-gradient(90% 70% at 10% 0%, rgba(217, 138, 43, .20), transparent 50%),
        linear-gradient(165deg, #0c2b27 0%, #0e2a2f 45%, #11343a 100%);
    color: #fff;
    padding: calc(var(--nav-h) + clamp(48px, 8vw, 96px)) 0 clamp(70px, 9vw, 110px);
}
/* faint blueprint grid (intentional, brand-reinforcing decoration) */
.hero::before {
    content: ""; position: absolute; inset: 0; z-index: -2;
    background-image:
        linear-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .05) 1px, transparent 1px);
    background-size: 54px 54px;
    -webkit-mask-image: radial-gradient(120% 80% at 70% 20%, #000 30%, transparent 78%);
    mask-image: radial-gradient(120% 80% at 70% 20%, #000 30%, transparent 78%);
}
/* soft glow blob */
.hero::after {
    content: ""; position: absolute; z-index: -2; right: -8%; top: 8%;
    width: 460px; height: 460px; border-radius: 50%;
    background: radial-gradient(circle, rgba(52, 194, 168, .35), transparent 65%);
    filter: blur(20px);
}
#heroCanvas { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; pointer-events: none; }

.hero-inner { display: grid; grid-template-columns: 1.04fr .96fr; gap: clamp(36px, 5vw, 64px); align-items: center; }
.badge {
    display: inline-flex; align-items: center; gap: 9px;
    padding: 8px 16px; border-radius: 999px; font-size: 13.5px; font-weight: 600;
    background: rgba(255, 255, 255, .10); border: 1px solid rgba(255, 255, 255, .18);
    color: rgba(255, 255, 255, .92); margin-bottom: 22px;
    -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.badge .dot { width: 8px; height: 8px; border-radius: 50%; background: #5ee0bd; box-shadow: 0 0 0 4px rgba(94, 224, 189, .25); }
.hero h1 {
    font-size: clamp(34px, 5.4vw, 58px); line-height: 1.12; font-weight: 800;
    letter-spacing: -.02em; margin-bottom: 20px;
}
.hero h1 .grad {
    background: linear-gradient(100deg, #7fe7cf, #f0b35e);
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero .lead { font-size: clamp(16px, 1.8vw, 19px); color: rgba(255, 255, 255, .82); max-width: 540px; margin-bottom: 30px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }

.hero-stats { display: flex; gap: clamp(20px, 3vw, 40px); margin-top: 40px; flex-wrap: wrap; }
.hero-stats div { display: flex; flex-direction: column; }
.hero-stats strong { font-size: clamp(24px, 3vw, 32px); font-weight: 800; color: #fff; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.hero-stats span { font-size: 13.5px; color: rgba(255, 255, 255, .66); margin-top: 2px; }

/* ----- glass app mockup ----- */
.hero-visual { position: relative; display: flex; justify-content: center; }
.app-card {
    width: min(360px, 100%);
    background: var(--glass-bg);
    -webkit-backdrop-filter: blur(22px) saturate(170%);
    backdrop-filter: blur(22px) saturate(170%);
    border: 1px solid var(--glass-brd);
    box-shadow: var(--glass-inset), var(--shadow-ink);
    border-radius: 24px; padding: 20px;
    transform: perspective(1400px) rotateY(-13deg) rotateX(5deg);
    transition: transform .6s var(--ease);
}
.hero-visual:hover .app-card { transform: perspective(1400px) rotateY(-7deg) rotateX(2deg); }
.app-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.app-top .t { font-size: 13px; font-weight: 700; color: var(--ink); letter-spacing: .04em; }
.app-top .amt { font-size: 22px; font-weight: 800; color: var(--brand); font-variant-numeric: tabular-nums; }
.app-row {
    display: flex; align-items: center; gap: 12px; padding: 11px 12px;
    border-radius: 14px; background: var(--surface); margin-bottom: 10px;
    box-shadow: var(--shadow-sm); border: 1px solid var(--line);
}
.app-row .ic { width: 34px; height: 34px; border-radius: 10px; flex: none; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.app-row .ic svg { width: 18px; height: 18px; }
.app-row .mid { flex: 1; min-width: 0; }
.app-row .mid p { font-size: 14px; font-weight: 600; color: var(--ink); line-height: 1.3; }
.app-row .mid small { font-size: 12px; color: var(--muted); }
.app-row .val { font-size: 14px; font-weight: 700; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.app-foot { margin-top: 6px; text-align: center; font-size: 12px; color: var(--muted); letter-spacing: .04em; }

/* floating glass chip */
.float-chip {
    position: absolute; background: var(--surface); border: 1px solid var(--line);
    border-radius: 14px; padding: 10px 14px; display: flex; align-items: center; gap: 9px;
    box-shadow: var(--shadow-md); font-size: 13px; font-weight: 600; color: var(--ink);
    animation: floaty 6s ease-in-out infinite;
}
.float-chip .d { width: 9px; height: 9px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 0 4px rgba(74, 222, 128, .2); }
.float-chip.c1 { top: 6%; left: -6%; animation-delay: .4s; }
.float-chip.c2 { bottom: 10%; right: -8%; animation-delay: 1.6s; }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }

/* ====================== STATS BAR ====================== */
.stats-bar {
    position: relative; z-index: 5; margin-top: clamp(-44px, -5vw, -36px);
}
.stats-inner {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md); display: grid; grid-template-columns: repeat(4, 1fr);
    overflow: hidden;
}
.stats-inner .cell { padding: clamp(20px, 3vw, 30px) 18px; text-align: center; border-right: 1px solid var(--line); }
.stats-inner .cell:last-child { border-right: none; }
.stats-inner .num { font-size: clamp(24px, 3.2vw, 34px); font-weight: 800; color: var(--brand); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.stats-inner .lab { color: var(--muted); font-size: 13.5px; margin-top: 4px; }

/* ====================== FEATURE GRID ====================== */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(18px, 2.4vw, 26px); }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(16px, 2vw, 22px); }

.card {
    position: relative; background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius); padding: clamp(24px, 3vw, 34px);
    transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .35s;
    overflow: hidden;
}
.card::after {
    content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
    background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 0%), color-mix(in srgb, var(--brand) 12%, transparent), transparent 60%);
    opacity: 0; transition: opacity .35s;
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); border-color: color-mix(in srgb, var(--brand) 35%, var(--line)); }
.card:hover::after { opacity: 1; }
.card-ic {
    width: 54px; height: 54px; border-radius: 15px; display: grid; place-items: center;
    background: var(--brand-soft); color: var(--brand); margin-bottom: 18px;
    transition: transform .35s var(--ease);
}
.card:hover .card-ic { transform: scale(1.06) rotate(-3deg); }
.card-ic svg { width: 26px; height: 26px; }
.card h3 { font-size: 19px; font-weight: 700; margin-bottom: 8px; color: var(--ink); letter-spacing: -.01em; }
.card p { color: var(--muted); font-size: 15px; }

/* ====================== STEPS ====================== */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(20px, 3vw, 34px); }
.step { position: relative; text-align: center; padding: 8px 14px; }
.step-no {
    width: 58px; height: 58px; border-radius: 50%; margin: 0 auto 18px;
    display: grid; place-items: center; font-size: 22px; font-weight: 800; color: #fff;
    background: linear-gradient(140deg, var(--brand), var(--brand-strong));
    box-shadow: var(--shadow-sm), 0 0 0 6px var(--brand-soft);
}
.step h3 { font-size: 18px; font-weight: 700; margin-bottom: 8px; color: var(--ink); }
.step p { color: var(--muted); font-size: 15px; }
.step:not(:last-child)::after {
    content: ""; position: absolute; top: 29px; left: 62%; width: 76%; height: 2px;
    background: repeating-linear-gradient(90deg, var(--line-strong) 0 8px, transparent 8px 16px);
}

/* ====================== ADVANTAGES ====================== */
.feature {
    display: flex; gap: 16px; align-items: flex-start; padding: clamp(20px, 2.4vw, 26px);
    border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line);
    transition: transform .3s var(--ease), box-shadow .3s;
}
.feature:hover { transform: translateY(-4px); box-shadow: var(--shadow-sm); }
.feature .ic { width: 44px; height: 44px; flex: none; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.feature .ic svg { width: 22px; height: 22px; }
.feature h3 { font-size: 17px; font-weight: 700; margin-bottom: 6px; color: var(--ink); }
.feature p { color: var(--muted); font-size: 14.5px; }

/* ====================== NEWS / POST CARDS ====================== */
.news-grid, .post-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(18px, 2.4vw, 26px); }
.news-card, .post-card {
    display: flex; flex-direction: column; background: var(--surface);
    border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
    transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .35s;
}
.news-card:hover, .post-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); border-color: color-mix(in srgb, var(--brand) 30%, var(--line)); }
.news-thumb, .post-thumb {
    height: 180px; position: relative; background-size: cover; background-position: center;
    background-image: linear-gradient(135deg, color-mix(in srgb, var(--brand) 22%, var(--surface-2)), color-mix(in srgb, var(--accent) 18%, var(--surface-2)));
}
.news-thumb::after, .post-thumb::after {
    content: ""; position: absolute; inset: 0;
    background: radial-gradient(120% 120% at 80% 0%, rgba(255, 255, 255, .25), transparent 55%);
}
.post-cat, .news-tag {
    position: absolute; left: 14px; top: 14px; z-index: 2;
    background: var(--brand); color: var(--brand-ink); font-size: 12px; font-weight: 600;
    padding: 4px 12px; border-radius: 999px;
}
.news-body, .post-body { padding: clamp(18px, 2vw, 22px); display: flex; flex-direction: column; flex: 1; }
.news-body h3, .post-body h3 { font-size: 17px; font-weight: 700; line-height: 1.45; margin-bottom: 8px; color: var(--ink); }
.news-body p, .post-body p { color: var(--muted); font-size: 14px; flex: 1; }
.news-date, .post-meta { margin-top: 14px; font-size: 13px; color: var(--faint); display: flex; gap: 14px; }
.post-meta { justify-content: space-between; }

.center { text-align: center; margin-top: clamp(32px, 4vw, 44px); }

/* ====================== CTA ====================== */
.cta { position: relative; overflow: hidden; }
.cta-inner {
    position: relative; text-align: center; color: #fff;
    background:
        radial-gradient(80% 120% at 15% 0%, rgba(52, 194, 168, .35), transparent 60%),
        linear-gradient(135deg, #0e3a36, #0d2b34 60%, #103a3f);
    border-radius: var(--radius-lg); padding: clamp(44px, 6vw, 72px) clamp(24px, 5vw, 56px);
    box-shadow: var(--shadow-ink);
}
.cta-inner::before {
    content: ""; position: absolute; inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .05) 1px, transparent 1px);
    background-size: 46px 46px;
    -webkit-mask-image: radial-gradient(70% 90% at 50% 50%, #000, transparent 80%);
    mask-image: radial-gradient(70% 90% at 50% 50%, #000, transparent 80%);
}
.cta-inner > * { position: relative; }
.cta-inner h2 { font-size: clamp(26px, 4vw, 38px); font-weight: 800; margin-bottom: 14px; letter-spacing: -.01em; }
.cta-inner p { color: rgba(255, 255, 255, .82); margin-bottom: 28px; font-size: clamp(15px, 1.7vw, 18px); max-width: 560px; margin-inline: auto; }
.cta-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* ====================== FOOTER ====================== */
.footer { background: #0e0c08; color: rgba(255, 255, 255, .68); padding: clamp(52px, 7vw, 72px) 0 28px; margin-top: auto; }
.footer .cols { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 36px 30px; align-items: start; margin-bottom: 38px; }
.footer .logo { color: #fff; margin-bottom: 14px; }
.footer .desc { font-size: 14px; line-height: 1.7; max-width: 320px; color: rgba(255, 255, 255, .6); }
.footer h5 { color: #fff; font-size: 15px; font-weight: 600; margin-bottom: 16px; }
.footer ul li { margin-bottom: 11px; }
.footer ul a { font-size: 14px; color: rgba(255, 255, 255, .6); transition: color .2s; }
.footer ul a:hover { color: #fff; }
.footer .copy { border-top: 1px solid rgba(255, 255, 255, .1); padding-top: 20px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; font-size: 13px; color: rgba(255, 255, 255, .45); }

/* ====================== INNER PAGE HERO ====================== */
.page-hero {
    position: relative; isolation: isolate; overflow: hidden; color: #fff;
    padding: calc(var(--nav-h) + clamp(44px, 6vw, 70px)) 0 clamp(40px, 5vw, 56px);
    background:
        radial-gradient(90% 80% at 90% 0%, rgba(217, 138, 43, .22), transparent 55%),
        linear-gradient(160deg, #0c2b27, #10343a 70%);
}
.page-hero::before {
    content: ""; position: absolute; inset: 0; z-index: -1;
    background-image:
        linear-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .05) 1px, transparent 1px);
    background-size: 52px 52px;
    -webkit-mask-image: radial-gradient(110% 90% at 75% 10%, #000 25%, transparent 75%);
    mask-image: radial-gradient(110% 90% at 75% 10%, #000 25%, transparent 75%);
}
.page-hero.slim { padding: calc(var(--nav-h) + clamp(30px, 4vw, 46px)) 0 clamp(22px, 3vw, 30px); }
.page-hero h1 { font-size: clamp(28px, 4.4vw, 42px); font-weight: 800; margin: 12px 0 8px; letter-spacing: -.01em; }
.page-hero p { color: rgba(255, 255, 255, .8); max-width: 620px; font-size: clamp(15px, 1.7vw, 18px); }
.crumb { font-size: 14px; color: rgba(255, 255, 255, .65); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.crumb a { color: rgba(255, 255, 255, .8); }
.crumb a:hover { color: #fff; }
.crumb b { font-weight: 600; }

/* ====================== CATEGORY TABS ====================== */
.cat-tabs { display: flex; flex-wrap: wrap; gap: 10px; margin: clamp(28px, 4vw, 40px) 0 8px; }
.cat-tab {
    padding: 9px 18px; border-radius: 999px; font-size: 14px; font-weight: 500;
    background: var(--surface); border: 1px solid var(--line); color: var(--muted);
    transition: all .2s var(--ease);
}
.cat-tab:hover { color: var(--brand); border-color: var(--brand); }
.cat-tab.active { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }

/* ====================== PAGER ====================== */
.pager { margin-top: clamp(32px, 4vw, 44px); display: flex; justify-content: center; }
.pager .pagination { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pager .pagination li { display: inline-flex; }
.pager .pagination a, .pager .pagination span {
    display: inline-grid; place-items: center; min-width: 40px; height: 40px; padding: 0 12px;
    border-radius: 11px; border: 1px solid var(--line); color: var(--muted); font-size: 14px;
    transition: all .2s var(--ease);
}
.pager .pagination a:hover { border-color: var(--brand); color: var(--brand); }
.pager .pagination .active span { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.pager .pagination .disabled span { color: var(--faint); cursor: not-allowed; opacity: .6; }

.empty { text-align: center; color: var(--muted); padding: 70px 0; font-size: 15px; }
.empty .em { font-size: 40px; display: block; margin-bottom: 12px; opacity: .5; }

/* ====================== ARTICLE DETAIL ====================== */
.article-head { margin-bottom: 22px; }
.article-cat { display: inline-block; background: var(--brand-soft); color: var(--brand); font-size: 13px; font-weight: 600; padding: 5px 14px; border-radius: 999px; margin-bottom: 14px; }
.article-head h1 { font-size: clamp(24px, 3.6vw, 34px); font-weight: 800; line-height: 1.35; letter-spacing: -.01em; color: var(--ink); }
.article-meta { display: flex; gap: 18px; margin-top: 14px; font-size: 14px; color: var(--faint); flex-wrap: wrap; }
.article-cover {
    height: clamp(220px, 34vw, 380px); border-radius: var(--radius); margin: 8px 0 32px;
    background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 22%, var(--surface-2)), color-mix(in srgb, var(--accent) 18%, var(--surface-2)));
    background-size: cover; background-position: center;
}
.article-content { font-size: 16.5px; color: var(--ink-soft); line-height: 1.9; }
.article-content h1, .article-content h2, .article-content h3 { margin: 30px 0 12px; line-height: 1.4; color: var(--ink); font-weight: 700; }
.article-content h2 { font-size: 24px; } .article-content h3 { font-size: 20px; }
.article-content p { margin-bottom: 16px; }
.article-content img { border-radius: 12px; margin: 18px 0; max-width: 100%; }
.article-content ul, .article-content ol { margin: 0 0 16px 22px; }
.article-content li { margin-bottom: 8px; }
.article-content blockquote { margin: 18px 0; padding: 12px 18px; border-left: 4px solid var(--brand); background: var(--surface-2); border-radius: 0 10px 10px 0; color: var(--muted); }
.article-content pre { background: #0f0d09; color: #e7e2d6; padding: 16px; border-radius: 12px; overflow: auto; font-size: 14px; margin: 16px 0; }
.back-link { display: inline-flex; align-items: center; gap: 6px; margin-top: 30px; color: var(--brand); font-weight: 600; }
.back-link:hover { gap: 10px; }

/* ====================== ABOUT ====================== */
.about-wrap { display: grid; grid-template-columns: 1.4fr 1fr; gap: clamp(30px, 4vw, 52px); align-items: start; }
.about-text h2 { font-size: clamp(24px, 3.4vw, 32px); font-weight: 800; margin: 10px 0 18px; line-height: 1.35; letter-spacing: -.01em; color: var(--ink); }
.about-text p { color: var(--muted); margin-bottom: 16px; font-size: 16px; }
.about-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.about-stats .stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; text-align: center; box-shadow: var(--shadow-sm); }
.about-stats .stat strong { display: block; font-size: clamp(22px, 2.6vw, 28px); color: var(--brand); font-weight: 800; font-variant-numeric: tabular-nums; }
.about-stats .stat span { font-size: 13px; color: var(--muted); }

.about-contact { display: grid; grid-template-columns: 1.3fr 1fr; gap: clamp(28px, 4vw, 44px); align-items: center; }
.about-contact h2 { font-size: clamp(24px, 3.4vw, 32px); font-weight: 800; margin: 10px 0 14px; color: var(--ink); }
.about-contact p { color: var(--muted); font-size: 16px; }
.contact-list { margin-top: 20px; }
.contact-list li { padding: 11px 0; border-bottom: 1px dashed var(--line); color: var(--muted); font-size: 15px; }
.contact-list b { color: var(--ink); margin-right: 6px; }
.contact-card {
    background: linear-gradient(150deg, #0e3a36, #0d2b34 70%, #103a3f); color: #fff;
    border-radius: var(--radius); padding: clamp(26px, 3vw, 34px); box-shadow: var(--shadow-ink);
}
.contact-card h3 { font-size: 20px; margin-bottom: 10px; }
.contact-card p { color: rgba(255, 255, 255, .8); margin-bottom: 18px; font-size: 15px; }

/* ====================== REVEAL ANIMATION ====================== */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s var(--ease), transform .7s var(--ease); transition-delay: calc(var(--i, 0) * 90ms); }
.reveal.in { opacity: 1; transform: none; }
.reveal-left { opacity: 0; transform: translateX(-30px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal-left.in { opacity: 1; transform: none; }
.reveal-right { opacity: 0; transform: translateX(30px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal-right.in { opacity: 1; transform: none; }

/* staggered reveal for grid children (framework-independent) */
.grid-3 .card:nth-child(3n+2),
.news-grid .news-card:nth-child(3n+2),
.post-grid .post-card:nth-child(3n+2) { transition-delay: .09s; }
.grid-3 .card:nth-child(3n+3),
.news-grid .news-card:nth-child(3n+3),
.post-grid .post-card:nth-child(3n+3) { transition-delay: .18s; }
.grid-2 .feature:nth-child(2) { transition-delay: .09s; }
.steps .step:nth-child(2) { transition-delay: .09s; }
.steps .step:nth-child(3) { transition-delay: .18s; }

/* ====================== RESPONSIVE ====================== */
@media (max-width: 980px) {
    .hero-inner { grid-template-columns: 1fr; gap: 44px; }
    .hero-visual { max-width: 420px; margin-inline: auto; }
    .grid-3, .news-grid, .post-grid { grid-template-columns: repeat(2, 1fr); }
    .steps { grid-template-columns: 1fr; gap: 30px; }
    .step:not(:last-child)::after { display: none; }
    .footer .cols { grid-template-columns: repeat(3, 1fr); }
    .footer .brand { grid-column: 1 / -1; }
    .about-wrap, .about-contact { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
    .nav-links, .nav-right .btn-ghost { display: none; }
    .hamburger { display: flex; }
    .stats-inner { grid-template-columns: repeat(2, 1fr); }
    .stats-inner .cell:nth-child(2) { border-right: none; }
    .stats-inner .cell:nth-child(1), .stats-inner .cell:nth-child(2) { border-bottom: 1px solid var(--line); }
}
@media (max-width: 560px) {
    .grid-3, .news-grid, .post-grid, .grid-2 { grid-template-columns: 1fr; }
    .footer .cols { grid-template-columns: 1fr; gap: 26px; }
    .footer .brand { grid-column: auto; }
    .footer .copy { flex-direction: column; }
    .about-stats { grid-template-columns: 1fr 1fr; }
    .hero-actions .btn, .cta-actions .btn { flex: 1; }
    .float-chip { display: none; }
}

/* ====================== REDUCED MOTION ====================== */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
    .reveal, .reveal-left, .reveal-right { opacity: 1 !important; transform: none !important; }
    #heroCanvas { display: none; }
}
