/* Text / mobile home page. Generated markup comes from scripts/prerender.js.
   Shown on phones (html.is-home) and without JavaScript. On the 3D desktop
   page (html.is-3d) it stays in the DOM for screen readers and search engines. */

:root {
    --h-ink: #141414;
    --h-paper: #f6f0e4;
    --h-paper-2: #ebe2d0;
    --h-muted: #5d574d;
    --h-accent: #ff5a1f;
    --h-accent-text: #c2410c;
    --h-ok: #1fb36b;
    --h-pixel: 'Jersey 10', 'IBM Plex Mono', ui-monospace, monospace;
    --h-body: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --h-mono: 'IBM Plex Mono', ui-monospace, Menlo, monospace;
}

/* ---------- mode switching ---------- */
html.is-3d .home {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    clip: rect(0 0 0 0) !important;
    clip-path: inset(50%) !important;
    white-space: nowrap !important;
}
html.is-home,
html.is-home body {
    overflow: auto !important;
    height: auto !important;
    background: var(--h-paper) !important;
}
html.is-home #css,
html.is-home #webgl,
html.is-home #overlay,
html.is-home #ui-interactive,
html.is-home #ui {
    display: none !important;
}
html.is-home { scroll-behavior: smooth; scroll-padding-top: 64px; }

/* ---------- base ---------- */
.home {
    color: var(--h-ink);
    background: var(--h-paper);
    font: 400 16.5px/1.6 var(--h-body);
    -webkit-font-smoothing: antialiased;
    -webkit-text-size-adjust: 100%;
    padding-bottom: env(safe-area-inset-bottom);
}
.home *, .home *::before, .home *::after { box-sizing: border-box; }
.home a { color: inherit; -webkit-tap-highlight-color: rgba(255, 90, 31, 0.25); }
.home img { display: block; max-width: 100%; height: auto; }
.home ul, .home ol { list-style: none; margin: 0; padding: 0; }
.home h1, .home h2, .home h3, .home p, .home figure, .home dl, .home dd { margin: 0; }
.home :focus-visible { outline: 2px dashed var(--h-accent); outline-offset: 3px; }

/* ---------- sticky nav ---------- */
.h-nav {
    position: sticky; top: 0; z-index: 10;
    display: flex; align-items: center; gap: 10px;
    padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top));
    background: color-mix(in srgb, var(--h-paper) 92%, transparent);
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
    border-bottom: 2px solid var(--h-ink);
}
.h-logo span {
    display: grid; place-items: center; width: 34px; height: 34px;
    background: var(--h-accent); border: 2px solid var(--h-ink);
    font: 400 17px/1 var(--h-pixel); text-decoration: none;
}
.h-logo { text-decoration: none; flex: none; }
.h-nav__links {
    display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
    mask-image: linear-gradient(90deg, #000 85%, transparent);
}
.h-nav__links::-webkit-scrollbar { display: none; }
.h-nav__links a {
    flex: none; padding: 8px 10px; text-decoration: none; white-space: nowrap;
    font: 500 13px/1 var(--h-mono); letter-spacing: 0.02em;
}
.h-nav__links a:active { background: var(--h-paper-2); }

/* ---------- hero ---------- */
.h-hero {
    display: grid; gap: 20px; padding: 24px 16px 32px;
    max-width: 1080px; margin: 0 auto;
}
.h-photo {
    width: 132px; aspect-ratio: 4 / 5; object-fit: cover;
    border: 2px solid var(--h-ink); box-shadow: 4px 4px 0 var(--h-ink); background: var(--h-paper-2);
}
.h-kicker { font: 500 12px/1.3 var(--h-mono); text-transform: uppercase; letter-spacing: 0.1em; color: var(--h-accent-text); }
.home h1 { font: 400 clamp(46px, 13vw, 76px)/0.9 var(--h-pixel); letter-spacing: 0.01em; margin: 6px 0 12px; }
.h-headline { font-weight: 600; font-size: 17px; line-height: 1.4; }
.h-role { color: var(--h-muted); font-size: 15px; margin-top: 6px; }
.h-status {
    display: inline-flex; align-items: flex-start; gap: 8px; margin-top: 14px;
    padding: 8px 12px; background: #e6f8ee; border: 2px solid var(--h-ink);
    font: 500 12.5px/1.45 var(--h-mono);
}
.h-led { flex: none; width: 9px; height: 9px; margin-top: 4px; border-radius: 50%; background: var(--h-ok); }
.h-cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.h-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 48px; padding: 0 18px; text-decoration: none;
    font: 400 21px/1 var(--h-pixel); letter-spacing: 0.03em;
    background: var(--h-paper); border: 2px solid var(--h-ink); box-shadow: 3px 3px 0 var(--h-ink);
    touch-action: manipulation;
}
.h-btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--h-ink); }
.h-btn--dark { background: var(--h-ink); color: var(--h-paper) !important; }
.h-btn--accent { background: var(--h-accent); }
.h-3d { margin-top: 14px; font-size: 14px; color: var(--h-muted); }
.h-3d a { text-decoration-color: var(--h-accent); text-underline-offset: 3px; }

/* ---------- sections ---------- */
.h-sec {
    max-width: 1080px; margin: 0 auto; padding: 32px 16px;
    border-top: 2px dashed #ddd2bb;
}
.home h2 { font: 400 40px/1 var(--h-pixel); letter-spacing: 0.01em; margin: 4px 0 16px; }
.home h3 { font: 400 25px/1.05 var(--h-pixel); letter-spacing: 0.02em; }
.h-sec > p + p { margin-top: 12px; }
.h-lead { font-size: 17.5px; }
.h-meta { margin-top: 14px; font-size: 14.5px; color: var(--h-muted); }
.h-callout {
    margin: 16px 0; padding: 14px 16px; background: #fff3ec;
    border: 2px solid var(--h-ink); box-shadow: 3px 3px 0 var(--h-ink);
}
.h-sec > p { color: #2a2722; }
.h-sec .h-callout + p { margin-bottom: 12px; }

.h-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.h-chips li { font: 500 12px/1 var(--h-mono); padding: 6px 8px; background: var(--h-paper-2); border: 1.5px solid var(--h-ink); }

.h-links { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 14px; }
.h-links a {
    font-weight: 600; font-size: 15px; text-decoration: underline;
    text-decoration-color: var(--h-accent); text-decoration-thickness: 2px; text-underline-offset: 4px;
    padding: 4px 0;
}
.h-more { font-size: 14.5px; align-items: baseline; }

/* projects */
.h-grid { display: grid; gap: 14px; }
.h-card {
    background: #fff; border: 2px solid var(--h-ink); box-shadow: 3px 3px 0 var(--h-ink);
    padding: 16px; border-top: 8px solid var(--c, var(--h-accent));
}
.h-card .h-tag { font: 500 11.5px/1.3 var(--h-mono); color: var(--h-muted); text-transform: uppercase; letter-spacing: 0.06em; margin: 4px 0 8px; }
.h-card > p { font-size: 15px; color: #34302a; }
.h-facts { margin-top: 10px; display: grid; gap: 4px; font-size: 14px; color: var(--h-muted); }
.h-facts strong { color: var(--h-ink); font-family: var(--h-mono); }

/* experience */
.home .h-tl { position: relative; padding-left: 26px; }
.h-tl::before { content: ''; position: absolute; left: 6px; top: 6px; bottom: 6px; border-left: 2px dashed var(--h-ink); }
.h-tl > li { position: relative; padding-bottom: 22px; }
.h-tl > li::before {
    content: ''; position: absolute; left: -26px; top: 4px; width: 14px; height: 14px;
    background: var(--h-paper); border: 2px solid var(--h-ink);
}
.h-tl > li.is-current::before { background: var(--h-accent); }
.h-when { font: 500 12.5px/1.4 var(--h-mono); color: var(--h-muted); }
.h-org { font-weight: 600; font-size: 15px; margin: 2px 0 6px; }
.h-tl ul li { position: relative; padding-left: 16px; font-size: 15px; color: #2f2b25; }
.h-tl ul li + li { margin-top: 4px; }
.h-tl ul li::before { content: '▸'; position: absolute; left: 0; color: var(--h-accent-text); }

/* education */
.h-edu { display: grid; gap: 10px; }
.h-edu li { display: grid; gap: 2px; padding: 12px 14px; background: #fff; border: 2px solid var(--h-ink); }
.h-edu li span:not(.h-when) { color: var(--h-muted); font-size: 14.5px; }

/* certificates */
.h-certs { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.h-certs figure { background: #fff; border: 2px solid var(--h-ink); box-shadow: 3px 3px 0 var(--h-ink); }
.h-certs img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; object-position: top; border-bottom: 2px solid var(--h-ink); }
.h-certs figcaption { display: grid; gap: 4px; padding: 12px 14px; font-size: 14px; }
.h-certs figcaption span { font: 500 12px/1.4 var(--h-mono); color: var(--h-muted); }
.h-certs figcaption a { font-weight: 600; text-decoration-color: var(--h-accent); text-underline-offset: 3px; }

/* skills */
.h-skills { display: grid; gap: 14px; }
.h-skills dt { font: 500 12.5px/1 var(--h-mono); text-transform: uppercase; letter-spacing: 0.08em; }
.h-skills .h-chips { margin-top: 8px; }

/* contact */
.h-contact { padding-bottom: 40px; }
.h-mail { margin-top: 16px; font-size: 19px; overflow-wrap: anywhere; text-align: center; padding: 10px 14px; height: auto; }
.h-foot {
    padding: 22px 16px calc(28px + env(safe-area-inset-bottom));
    background: var(--h-ink); color: #cfc7b8; font: 400 12.5px/1.6 var(--h-mono);
}
.h-foot p { max-width: 1080px; margin: 0 auto; }
.h-foot a { color: #fff; }

/* ---------- larger screens (no-JS desktops) ---------- */
@media (min-width: 768px) {
    .h-hero { grid-template-columns: 220px 1fr; gap: 36px; padding: 48px 24px; align-items: center; }
    .h-photo { width: 220px; }
    .h-sec { padding: 44px 24px; }
    .h-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .h-skills { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .h-nav { padding-left: 24px; padding-right: 24px; }
}

@media (prefers-reduced-motion: reduce) {
    html.is-home { scroll-behavior: auto; }
}

/* First-screen focus line */
.h-focus { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.h-focus span {
    font: 600 12.5px/1 var(--h-mono); letter-spacing: 0.04em; text-transform: uppercase;
    padding: 7px 10px; background: var(--h-ink); color: var(--h-paper);
}
.h-focus span:first-child { background: var(--h-accent); color: var(--h-ink); }
.h-skills dt span { display: block; margin-top: 4px; font: 400 12.5px/1.3 var(--h-body); text-transform: none; letter-spacing: 0; color: var(--h-muted); }
.h-headline { font-size: 18px; }
.h-focus span { white-space: nowrap; }
