/*
    ════════════════════════════════════════════
    Mattias Rask. Portfolio
    Editorial redesign · v3.1
    ════════════════════════════════════════════
*/

:root {
    --bg:           #0c0b09;
    --bg-soft:      #141210;
    --fg:           #ece6d9;
    --fg-body:      #c4bdaf;
    --muted:        #857f72;
    --dim:          #4a453c;
    --line:         #201e1b;
    --line-strong:  #2e2b26;
    --accent:       #d97b3e;

    --serif:        'Fraunces', 'Iowan Old Style', 'Georgia', serif;
    --sans:         'Inter', -apple-system, system-ui, sans-serif;
    --mono:         'JetBrains Mono', 'SF Mono', ui-monospace, monospace;

    --ease:         cubic-bezier(0.2, 0.8, 0.2, 1);

    --max:          1180px;
    --pad:          max(1.25rem, 4vw);
}

/* ─── Reset ─── */

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

html {
    scroll-behavior: smooth;
    background: var(--bg);
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    background: var(--bg);
    color: var(--fg-body);
    font-family: var(--sans);
    font-size: 1.0625rem;
    line-height: 1.65;
    font-feature-settings: "ss01", "cv11";
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
    -webkit-tap-highlight-color: transparent;
}

/* Display/serif typography. Enable ligatures on Fraunces */
.hero-name,
.section-head h2,
.archive h3,
.featured-body h3,
.about-text .lede,
.contact-lede,
.featured-punch,
.archive .punch,
.contact-list a,
.nav-mark {
    font-feature-settings: "liga", "dlig", "calt";
}

::selection { background: var(--fg); color: var(--bg); }

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

:focus-visible {
    outline: 1px solid var(--fg);
    outline-offset: 4px;
}

/* ─── Skip link ─── */

.skip-link {
    position: absolute;
    top: -100px;
    left: 1rem;
    z-index: 10000;
    padding: 0.6rem 1rem;
    background: var(--fg);
    color: var(--bg);
    font-family: var(--mono);
    font-size: 0.75rem;
    transition: top 0.2s var(--ease);
}

.skip-link:focus { top: 1rem; }

/* ─── Navigation ─── */

.nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    padding: 1.4rem var(--pad);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.35s var(--ease), border-color 0.35s, padding 0.35s var(--ease), transform 0.4s var(--ease);
    border-bottom: 1px solid transparent;
}

.nav.scrolled {
    padding: 0.85rem var(--pad);
    background: rgba(12, 11, 9, 0.82);
    backdrop-filter: blur(18px) saturate(1.2);
    -webkit-backdrop-filter: blur(18px) saturate(1.2);
    border-bottom-color: var(--line);
}

.nav.hidden { transform: translateY(-100%); }

/* When the mobile menu is open, kill anything on the nav that would
   create a containing block for its fixed-positioned descendants —
   otherwise .nav-links sits inside the tiny nav strip instead of the
   viewport and the page bleeds through the overlay. */
.nav:has(.nav-links.open) {
    transform: none !important;
    background: var(--bg) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

.nav-mark {
    font-family: var(--serif);
    font-size: 1.1rem;
    font-weight: 400;
    color: var(--fg);
    letter-spacing: -0.015em;
    font-variation-settings: "opsz" 36, "SOFT" 40;
    white-space: nowrap;
}

.nav-mark em {
    font-style: italic;
    font-weight: 400;
    color: var(--fg);
}

.nav-links {
    display: flex;
    gap: 2.25rem;
    font-family: var(--mono);
    font-size: 0.72rem;
    letter-spacing: 0.02em;
    color: var(--muted);
}

.nav-links a {
    position: relative;
    padding: 0.3rem 0;
    transition: color 0.3s;
}

.nav-links a::after {
    content: '';
    position: absolute;
    left: 0; bottom: 0;
    width: 0;
    height: 1px;
    background: currentColor;
    transition: width 0.35s var(--ease);
}

.nav-links a:hover { color: var(--fg); }
.nav-links a:hover::after { width: 100%; }

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 6px;
    padding: 8px;
    margin: -8px;
    z-index: 1001;
}

.nav-toggle span {
    display: block;
    width: 22px;
    height: 1px;
    background: var(--fg);
    transition: all 0.3s var(--ease);
}

/* ─── Hero ─── */

.hero {
    min-height: 100vh;
    min-height: 100svh;
    padding: 8rem var(--pad) 5rem;
    max-width: var(--max);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2.5rem;
}

.hero-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--line);
    font-family: var(--mono);
    font-size: 0.72rem;
    color: var(--muted);
    letter-spacing: 0.04em;
}

.hero-bar > span {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
}

.hero-bar-status {
    color: var(--fg);
}

.hero-bar-status i {
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(217, 123, 62, 0.6);
    animation: pulse 2.6s ease-in-out infinite;
    flex-shrink: 0;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: 0.45; transform: scale(0.85); }
}

.hero-name {
    font-family: var(--serif);
    font-weight: 340;
    font-size: clamp(3.75rem, 13.5vw, 12rem);
    line-height: 0.93;
    letter-spacing: -0.045em;
    color: var(--fg);
    font-variation-settings: "opsz" 144, "SOFT" 50;
    word-break: break-word;
    hyphens: none;
}

.hero-name em {
    font-style: italic;
    font-weight: 300;
    color: var(--fg);
    font-variation-settings: "opsz" 144, "SOFT" 100;
}

.hero-name .period {
    color: var(--accent);
    font-style: normal;
}

.hero-lede {
    max-width: 42rem;
    font-size: clamp(1.05rem, 1.3vw, 1.2rem);
    line-height: 1.55;
    color: var(--fg-body);
}

.hero-actions {
    display: flex;
    gap: 1.75rem;
    align-items: center;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.95rem 1.75rem;
    font-family: var(--mono);
    font-size: 0.75rem;
    color: var(--fg);
    border: 1px solid var(--line-strong);
    transition: all 0.35s var(--ease);
    letter-spacing: 0.02em;
    min-height: 44px;
}

.btn:hover {
    background: var(--fg);
    color: var(--bg);
    border-color: var(--fg);
}

.ghost {
    font-family: var(--mono);
    font-size: 0.8rem;
    color: var(--muted);
    transition: color 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0;
    min-height: 44px;
}

.ghost:hover { color: var(--fg); }
.ghost:hover span { transform: translateX(3px); }
.ghost span { transition: transform 0.3s var(--ease); display: inline-block; }

/* ─── Sections ─── */

.section {
    max-width: var(--max);
    margin: 0 auto;
    padding: 6rem var(--pad);
    border-top: 1px solid var(--line);
}

.section-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 3.5fr;
    gap: 3rem;
    align-items: baseline;
    margin-bottom: 4rem;
}

.kicker {
    font-family: var(--mono);
    font-size: 0.72rem;
    color: var(--muted);
    letter-spacing: 0.04em;
    padding-top: 0.9rem;
    border-top: 1px solid var(--line-strong);
    display: block;
}

.kicker-num {
    color: var(--fg);
    font-weight: 500;
    margin-right: 0.7em;
    letter-spacing: 0.06em;
}

.section-head h2 {
    font-family: var(--serif);
    font-weight: 350;
    font-size: clamp(2.25rem, 5.5vw, 4.25rem);
    line-height: 1;
    letter-spacing: -0.035em;
    color: var(--fg);
    font-variation-settings: "opsz" 144, "SOFT" 50;
}

.section-head h2 em {
    font-style: italic;
    font-weight: 300;
    font-variation-settings: "opsz" 144, "SOFT" 100;
}

.period {
    color: var(--accent);
    font-style: normal;
}

/* ─── Featured (Now) ─── */

.featured {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 4rem;
    align-items: center;
    transition: opacity 0.3s;
}

.featured-frame {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--line);
    background: var(--bg-soft);
}

.featured-frame::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(217, 123, 62, 0.08), transparent 55%);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s var(--ease);
    z-index: 1;
}

.featured:hover .featured-frame::before { opacity: 1; }

.featured-frame img {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    transition: transform 0.8s var(--ease);
}

.featured:hover .featured-frame img { transform: scale(1.02); }

.featured-body h3 {
    font-family: var(--serif);
    font-weight: 400;
    font-size: clamp(2.25rem, 4vw, 3.25rem);
    letter-spacing: -0.03em;
    line-height: 1;
    color: var(--fg);
    margin-bottom: 1.25rem;
    font-variation-settings: "opsz" 144, "SOFT" 50;
}

.featured-punch {
    font-family: var(--serif);
    font-weight: 400;
    font-style: italic;
    font-size: clamp(1.2rem, 1.8vw, 1.5rem);
    line-height: 1.35;
    color: var(--fg);
    margin-bottom: 1.5rem;
    max-width: 34rem;
    font-variation-settings: "opsz" 72, "SOFT" 90;
}

.featured-desc {
    color: var(--fg-body);
    margin-bottom: 2.25rem;
    max-width: 36rem;
    font-size: 0.98rem;
    line-height: 1.6;
}

.spec {
    display: grid;
    gap: 0;
    font-family: var(--mono);
    font-size: 0.74rem;
}

.spec > div {
    display: grid;
    grid-template-columns: 5rem 1fr;
    gap: 1.25rem;
    padding: 0.35rem 0;
    align-items: baseline;
}

.spec dt {
    color: var(--muted);
    letter-spacing: 0.04em;
}

.spec dd {
    color: var(--fg);
    overflow-wrap: anywhere;
}

.spec .arrow {
    color: var(--muted);
    margin-left: 0.4rem;
    transition: transform 0.3s var(--ease);
    display: inline-block;
}

.featured:hover .spec .arrow {
    transform: translate(2px, -2px);
    color: var(--accent);
}

/* ─── Featured (private state) ─── */

.featured-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1.5rem;
    margin-bottom: 1.25rem;
}

.featured-top h3 { margin-bottom: 0; }

.featured.private {
    cursor: default;
}

.featured.private:hover .featured-frame::before { opacity: 0; }
.featured.private:hover .featured-frame img { transform: none; }

.featured-desc code {
    font-family: var(--mono);
    font-size: 0.86em;
    color: var(--fg);
    background: var(--bg-soft);
    padding: 0.1em 0.4em;
    border: 1px solid var(--line);
}

/* ─── Featured (install terminal variant) ─── */

.featured-install {
    align-self: stretch;
    display: flex;
    flex-direction: column;
    min-height: 19rem;
}

.terminal-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 1.1rem;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.018);
    position: relative;
    z-index: 2;
    flex-shrink: 0;
}

.terminal-title {
    font-family: var(--mono);
    font-size: 0.7rem;
    letter-spacing: 0.18em;
    color: var(--fg);
    text-transform: uppercase;
}

.terminal-meta {
    font-family: var(--mono);
    font-size: 0.66rem;
    letter-spacing: 0.05em;
    color: var(--muted);
}

.terminal-body {
    flex: 1;
    padding: 1.65rem 1.25rem 1.4rem;
    font-family: var(--mono);
    font-size: 0.82rem;
    line-height: 1.85;
    color: var(--fg);
    overflow-x: auto;
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.1rem;
}

.terminal-line {
    white-space: nowrap;
    color: var(--fg);
}

.terminal-slash {
    color: var(--accent);
    font-weight: 500;
}

.terminal-cursor {
    margin-top: 1.1rem;
    line-height: 1;
    color: var(--fg);
    font-size: 0.92rem;
}

.terminal-cursor .cursor {
    display: inline-block;
    animation: terminal-blink 1.1s steps(2, end) infinite;
}

@keyframes terminal-blink {
    0%, 49%   { opacity: 1; }
    50%, 100% { opacity: 0; }
}

.terminal-foot {
    padding: 0.85rem 1.1rem;
    border-top: 1px solid var(--line);
    background: rgba(0, 0, 0, 0.18);
    font-family: var(--mono);
    font-size: 0.66rem;
    color: var(--muted);
    line-height: 1.55;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.55rem 0.7rem;
    position: relative;
    z-index: 2;
    flex-shrink: 0;
}

.terminal-foot-label {
    color: var(--dim);
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-size: 0.6rem;
    flex-shrink: 0;
}

.terminal-foot code {
    font-family: inherit;
    font-size: 1em;
    color: var(--fg-body);
    background: none;
    border: none;
    padding: 0;
}

/* ─── Archive groups ─── */

.archive-group + .archive-group {
    margin-top: 4.5rem;
}

.group-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 1rem;
    margin-bottom: 0;
    border-bottom: 1px solid var(--line-strong);
}

.group-label {
    font-family: var(--mono);
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    color: var(--fg);
    text-transform: uppercase;
}

.group-note {
    font-family: var(--sans);
    font-size: 0.92rem;
    color: var(--muted);
    line-height: 1.55;
    max-width: 38rem;
    padding: 1rem 0 0;
    margin-bottom: -0.5rem;
}

/* ─── Archive entries ─── */

.archive li {
    border-bottom: 1px solid var(--line);
}

.archive .entry {
    display: block;
    padding: 2.25rem 0;
    transition: padding 0.4s var(--ease);
    position: relative;
}

a.entry::before {
    content: '';
    position: absolute;
    left: calc(-1 * var(--pad));
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--accent);
    opacity: 0;
    transition: opacity 0.4s var(--ease);
}

a.entry:hover { padding-left: 1.25rem; }
a.entry:hover::before { opacity: 1; }
a.entry:hover .arrow { color: var(--accent); transform: translate(3px, -3px); }
a.entry:hover h3 { color: var(--fg); }

.entry.private { cursor: default; }

.entry-top {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1.25rem;
    margin-bottom: 0.85rem;
}

.archive h3 {
    font-family: var(--serif);
    font-weight: 350;
    font-size: clamp(1.85rem, 4.5vw, 2.85rem);
    line-height: 1;
    letter-spacing: -0.03em;
    color: var(--fg);
    font-variation-settings: "opsz" 144, "SOFT" 55;
    transition: color 0.3s;
    margin-bottom: 0;
}

.archive .desc {
    font-family: var(--sans);
    font-size: clamp(0.95rem, 1.2vw, 1.025rem);
    line-height: 1.55;
    color: var(--fg-body);
    max-width: 48rem;
    margin-bottom: 1.25rem;
}

.archive .arrow {
    font-family: var(--serif);
    font-size: 1.3rem;
    color: var(--dim);
    transition: color 0.3s var(--ease), transform 0.3s var(--ease);
    display: inline-block;
    flex-shrink: 0;
}

/* "Private" pill. Shared by featured + archive */

.badge {
    font-family: var(--mono);
    font-size: 0.62rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    padding: 0.32rem 0.6rem;
    border: 1px solid var(--line-strong);
    color: var(--muted);
    flex-shrink: 0;
    line-height: 1;
    align-self: center;
    white-space: nowrap;
}

/* ─── About ─── */

.about {
    display: grid;
    grid-template-columns: 2.3fr 1fr;
    gap: 5rem;
    align-items: start;
}

.about-text .lede {
    font-family: var(--serif);
    font-weight: 400;
    font-size: clamp(1.65rem, 2.6vw, 2.15rem);
    line-height: 1.25;
    letter-spacing: -0.02em;
    color: var(--fg);
    margin-bottom: 2rem;
    font-variation-settings: "opsz" 72, "SOFT" 50;
}

.about-text p {
    color: var(--fg-body);
    max-width: 40rem;
}

.about-stack {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.about-stack dl {
    font-family: var(--mono);
    font-size: 0.74rem;
    padding-top: 1rem;
    border-top: 1px solid var(--line-strong);
}

.about-stack dt {
    color: var(--muted);
    letter-spacing: 0.04em;
    margin-bottom: 0.4rem;
}

.about-stack dd {
    color: var(--fg);
    margin-bottom: 1.1rem;
    line-height: 1.55;
}

.about-stack dd:last-of-type {
    margin-bottom: 0;
}

.about-stack .certs dd > span {
    display: block;
    color: var(--fg);
    margin-bottom: 0.5rem;
}

.about-stack .certs ul {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.about-stack .certs li {
    color: var(--fg-body);
    padding-left: 0.9rem;
    position: relative;
}

.about-stack .certs li::before {
    content: '';
    position: absolute;
    left: 0; top: 0.65em;
    width: 0.4rem;
    height: 1px;
    background: var(--accent);
}

/* ─── Photo reel ─── */

.reel {
    margin-top: 5rem;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x proximity;
    scroll-padding-inline-start: var(--pad);
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--line-strong) transparent;
    margin-left: calc(-1 * var(--pad));
    margin-right: calc(-1 * var(--pad));
    padding: 0.25rem var(--pad) 1.25rem;
}

.reel::-webkit-scrollbar { height: 6px; }
.reel::-webkit-scrollbar-track { background: transparent; }
.reel::-webkit-scrollbar-thumb {
    background: var(--line-strong);
    border-radius: 3px;
}
.reel::-webkit-scrollbar-thumb:hover {
    background: var(--muted);
}

.reel-track {
    display: flex;
    gap: 1.25rem;
    width: max-content;
}

.reel-card {
    scroll-snap-align: start;
    flex: 0 0 auto;
}

.reel-card figure {
    margin: 0;
}

.reel-card img {
    height: 30rem;
    width: auto;
    display: block;
    border: 1px solid var(--line);
    background: var(--bg-soft);
    transition: filter 0.5s var(--ease);
    filter: brightness(0.95) saturate(0.95);
}

.reel-card:hover img,
.reel-card:focus-within img {
    filter: brightness(1) saturate(1);
}

.reel-card figcaption {
    margin-top: 0.85rem;
    color: var(--muted);
    font-family: var(--mono);
    font-size: 0.7rem;
    letter-spacing: 0.04em;
    line-height: 1.4;
}

/* ─── Contact ─── */

.contact-lede {
    font-family: var(--serif);
    font-weight: 400;
    font-size: clamp(1.5rem, 2.7vw, 2.25rem);
    line-height: 1.3;
    letter-spacing: -0.02em;
    color: var(--fg);
    max-width: 42rem;
    margin-bottom: 4rem;
    font-variation-settings: "opsz" 96, "SOFT" 50;
}

.contact-list li {
    display: grid;
    grid-template-columns: 8rem 1fr;
    gap: 2rem;
    align-items: baseline;
    padding: 1.4rem 0;
    border-bottom: 1px solid var(--line);
}

.contact-list li:first-child { border-top: 1px solid var(--line); }

.contact-list .label {
    font-family: var(--mono);
    font-size: 0.72rem;
    color: var(--muted);
    letter-spacing: 0.04em;
}

.contact-list a {
    font-family: var(--serif);
    font-weight: 400;
    font-size: clamp(1.1rem, 2vw, 1.5rem);
    color: var(--fg);
    transition: color 0.3s;
    display: inline-flex;
    align-items: baseline;
    gap: 0.5rem;
    font-variation-settings: "opsz" 36, "SOFT" 70;
    overflow-wrap: anywhere;
}

.contact-list a .arrow {
    font-size: 0.9em;
    color: var(--muted);
    transition: transform 0.3s var(--ease), color 0.3s;
    display: inline-block;
    flex-shrink: 0;
}

.contact-list a:hover { color: var(--accent); }
.contact-list a:hover .arrow {
    transform: translate(3px, -1px);
    color: var(--accent);
}

/* ─── Blog ─── */

.blog-list {
    display: flex;
    flex-direction: column;
}

.post {
    display: grid;
    grid-template-columns: 1fr 3.5fr;
    gap: 4rem;
    padding: 3rem 0;
    border-bottom: 1px solid var(--line);
}

.post:first-child { border-top: 1px solid var(--line-strong); }
.post:last-child  { border-bottom: none; }

.post-meta {
    font-family: var(--mono);
    font-size: 0.72rem;
    color: var(--muted);
    letter-spacing: 0.04em;
    line-height: 1.5;
    align-self: start;
    padding-top: 0.4rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    position: sticky;
    top: 5rem;
}

.post-meta time {
    color: var(--fg);
    display: block;
}

.post-tag {
    color: var(--dim);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.66rem;
}

.post-read {
    color: var(--dim);
    font-size: 0.66rem;
    letter-spacing: 0.04em;
}

.post-body {
    max-width: 42rem;
    min-width: 0;
}

.post-title {
    font-family: var(--serif);
    font-weight: 350;
    font-size: clamp(1.85rem, 3.8vw, 2.65rem);
    line-height: 1.05;
    letter-spacing: -0.025em;
    color: var(--fg);
    margin-bottom: 0.75rem;
    font-variation-settings: "opsz" 144, "SOFT" 55;
}

.post-dek {
    font-family: var(--serif);
    font-weight: 400;
    font-style: italic;
    font-size: clamp(1.1rem, 1.5vw, 1.25rem);
    line-height: 1.4;
    color: var(--fg);
    margin-bottom: 2.25rem;
    font-variation-settings: "opsz" 36, "SOFT" 90;
    max-width: 36rem;
}

.post-prose p {
    color: var(--fg-body);
    font-size: 1rem;
    line-height: 1.7;
    margin-bottom: 1.15rem;
    max-width: 38rem;
}

.post-prose p:last-child { margin-bottom: 0; }

.post-prose h4 {
    font-family: var(--serif);
    font-weight: 400;
    font-size: clamp(1.2rem, 1.7vw, 1.4rem);
    line-height: 1.25;
    letter-spacing: -0.015em;
    color: var(--fg);
    margin-top: 2.75rem;
    margin-bottom: 1rem;
    font-variation-settings: "opsz" 48, "SOFT" 60;
    max-width: 38rem;
}

.post-prose h4:first-child { margin-top: 0; }

.post-prose strong {
    color: var(--fg);
    font-weight: 500;
}

.post-prose em {
    font-style: italic;
    color: var(--fg);
}

.post-prose code {
    font-family: var(--mono);
    font-size: 0.86em;
    color: var(--fg);
    background: var(--bg-soft);
    padding: 0.12em 0.42em;
    border: 1px solid var(--line);
    overflow-wrap: anywhere;
}

.post-prose pre {
    font-family: var(--mono);
    font-size: 0.78rem;
    line-height: 1.7;
    color: var(--fg);
    background: var(--bg-soft);
    border: 1px solid var(--line);
    border-left: 2px solid var(--accent);
    padding: 1.05rem 1.15rem;
    margin: 1.5rem 0 1.65rem;
    overflow-x: auto;
    max-width: 38rem;
    -webkit-overflow-scrolling: touch;
}

.post-prose pre code {
    border: none;
    background: none;
    padding: 0;
    font-size: inherit;
    color: inherit;
    overflow-wrap: normal;
    white-space: pre;
}

.post-prose blockquote {
    border-left: 2px solid var(--line-strong);
    padding: 0.15rem 0 0.15rem 1.25rem;
    margin: 1.5rem 0 1.65rem;
    max-width: 38rem;
}

.post-prose blockquote p {
    font-family: var(--serif);
    font-weight: 400;
    font-style: italic;
    font-size: 1.075rem;
    line-height: 1.55;
    color: var(--fg);
    margin-bottom: 0;
    font-variation-settings: "opsz" 48, "SOFT" 90;
}

.post-prose blockquote code {
    font-style: normal;
    font-size: 0.84em;
}

.post-prose ul,
.post-prose ol {
    margin: 0 0 1.15rem 0;
    padding-left: 1.4rem;
    max-width: 38rem;
    color: var(--fg-body);
    line-height: 1.7;
    list-style-position: outside;
}

.post-prose ul { list-style-type: disc; }
.post-prose ol { list-style-type: decimal; }

.post-prose li {
    margin-bottom: 0.4rem;
}

.post-prose li::marker {
    color: var(--muted);
}

.post-prose a {
    color: var(--fg);
    border-bottom: 1px solid var(--dim);
    transition: color 0.3s, border-color 0.3s var(--ease);
}

.post-prose a:hover {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* ─── Footer ─── */

.footer {
    max-width: var(--max);
    margin: 0 auto;
    padding: 2.5rem var(--pad);
    border-top: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
    font-family: var(--mono);
    font-size: 0.7rem;
    color: var(--dim);
    letter-spacing: 0.04em;
}

/* ─── Reveal ─── */

.reveal {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.8s var(--ease), transform 0.9s var(--ease);
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ═════════════ Responsive ═════════════ */

/* Tablet + small laptop */
@media (max-width: 960px) {
    .hero {
        gap: 2rem;
        padding: 7.5rem var(--pad) 5rem;
    }

    .hero-bar {
        gap: 0.75rem 1.75rem;
        padding-bottom: 1.25rem;
    }

    .section {
        padding: 5rem var(--pad);
    }

    .section-head {
        grid-template-columns: 1fr;
        gap: 1rem;
        margin-bottom: 3rem;
    }

    .kicker {
        border-top: none;
        padding-top: 0;
    }

    .featured {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }

    .about {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .archive a { padding: 2.5rem 0; }
    .archive a:hover { padding-left: 0.75rem; }

    .reel { margin-top: 4rem; }
    .reel-card img { height: 26rem; }

    .post {
        grid-template-columns: 1fr;
        gap: 1.25rem;
        padding: 2.5rem 0;
    }

    .post-meta {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: baseline;
        gap: 1.25rem;
        padding-top: 0;
        position: static;
        top: auto;
    }

    .post-meta time { display: inline; }

    .post-prose pre,
    .post-prose blockquote { max-width: 100%; }
}

/* Phone */
@media (max-width: 640px) {
    :root { --pad: 1.4rem; }

    /* ── Nav ── */
    .nav { padding: 1rem var(--pad); }
    .nav.scrolled { padding: 0.75rem var(--pad); }
    .nav-mark { font-size: 1rem; }

    .nav-links {
        position: fixed;
        inset: 0;
        background: var(--bg);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 2.25rem;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s var(--ease);
        z-index: 999;
        font-family: var(--serif);
        font-size: 1.75rem;
        color: var(--fg);
        font-variation-settings: "opsz" 72, "SOFT" 60;
        letter-spacing: -0.015em;
    }

    .nav-links a {
        padding: 0.4rem 0;
        font-style: italic;
    }

    .nav-links a::after { display: none; }
    .nav-links a:hover { color: var(--accent); }

    .nav-links.open { opacity: 1; pointer-events: all; }

    .nav-toggle { display: flex; }
    .nav-toggle.active span:first-child { transform: rotate(45deg) translate(3px, 3px); }
    .nav-toggle.active span:last-child  { transform: rotate(-45deg) translate(3px, -3px); }

    /* ── Hero ── */
    .hero {
        padding: 7rem var(--pad) 4.5rem;
        gap: 1.75rem;
        min-height: auto;
    }

    .hero-name {
        font-size: clamp(4rem, 22vw, 7rem);
        line-height: 0.9;
        letter-spacing: -0.04em;
    }

    .hero-lede {
        font-size: 1.075rem;
        line-height: 1.55;
    }

    .hero-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.55rem;
        padding-bottom: 1.1rem;
        font-size: 0.68rem;
    }

    .hero-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
        margin-top: 0.5rem;
    }

    .hero-actions .btn {
        width: 100%;
        padding: 1.1rem 1.5rem;
        font-size: 0.78rem;
    }

    .hero-actions .ghost {
        justify-content: flex-start;
        font-size: 0.85rem;
    }

    /* ── Sections ── */
    .section {
        padding: 5.5rem var(--pad);
    }

    .section-head {
        margin-bottom: 2.75rem;
    }

    .section-head h2 {
        font-size: clamp(2.25rem, 11vw, 3.5rem);
    }

    /* ── Featured ── */
    .featured { gap: 2.25rem; }

    .featured-body h3 {
        font-size: clamp(2.25rem, 10vw, 3rem);
        margin-bottom: 1.1rem;
    }

    .featured-punch {
        font-size: 1.2rem;
        line-height: 1.35;
        margin-bottom: 1.25rem;
    }

    .featured-desc {
        font-size: 0.98rem;
        margin-bottom: 1.75rem;
    }

    .spec > div {
        grid-template-columns: 4.5rem 1fr;
        gap: 0.85rem;
        padding: 0.4rem 0;
    }

    .spec dd { overflow-wrap: anywhere; }

    .featured-install { min-height: 16rem; }
    .terminal-body { font-size: 0.74rem; padding: 1.4rem 1.1rem 1.2rem; }
    .terminal-bar { padding: 0.75rem 1rem; }
    .terminal-title { font-size: 0.66rem; }
    .terminal-meta { font-size: 0.62rem; }
    .terminal-foot { padding: 0.8rem 1rem; font-size: 0.62rem; }

    /* ── Archive ── */
    .archive a {
        padding: 2.5rem 0;
    }

    .archive a:hover {
        padding-left: 0;   /* disable hover translate; touch device */
    }

    .archive a::before { display: none; }

    .archive .row-top {
        margin-bottom: 1.1rem;
    }

    .archive h3 {
        font-size: clamp(2.1rem, 10vw, 3rem);
        margin-bottom: 1.1rem;
    }

    .archive .punch {
        font-size: 1.1rem;
        line-height: 1.4;
        margin-bottom: 1.5rem;
    }

    /* ── About ── */
    .about-text .lede {
        font-size: 1.625rem;
        line-height: 1.25;
        margin-bottom: 1.75rem;
    }

    .about-text p {
        font-size: 1rem;
    }

    .about-stack {
        gap: 2rem;
    }

    .about-stack dt {
        font-size: 0.7rem;
    }

    .about-stack dd {
        font-size: 0.85rem;
        padding-bottom: 1.1rem;
        margin-bottom: 1.1rem;
    }

    .about-stack .certs dd > span {
        font-size: 0.9rem;
    }

    /* ── Reel ── */
    .reel { margin-top: 3rem; }
    .reel-card img { height: 21rem; }
    .reel-track { gap: 0.85rem; }
    .reel-card figcaption {
        font-size: 0.68rem;
        margin-top: 0.7rem;
    }

    /* ── Contact ── */
    .contact-lede {
        font-size: 1.625rem;
        margin-bottom: 2.75rem;
    }

    .contact-list li {
        grid-template-columns: 1fr;
        gap: 0.4rem;
        padding: 1.25rem 0;
    }

    .contact-list a {
        font-size: 1.2rem;
    }

    /* ── Blog ── */
    .post { padding: 2rem 0; gap: 1rem; }
    .post-title {
        font-size: clamp(1.7rem, 8vw, 2.15rem);
        margin-bottom: 0.65rem;
    }
    .post-dek {
        font-size: 1.075rem;
        margin-bottom: 1.65rem;
    }
    .post-prose p { font-size: 0.98rem; }
    .post-prose h4 {
        font-size: 1.2rem;
        margin-top: 2.25rem;
        margin-bottom: 0.85rem;
    }
    .post-prose pre {
        font-size: 0.74rem;
        padding: 0.95rem 1rem;
        margin: 1.25rem 0 1.4rem;
    }
    .post-prose blockquote {
        padding-left: 1rem;
        margin: 1.25rem 0 1.4rem;
    }
    .post-prose blockquote p { font-size: 1.025rem; }

    /* ── Footer ── */
    .footer {
        flex-direction: column;
        gap: 0.55rem;
        padding: 2.5rem var(--pad);
        line-height: 1.6;
    }
}

/* Very small devices */
@media (max-width: 380px) {
    :root { --pad: 1.25rem; }

    .hero-name { font-size: 4rem; }
    .section-head h2 { font-size: 2.15rem; }
    .archive h3, .featured-body h3 { font-size: 2rem; }
    .post-title { font-size: 1.75rem; }
}

/* ─── Reduced motion ─── */

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .reveal { opacity: 1; transform: none; }
}
