/* ---------- Tokens ---------- */
:root {
    --paper:       #F6F2E9;
    --paper-deep:  #EFE9DC;
    --ink:         #1A1814;
    --ink-muted:   #6B645A;
    --ink-soft:    #8C8579;
    --rule:        #D9D2C5;
    --rule-soft:   #E5DFD2;

    --accent:      #3D5240;   /* forest green */
    --accent-deep: #2D3E30;
    --clay:        #B8593A;   /* warm secondary; sparingly */
    --clay-deep:   #8F4329;

    --font-display: 'Fraunces', 'Iowan Old Style', 'Hoefler Text', Georgia, serif;
    --font-body:    'Instrument Sans', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', system-ui, sans-serif;
    --font-mono:    'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

    --gutter:   clamp(1.5rem, 5vw, 4rem);
    --max-w:    980px;
    --meta-col: 7rem;
    --meta-gap: 2rem;

    --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
img, svg { display: block; max-width: 100%; }

/* ---------- Base ---------- */
html { background: var(--paper); }

body {
    font-family: var(--font-body);
    font-size: 1.0625rem;
    line-height: 1.6;
    color: var(--ink);
    background: var(--paper);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-feature-settings: 'kern' 1, 'liga' 1, 'calt' 1;
}

/* Subtle paper grain */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 100;
    opacity: 0.5;
    mix-blend-mode: multiply;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.05 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

a { color: inherit; }

::selection {
    background: var(--accent);
    color: var(--paper);
}

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

/* ---------- Layout ---------- */
.page {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: clamp(1.25rem, 3.5vw, 2.5rem) var(--gutter) clamp(2rem, 5vw, 4rem);
}

/* ---------- Site head ---------- */
.site-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: clamp(3rem, 8vw, 6rem);
}

.mark {
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 500;
    font-size: 1.2rem;
    text-decoration: none;
    color: var(--ink);
    letter-spacing: 0.04em;
    font-variation-settings: 'SOFT' 100, 'opsz' 18;
    transition: color 0.25s var(--ease);
}
.mark:hover { color: var(--accent); }

.nav {
    display: flex;
    flex-wrap: wrap;
    gap: clamp(0.9rem, 2.5vw, 1.6rem);
    font-family: var(--font-mono);
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
}
.nav a {
    color: var(--ink-muted);
    text-decoration: none;
    position: relative;
    padding-bottom: 2px;
    transition: color 0.25s var(--ease);
}
.nav a::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0;
    height: 1px;
    background: var(--accent);
    transition: width 0.3s var(--ease);
}
.nav a:hover { color: var(--accent); }
.nav a:hover::after { width: 100%; }

/* ---------- Hero ---------- */
.hero {
    padding: 0 0 clamp(4rem, 9vw, 7rem);
    display: grid;
    grid-template-columns: 1fr;
    row-gap: 0;
}

.display {
    font-family: var(--font-display);
    font-weight: 350;
    font-size: clamp(3.25rem, 9vw, 6.5rem);
    line-height: 0.95;
    letter-spacing: -0.025em;
    margin: 0;
    color: var(--ink);
    font-variation-settings: 'SOFT' 40, 'opsz' 144;
}

.subtitle {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(1.15rem, 2vw, 1.45rem);
    color: var(--ink-muted);
    margin: 1.25rem 0 0;
    letter-spacing: -0.005em;
    line-height: 1.4;
    font-variation-settings: 'opsz' 24;
}
.subtitle em {
    font-style: italic;
    color: var(--ink);
    font-variation-settings: 'SOFT' 100, 'opsz' 24;
}

.lede {
    margin: clamp(2rem, 4vw, 2.75rem) 0 0;
    max-width: 36em;
    font-size: clamp(1.0625rem, 1.3vw, 1.18rem);
    line-height: 1.6;
}
.lede em {
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 500;
    font-size: 1.04em;
    color: var(--accent);
    font-variation-settings: 'SOFT' 100, 'opsz' 18;
}

.links { margin: clamp(2rem, 4vw, 2.75rem) 0 0; }

.link-arrow {
    display: inline-flex;
    align-items: baseline;
    gap: 0.5em;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--accent);
    text-decoration: none;
    padding: 0 0 0.45em;
    border-bottom: 1px solid currentColor;
    transition: gap 0.25s var(--ease), color 0.25s var(--ease);
}
.link-arrow:hover {
    gap: 0.85em;
    color: var(--accent-deep);
}

/* Portrait — colored block offset behind the image (paper-shift style) */
.hero-portrait {
    margin: clamp(2rem, 4vw, 2.5rem) auto 0;
    width: clamp(180px, 60vw, 240px);
    max-width: 100%;
    position: relative;
    isolation: isolate;
}
.hero-portrait::before {
    content: '';
    position: absolute;
    top: clamp(0.6rem, 1.2vw, 1rem);
    left: clamp(0.6rem, 1.2vw, 1rem);
    right: calc(-1 * clamp(0.6rem, 1.2vw, 1rem));
    bottom: calc(-1 * clamp(0.6rem, 1.2vw, 1rem));
    background: var(--clay);
    z-index: -1;
}
.hero-portrait img {
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    display: block;
    background: var(--paper-deep);
    filter: drop-shadow(0 4px 14px rgba(26, 24, 20, 0.08));
}

/* Desktop hero: two-column with portrait in the right column */
@media (min-width: 720px) {
    .hero {
        grid-template-columns: 1fr clamp(220px, 28%, 280px);
        grid-template-rows: auto auto 1fr auto;
        column-gap: clamp(2.5rem, 5vw, 4rem);
        align-items: start;
    }
    .display       { grid-column: 1; grid-row: 1; }
    .subtitle      { grid-column: 1; grid-row: 2; }
    .lede          { grid-column: 1; grid-row: 3; }
    .links         { grid-column: 1; grid-row: 4; }
    .hero-portrait {
        grid-column: 2;
        grid-row: 1 / span 4;
        align-self: start;
        margin: 0.75rem 0 0;
        justify-self: end;
        width: 100%;
    }
}

/* ---------- Section frame ---------- */
.section {
    padding: clamp(3.5rem, 7vw, 5.5rem) 0;
    border-top: 1px solid var(--rule);
}

.section-head {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.25rem;
    align-items: baseline;
    margin-bottom: clamp(2rem, 4vw, 3rem);
}

.section-head .num {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--ink-soft);
    letter-spacing: 0.08em;
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
}
.section-head .num::after {
    content: '';
    width: 1.4rem;
    height: 1px;
    background: var(--ink-soft);
    flex: 0 0 1.4rem;
    opacity: 0.7;
}

.section-head h2 {
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 400;
    font-size: clamp(2rem, 4.5vw, 2.85rem);
    margin: 0;
    letter-spacing: -0.018em;
    color: var(--ink);
    font-variation-settings: 'SOFT' 60, 'opsz' 60;
    line-height: 1;
}

@media (min-width: 720px) {
    .section-head {
        grid-template-columns: var(--meta-col) 1fr;
        gap: var(--meta-gap);
    }
}

/* ---------- Currently — definition list style ---------- */
.now-body { max-width: 38em; }

.now-intro {
    margin: 0 0 1.5rem;
    color: var(--ink-muted);
    font-size: 1.02rem;
}

.now-list {
    margin: 0;
    border-top: 1px solid var(--rule);
}
.now-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.25rem;
    padding: 1.1rem 0;
    border-bottom: 1px solid var(--rule);
    align-items: baseline;
    transition: padding-left 0.3s var(--ease);
}
.now-row:hover { padding-left: 0.4rem; }
.now-row dt {
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 500;
    font-size: 1.15rem;
    color: var(--accent);
    font-variation-settings: 'SOFT' 100, 'opsz' 24;
    line-height: 1.25;
    letter-spacing: -0.005em;
}
.now-row dd {
    margin: 0;
    color: var(--ink);
    font-size: 1rem;
    line-height: 1.55;
}

@media (min-width: 640px) {
    .now-row {
        grid-template-columns: 14rem 1fr;
        gap: 1.75rem;
    }
}

@media (min-width: 720px) {
    .now-body { margin-left: calc(var(--meta-col) + var(--meta-gap)); }
}

/* ---------- Work entries ---------- */
.entries {
    display: flex;
    flex-direction: column;
    gap: clamp(2.5rem, 5vw, 3.5rem);
}

.entry {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.4rem;
}
.entry-meta time {
    font-family: var(--font-mono);
    font-size: 0.76rem;
    color: var(--ink-muted);
    letter-spacing: 0.02em;
    white-space: nowrap;
}
.entry-body h3.company {
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 500;
    font-size: 1.4rem;
    margin: 0 0 0.2rem;
    letter-spacing: -0.008em;
    color: var(--ink);
    font-variation-settings: 'SOFT' 100, 'opsz' 28;
    line-height: 1.2;
}
.entry-body .role {
    margin: 0 0 0.7rem;
    font-size: 0.95rem;
    color: var(--ink-muted);
    font-weight: 500;
}
.entry-body p:last-child {
    margin: 0;
    max-width: 34em;
}
.entry-body em {
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 500;
    color: var(--accent);
    font-size: 1.02em;
    font-variation-settings: 'SOFT' 100, 'opsz' 18;
}

@media (min-width: 720px) {
    .entry {
        grid-template-columns: var(--meta-col) 1fr;
        gap: var(--meta-gap);
    }
    .entry-meta time { padding-top: 0.55rem; }
}

.see-more {
    margin: clamp(2.5rem, 4vw, 3rem) 0 0;
    font-size: 0.95rem;
    color: var(--ink-muted);
}
.see-more a {
    color: var(--accent);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.22em;
    transition: color 0.25s var(--ease);
}
.see-more a:hover { color: var(--accent-deep); }

@media (min-width: 720px) {
    .see-more { padding-left: calc(var(--meta-col) + var(--meta-gap)); }
}

/* ---------- Photography ---------- */
.photo-body {}

.photo-intro {
    margin: 0 0 clamp(1.5rem, 3vw, 2.25rem);
    color: var(--ink-muted);
    font-size: 1.02rem;
    max-width: 36em;
}
.photo-intro em {
    font-family: var(--font-display);
    font-style: italic;
    color: var(--ink);
    font-variation-settings: 'SOFT' 100, 'opsz' 22;
}

.photo-gallery {
    column-count: 1;
    column-gap: clamp(0.75rem, 1.5vw, 1.25rem);
}
@media (min-width: 560px) { .photo-gallery { column-count: 2; } }
@media (min-width: 980px) { .photo-gallery { column-count: 3; } }

.photo {
    break-inside: avoid;
    margin: 0 0 clamp(1rem, 2vw, 1.5rem);
    position: relative;
}
.photo img {
    width: 100%;
    height: auto;
    display: block;
    background: var(--paper-deep);
    transition: filter 0.4s var(--ease), transform 0.4s var(--ease);
}
.photo:hover img {
    filter: brightness(1.04) saturate(1.05);
}
.photo figcaption {
    margin: 0.65rem 0 0;
    display: flex;
    gap: 0.7rem;
    align-items: baseline;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.13em;
    color: var(--ink-soft);
    line-height: 1.4;
}
.photo .photo-num {
    color: var(--clay);
    font-weight: 500;
    flex-shrink: 0;
}

@media (min-width: 720px) {
    .photo-body { margin-left: calc(var(--meta-col) + var(--meta-gap)); }
}

/* ---------- Beyond ---------- */
.beyond-body {
    display: grid;
    grid-template-columns: 1fr;
    gap: clamp(2rem, 4vw, 2.75rem);
}

.beyond-group h3.group-label {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--ink-soft);
    margin: 0 0 1rem;
    font-weight: 500;
}

.dl {
    margin: 0;
    border-top: 1px solid var(--rule);
}
.dl-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.15rem;
    padding: 0.9rem 0;
    border-bottom: 1px solid var(--rule);
    align-items: baseline;
}
.dl-row dt {
    font-family: var(--font-display);
    font-style: italic;
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--ink);
    font-variation-settings: 'SOFT' 100, 'opsz' 22;
    line-height: 1.25;
}
.dl-row dd {
    margin: 0;
    color: var(--ink-muted);
    font-size: 0.95rem;
}
.dl abbr {
    text-decoration: none;
    border-bottom: 1px dotted var(--ink-soft);
    cursor: help;
}

@media (min-width: 560px) {
    .dl-row {
        grid-template-columns: 14ch 1fr;
        gap: 1.5rem;
    }
}

@media (min-width: 720px) {
    .beyond-body { margin-left: calc(var(--meta-col) + var(--meta-gap)); }
}

/* ---------- Footer ---------- */
.site-foot {
    margin-top: clamp(3rem, 6vw, 5rem);
    padding-top: 1.75rem;
    border-top: 1px solid var(--rule);
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: baseline;
    justify-content: space-between;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--ink-soft);
}
.copyright { margin: 0; }
.foot-nav {
    display: flex;
    gap: 1.25rem;
}
.foot-nav a {
    color: var(--ink-muted);
    text-decoration: none;
    padding-bottom: 0.15em;
    border-bottom: 1px solid var(--rule);
    transition: color 0.25s var(--ease), border-color 0.25s var(--ease);
}
.foot-nav a:hover {
    color: var(--accent);
    border-color: var(--accent);
}

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: no-preference) {
    .hero > * {
        opacity: 0;
        transform: translateY(10px);
        animation: rise 0.75s var(--ease) forwards;
    }
    .hero .display       { animation-delay: 0.08s; }
    .hero .subtitle      { animation-delay: 0.22s; }
    .hero .hero-portrait { animation-delay: 0.30s; }
    .hero .lede          { animation-delay: 0.42s; }
    .hero .links         { animation-delay: 0.56s; }

    .site-head {
        opacity: 0;
        animation: fade 0.6s var(--ease) 0.02s forwards;
    }

    /* Scroll-triggered section reveals (only when JS marks <html> with .js-reveal) */
    .js-reveal .section {
        opacity: 0;
        transform: translateY(20px);
        transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
    }
    .js-reveal .section.is-in-view {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes rise {
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fade {
    to { opacity: 1; }
}
