:root {
    /* Warm charcoal palette — single CSS variable swap to retheme. */
    --bg: #f8f6f1;
    --bg-elev: #ffffff;
    --text: #1f1d1a;
    --text-muted: #6e6a64;
    --border: #e6e1d6;
    --accent: #3a3530;
    --accent-soft: rgba(58, 53, 48, 0.08);
    --accent-glow: rgba(58, 53, 48, 0.14);

    --intro-width: 620px;
    --cards-width: 400px;
    --page-width: 960px;
    --nav-height: 3.5rem;
    --footer-height: 3.25rem;

    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 2rem;
    --space-lg: 4rem;

    --shadow-soft: 0 1px 2px rgba(31, 29, 26, 0.04), 0 8px 24px rgba(31, 29, 26, 0.06);
    --shadow-lifted: 0 2px 6px rgba(31, 29, 26, 0.06), 0 18px 40px rgba(31, 29, 26, 0.10);

    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
    font-size: 17px;
    line-height: 1.6;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: opacity 0.2s ease, color 0.2s ease;
}

a:hover { opacity: 0.7; }

img { max-width: 100%; height: auto; display: block; }

ul { margin: 0; padding: 0; list-style: none; }

h1, h2, h3 {
    margin-top: 0;
    line-height: 1.15;
    letter-spacing: -0.02em;
}

p { margin: 0 0 var(--space-sm); }

/* ============================================================
   Top navigation (all pages)
   ============================================================ */
.site-nav {
    position: relative;
    z-index: 5;
    height: var(--nav-height);
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: 0 1.25rem;
    max-width: 1280px;
    width: 100%;
    margin: 0 auto;
}

.site-nav .brand { display: inline-flex; align-items: center; }
.site-nav .brand img { height: 28px; width: auto; }

.nav-links {
    display: flex;
    gap: 1.25rem;
    margin-left: auto;
}

.site-nav a {
    color: var(--text-muted);
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.site-nav a:hover, .site-nav a.active { color: var(--text); opacity: 1; }

.lang-link {
    padding: 0.3rem 0.7rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: rgba(248, 246, 241, 0.8);
    text-transform: none !important;
    letter-spacing: 0.02em !important;
}

/* ============================================================
   Animation hooks (home page)
   <html class="anim-ready"> is added in <head> unless the visitor
   prefers reduced motion. Only then are .anim elements hidden, and
   site.js (anime.js timeline) brings them in. When the entrance is
   done, site.js adds <html class="idle"> and the idle loops start.
   No JS → everything visible and still.
   ============================================================ */
.anim-ready .anim,
.anim-ready .logo { opacity: 0; }

.anim-ready .logo-mark { fill-opacity: 0; }

.idle .portrait-wrap { animation: float 6s ease-in-out infinite; }

.idle .logo-diamond-wrap {
    transform-box: fill-box;
    transform-origin: center;
    animation: spin 70s linear infinite;
}

.idle .link-cards li {
    animation: float 7s ease-in-out infinite;
    animation-delay: calc(var(--i, 0) * -2.4s);
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-6px); }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================================
   The stage — the home page on one screen (desktop)
   ============================================================ */
.site-main { flex: 1; display: flex; flex-direction: column; }

.stage {
    position: relative;
    flex: 1;
    min-height: calc(100vh - var(--footer-height) - var(--nav-height));
    min-height: calc(100svh - var(--footer-height) - var(--nav-height));
    display: grid;
    align-content: center;
    justify-items: center;
    row-gap: var(--space-md);
    padding: 1rem var(--space-sm) 1.5rem;
    overflow: hidden;
}

/* Site-wide particle field (canvas, drawn by particles.js): fixed behind every page. */
.particles {
    position: fixed;
    inset: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.site-nav, .site-main, .site-footer { position: relative; z-index: 1; }

/* Two soft light blobs that drift slowly behind everything. */
.glow {
    position: absolute;
    z-index: 0;
    pointer-events: none;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.9;
}

.glow-a {
    width: 55vw;
    height: 55vw;
    max-width: 720px;
    max-height: 720px;
    top: -15%;
    left: 5%;
    background: radial-gradient(circle, var(--accent-glow), transparent 68%);
    animation: drift-a 22s ease-in-out infinite alternate;
}

.glow-b {
    width: 45vw;
    height: 45vw;
    max-width: 600px;
    max-height: 600px;
    bottom: -20%;
    right: 0;
    background: radial-gradient(circle, var(--accent-soft), transparent 68%);
    animation: drift-b 26s ease-in-out infinite alternate;
}

@keyframes drift-a {
    from { transform: translate(0, 0) scale(1); }
    to   { transform: translate(12vw, 8vh) scale(1.15); }
}

@keyframes drift-b {
    from { transform: translate(0, 0) scale(1.1); }
    to   { transform: translate(-10vw, -10vh) scale(0.95); }
}

.intro {
    position: relative;
    z-index: 1;
    max-width: var(--intro-width);
    width: 100%;
    text-align: center;
    will-change: transform;
}

.media {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
}

.logo {
    height: 150px;
    width: auto;
    color: var(--accent);
    overflow: visible;
}

.logo-mark {
    fill: currentColor;
    stroke: currentColor;
    stroke-width: 110;
    stroke-linejoin: round;
}

.logo-diamond {
    fill: none;
    stroke: currentColor;
    stroke-width: 170;
    stroke-linejoin: round;
}

.portrait-wrap {
    display: block;
    flex: none;
}

.portrait {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--bg-elev);
    box-shadow: var(--shadow-lifted);
    will-change: transform;
}

.name {
    font-family: "Newsreader", "Source Serif Pro", Georgia, serif;
    font-weight: 500;
    font-size: clamp(2.4rem, 5.5vw, 4rem);
    line-height: 1.1;
    margin-bottom: 0.35rem;
    perspective: 600px;
}

.word { display: inline-flex; }

.letter {
    display: inline-block;
    transform-origin: 50% 100%;
    will-change: transform, opacity;
    cursor: default;
}

.tagline {
    margin: 0 0 1rem;
    color: var(--text-muted);
    font-size: 1.02rem;
    letter-spacing: 0.02em;
}

.quote {
    margin: 0 0 1.1rem;
    padding-left: 0.9rem;
    border-left: 2px solid var(--border);
    text-align: left;
    font-family: "Newsreader", "Source Serif Pro", Georgia, serif;
    font-style: italic;
    font-size: 1.05rem;
    line-height: 1.5;
    color: var(--text-muted);
}

.quote p { margin: 0; }

.bio { text-align: left; }

.bio p {
    line-height: 1.5;
    font-size: 0.93rem;
    margin-bottom: 0.5rem;
}

.bio p:last-of-type { margin-bottom: 0; }

/* ============================================================
   Link cards (Email, LinkedIn, Revolut)
   ============================================================ */
.link-cards {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    width: 100%;
    max-width: var(--cards-width);
    will-change: transform;
}

.link-card {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    column-gap: var(--space-sm);
    row-gap: 0.1rem;
    align-items: center;
    padding: 0.9rem 1.25rem;
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text);
    transition: transform 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out), border-color 0.25s ease;
}

.link-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lifted);
    border-color: var(--accent);
    opacity: 1;
}

.link-card-icon {
    grid-column: 1;
    grid-row: 1 / span 2;
    width: 26px;
    height: 26px;
    color: var(--accent);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.link-card-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

.link-label {
    grid-column: 2;
    grid-row: 1;
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
}

.link-value {
    grid-column: 2;
    grid-row: 2;
    font-weight: 500;
    font-size: 0.93rem;
    word-break: break-word;
}

/* ============================================================
   Content pages (services, projects, contact, privacy)
   ============================================================ */
.page {
    width: 100%;
    max-width: var(--page-width);
    margin: 0 auto;
    padding: var(--space-md) var(--space-sm) var(--space-lg);
}

.page h1 {
    font-family: "Newsreader", "Source Serif Pro", Georgia, serif;
    font-weight: 500;
    font-size: clamp(2rem, 4vw, 3rem);
    margin-bottom: var(--space-xs);
}

.page h2.section-title {
    font-family: "Newsreader", "Source Serif Pro", Georgia, serif;
    font-weight: 500;
    font-size: 1.8rem;
    margin: var(--space-lg) 0 var(--space-sm);
}

.lead {
    color: var(--text-muted);
    font-size: 1.08rem;
    max-width: 680px;
    margin-bottom: var(--space-md);
}

.prose { max-width: 680px; }
.prose p { line-height: 1.7; }
.muted { color: var(--text-muted); }
.small { font-size: 0.85rem; }
.crumb { font-size: 0.85rem; color: var(--text-muted); margin-bottom: var(--space-xs); }
.crumb a { color: var(--text-muted); }

.service-head { display: flex; align-items: center; gap: var(--space-sm); margin-bottom: var(--space-xs); }
.service-head h1 { margin-bottom: 0; }

.service-icon {
    display: inline-flex;
    width: 40px;
    height: 40px;
    flex: none;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: var(--accent-soft);
    color: var(--accent);
}

.service-icon svg { width: 22px; height: 22px; }

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: var(--space-sm);
}

.card {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1.4rem 1.4rem 1.2rem;
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: 14px;
    color: var(--text);
    transition: transform 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out), border-color 0.25s ease;
}

a.card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lifted);
    border-color: var(--accent);
    opacity: 1;
}

.card h2 { font-size: 1.25rem; margin: 0.25rem 0 0; }
.card p { margin: 0; color: var(--text-muted); font-size: 0.95rem; line-height: 1.55; flex: 1; }
.card .price { font-weight: 500; margin-top: 0.4rem; }
.card .price small, .package .price small { color: var(--text-muted); font-weight: 400; font-size: 0.8rem; margin-left: 0.3rem; }
.text-link { font-size: 0.9rem; font-weight: 500; }

.packages {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-sm);
}

.package {
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: 14px;
}

.package h3 { font-size: 1.3rem; margin-bottom: 0.2rem; }
.package .price {
    font-family: "Newsreader", "Source Serif Pro", Georgia, serif;
    font-size: 1.6rem;
    margin: 0;
    line-height: 1.2;
}
.package .price-note { color: var(--text-muted); font-size: 0.85rem; margin: 0.15rem 0 0; }
.package dl { margin: var(--space-sm) 0 var(--space-sm); flex: 1; }
.package dt {
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-top: 0.8rem;
}
.package dd { margin: 0.2rem 0 0; font-size: 0.95rem; line-height: 1.5; }
.package dd ul { list-style: disc; padding-left: 1.1rem; }
.package dd li { margin-bottom: 0.15rem; }
.package .btn { align-self: flex-start; }

.btn {
    display: inline-block;
    padding: 0.65rem 1.25rem;
    background: var(--accent);
    color: #fff;
    border: 1px solid var(--accent);
    border-radius: 999px;
    font: inherit;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.2s ease, transform 0.2s var(--ease-out);
}

.btn:hover { opacity: 0.85; transform: translateY(-1px); }
.btn-secondary { background: transparent; color: var(--accent); }

.cta-line {
    margin-top: var(--space-lg);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex-wrap: wrap;
    color: var(--text-muted);
}

/* Forms */
.form { max-width: 560px; }
.form label { display: block; margin-bottom: 1.1rem; }
.form label > span { display: block; font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0.3rem; }
.form input, .form select, .form textarea {
    width: 100%;
    font: inherit;
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg-elev);
    color: var(--text);
}
.form input:focus, .form select:focus, .form textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.form textarea { resize: vertical; }
.form label.checkbox { display: flex; gap: 0.6rem; align-items: flex-start; }
.form label.checkbox input { width: auto; margin-top: 0.3rem; }
.form label.checkbox > span { color: var(--text); font-size: 0.9rem; margin: 0; }
.form .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form .form-actions { margin-top: var(--space-sm); }
.field-error { display: block; color: #a33; font-size: 0.85rem; margin-top: 0.25rem; }
.field-error:empty { display: none; }
.validation-summary ul { list-style: disc; padding-left: 1.2rem; color: #a33; margin-bottom: var(--space-sm); }
.input-validation-error { border-color: #c66 !important; }

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
    min-height: var(--footer-height);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    flex-wrap: wrap;
    padding: 0.5rem var(--space-sm);
    color: var(--text-muted);
    font-size: 0.78rem;
    letter-spacing: 0.02em;
}

.site-footer a { color: var(--text-muted); }

/* ============================================================
   Responsive
   ============================================================ */

/* Desktop home: text on the left; logo + portrait above the cards on the right. */
@media (min-width: 960px) {
    .stage {
        grid-template-columns: minmax(0, var(--intro-width)) var(--cards-width);
        grid-template-rows: auto auto;
        column-gap: 5rem;
        row-gap: var(--space-md);
        justify-content: center;
        align-items: center;
        align-content: center;
    }

    .intro {
        grid-column: 1;
        grid-row: 1 / span 2;
        text-align: left;
    }

    .media {
        grid-column: 2;
        grid-row: 1;
        align-self: end;
    }

    .link-cards {
        grid-column: 2;
        grid-row: 2;
        align-self: start;
    }
}

@media (min-width: 1400px) {
    html { font-size: 18px; }
    .stage { column-gap: 6rem; }
}

/* Short desktop viewports (a 768px laptop minus browser chrome): tighten
   the home page so it still fits without scrolling. */
@media (min-width: 960px) and (max-height: 760px) {
    .is-home { font-size: 16px; }
    .stage { padding-block: 0.5rem; row-gap: 1.25rem; }
    .name { font-size: 2.7rem; margin-bottom: 0.2rem; }
    .tagline { margin-bottom: 0.7rem; }
    .quote { font-size: 0.98rem; margin-bottom: 0.8rem; }
    .bio p { font-size: 0.9rem; line-height: 1.45; margin-bottom: 0.4rem; }
    .logo { height: 120px; }
    .portrait { width: 120px; height: 120px; }
    .link-card { padding: 0.7rem 1.1rem; }
}

@media (max-width: 540px) {
    .site-nav { gap: var(--space-sm); padding: 0 var(--space-sm); }
    .nav-links { gap: 0.8rem; }
    .site-nav a { font-size: 0.72rem; }
    .media { gap: var(--space-sm); }
    .logo { height: 120px; }
    .portrait { width: 120px; height: 120px; }
}

@media (prefers-reduced-motion: reduce) {
    .glow-a, .glow-b,
    .idle .portrait-wrap,
    .idle .logo-diamond-wrap,
    .idle .link-cards li { animation: none; }
    .portrait { box-shadow: var(--shadow-soft); }
}

/* ============================================================
   Services: business chooser, stories, deliverables, timeline, FAQ
   ============================================================ */
.service-hero { display: flex; align-items: flex-start; gap: var(--space-sm); margin-bottom: var(--space-sm); }
.service-hero .service-icon { margin-top: 0.4rem; }
.service-hero h1 { margin-bottom: 0.25rem; }
.service-hero .headline {
    font-family: "Newsreader", "Source Serif Pro", Georgia, serif;
    font-style: italic;
    font-size: 1.25rem;
    color: var(--text-muted);
    margin: 0;
}

.block { margin-top: var(--space-lg); }

.chooser-block { margin: var(--space-md) 0; }
.chooser-title { font-size: 1.1rem; margin-bottom: 0.15rem; }

.chooser { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.75rem; }

.chip {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 0.9rem 0.45rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--bg-elev);
    color: var(--text-muted);
    font: inherit;
    font-size: 0.88rem;
    cursor: pointer;
    transition: border-color 0.2s ease, color 0.2s ease, transform 0.2s var(--ease-out), box-shadow 0.2s ease;
}

.chip:hover { color: var(--text); transform: translateY(-1px); box-shadow: var(--shadow-soft); }
.chip.active { color: #fff; background: var(--accent); border-color: var(--accent); }
.chip.active .biz-icon { color: #fff; }

.biz-icon { display: inline-flex; width: 22px; height: 22px; color: var(--accent); flex: none; }
.biz-icon svg { width: 100%; height: 100%; }

.stories { margin-top: var(--space-lg); }
.story-panels { margin-top: var(--space-sm); }
.story {
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.6rem;
    margin-bottom: var(--space-sm);
}
.js-ready .story { display: none; }
.js-ready .story.active { display: block; }
.story-title {
    font-family: "Newsreader", "Source Serif Pro", Georgia, serif;
    font-weight: 500;
    font-size: 1.5rem;
    margin-bottom: var(--space-sm);
}
.story-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--space-sm); margin-bottom: var(--space-sm); }
.story-step { position: relative; padding-left: 1rem; border-left: 2px solid var(--border); }
.story-step:last-child { border-left-color: var(--accent); }
.story-step p { margin: 0; font-size: 0.95rem; line-height: 1.6; }
.step-label {
    display: block;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}

.card-story { min-height: 3.2em; }
.service-card.has-story .card-story { color: var(--text); }

.check-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 0.5rem 1.5rem; }
.check-list li { display: flex; gap: 0.6rem; align-items: flex-start; line-height: 1.5; font-size: 0.97rem; }
.check-list .check { color: var(--accent); flex: none; font-weight: 600; }

.tagline-sm { color: var(--text-muted); margin: 0 0 0.25rem; font-size: 0.95rem; }

.timeline { list-style: none; counter-reset: step; padding: 0; display: grid; gap: 1rem; max-width: 720px; }
.timeline li { position: relative; padding-left: 3.2rem; }
.timeline li::before {
    counter-increment: step;
    content: counter(step);
    position: absolute;
    left: 0;
    top: 0;
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: "Newsreader", Georgia, serif;
    font-size: 1.1rem;
}
.timeline h3 { font-size: 1.05rem; margin: 0.3rem 0 0.2rem; }
.timeline p { margin: 0; color: var(--text-muted); line-height: 1.55; }

.faq { max-width: 720px; }
.faq details { border-top: 1px solid var(--border); padding: 0.7rem 0; }
.faq details:last-child { border-bottom: 1px solid var(--border); }
.faq summary { cursor: pointer; font-weight: 500; list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--text-muted); font-size: 1.2rem; line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq p { margin: 0.6rem 0 0; color: var(--text-muted); line-height: 1.6; }

.field-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }

/* Reveal on scroll (services.js adds .visible) */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out); }
.reveal.visible { opacity: 1; transform: none; }
html:not(.anim-ready) .reveal { opacity: 1; transform: none; }

@media (max-width: 600px) {
    .field-pair { grid-template-columns: 1fr; }
    .story { padding: 1.2rem; }
}
