/* ==========================================================================
   Naol Berhanu Diriba: portfolio styles
   One loud moment (the 3D hero); everything after it is quiet and precise.
   ========================================================================== */

@font-face { font-family: 'Plex Sans'; src: url('fonts/plex-sans-400.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Plex Sans'; src: url('fonts/plex-sans-500.woff2') format('woff2'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'Plex Sans'; src: url('fonts/plex-sans-600.woff2') format('woff2'); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: 'Plex Mono'; src: url('fonts/plex-mono-400.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Plex Mono'; src: url('fonts/plex-mono-500.woff2') format('woff2'); font-weight: 500; font-style: normal; font-display: swap; }

:root {
    --ink: #0E1014;
    --ink-raised: #151820;
    --ink-sunk: #0A0C0F;
    --line: #242933;
    --line-strong: #353B47;
    --paper: #ECE8E1;
    --muted: #A3A9B4;
    --faint: #7C8390;
    --btc: #F7931A;
    --btc-soft: rgba(247, 147, 26, 0.12);
    --ok: #57C785;
    --err: #FF7A6B;

    --sans: 'Plex Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --mono: 'Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;

    --step--1: 0.875rem;
    --step-0: 1rem;
    --step-1: 1.125rem;
    --step-2: 1.375rem;
    --step-3: 1.75rem;
    --step-4: clamp(2.5rem, 6.5vw, 4.75rem);

    --header-h: 64px;
    --radius: 6px;
    --container: 1120px;
    --gutter: clamp(20px, 4vw, 32px);
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-h) + 16px);
    -webkit-text-size-adjust: 100%;
    background: var(--ink);
    touch-action: manipulation;
}

body {
    margin: 0;
    background: var(--ink);
    color: var(--paper);
    font-family: var(--sans);
    font-size: var(--step-0);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
    overflow-x: clip;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }

::selection { background: var(--btc); color: var(--ink); }

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

.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.skip-link {
    position: absolute; left: 12px; top: -48px; z-index: 100;
    background: var(--btc); color: var(--ink); padding: 10px 16px; border-radius: var(--radius);
    font-weight: 600; text-decoration: none; transition: top .15s;
}
.skip-link:focus { top: 12px; }

.container {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding-left: max(var(--gutter), env(safe-area-inset-left));
    padding-right: max(var(--gutter), env(safe-area-inset-right));
}

/* ----- 3D canvas + fallback backdrop --------------------------------------- */
#hero-3d {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    pointer-events: none;
    transition: opacity .2s linear;
}
.hero::before {
    /* Shown when WebGL is unavailable or 3D is skipped (Save-Data, reduced data) */
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(60% 50% at 70% 35%, rgba(247, 147, 26, 0.16), transparent 70%),
        radial-gradient(40% 40% at 20% 80%, rgba(255, 107, 0, 0.08), transparent 70%);
    z-index: -1;
    transition: opacity .6s;
}
.has-3d .hero::before { opacity: 0; }

/* ----- Header --------------------------------------------------------------- */
.site-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 50;
    height: var(--header-h);
    padding-top: env(safe-area-inset-top);
    border-bottom: 1px solid transparent;
    transition: border-color .2s;
}
/* The blur lives on a pseudo-element: backdrop-filter on the header itself
   would trap the fixed mobile menu inside the header's box. */
.site-header::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background: rgba(14, 16, 20, 0.55);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    transition: background .2s;
}
.site-header.is-scrolled { border-bottom-color: var(--line); }
.site-header.is-scrolled::before { background: rgba(14, 16, 20, 0.92); }
.menu-open .site-header::before { background: var(--ink); }
.header-inner {
    height: var(--header-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}
.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    font-weight: 600;
    letter-spacing: 0.01em;
    white-space: nowrap;
}
.brand-mark { width: 32px; height: 32px; border-radius: 8px; }

.site-nav { display: flex; align-items: center; gap: 4px; }
.site-nav a {
    text-decoration: none;
    color: var(--muted);
    font-size: 0.9375rem;
    padding: 8px 12px;
    border-radius: var(--radius);
    transition: color .15s, background .15s;
}
.site-nav a:hover { color: var(--paper); }
.site-nav a[aria-current="true"] { color: var(--paper); background: rgba(255, 255, 255, 0.05); }
.site-nav .nav-cta {
    color: var(--ink);
    background: var(--btc);
    font-weight: 500;
    margin-left: 8px;
}
.site-nav .nav-cta:hover, .site-nav .nav-cta[aria-current="true"] { color: var(--ink); background: #ffa53d; }

.nav-toggle {
    display: none;
    width: 44px; height: 44px;
    margin-right: -10px;
    background: none; border: 0; cursor: pointer;
    position: relative;
}
.nav-toggle-bar {
    position: absolute; left: 11px; right: 11px; height: 2px;
    background: var(--paper); border-radius: 2px;
    transition: transform .2s, top .2s;
}
.nav-toggle-bar:nth-child(2) { top: 17px; }
.nav-toggle-bar:nth-child(3) { top: 25px; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) { top: 21px; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) { top: 21px; transform: rotate(-45deg); }

/* ----- Buttons and links --------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    padding: 0 22px;
    border-radius: var(--radius);
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background .15s, border-color .15s, color .15s, transform .15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--btc); color: var(--ink); }
.btn-primary:hover { background: #ffa53d; }
.btn-primary[disabled] { opacity: .6; cursor: progress; }
.btn-ghost { border-color: var(--line-strong); color: var(--paper); background: rgba(14, 16, 20, 0.5); }
.btn-ghost:hover { border-color: var(--paper); }

.text-link {
    color: var(--btc);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 4px;
    font-weight: 500;
}
.text-link:hover { text-decoration-thickness: 2px; }
.ext::after {
    content: '';
    display: inline-block;
    width: 0.7em; height: 0.7em;
    margin-left: 0.35em;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M4 1h7v7M11 1 1 11' fill='none' stroke='black' stroke-width='1.6'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M4 1h7v7M11 1 1 11' fill='none' stroke='black' stroke-width='1.6'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* ----- Hero ----------------------------------------------------------------- */
main { position: relative; z-index: 1; }
.hero {
    position: relative;
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    align-items: center;
    padding: calc(var(--header-h) + 48px) 0 96px;
    text-align: center;
    isolation: isolate;
    overflow: hidden;
    overflow: clip;
}
.hero-inner { position: relative; display: flex; flex-direction: column; align-items: center; }
.hero-inner::before {
    /* soft scrim so text stays legible over the moving blocks */
    content: '';
    position: absolute;
    inset: -12% 0;
    background: radial-gradient(closest-side, rgba(14, 16, 20, 0.72), rgba(14, 16, 20, 0.35) 60%, transparent);
    z-index: -1;
    pointer-events: none;
}
.hero-name {
    font-size: var(--step-4);
    font-weight: 600;
    line-height: 1.02;
    letter-spacing: -0.025em;
    text-wrap: balance;
    text-shadow: 0 2px 30px rgba(14, 16, 20, 0.8);
}
.hero-role {
    margin-top: 20px;
    max-width: 50ch;
    font-size: var(--step-1);
    color: var(--paper);
    text-wrap: balance;
    text-shadow: 0 1px 16px rgba(14, 16, 20, 0.9);
}
.hero-lede {
    margin-top: 16px;
    max-width: 56ch;
    color: var(--muted);
    text-wrap: pretty;
    text-shadow: 0 1px 16px rgba(14, 16, 20, 0.9);
}
.hero-actions { margin-top: 36px; display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.hero-hint {
    margin-top: 40px;
    font-family: var(--mono);
    font-size: var(--step--1);
    color: var(--btc);
    opacity: .85;
    transition: opacity .4s;
}
.hero-hint.is-pending { visibility: hidden; opacity: 0; }

/* 404 page: the same block card the hero uses, so a dead link still
   looks like part of the site rather than a server error page */
.hero-404 { min-height: 92vh; min-height: 92svh; padding-bottom: 72px; text-align: left; }
.hero-404 .hero-inner { align-items: center; }
.nf-card {
    width: min(560px, 100%);
    background: rgba(14, 16, 20, 0.94);
    border: 1px solid rgba(247, 147, 26, 0.45);
    border-radius: 10px;
    box-shadow: 0 18px 54px rgba(0, 0, 0, 0.55);
    overflow: hidden;
}
.nf-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 16px;
    background: var(--btc);
    color: var(--ink);
    font-family: var(--mono);
    font-weight: 500;
}
.nf-card-code { font-size: 0.8125rem; letter-spacing: 0.08em; }
.nf-card-body { padding: 26px clamp(18px, 4vw, 28px) 28px; }
.nf-card-body h1 {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: -0.02em;
    text-wrap: balance;
}
.nf-card-body > p { margin-top: 14px; color: var(--muted); max-width: 46ch; }
.nf-facts { margin: 24px 0 26px; font-size: 0.875rem; }
.nf-facts .bc-row { padding: 8px 0; border-bottom: 1px solid var(--line); }
.nf-facts dt { color: var(--faint); }
.nf-facts dd { text-align: right; color: var(--paper); }
.nf-facts code { font-family: var(--mono); font-size: 0.8125rem; color: var(--btc); word-break: break-all; }
.hero-404 .hero-actions { margin-top: 0; justify-content: flex-start; }
.nf-links {
    width: min(560px, 100%);
    margin-top: 32px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
    display: flex;
    flex-wrap: wrap;
    gap: 10px 24px;
    font-size: 0.9375rem;
}
.nf-links a { color: var(--muted); text-decoration: none; }
.nf-links a:hover { color: var(--btc); }

/* ----- Sections ------------------------------------------------------------- */
.section {
    position: relative;
    background: var(--ink);
    border-top: 1px solid var(--line);
    padding: clamp(64px, 9vw, 112px) 0;
}
.section-grid {
    display: grid;
    grid-template-columns: 200px minmax(0, 1fr);
    gap: 48px;
    align-items: start;
}
.rail-title {
    position: sticky;
    top: calc(var(--header-h) + 32px);
    font-size: var(--step-1);
    font-weight: 600;
    color: var(--paper);
    line-height: 1.3;
}
.rail-title::before {
    content: '';
    display: block;
    width: 24px; height: 2px;
    background: var(--btc);
    margin-bottom: 14px;
}
.section-body { min-width: 0; }

.lead { font-size: var(--step-1); line-height: 1.55; color: var(--paper); }
.prose p { max-width: 68ch; color: var(--muted); }
.prose p + p { margin-top: 1em; }
.prose .lead { color: var(--paper); }

/* About */
.about-grid {
    display: grid;
    grid-template-columns: minmax(180px, 260px) minmax(0, 1fr);
    gap: 40px;
    align-items: start;
}
.portrait img {
    width: 100%;
    height: auto;
    aspect-ratio: 640 / 782;
    object-fit: cover;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: var(--ink-raised);
}
.highlights {
    margin-top: 56px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border-top: 1px solid var(--line);
}
.highlight { padding: 20px 20px 0 0; }
.highlight + .highlight { padding-left: 20px; border-left: 1px solid var(--line); }
.highlight dt { font-weight: 600; color: var(--btc); }
.highlight dd { margin-top: 6px; font-size: var(--step--1); color: var(--muted); line-height: 1.5; }

/* Experience */
.timeline { position: relative; }
.role {
    position: relative;
    padding-left: 28px;
    padding-bottom: 48px;
    border-left: 1px solid var(--line);
}
.role:last-child { padding-bottom: 0; }
.role::before {
    content: '';
    position: absolute;
    left: -5px; top: 7px;
    width: 9px; height: 9px;
    border-radius: 2px;
    background: var(--ink);
    border: 2px solid var(--btc);
}
.role:first-child::before { background: var(--btc); }
.role-dates { font-family: var(--mono); font-size: var(--step--1); color: var(--btc); }
.role-title { margin-top: 6px; font-size: var(--step-2); font-weight: 600; line-height: 1.3; }
.role-org { margin-top: 4px; color: var(--muted); }
.role-points { margin-top: 18px; display: grid; gap: 10px; max-width: 70ch; }
.role-points li { position: relative; padding-left: 18px; color: var(--muted); }
.role-points li::before {
    content: '';
    position: absolute; left: 0; top: 0.72em;
    width: 6px; height: 1px; background: var(--faint);
}

/* Expertise */
.expertise { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.skill-group {
    padding: 24px;
    background: var(--ink-raised);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
}
.skill-group h3 { font-size: var(--step-1); font-weight: 600; line-height: 1.35; }
.skill-group p { margin-top: 12px; color: var(--muted); font-size: 0.9375rem; }
.skill-group .evidence { margin-top: auto; padding-top: 16px; font-size: var(--step--1); color: var(--faint); }
.skill-group .evidence a { color: var(--btc); }
.tools { margin-top: 24px; color: var(--muted); font-size: 0.9375rem; }
.tools-label { color: var(--paper); font-weight: 500; margin-right: 8px; }

/* Work */
.work-feature {
    padding: clamp(24px, 4vw, 40px);
    border: 1px solid var(--line-strong);
    border-left: 3px solid var(--btc);
    border-radius: var(--radius);
    background: linear-gradient(180deg, var(--ink-raised), var(--ink));
}
.work-meta { font-family: var(--mono); font-size: var(--step--1); color: var(--btc); }
.work-feature h3 { margin-top: 10px; font-size: var(--step-3); font-weight: 600; line-height: 1.25; max-width: 34ch; text-wrap: balance; }
.work-feature p:not(.work-meta) { margin-top: 14px; color: var(--muted); max-width: 64ch; }
.work-feature .text-link { display: inline-block; margin-top: 20px; }
.work-grid { margin-top: 16px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.work-item { padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); }
.work-item h3 { font-size: var(--step-1); font-weight: 600; }
.work-item p { margin-top: 10px; color: var(--muted); font-size: 0.9375rem; }
.work-item .work-note { font-size: var(--step--1); color: var(--faint); }

/* Speaking */
.media-list { display: grid; gap: 32px; }
.media-item { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 28px; align-items: start; }
.media-thumb {
    position: relative;
    display: block;
    aspect-ratio: 16 / 9;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--line);
    background: var(--ink-raised);
}
.media-thumb img { position: relative; z-index: 1; width: 100%; height: 100%; object-fit: cover; filter: saturate(.85); transition: filter .2s; }
.thumb-fallback {
    position: absolute; left: 16px; bottom: 12px;
    font-weight: 600; color: var(--paper);
}
.media-thumb:not(.media-thumb-text) { background: linear-gradient(135deg, rgba(247, 147, 26, 0.14), transparent 60%), var(--ink-raised); }
.media-thumb .play { z-index: 2; }
.media-thumb:hover img { filter: saturate(1); }
.media-thumb .play {
    position: absolute; left: 50%; top: 50%;
    width: 48px; height: 48px; margin: -24px 0 0 -24px;
    border-radius: 50%;
    background: rgba(14, 16, 20, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
}
.media-thumb .play::after {
    content: ''; position: absolute; left: 19px; top: 15px;
    border-left: 13px solid var(--paper); border-top: 9px solid transparent; border-bottom: 9px solid transparent;
}
.media-thumb-text {
    display: flex; flex-direction: column; justify-content: flex-end;
    padding: 16px; text-decoration: none;
    background:
        linear-gradient(135deg, rgba(247, 147, 26, 0.16), transparent 60%),
        var(--ink-raised);
}
.thumb-city { font-size: var(--step-2); font-weight: 600; line-height: 1.1; }
.thumb-year { font-family: var(--mono); color: var(--btc); font-size: var(--step--1); }
.media-meta { font-family: var(--mono); font-size: var(--step--1); color: var(--btc); }
.media-body h3 { margin-top: 6px; font-size: var(--step-1); font-weight: 600; line-height: 1.35; }
.media-body p:not(.media-meta) { margin-top: 8px; color: var(--muted); max-width: 64ch; }
.media-body .text-link { display: inline-block; margin-top: 12px; font-size: 0.9375rem; }

/* Writing */
.articles { border-top: 1px solid var(--line); }
.article {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr);
    gap: 24px;
    padding: 24px 0;
    border-bottom: 1px solid var(--line);
}
.article-date { font-family: var(--mono); font-size: var(--step--1); color: var(--faint); padding-top: 3px; }
.article h3 { font-size: var(--step-1); font-weight: 600; line-height: 1.4; }
.article h3 a { text-decoration: none; }
.article h3 a:hover { color: var(--btc); }
.article h3 a::after { content: ''; }
.article p { margin-top: 8px; color: var(--muted); max-width: 68ch; }
.more { margin-top: 20px; }

/* Credentials */
.cred-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px; }
.cred-heading { font-size: var(--step--1); font-weight: 500; color: var(--faint); letter-spacing: 0.02em; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.cred-list li { padding: 18px 0; border-bottom: 1px solid var(--line); }
.cred-name { font-weight: 600; }
.cred-where { color: var(--muted); margin-top: 2px; }
.cred-when { font-family: var(--mono); font-size: var(--step--1); color: var(--btc); margin-top: 6px; }
.cred-verify { margin-top: 28px; color: var(--muted); max-width: 68ch; }

/* Ethiopia */
.eth-intro { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 32px; align-items: start; }
.eth-flag-wrap { display: block; }
.eth-flag { display: block; width: 160px; height: auto; aspect-ratio: 320 / 172; }
.eth-intro .lead { max-width: 62ch; }
.stats {
    margin-top: 40px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px;
    background: var(--line);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
}
.stat { background: var(--ink); padding: 22px 22px 20px; }
.stat dt { font-size: var(--step--1); color: var(--muted); }
.stat-value { margin-top: 6px; font-size: var(--step-3); font-weight: 600; color: var(--btc); line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-note { margin-top: 6px; font-size: 0.8125rem; color: var(--faint); line-height: 1.45; }
.facts { margin-top: 28px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 40px; }
.facts div { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 0.9375rem; }
.facts dt { color: var(--faint); }
.sources { margin-top: 24px; font-size: 0.8125rem; color: var(--faint); max-width: 80ch; }
.sources a { color: var(--muted); }

/* Contact */
.contact-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 48px; align-items: start; }
.contact-methods { margin-top: 28px; display: grid; gap: 4px; }
.contact-methods a, .cm-static {
    display: flex; align-items: center; gap: 14px;
    padding: 12px 0;
    text-decoration: none;
    border-bottom: 1px solid var(--line);
    word-break: break-word;
}
.contact-methods a:hover { color: var(--btc); }
.contact-methods svg { width: 22px; height: 22px; flex: none; fill: none; stroke: var(--btc); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.cm-label { display: block; font-size: 0.8125rem; color: var(--faint); }

.contact-form {
    padding: clamp(20px, 4vw, 32px);
    background: var(--ink-raised);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    display: grid;
    gap: 18px;
}
.field { display: grid; gap: 6px; }
.field label { font-size: 0.9375rem; font-weight: 500; }
.optional { color: var(--faint); font-weight: 400; }
.field input, .field select, .field textarea {
    width: 100%;
    min-height: 48px;
    padding: 12px 14px;
    background: var(--ink-sunk);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    font-size: 1rem; /* 16px avoids iOS zoom on focus */
    transition: border-color .15s, box-shadow .15s;
}
.field select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23A3A9B4' stroke-width='1.6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 12px;
    padding-right: 40px;
}
.field textarea { resize: vertical; min-height: 132px; }
.field input:focus, .field select:focus, .field textarea:focus {
    outline: none;
    border-color: var(--btc);
    box-shadow: 0 0 0 3px var(--btc-soft);
}
.field [aria-invalid="true"] { border-color: var(--err); }
.field input:-webkit-autofill,
.field input:-webkit-autofill:hover,
.field input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--paper);
    caret-color: var(--paper);
    -webkit-box-shadow: 0 0 0 1000px var(--ink-sunk) inset;
    box-shadow: 0 0 0 1000px var(--ink-sunk) inset;
    transition: background-color 9999s ease-out 0s;
}
.field input:-webkit-autofill:focus { -webkit-box-shadow: 0 0 0 1000px var(--ink-sunk) inset, 0 0 0 3px var(--btc-soft); }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-status { min-height: 1.5em; font-size: 0.9375rem; color: var(--muted); }
.form-status.is-ok { color: var(--ok); }
.form-status.is-err { color: var(--err); }
.form-status a { color: var(--btc); }

/* ----- Footer --------------------------------------------------------------- */
.site-footer { position: relative; z-index: 1; background: var(--ink-sunk); border-top: 1px solid var(--line); }
.ticker { border-bottom: 1px solid var(--line); }
.ticker-inner {
    display: flex; align-items: center; gap: 20px;
    min-height: 48px;
    font-family: var(--mono);
    font-size: var(--step--1);
}
.ticker-label { color: var(--paper); font-weight: 500; }
.ticker-items { color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px 20px; flex: 1; }
.tick b { color: var(--paper); font-weight: 500; margin-right: 6px; }
.tick .up { color: var(--ok); margin-left: 6px; }
.tick .down { color: var(--err); margin-left: 6px; }
.footer-inner {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
    gap: 12px 32px;
    padding-top: 28px;
    padding-bottom: max(28px, env(safe-area-inset-bottom));
    font-size: var(--step--1);
    color: var(--faint);
}
.footer-nav { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.footer-nav a { text-decoration: none; color: var(--muted); }
.footer-nav a:hover { color: var(--paper); }

/* ----- Block story card (created by hero3d.js) ------------------------------ */
.block-card {
    position: fixed;
    z-index: 60;
    width: 340px;
    max-width: calc(100vw - 16px);
    background: rgba(14, 16, 20, 0.97);
    border: 1px solid rgba(247, 147, 26, 0.45);
    border-radius: 10px;
    box-shadow: 0 18px 54px rgba(0, 0, 0, 0.6);
    font-size: 0.8125rem;
    line-height: 1.5;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity .16s ease, transform .16s ease;
    overflow: hidden;
}
.block-card.is-open { opacity: 1; transform: none; }
.block-card.is-sheet {
    left: 8px !important; right: 8px; bottom: max(8px, env(safe-area-inset-bottom)); top: auto !important;
    width: auto; max-width: none;
    max-height: 70vh; overflow-y: auto;
    background: var(--ink);
    transform: translateY(24px);
}
.block-card.is-sheet.is-open { transform: none; }
.bc-head {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px 10px 14px;
    background: var(--btc); color: var(--ink);
    font-family: var(--mono);
}
.bc-height { font-weight: 500; }
.bc-tag { flex: 1; text-align: right; font-size: 0.75rem; }
.bc-close {
    width: 32px; height: 32px; margin: -6px -4px -6px 0;
    border: 0; background: transparent; color: var(--ink);
    font-size: 22px; line-height: 1; cursor: pointer; border-radius: 4px;
}
.bc-close:hover { background: rgba(0, 0, 0, 0.12); }
.bc-note { padding: 12px 14px 4px; color: #f0d6b0; }
.bc-facts { padding: 4px 14px 0; margin: 0; }
.bc-row { display: flex; justify-content: space-between; gap: 16px; padding: 5px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
.bc-row dt { color: var(--faint); }
.bc-row dd { text-align: right; color: var(--paper); }
.bc-row code { font-family: var(--mono); font-size: 0.75rem; }
.bc-dim { color: var(--faint); }
.bc-foot { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; padding: 10px 14px 0; }
.bc-verify-label { color: var(--faint); }
.bc-verify { color: var(--btc); font-weight: 500; text-decoration: underline; text-underline-offset: 3px; }
.bc-sep { color: var(--faint); }
.bc-status { flex-basis: 100%; color: var(--ok); font-size: 0.75rem; }
.bc-rel {
    display: grid; gap: 2px;
    margin: 12px 14px 14px;
    padding: 10px 12px;
    border: 1px solid rgba(247, 147, 26, 0.35);
    border-radius: 8px;
    background: var(--btc-soft);
    text-decoration: none;
    color: var(--paper);
}
.bc-rel:hover { border-color: var(--btc); }
.bc-rel-k { font-size: 0.75rem; color: var(--btc); }

/* ----- Responsive ----------------------------------------------------------- */
@media (max-width: 1080px) {
    .site-nav a { padding: 8px 9px; }
}

@media (max-width: 960px) {
    .nav-toggle { display: block; }
    .site-nav {
        position: fixed;
        top: calc(var(--header-h) + env(safe-area-inset-top));
        left: 0; right: 0; bottom: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 12px var(--gutter) max(24px, env(safe-area-inset-bottom));
        background: var(--ink);
        border-top: 1px solid var(--line);
        overflow-y: auto;
        visibility: hidden;
        opacity: 0;
        transform: translateY(-8px);
        transition: opacity .18s, transform .18s, visibility 0s linear .18s;
    }
    .site-nav.is-open { visibility: visible; opacity: 1; transform: none; transition: opacity .18s, transform .18s; }
    .site-nav a { font-size: var(--step-2); padding: 14px 4px; border-bottom: 1px solid var(--line); border-radius: 0; color: var(--paper); }
    .site-nav a[aria-current="true"] { background: none; color: var(--btc); }
    .site-nav .nav-cta { margin: 20px 0 0; text-align: center; border-radius: var(--radius); border-bottom: 0; }

    .section-grid { grid-template-columns: minmax(0, 1fr); gap: 28px; }
    .rail-title { position: static; font-size: var(--step-2); }
    .highlights { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .highlight:nth-child(3) { padding-left: 0; border-left: 0; }
    .expertise { grid-template-columns: minmax(0, 1fr); }
    .contact-grid { grid-template-columns: minmax(0, 1fr); gap: 36px; }
    .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .facts { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 640px) {
    :root { --header-h: 58px; }
    .hero-404 { align-items: center; padding-bottom: 56px; }
    .hero-404 .hero-inner { align-items: stretch; }
    .hero-404 .hero-actions { flex-direction: column; }
    .nf-links { gap: 10px 20px; }
    .hero { text-align: left; align-items: flex-end; padding-bottom: 72px; }
    .hero-inner { align-items: flex-start; }
    .hero-actions { justify-content: flex-start; width: 100%; }
    .hero-actions .btn { flex: 1 1 auto; }
    .about-grid { grid-template-columns: minmax(0, 1fr); gap: 28px; }
    .portrait { max-width: 220px; }
    .highlights { grid-template-columns: minmax(0, 1fr); }
    .highlight, .highlight + .highlight { padding: 16px 0; border-left: 0; border-bottom: 1px solid var(--line); }
    .work-grid { grid-template-columns: minmax(0, 1fr); }
    .media-item { grid-template-columns: minmax(0, 1fr); gap: 16px; }
    .media-thumb { max-width: 420px; }
    .article { grid-template-columns: minmax(0, 1fr); gap: 6px; }
    .cred-cols { grid-template-columns: minmax(0, 1fr); gap: 32px; }
    .eth-intro { grid-template-columns: minmax(0, 1fr); gap: 18px; }
    .eth-flag { width: 140px; }
    .stats { grid-template-columns: minmax(0, 1fr); }
    .facts div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
    .ticker-inner { padding-top: 10px; padding-bottom: 10px; flex-wrap: wrap; gap: 6px 16px; }
    .ticker-items { flex-basis: 100%; order: 3; }
    .footer-inner { flex-direction: column; align-items: flex-start; }
}

@media (hover: none) {
    .media-thumb img { filter: none; }
}

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

/* ----- Print: a clean one-page summary ------------------------------------- */
@media print {
    :root { --paper: #111; --muted: #333; --faint: #555; --btc: #9a5300; --line: #ccc; --ink: #fff; --ink-raised: #fff; --ink-sunk: #fff; }
    body { background: #fff; color: #111; font-size: 11pt; }
    #hero-3d, .nf-links, .hero-404 .hero-actions, .site-header, .hero-actions, .hero-hint, .ticker, .contact-form, .footer-nav, .skip-link, .media-thumb, .block-card, #ethiopia { display: none !important; }
    .hero { min-height: 0; padding: 0 0 12pt; text-align: left; }
    .hero-inner { align-items: flex-start; }
    .hero-name, .hero-role, .hero-lede { text-shadow: none; }
    .section { padding: 14pt 0; break-inside: avoid-page; }
    .section-grid { grid-template-columns: 120px 1fr; gap: 16pt; }
    .rail-title { position: static; }
    a { text-decoration: none; }
    .ext::after { display: none; }
}
