@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600;9..144,700;9..144,800&family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* ══════════════════════════════════════
   TOKENS — Light (default) + Dark
   Editorial cobalt/navy system.
══════════════════════════════════════ */
:root {
    color-scheme: light;

    /* Neutrals — cool, blue-tinted greys rather than true grey */
    --ink: #101728;
    --ink-soft: #4C566E;
    --ink-faint: #8892A6;

    --paper: #F4F6FB;
    --paper-raised: #FFFFFF;
    --paper-sunken: #EAEEF6;
    --line: #DCE2EE;
    --line-strong: #C6CEE0;

    /* Brand — cobalt family, one supporting teal */
    --brand-900: #0B1E45;
    --brand-700: #1B3E8C;
    --brand-600: #2955C4;
    --brand-500: #3866DE;
    --brand-400: #6F8FEE;
    --brand-tint: #E7ECFB;
    --brand-tint-strong: #D2DCF7;

    --teal-600: #0E7C86;
    --teal-tint: #DFF1F0;

    --surface: var(--paper-raised);
    --surface-alt: var(--paper-sunken);
    --text: var(--ink);
    --text-soft: var(--ink-soft);
    --text-faint: var(--ink-faint);
    --bg: var(--paper);
    --border: var(--line);
    --border-strong: var(--line-strong);

    --accent: var(--brand-500);
    --accent-hover: var(--brand-700);
    --accent-ink: #FFFFFF;
    --accent-tint: var(--brand-tint);
    --accent-tint-strong: var(--brand-tint-strong);

    --header-bg: rgba(244, 246, 251, 0.82);
    --scrim-1: rgba(11, 30, 69, 0.94);
    --scrim-2: rgba(11, 30, 69, 0.55);
    --scrim-3: rgba(11, 30, 69, 0.12);

    --display: 'Fraunces', Georgia, serif;
    --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --mono: 'JetBrains Mono', 'Courier New', monospace;

    --radius-sm: 8px;
    --radius: 14px;
    --radius-lg: 20px;
    --radius-pill: 999px;
    --max: 1180px;

    --shadow-sm: 0 1px 2px rgba(16, 27, 60, 0.05), 0 1px 1px rgba(16, 27, 60, 0.04);
    --shadow: 0 10px 28px rgba(20, 33, 74, 0.09), 0 2px 8px rgba(20, 33, 74, 0.05);
    --shadow-lg: 0 26px 64px rgba(15, 26, 61, 0.22), 0 8px 20px rgba(15, 26, 61, 0.10);

    --ease: 340ms cubic-bezier(0.22, 1, 0.36, 1);
    --ease-fast: 160ms cubic-bezier(0.4, 0, 0.2, 1);
    --ease-theme: 420ms cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
    color-scheme: dark;

    --ink: #EAEEF8;
    --ink-soft: #AEB8CE;
    --ink-faint: #74809A;

    --paper: #0A1120;
    --paper-raised: #101A30;
    --paper-sunken: #0D1526;
    --line: #22304C;
    --line-strong: #2E3F62;

    --brand-900: #0B1E45;
    --brand-700: #A9C0FF;
    --brand-600: #86A6F8;
    --brand-500: #6E8FF0;
    --brand-400: #5877CE;
    --brand-tint: #16223F;
    --brand-tint-strong: #1C2C50;

    --teal-600: #4FC2C4;
    --teal-tint: #103534;

    --surface: var(--paper-raised);
    --surface-alt: var(--paper-sunken);
    --text: var(--ink);
    --text-soft: var(--ink-soft);
    --text-faint: var(--ink-faint);
    --bg: var(--paper);
    --border: var(--line);
    --border-strong: var(--line-strong);

    --accent: var(--brand-500);
    --accent-hover: var(--brand-600);
    --accent-ink: #08122A;
    --accent-tint: var(--brand-tint);
    --accent-tint-strong: var(--brand-tint-strong);

    --header-bg: rgba(10, 17, 32, 0.80);
    --scrim-1: rgba(5, 10, 22, 0.96);
    --scrim-2: rgba(5, 10, 22, 0.68);
    --scrim-3: rgba(5, 10, 22, 0.18);

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.24);
    --shadow: 0 10px 28px rgba(0, 0, 0, 0.38), 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 30px 70px rgba(0, 0, 0, 0.55), 0 10px 24px rgba(0, 0, 0, 0.3);
}

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

html { scroll-behavior: smooth; }

body {
    font-family: var(--sans);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    font-size: 1rem;
    -webkit-font-smoothing: antialiased;
    transition: background var(--ease-theme), color var(--ease-theme);
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { font: inherit; cursor: pointer; }

.container {
    width: 100%;
    max-width: var(--max);
    margin-inline: auto;
    padding-inline: 1.75rem;
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 4px;
}

/* ══════════════════════════════════════
   SHARED — stamps, buttons, eyebrows
══════════════════════════════════════ */
.stamp {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-family: var(--mono);
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    font-weight: 600;
    padding: 0.32rem 0.75rem 0.32rem 0.6rem;
    border-radius: var(--radius-sm);
    border: 1px solid currentColor;
}

.stamp::before {
    content: '';
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}

.stamp--hero {
    color: #DCE7FF;
    background: rgba(110, 143, 240, 0.16);
    border-color: rgba(220, 231, 255, 0.4);
}

.stamp--card {
    color: var(--teal-600);
    background: var(--teal-tint);
    border-color: transparent;
}

.eyebrow {
    font-family: var(--mono);
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    color: var(--text-soft);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin-bottom: 2.25rem;
}

.eyebrow::before {
    content: '';
    width: 18px;
    height: 2px;
    background: var(--accent);
    border-radius: 1px;
    flex-shrink: 0;
}

.eyebrow::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: 0.005em;
    padding: 0.85rem 1.55rem;
    border-radius: var(--radius-sm);
    transition: background var(--ease-fast), transform var(--ease-fast), box-shadow var(--ease-fast), color var(--ease-fast), border-color var(--ease-fast);
    border: 1px solid transparent;
}

.btn svg { transition: transform var(--ease-fast); flex-shrink: 0; }
.btn:hover svg { transform: translateX(3px); }

.btn--primary {
    background: var(--accent);
    color: var(--accent-ink);
    box-shadow: 0 12px 26px rgba(41, 85, 196, 0.28);
}
.btn--primary:hover { background: var(--accent-hover); transform: translateY(-2px); box-shadow: 0 16px 32px rgba(41, 85, 196, 0.34); }
.btn--primary:active { transform: translateY(0); }

.btn--ghost {
    color: var(--accent);
    font-size: 0.82rem;
    letter-spacing: 0.01em;
    padding: 0;
}
.btn--ghost:hover { color: var(--accent-hover); }

/* ══════════════════════════════════════
   THEME TOGGLE
══════════════════════════════════════ */
.theme-toggle {
    position: relative;
    width: 52px;
    height: 30px;
    border-radius: var(--radius-pill);
    background: var(--surface-alt);
    border: 1px solid var(--border-strong);
    display: inline-flex;
    align-items: center;
    padding: 3px;
    flex-shrink: 0;
    transition: background var(--ease-fast), border-color var(--ease-fast);
}

.theme-toggle:hover { border-color: var(--accent); }

.theme-toggle-knob {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-ink);
    transform: translateX(0);
    transition: transform var(--ease-theme), background var(--ease-fast);
    box-shadow: var(--shadow-sm);
}

[data-theme="dark"] .theme-toggle-knob { transform: translateX(22px); }

.theme-toggle-knob svg { width: 13px; height: 13px; }
.theme-toggle-knob .icon-sun { display: block; }
.theme-toggle-knob .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle-knob .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle-knob .icon-moon { display: block; }

/* ══════════════════════════════════════
   HEADER
══════════════════════════════════════ */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--header-bg);
    backdrop-filter: blur(16px) saturate(160%);
    -webkit-backdrop-filter: blur(16px) saturate(160%);
    border-bottom: 1px solid var(--border);
    transition: background var(--ease-theme), border-color var(--ease-theme);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    height: 76px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.logo-mark {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: linear-gradient(155deg, var(--brand-600), var(--brand-900));
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08);
}

.logo-mark svg { width: 17px; height: 17px; }

.logo-word {
    font-family: var(--display);
    font-size: 1.4rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--text);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-left: auto;
}

.nav-list {
    display: flex;
    gap: 0.15rem;
    align-items: center;
}

.nav-list a {
    font-size: 0.87rem;
    font-weight: 600;
    color: var(--text-soft);
    padding: 0.55rem 0.95rem;
    border-radius: var(--radius-sm);
    transition: color var(--ease-fast), background var(--ease-fast);
}

.nav-list a:hover { color: var(--text); background: var(--surface-alt); }

.nav-list a[aria-current="page"] {
    color: var(--accent);
    background: var(--accent-tint);
}

.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: var(--surface);
    border: 1px solid var(--border);
    cursor: pointer;
    padding: 10px;
    border-radius: var(--radius-sm);
    transition: background var(--ease-fast), border-color var(--ease-fast);
}

.hamburger:hover { background: var(--surface-alt); }

.hamburger span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: transform var(--ease-fast), opacity var(--ease-fast);
}

.hamburger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.hamburger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-nav {
    display: none;
    background: var(--surface);
    border-top: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
}

.mobile-nav.is-open { display: block; animation: dropIn var(--ease); }

@keyframes dropIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.mobile-nav ul { display: flex; flex-direction: column; padding: 1rem 1.75rem 1.5rem; gap: 0.25rem; }

.mobile-nav a {
    display: block;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-soft);
    border-radius: var(--radius-sm);
    transition: color var(--ease-fast), background var(--ease-fast);
}

.mobile-nav a:hover { color: var(--text); background: var(--surface-alt); }
.mobile-nav a[aria-current="page"] { color: var(--accent); }

/* ══════════════════════════════════════
   HERO — carousel
══════════════════════════════════════ */
.hero {
    position: relative;
    overflow: hidden;
    background: var(--brand-900);
    color: var(--paper);
}

.hero-track {
    position: relative;
    min-height: 600px;
}

.hero-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    transform: scale(1.03);
    transition: opacity 700ms var(--ease), transform 900ms var(--ease), visibility 0s 700ms;
    display: flex;
    align-items: center;
}

.hero-slide.is-active {
    position: relative;
    opacity: 1;
    visibility: visible;
    transform: scale(1);
    transition: opacity 700ms var(--ease), transform 900ms var(--ease);
}

.hero-slide-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    filter: saturate(0.92);
}

.hero-slide-scrim {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, var(--scrim-1) 10%, var(--scrim-2) 44%, var(--scrim-3) 78%),
        linear-gradient(0deg, rgba(6, 14, 32, 0.45), transparent 42%);
}

.hero-slide-inner {
    position: relative;
    max-width: 620px;
    padding-block: 6rem;
}

.hero-slide .stamp { margin-bottom: 1.5rem; }

.hero-headline {
    font-family: var(--display);
    font-size: clamp(2.05rem, 4.2vw, 3.25rem);
    line-height: 1.1;
    font-weight: 600;
    letter-spacing: -0.01em;
    margin-bottom: 1.35rem;
    color: #F6F8FE;
}

.hero-desc {
    font-size: 1.04rem;
    line-height: 1.75;
    color: #C3CEE8;
    margin-bottom: 2.1rem;
    max-width: 50ch;
}

.hero-controls {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    pointer-events: none;
    padding-block: 6rem;
}

.hero-arrow {
    pointer-events: auto;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(246, 248, 254, 0.08);
    border: 1px solid rgba(246, 248, 254, 0.22);
    color: #F6F8FE;
    font-size: 1.35rem;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(6px);
    transition: background var(--ease-fast), transform var(--ease-fast), border-color var(--ease-fast);
}

.hero-arrow:hover { background: rgba(246, 248, 254, 0.18); border-color: rgba(246,248,254,0.45); transform: translateY(-1px); }

.hero-dots {
    pointer-events: auto;
    position: absolute;
    left: 50%;
    bottom: 2.6rem;
    transform: translateX(-50%);
    display: flex;
    gap: 0.6rem;
}

.hero-dot {
    width: 26px;
    height: 3px;
    border-radius: 2px;
    background: rgba(246, 248, 254, 0.25);
    border: none;
    transition: background var(--ease-fast);
}

.hero-dot.is-active { background: var(--brand-400); }

.hero-progress {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 2px;
    background: rgba(246, 248, 254, 0.1);
}

.hero-progress-bar {
    height: 100%;
    width: 0%;
    background: var(--brand-400);
}

.hero-progress-bar.is-animating { transition: width 6s linear; width: 100%; }

/* ══════════════════════════════════════
   MAIN LAYOUT
══════════════════════════════════════ */
.site-main { padding: 5.5rem 0 6.5rem; }

.main-grid {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 4.5rem;
    align-items: start;
}

/* ── Post list: reading path device ── */
.posts-list {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
}

.posts-list::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 10px;
    bottom: 10px;
    width: 0;
    border-left: 2px dotted var(--border-strong);
}

.post-card {
    position: relative;
    display: grid;
    grid-template-columns: 216px 1fr;
    gap: 1.75rem;
    padding: 1.4rem;
    padding-left: 3.25rem;
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    transition: box-shadow var(--ease-fast), transform var(--ease-fast), border-color var(--ease-fast), background var(--ease-theme);
}

.post-card::before {
    content: '';
    position: absolute;
    left: 9px;
    top: 2.05rem;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: var(--surface);
    border: 2px solid var(--accent);
    z-index: 1;
    transition: background var(--ease-theme);
}

.post-card:hover {
    box-shadow: var(--shadow);
    transform: translateY(-3px);
    border-color: var(--accent-tint-strong);
}

.post-thumb {
    width: 216px;
    height: 148px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--surface-alt);
    flex-shrink: 0;
}

.post-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 500ms var(--ease);
}

.post-card:hover .post-thumb img { transform: scale(1.05); }

.post-meta { margin-bottom: 0.85rem; }

.post-title {
    font-family: var(--display);
    font-size: 1.28rem;
    line-height: 1.32;
    font-weight: 600;
    margin-bottom: 0.6rem;
    letter-spacing: -0.005em;
    color: var(--text);
}

.post-title a { transition: color var(--ease-fast); }
.post-title a:hover { color: var(--accent); }

.post-excerpt {
    font-size: 0.91rem;
    color: var(--text-soft);
    line-height: 1.7;
    margin-bottom: 1.1rem;
    max-width: 54ch;
}

.read-more {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-family: var(--mono);
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    color: var(--accent);
    transition: gap var(--ease-fast), color var(--ease-fast);
}

.read-more:hover { gap: 0.6rem; color: var(--accent-hover); }

/* ── Sidebar ── */
.sidebar { position: sticky; top: 106px; }

.sidebar-block {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.75rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: background var(--ease-theme), border-color var(--ease-theme);
}

.sidebar-block:last-child { margin-bottom: 0; }

.sidebar-title {
    font-family: var(--display);
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    color: var(--text);
}

.category-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.category-list a {
    display: inline-flex;
    align-items: center;
    font-family: var(--mono);
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--text-soft);
    background: var(--surface-alt);
    border: 1px solid var(--border);
    padding: 0.48rem 0.85rem;
    border-radius: var(--radius-sm);
    transition: color var(--ease-fast), background var(--ease-fast), border-color var(--ease-fast);
}

.category-list a:hover {
    color: var(--accent);
    background: var(--accent-tint);
    border-color: var(--accent-tint-strong);
}

/* ══════════════════════════════════════
   FOOTER
══════════════════════════════════════ */
.site-footer {
    background: var(--brand-900);
    color: #A6B4D6;
    padding: 4rem 0 2.25rem;
    transition: background var(--ease-theme);
}

[data-theme="dark"] .site-footer { background: #060B18; }

.footer-inner {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 2rem;
    align-items: end;
    padding-bottom: 2.25rem;
    border-bottom: 1px solid rgba(166, 180, 214, 0.14);
    margin-bottom: 1.75rem;
}

.footer-brand .logo-word { color: #F6F8FE; }
.footer-brand .logo-mark { background: linear-gradient(155deg, var(--brand-400), var(--brand-600)); }

.footer-brand p {
    font-size: 0.87rem;
    max-width: 320px;
    line-height: 1.7;
    margin-top: 0.85rem;
    color: #8492B5;
}

.social-links { display: flex; gap: 0.65rem; align-items: center; }

.social-link {
    width: 40px;
    height: 40px;
    border: 1px solid rgba(166, 180, 214, 0.18);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #A6B4D6;
    background: rgba(246, 248, 254, 0.03);
    transition: border-color var(--ease-fast), color var(--ease-fast), background var(--ease-fast), transform var(--ease-fast);
}

.social-link:hover {
    border-color: var(--brand-400);
    color: #F6F8FE;
    background: rgba(110, 143, 240, 0.16);
    transform: translateY(-2px);
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    font-family: var(--mono);
    color: #5E6C8F;
}

.footer-nav { display: flex; gap: 1.75rem; }
.footer-nav a { color: #8492B5; transition: color var(--ease-fast); }
.footer-nav a:hover { color: #F6F8FE; }

/* ══════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════ */
@media (max-width: 960px) {
    .hero-track { min-height: 560px; }
    .hero-slide-inner { padding-block: 4.5rem; }
    .hero-controls { padding-block: 4.5rem; }
}

@media (max-width: 860px) {
    .main-grid { grid-template-columns: 1fr; }
    .sidebar { position: static; }
    .hamburger { display: flex; }
    .main-nav { display: none; }
    .hero-slide-inner { max-width: 100%; }
    .hero-slide-scrim {
        background:
            linear-gradient(0deg, var(--scrim-1) 32%, var(--scrim-2) 72%),
            linear-gradient(180deg, rgba(6,14,32,0.5), transparent 40%);
    }
}

@media (max-width: 600px) {
    .header-inner { height: 68px; }
    .post-card {
        grid-template-columns: 1fr;
        padding-left: 1.5rem;
    }
    .post-card::before { display: none; }
    .posts-list::before { display: none; }
    .post-thumb { width: 100%; height: 190px; }

    .hero-track { min-height: 500px; }
    .hero-arrow { width: 38px; height: 38px; }
    .hero-headline { font-size: 1.78rem; }
    .hero-dots { bottom: 2.1rem; }

    .footer-inner { grid-template-columns: 1fr; gap: 1.75rem; }
    .footer-bottom { flex-direction: column; gap: 1rem; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; }
    .hero-slide { transition: opacity 300ms linear !important; transform: none !important; }
}
