/* ============================================================
   addedPIXELS · 2026 design system
   Shared tokens, type, header, footer, buttons, reveal system.
   Per-page sections live in each page's own <style> block.
   ============================================================ */

:root {
    --cream: #f6efe1;
    --cream-soft: #efe6d2;
    --cream-deep: #e7dcc1;
    --paper: #fbf6e9;
    --ink: #1a1a16;
    --ink-soft: #3a3a32;
    --ink-mute: #6a6859;
    --rule: #d8cfb4;
    --rule-soft: #e7dec5;
    --green: #4caf50;
    --green-deep: #2e7d32;
    --green-soft: rgba(76, 175, 80, 0.14);
    --terracotta: #d36a3c;
    --gold: #d4a437;

    --display: "Fraunces", "Times New Roman", serif;
    --sans: "Manrope", -apple-system, "Helvetica Neue", sans-serif;
    --hand: "Caveat", "Bradley Hand", cursive;

    /* Inverted cards that should stay dark in both light + dark mode */
    --invert-bg: #1a1a16;
    --invert-bg-soft: #25241e;
    --invert-text: #f3ecd6;
    --invert-text-soft: rgba(243, 236, 214, 0.78);
    --invert-text-mute: rgba(243, 236, 214, 0.6);
}

@media (prefers-color-scheme: dark) {
    :root {
        --cream: #1a1815;
        --cream-soft: #1f1d1a;
        --cream-deep: #252320;
        --paper: #161410;
        --ink: #f3ecd6;
        --ink-soft: #d8d0b9;
        --ink-mute: #908b77;
        --rule: #36322a;
        --rule-soft: #2a2620;
        --green: #66bb6a;
        --green-deep: #a5d6a7;
        --green-soft: rgba(102, 187, 106, 0.16);
        --terracotta: #e88159;
        --gold: #e7bb56;
        --invert-bg: #0a0908;
        --invert-bg-soft: #14120e;
        --invert-text: #f3ecd6;
        --invert-text-soft: rgba(243, 236, 214, 0.78);
        --invert-text-mute: rgba(243, 236, 214, 0.6);
    }
    .logo-light { display: inline !important; }
    .logo-dark { display: none !important; }
}

/* base reset */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    background: var(--paper);
    color: var(--ink);
    font-family: var(--sans);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    background-image:
        radial-gradient(ellipse at 10% 0%, var(--green-soft) 0%, transparent 40%),
        radial-gradient(ellipse at 90% 100%, rgba(211, 106, 60, 0.08) 0%, transparent 40%);
    background-attachment: fixed;
}
::selection { background: var(--green); color: var(--paper); }

/* paper grain */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: 0.4;
    z-index: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.2 0 0 0 0 0.2 0 0 0 0 0.15 0 0 0 0.07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
@media (prefers-color-scheme: dark) {
    body::before {
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.04 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    }
}

main, header, footer, section { position: relative; z-index: 1; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 1.5rem; }
.wrap-narrow { max-width: 880px; margin: 0 auto; padding: 0 1.5rem; }

/* ───── HEADER ───── */
.head {
    padding: 1.5rem 0;
    position: sticky; top: 0; z-index: 20;
    background: color-mix(in srgb, var(--paper) 88%, transparent);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--rule-soft);
}
.head-inner {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.brand { display: flex; align-items: center; gap: 0.75rem; text-decoration: none; color: var(--ink); }
.brand img { height: 28px; }
.brand .logo-light { display: none; }
.brand-hand {
    font-family: var(--hand);
    font-size: 1.05rem;
    color: var(--green-deep);
    
    padding-left: 0.5rem;
    margin-left: 0.25rem;
    border-left: 1px solid var(--rule);
}

.nav { display: flex; align-items: center; gap: 1.75rem; }
.nav a {
    color: var(--ink-soft);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    position: relative;
    transition: color 0.2s;
}
.nav a:hover { color: var(--green-deep); }
.nav a:not(.cta):hover::after {
    content: "";
    position: absolute;
    left: -2px; right: -2px; bottom: -4px;
    height: 2px;
    background: var(--green);
    
    border-radius: 2px;
}
.nav .cta {
    background: var(--ink);
    color: var(--paper);
    padding: 0.6rem 1.1rem;
    border-radius: 999px;
    font-weight: 600;
    transition: transform 0.2s, background 0.2s;
}
.nav .cta:hover { background: var(--green-deep); color: #fff; transform: translateY(-1px); }

/* ───── MOBILE NAV (hamburger + drawer) ───── */
.nav-toggle {
    display: none;
    background: none;
    border: 0;
    width: 44px; height: 44px;
    padding: 0;
    cursor: pointer;
    color: var(--ink);
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 60;
}
.nav-toggle .bars,
.nav-toggle .bars::before,
.nav-toggle .bars::after {
    display: block;
    width: 22px;
    height: 2px;
    background: currentColor;
    border-radius: 2px;
    transition: transform 0.25s ease, top 0.25s ease, background 0.2s ease;
}
.nav-toggle .bars { position: relative; }
.nav-toggle .bars::before,
.nav-toggle .bars::after {
    content: "";
    position: absolute;
    left: 0;
}
.nav-toggle .bars::before { top: -7px; }
.nav-toggle .bars::after  { top:  7px; }
.nav-toggle[aria-expanded="true"] .bars                { background: transparent; }
.nav-toggle[aria-expanded="true"] .bars::before        { top: 0; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] .bars::after         { top: 0; transform: rotate(-45deg); }

@media (max-width: 820px) {
    .nav-toggle { display: inline-flex; }

    /* Kill the header's backdrop-filter on mobile — it creates a containing
       block for position:fixed descendants, trapping the drawer inside the
       header strip instead of the viewport. Solid background replaces it.
       Bump z-index above the body.nav-open::after backdrop (35) so the
       drawer (inside this stacking context) wins the hit-test over the
       backdrop and links inside the drawer become tappable. */
    .head {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        background: var(--paper);
        z-index: 50;
    }

    /* Drawer — fixed sheet, slides in from right */
    .nav {
        position: fixed;
        top: 0; right: 0; bottom: 0;
        width: min(86vw, 380px);
        background: var(--paper);
        border-left: 1px solid var(--rule);
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 5rem 1.5rem 2rem;
        transform: translateX(100%);
        transition: transform 0.3s cubic-bezier(0.2, 0.65, 0.3, 1);
        box-shadow: -8px 0 30px -10px rgba(0,0,0,0.25);
        z-index: 40;
        overflow-y: auto;
        overscroll-behavior: contain;
    }
    .nav.is-open { transform: translateX(0); }

    /* Each inline link in the drawer */
    .nav > a {
        display: block;
        padding: 0.85rem 0;
        font-size: 1.1rem;
        font-weight: 500;
        color: var(--ink);
        border-bottom: 1px dashed var(--rule-soft);
    }
    .nav > a:hover { background: transparent; color: var(--green-deep); }
    .nav > a:hover::after { display: none; }

    /* Dropdowns expand inline */
    .nav-drop {
        list-style: none;
        border-bottom: 1px dashed var(--rule-soft);
    }
    .nav-drop > a {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.85rem 0;
        font-size: 1.1rem;
        font-weight: 500;
        color: var(--ink);
    }
    .nav-drop > a:hover { color: var(--green-deep); }
    .nav-drop-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        background: var(--cream-soft);
        border: 1px solid var(--rule-soft);
        box-shadow: none;
        margin: 0 0 0.75rem;
        padding: 0.35rem;
        border-radius: 10px;
        min-width: 0;
        z-index: auto;
    }
    .nav-drop-menu.is-work { min-width: 0; }
    .nav-drop-menu .case-entry { padding: 0.6rem 0.7rem; }
    .nav-drop-menu .case-entry .t { font-size: 0.95rem; }
    .nav-drop-menu .case-entry .s { font-size: 1rem; }

    /* CTA is the last item, sit at the bottom of the drawer */
    .nav .cta {
        margin-top: auto;
        text-align: center;
        padding: 0.85rem 1.25rem;
        font-size: 1rem;
    }
    .nav .cta + * { display: none; }

    /* Backdrop */
    body.nav-open { overflow: hidden; }
    body.nav-open::after {
        content: "";
        position: fixed;
        inset: 0;
        background: rgba(20, 22, 16, 0.45);
        z-index: 35;
    }
}

/* dropdown nav (apps, work) */
.nav-drop { position: relative; }
.nav-drop > a .chev {
    display: inline-block;
    margin-left: 0.25rem;
    font-size: 0.75em;
    color: var(--ink-mute);
    transition: color 0.2s, transform 0.2s;
}
.nav-drop:hover > a .chev,
.nav-drop:focus-within > a .chev { color: var(--green-deep); transform: rotate(180deg); }
/* the dropdown anchor opts out of the hover-underline (which would steal ::after) */
.nav-drop > a:hover::after { display: none !important; }
.nav-drop-menu {
    position: absolute;
    /* Flush against the trigger's bottom — visual gap is provided by the
       menu's own top padding so the hover hit-area is continuous and the
       cursor doesn't lose hover crossing dead space. */
    top: 100%; left: 0;
    background: var(--cream);
    border: 1px solid var(--rule);
    border-radius: 14px;
    padding: 0.85rem 0.5rem 0.5rem;
    min-width: 200px;
    box-shadow: 0 10px 30px -16px rgba(0,0,0,0.25);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
    list-style: none;
    z-index: 30;
}
.nav-drop:hover .nav-drop-menu,
.nav-drop:focus-within .nav-drop-menu {
    opacity: 1;
    visibility: visible;
    transform: none;
}
.nav-drop-menu a {
    display: block;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    color: var(--ink);
    font-size: 0.92rem;
    font-weight: 500;
}
.nav-drop-menu a:hover { background: var(--green-soft); color: var(--green-deep); }
.nav-drop-menu a:hover::after { display: none; }

/* case-entry: two-line dropdown items for the Work menu */
.nav-drop-menu.is-work { min-width: 320px; padding: 0.6rem; }
.nav-drop-menu .case-entry {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    padding: 0.6rem 0.85rem;
}
.nav-drop-menu .case-entry .t {
    font-family: var(--sans);
    font-weight: 600;
    color: var(--ink);
    font-size: 0.95rem;
    line-height: 1.2;
}
.nav-drop-menu .case-entry .s {
    font-family: var(--hand);
    color: var(--green-deep);
    font-size: 1.05rem;
    line-height: 1;
    margin-top: 0.15rem;
    
    transform-origin: 0% 100%;
    display: inline-block;
}
.nav-drop-menu .case-entry:hover { background: var(--green-soft); }
.nav-drop-menu .case-entry:hover .t { color: var(--green-deep); }
.nav-drop-menu .case-entry:hover .s { color: var(--terracotta); }
.nav-drop-menu .case-entry.is-active .t { color: var(--green-deep); }
.nav-drop-menu .case-entry.is-active .s { color: var(--terracotta); }
.nav-drop-menu li.div {
    border-top: 1px dashed var(--rule);
    margin: 0.4rem 0.5rem;
    list-style: none;
}
.nav-drop-menu .case-entry.case-all {
    text-align: center;
    padding-top: 0.5rem;
}
.nav-drop-menu .case-entry.case-all .t {
    font-style: italic;
    color: var(--ink-mute);
    font-weight: 500;
}
.nav-drop-menu .case-entry.case-all:hover .t { color: var(--ink); }

/* ───── BUTTONS ───── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.85rem 1.4rem;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: transform 0.2s, background 0.2s, color 0.2s, box-shadow 0.2s, border-color 0.2s;
    border: 1px solid transparent;
    background: var(--ink);
    color: var(--paper);
    cursor: pointer;
    font-family: var(--sans);
}
.btn:hover {
    background: var(--green-deep);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 4px 4px 0 var(--ink);
}
.btn.ghost {
    background: transparent;
    color: var(--ink);
    border-color: var(--rule);
}
.btn.ghost:hover {
    background: var(--cream-soft);
    border-color: var(--ink);
    color: var(--ink);
    box-shadow: 4px 4px 0 var(--terracotta);
}
.btn.small {
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
}

/* ───── COMMON ACCENTS ───── */
.pill {
    font-family: var(--hand);
    color: var(--green-deep);
    background: var(--green-soft);
    border: 1px solid color-mix(in srgb, var(--green) 30%, var(--rule));
    padding: 0.4rem 1rem;
    border-radius: 999px;
    
    font-size: 1.05rem;
    display: inline-block;
}
.scribble {
    font-family: var(--hand);
    color: var(--green);
    font-size: 1.3rem;
    
    display: inline-block;
}
.handnote {
    font-family: var(--hand);
    color: var(--terracotta);
    font-size: 1.2rem;
    
    display: inline-block;
}
.underline-hand {
    position: relative;
    display: inline-block;
}
.underline-hand::after {
    content: "";
    position: absolute;
    left: -1%; right: -1%;
    bottom: 0.05em;
    height: 0.12em;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 12' preserveAspectRatio='none'%3E%3Cpath d='M2 7 Q 80 0 150 5 T 300 6 T 398 4' fill='none' stroke='%234caf50' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat center / 100% 100%;
    z-index: -1;
}
.circle-hand {
    display: inline-block;
    position: relative;
    padding: 0 0.15em;
}
.circle-hand::after {
    content: "";
    position: absolute;
    inset: -10% -10%;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 100' preserveAspectRatio='none'%3E%3Cpath d='M150 8 C 50 8 8 35 8 50 C 8 75 60 92 150 92 C 240 92 292 75 292 50 C 292 35 230 8 150 8' fill='none' stroke='%23d36a3c' stroke-width='2.5'/%3E%3C/svg%3E") no-repeat center / 100% 100%;
    pointer-events: none;
}
.strike-hand {
    text-decoration: line-through;
    text-decoration-color: var(--terracotta);
    text-decoration-thickness: 3px;
    color: var(--ink-mute);
}

/* ───── TYPOGRAPHY ───── */
.display {
    font-family: var(--display);
    font-weight: 350;
    font-variation-settings: "opsz" 144, "SOFT" 60, "WONK" 1;
    line-height: 1;
    letter-spacing: -0.03em;
}
.display em {
    font-style: italic;
    color: var(--green-deep);
    font-variation-settings: "opsz" 144, "SOFT" 100, "WONK" 1;
}
.kicker {
    font-family: var(--hand);
    color: var(--terracotta);
    font-size: 1.3rem;
    
    display: inline-block;
    margin-bottom: 0.5rem;
}

/* ───── REUSABLE CARD STYLES ───── */
.note-card {
    background: var(--cream);
    border: 1px solid var(--rule);
    border-radius: 18px;
    padding: 1.75rem;
    transition: transform 0.25s, box-shadow 0.25s;
}
.note-card:hover {
    box-shadow: 5px 5px 0 var(--rule-soft);
    transform: translateY(-2px);
}
.note-card.is-dark {
    background: var(--invert-bg);
    color: var(--invert-text);
    border-color: var(--invert-bg-soft);
}
.note-card.is-dark p { color: var(--invert-text-soft); }
.note-card.is-dark h2, .note-card.is-dark h3 { color: var(--invert-text); }

/* phone-screenshot variant: cream backdrop, full image shown (no crop) */
.is-screenshot {
    background: linear-gradient(160deg, var(--cream-soft) 0%, var(--cream-deep) 100%) !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 0.75rem;
}
.is-screenshot img {
    object-fit: contain !important;
    width: auto !important;
    max-width: 100%;
    max-height: 100%;
    height: 100% !important;
    filter: drop-shadow(0 8px 22px rgba(0,0,0,0.18)) !important;
    border-radius: 24px;
}

/* tape & polaroid accents */
.tape {
    position: absolute;
    top: -6px; left: 24px;
    width: 70px; height: 18px;
    background: rgba(212, 164, 55, 0.55);
    border: 1px solid rgba(212, 164, 55, 0.65);
    
}
.tape.center {
    left: 50%;
    transform: translateX(-50%);
}

/* ───── FOOTER ───── */
.foot-band {
    margin: 5rem 0 0;
    background: var(--cream);
    border-top: 1px dashed var(--rule);
    border-bottom: 1px dashed var(--rule);
    padding: 3rem 0;
}
.foot-band-inner {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 3rem;
    align-items: start;
}
.foot-band h3 {
    font-family: var(--display);
    font-weight: 400;
    font-variation-settings: "opsz" 32;
    font-size: 1.3rem;
    margin-bottom: 1rem;
    letter-spacing: -0.015em;
}
.foot-band .lede {
    font-family: var(--hand);
    color: var(--green-deep);
    font-size: 1.4rem;
    
    display: inline-block;
    margin-bottom: 0.5rem;
}
.foot-band p { color: var(--ink-soft); font-size: 0.95rem; }
.foot-band ul { list-style: none; }
.foot-band ul li {
    padding: 0.4rem 0;
    border-bottom: 1px solid var(--rule-soft);
}
.foot-band ul li:last-child { border-bottom: none; }
.foot-band ul a {
    color: var(--ink);
    text-decoration: none;
    font-size: 0.95rem;
    display: flex;
    justify-content: space-between;
}
.foot-band ul a .k {
    font-family: var(--hand);
    color: var(--ink-mute);
    font-size: 1rem;
}
.foot-band ul a:hover { color: var(--green-deep); }
@media (max-width: 820px) {
    .foot-band-inner { grid-template-columns: 1fr; gap: 2rem; }
}

.foot {
    padding: 2rem 0 3rem;
    text-align: center;
    color: var(--ink-mute);
    font-size: 0.9rem;
    font-family: var(--hand);
    border-top: 1px dashed var(--rule);
}
.foot a { color: var(--green-deep); text-decoration: none; }
.foot a:hover { text-decoration: underline; }
.foot .row { display: flex; justify-content: center; gap: 1.5rem; flex-wrap: wrap; }

/* ───── FOCUS (keyboard accessibility) ───── */
/* Visible focus for keyboard users; suppressed for mouse via :focus-visible */
*:focus { outline: none; }
*:focus-visible {
    outline: 2px solid var(--green);
    outline-offset: 2px;
    border-radius: 4px;
}
.btn:focus-visible,
.nav .cta:focus-visible,
.case-nav a:focus-visible {
    outline-offset: 3px;
}

/* ───── REVEAL ───── */
[data-reveal] { opacity: 0; transform: translateY(6px); transition: opacity 0.35s ease-out, transform 0.35s ease-out; }
[data-reveal].is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
    [data-reveal] { opacity: 1; transform: none; transition: none; }
    .hero-greeting .wave { animation: none !important; }
}

/* shared keyframes */
@keyframes wave {
    0%, 60%, 100% { transform: rotate(0); }
    10%, 30% {  }
    20% {  }
}

/* utility */
.center-text { text-align: center; }
.dim { color: var(--ink-mute); }
.green-text { color: var(--green-deep); }
.terr-text { color: var(--terracotta); }
em.green-em { font-style: italic; color: var(--green-deep); font-family: var(--display); font-variation-settings: "opsz" 144, "SOFT" 100, "WONK" 1; }

/* prev/next case-study footer */
.case-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin-top: 3rem;
}
.case-nav a {
    background: var(--cream);
    border: 1px solid var(--rule);
    border-radius: 14px;
    padding: 1.25rem 1.5rem;
    text-decoration: none;
    color: var(--ink);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.case-nav a:hover { transform: translateY(-2px); box-shadow: 5px 5px 0 var(--rule-soft); }
.case-nav a .k {
    font-family: var(--hand);
    color: var(--ink-mute);
    font-size: 1rem;
}
.case-nav a .v {
    font-family: var(--display);
    font-size: 1.2rem;
    color: var(--green-deep);
}
.case-nav a.next { text-align: right; }
@media (max-width: 700px) {
    .case-nav { grid-template-columns: 1fr; }
}
