:root {
    --bg: #f4efe8;
    --bg-card: #ede8e0;
    --accent: #c4622d;
    --accent-hover: rgba(196, 98, 45, 0.09);
    --text: #1c1714;
    --text-body: #3a3028;
    --text-dim: #8a7a6e;
    --border: #dcd6cc;
    --glass: rgba(255, 255, 255, 0.65);
    --input-bg: #fff;
    --transition: all 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --hero-photo-opacity: 0.5;
}

/* ── Dark mode: system preference ── */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #1a1512;
        --bg-card: #231e1a;
        --text: #f0ebe4;
        --text-body: #c8bfb5;
        --text-dim: #7a6e64;
        --border: #312b25;
        --glass: rgba(0, 0, 0, 0.5);
        --input-bg: #1a1512;
        --accent-hover: rgba(196, 98, 45, 0.14);
        --hero-photo-opacity: 0.7;
    }
}

/* ── Dark mode: explicit toggle ── */
[data-theme="dark"] {
    --bg: #1a1512;
    --bg-card: #231e1a;
    --text: #f0ebe4;
    --text-body: #c8bfb5;
    --text-dim: #7a6e64;
    --border: #312b25;
    --glass: rgba(0, 0, 0, 0.5);
    --input-bg: #1a1512;
    --accent-hover: rgba(196, 98, 45, 0.14);
    --hero-photo-opacity: 0.22;
}

* { box-sizing: border-box; }
body, html { margin: 0; padding: 0; background: var(--bg); color: var(--text); font-family: 'DM Sans', sans-serif; line-height: 1.7; overflow-x: hidden; }

/* LAYOUT */
.container { max-width: 1100px; margin: 0 auto; padding: 0 30px; width: 100%; }

/* ─────────────────────────────────────────
   SITE HEADER
───────────────────────────────────────── */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    height: 54px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
}

.monogram {
    font-family: 'Fraunces', serif;
    font-weight: 900;
    font-size: 1.25rem;
    color: var(--text);
    text-decoration: none;
    letter-spacing: -1px;
}

.site-nav { display: flex; gap: 28px; align-items: center; flex-wrap: wrap; }
.site-nav a {
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--text-dim);
    text-decoration: none;
    transition: var(--transition);
}
.site-nav a:hover { color: var(--accent); }

.site-nav .nav-back {
    font-size: 0.82rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: none;
    color: var(--text);
    border: 1px solid var(--border);
    padding: 5px 14px;
    border-radius: 20px;
    transition: var(--transition);
}
.site-nav .nav-back:hover {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--accent-hover);
}

/* ── Dark mode toggle ── */
.theme-toggle {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-dim);
    cursor: pointer;
    width: 34px;
    height: 34px;
    border-radius: 17px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    transition: var(--transition);
    padding: 0;
    flex-shrink: 0;
}
.theme-toggle:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-hover);
}
.theme-toggle .icon-moon { display: inline; }
.theme-toggle .icon-sun  { display: none; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun  { display: inline; }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
    :root:not([data-theme="light"]) .theme-toggle .icon-sun  { display: inline; }
}

/* ─────────────────────────────────────────
   HERO
───────────────────────────────────────── */
.hero {
    position: relative;
    height: 68vh;
    min-height: 420px;
    display: flex;
    align-items: center;
    background: var(--bg);
    overflow: hidden;
}

.hero-photo {
    position: absolute;
    top: 0;
    right: 0;
    width: 48%;
    height: 100%;
    background: url('src/mikko-seppala.webp') no-repeat center top / cover;
    opacity: var(--hero-photo-opacity, 0.16);
    filter: sepia(0.4) saturate(0.7);
    mask-image: linear-gradient(to left, black 30%, transparent 100%);
    -webkit-mask-image: linear-gradient(to left, black 30%, transparent 100%);
}

.hero-inner {
    position: relative;
    z-index: 10;
    max-width: 60%;
}

.hero h1 {
    font-family: 'Fraunces', serif;
    font-size: clamp(4rem, 11vw, 8.5rem);
    font-weight: 900;
    margin: 0;
    letter-spacing: -4px;
    line-height: 0.85;
    color: var(--text);
}

.hero-desc {
    margin: 22px 0 0;
    font-size: 0.88rem;
    color: var(--text-dim);
    font-weight: 300;
    letter-spacing: 0.5px;
}

/* Global h1 (post page) */
h1 {
    font-family: 'Fraunces', serif;
    font-weight: 900;
    margin: 0;
    color: var(--text);
}

/* ─────────────────────────────────────────
   TWO-COLUMN EDITORIAL SPLIT
───────────────────────────────────────── */
.site-split {
    display: grid;
    grid-template-columns: 1fr 360px;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 30px;
    position: relative;
}

.site-split::before {
    content: '';
    position: absolute;
    top: -70px;
    left: 0;
    right: 0;
    height: 70px;
    background: linear-gradient(to bottom, transparent, var(--bg));
    pointer-events: none;
    z-index: 2;
}

.col-journal {
    padding: 60px 48px 80px 0;
    border-right: 1px solid var(--border);
}

.col-vibes {
    padding: 60px 0 80px 48px;
}

.section-label {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--accent);
    font-weight: 500;
    margin: 0 0 28px;
    display: block;
}

/* ─────────────────────────────────────────
   JOURNAL ENTRIES
───────────────────────────────────────── */
.journal-entry {
    display: block;
    padding: 30px 0;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

.journal-entry:hover .journal-title {
    color: var(--accent);
    transform: translateX(6px);
}

.journal-meta {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 10px;
}

.journal-date {
    font-size: 0.68rem;
    color: var(--text-dim);
    font-weight: 500;
    letter-spacing: 1.5px;
}

.journal-tags {
    font-size: 0.68rem;
    color: var(--accent);
    font-weight: 500;
    letter-spacing: 1px;
}

.journal-title {
    font-family: 'Fraunces', serif;
    font-size: clamp(1.8rem, 3vw, 2.6rem);
    font-weight: 700;
    letter-spacing: -0.5px;
    line-height: 1.08;
    margin: 0;
    transition: color 0.3s ease, transform 0.3s ease;
}

/* ─────────────────────────────────────────
   PROJECT CARDS (vibes column — single col)
───────────────────────────────────────── */
#project-grid { display: flex; flex-direction: column; gap: 16px; }

.card-wrap {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border);
    transition: var(--transition);
}
.card-wrap:hover {
    border-color: var(--accent);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(196, 98, 45, 0.1);
}
.card-wrap:hover .card-image { opacity: 1; }

.card {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
}

.card-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    background-color: var(--border);
    background-position: center;
    background-size: cover;
    opacity: 0.85;
    transition: var(--transition);
    border-bottom: 1px solid var(--border);
}

.card h3 {
    margin: 0;
    padding: 14px 18px 10px;
    font-size: 0.82rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-weight: 500;
    color: var(--text);
    font-family: 'DM Sans', sans-serif;
}

.card-post-link {
    display: block;
    padding: 11px 18px;
    border-top: 1px solid var(--border);
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--accent);
    text-decoration: none;
    transition: var(--transition);
}
.card-post-link:hover { letter-spacing: 2px; }

/* ─────────────────────────────────────────
   PROJECT TAG OVERLAY
───────────────────────────────────────── */
.card-image-wrapper { position: relative; }
.card-tags { position: absolute; bottom: 10px; left: 10px; display: flex; gap: 5px; flex-wrap: wrap; z-index: 1; }
.tag-badge {
    background: rgba(28, 23, 20, 0.72);
    color: #fff;
    font-size: 0.62rem;
    font-weight: 500;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 3px;
    backdrop-filter: blur(4px);
}

/* ─────────────────────────────────────────
   TYPE FILTER
───────────────────────────────────────── */
.type-filter { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; }
.filter-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-dim);
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    padding: 6px 14px;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}
.filter-btn:hover { border-color: var(--accent); color: var(--accent); }
.filter-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ─────────────────────────────────────────
   SITE FOOTER
───────────────────────────────────────── */
.site-footer {
    padding: 22px 30px;
    border-top: 1px solid var(--border);
    font-size: 0.7rem;
    color: var(--text-dim);
    letter-spacing: 1px;
    text-transform: uppercase;
    max-width: 1100px;
    margin: 0 auto;
}

/* ─────────────────────────────────────────
   SCROLL REVEAL
───────────────────────────────────────── */
.reveal { opacity: 0; transform: translateY(30px); transition: var(--transition); }
.reveal.active { opacity: 1; transform: translateY(0); }


/* ─────────────────────────────────────────
   EDITOR INPUTS
───────────────────────────────────────── */
input, textarea {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 16px 18px;
    border-radius: 6px;
    font-family: inherit;
    font-size: 1rem;
    margin-bottom: 22px;
    outline: none;
    transition: var(--transition);
}
input:focus, textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-hover);
}

/* ─────────────────────────────────────────
   POST PAGE
───────────────────────────────────────── */
.post-hero {
    height: 52vh;
    min-height: 360px;
    display: flex;
    align-items: flex-end;
    padding-bottom: 60px;
    background: #0e0b09;
    position: relative;
    overflow: hidden;
}

.post-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    background: linear-gradient(to bottom, rgba(14,11,9,0.2) 0%, transparent 40%, rgba(14,11,9,0.75) 80%, #0e0b09 100%);
    pointer-events: none;
}

.post-hero-img {
    position: absolute;
    inset: 0;
    background-image: none;
    background-repeat: no-repeat;
    background-position: center center;
    background-size: cover;
    opacity: 0.3;
    filter: grayscale(0.6) sepia(0.2);
}

.post-hero .container { position: relative; z-index: 10; }
.post-hero-inner { position: relative; z-index: 10; }
.post-hero-label {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: rgba(196, 98, 45, 0.85);
    font-weight: 500;
    margin: 0 0 16px;
}

.section-title {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--accent);
    margin-bottom: 28px;
    display: block;
    font-weight: 500;
}

.post-hero h1 {
    font-family: 'Fraunces', serif;
    font-size: clamp(2.5rem, 7vw, 5rem);
    color: #f4efe8;
    letter-spacing: -2px;
    line-height: 0.9;
}
.post-tags { color: rgba(196, 98, 45, 0.85); font-weight: 500; margin-top: 18px; font-size: 0.8rem; letter-spacing: 1px; text-transform: uppercase; }

.post-project-callout {
    max-width: 680px;
    margin: 0 auto;
    padding: 24px 25px 24px 22px;
    border-bottom: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    display: flex;
    align-items: center;
    gap: 20px;
}
.post-project-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--accent);
    font-weight: 500;
    white-space: nowrap;
}
.post-project-title {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text);
    text-decoration: none;
    transition: var(--transition);
}
.post-project-title:hover { color: var(--accent); }

.post-content {
    font-family: 'DM Sans', sans-serif;
    max-width: 680px;
    margin: 0 auto;
    padding: 80px 25px 100px;
    font-size: 1.15rem;
    line-height: 1.95;
    color: var(--text-body);
}
.post-content p { margin-bottom: 2.2rem; }
.post-content p:first-child {
    font-size: 1.3rem;
    color: var(--text);
    border-left: 3px solid var(--accent);
    padding-left: 18px;
    margin-left: -21px;
}
.post-content h2 { font-family: 'Fraunces', serif; font-size: 1.7rem; font-weight: 700; color: var(--text); margin: 2.5rem 0 0.6rem; line-height: 1.2; }
.post-content h3 { font-family: 'Fraunces', serif; font-size: 1.25rem; font-weight: 700; color: var(--text); margin: 2rem 0 0.5rem; }
.post-content ul, .post-content ol { padding-left: 1.4em; margin-bottom: 2rem; }
.post-content li { margin-bottom: 0.5rem; line-height: 1.7; }
.post-content blockquote { border-left: 3px solid var(--accent); margin: 0 0 2rem; padding: 4px 0 4px 18px; color: var(--text-dim); font-style: italic; }
.post-content blockquote p { font-size: inherit; border-left: none; padding-left: 0; margin-left: 0; }
.post-content code { font-family: monospace; background: var(--bg-card); border: 1px solid var(--border); border-radius: 3px; padding: 1px 5px; font-size: 0.88em; }
.post-content pre { background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px; padding: 20px; overflow-x: auto; margin-bottom: 2rem; }
.post-content pre code { background: none; border: none; padding: 0; font-size: 0.9rem; }
.post-content a { color: var(--accent); text-decoration: underline; }

/* ─────────────────────────────────────────
   RESPONSIVE
───────────────────────────────────────── */
@media (max-width: 768px) {
    /* Header */
    .site-header { padding: 0 20px; }
    .site-nav { gap: 14px; }
    .site-nav a { font-size: 0.65rem; }

    /* Hero */
    .hero { height: auto; min-height: unset; padding: 60px 0 52px; }
    .hero-photo { width: 65%; opacity: 0.4; }
    .hero-inner { max-width: 100%; }
    .hero h1 { font-size: clamp(3.5rem, 15vw, 6rem); letter-spacing: -2px; }

    /* Split */
    .site-split { grid-template-columns: 1fr; padding: 0 20px; }
    .col-journal { padding: 40px 0 50px; border-right: none; border-bottom: 1px solid var(--border); }
    .col-vibes { padding: 40px 0 60px; }

    /* Journal */
    .journal-title { font-size: clamp(1.5rem, 7vw, 2rem); }

    /* Back nav */
    .site-nav .nav-back { font-size: 0.75rem; padding: 4px 12px; }

    /* Footer */
    .site-footer { padding: 18px 20px; }

    /* Post */
    .post-hero { padding-bottom: 40px; }
    .post-content { padding: 50px 20px 70px; font-size: 1.05rem; }
    .post-content p:first-child { font-size: 1.15rem; }
}
