﻿/* â”€â”€ CSS CUSTOM PROPERTIES â”€â”€ */
:root {
    --bg:       #ffffff;
    --card:     #ffffff;
    --card-2:   #fafafa;
    --border:   #e8e8e8;
    --border-2: #d2d2d2;
    --accent:   #0b7285;
    --accent-soft: #f0f7f9;
    --ink:      #16181d;
    --text:     #2c3138;
    --muted:    #5f666f;
    --dim:      #9aa1a9;
    --danger:   #c0392b;
    --warn:     #8a6d1f;
    --ok:       #2f7d3a;
    --font:     'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --mono:     'JetBrains Mono', ui-monospace, 'SF Mono', 'Cascadia Mono', Consolas, monospace;

    /* â”€â”€ Layout tokens â”€â”€
       Every centered container reads --maxw, and every horizontal edge reads
       --gutter, so widths are changed in one place instead of a dozen. The
       content cap steps up on large displays rather than stranding the page
       at 1080px in the middle of a 1440p or 4K screen. */
    --maxw:   1080px;
    --gutter: 40px;
}

@media (min-width: 1500px) { :root { --maxw: 1240px; } }
@media (min-width: 1800px) { :root { --maxw: 1380px; } }
@media (min-width: 2200px) { :root { --maxw: 1520px; } }

/* Shared centered-column geometry. */
section,
#hero,
#projects,
#about-hero,
#portfolio-hero,
#contact-hero,
#project-detail {
    max-width: var(--maxw);
    padding-inline: var(--gutter);
}

/* Full-bleed bars whose *contents* still line up with the centered column.
   max() resolves to --gutter on narrow screens (the calc goes negative) and
   to the column's left edge once the viewport is wider than --maxw, so the
   logo sits directly above the hero text at any width. */
nav,
footer {
    padding-inline: max(var(--gutter), calc(50% - var(--maxw) / 2 + var(--gutter)));
}

/* â”€â”€ GLOBAL RESET & BASE â”€â”€ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font);
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.7;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.15s ease;
}

a:hover {
    color: var(--ink);
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 3px;
}

/* â”€â”€ NAVBAR â”€â”€ */
nav {
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-logo {
    font-size: 18px;
    font-weight: 700;
    color: var(--ink);
    letter-spacing: 1px;
}

.nav-logo span {
    color: var(--accent);
}

.nav-logo:hover {
    color: var(--ink);
}

.nav-links {
    display: flex;
    gap: 4px;
    align-items: center;
}

.nav-links a {
    font-size: 14px;
    font-weight: 500;
    color: var(--muted);
    padding: 6px 14px;
    border-radius: 6px;
    transition: color 0.15s, background 0.15s;
}

.nav-links a:hover {
    color: var(--ink);
    background: var(--card-2);
}

.nav-links a.active {
    color: var(--ink);
    font-weight: 600;
}

.nav-links .nav-inbox {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.nav-inbox-badge {
    background: var(--danger);
    color: #fff;
    font-size: 11px;
    font-family: var(--mono);
    font-weight: 600;
    padding: 1px 7px;
    border-radius: 10px;
    line-height: 1.5;
}

/* â”€â”€ SECTIONS (generic) â”€â”€ */
section {
    margin: clamp(48px, 7vw, 96px) auto;
}

section h2 {
    font-size: 12px;
    color: var(--dim);
    text-transform: uppercase;
    letter-spacing: 1.6px;
    margin-bottom: 32px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
}

section h3 {
    font-size: 18px;
    color: var(--ink);
    margin: 24px 0 8px;
    font-weight: 600;
}

section p {
    color: var(--muted);
    margin-bottom: 12px;
}

section ul {
    list-style: none;
    padding: 0;
}

section ul li {
    padding: 6px 0;
    color: var(--muted);
}

section ul li strong {
    color: var(--ink);
}

/* â”€â”€ HERO SECTION â”€â”€ */
#hero {
    min-height: calc(100vh - 64px);
    margin: 0 auto;
    display: grid;
    /* Columns collapse to one automatically once each would fall under ~380px,
       so the hero reflows without a breakpoint doing the deciding. */
    grid-template-columns: repeat(auto-fit, minmax(min(380px, 100%), 1fr));
    gap: clamp(32px, 5vw, 72px);
    align-items: center;
}

.hero-left {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.hero-eyebrow {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--accent);
    letter-spacing: 1.6px;
    text-transform: uppercase;
}

.hero-name {
    font-size: clamp(34px, 4.4vw, 64px);
    font-weight: 700;
    color: var(--ink);
    line-height: 1.08;
    letter-spacing: -0.025em;
}

.hero-sub {
    font-size: clamp(17px, 1.5vw, 22px);
    color: var(--muted);
    font-weight: 400;
}

.hero-desc {
    font-size: clamp(14.5px, 1.1vw, 17px);
    color: var(--muted);
    line-height: 1.8;
    /* ch keeps the measure readable as the font grows on wide screens. */
    max-width: 52ch;
}

.hero-cta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.btn-primary {
    background: var(--ink);
    color: #ffffff;
    padding: 11px 26px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    transition: background 0.15s ease;
    display: inline-block;
}

.btn-primary:hover {
    background: #333940;
    color: #ffffff;
}

.btn-outline {
    border: 1px solid var(--border-2);
    color: var(--ink);
    padding: 11px 26px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: border-color 0.15s ease, background 0.15s ease;
    display: inline-block;
}

.btn-outline:hover {
    border-color: var(--ink);
    color: var(--ink);
    background: var(--card-2);
}

/* â”€â”€ TERMINAL WIDGET â”€â”€
   Shown at every width. The font scales with the viewport so the longest
   line (~46 monospace chars) fits a 360px phone, and the body scrolls
   horizontally as a fallback for anything narrower. */
.hero-terminal {
    background: var(--card-2);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    font-family: var(--mono);
    font-size: clamp(10.5px, 2.6vw, 13px);
    min-width: 0;
}

.terminal-bar {
    background: #f2f3f4;
    padding: 10px clamp(12px, 3vw, 16px);
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid var(--border);
}

.terminal-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--border-2);
    flex-shrink: 0;
}

.terminal-title {
    font-size: 12px;
    color: var(--dim);
    margin-left: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.terminal-body {
    padding: clamp(14px, 3.5vw, 20px);
    line-height: 1.8;
    color: var(--muted);
    overflow-x: auto;
}

.terminal-body > div {
    white-space: nowrap;
}

.terminal-body::-webkit-scrollbar { height: 6px; }
.terminal-body::-webkit-scrollbar-thumb {
    background: var(--border-2);
    border-radius: 3px;
}

.terminal-body .t-prompt { color: var(--accent); }
.terminal-body .t-cmd    { color: var(--ink); }
.terminal-body .t-out    { color: var(--ok); }
.terminal-body .t-comment{ color: var(--dim); }
.terminal-body .t-warn   { color: var(--warn); }

.terminal-cursor {
    display: inline-block;
    width: 7px;
    height: 14px;
    background: var(--accent);
    vertical-align: text-bottom;
    animation: blink 1.2s ease-in-out infinite;
    margin-left: 2px;
    border-radius: 1px;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.2; }
}

/* ─────────────────────────────────────────
   SKILLS — interactive domain graph
   Category accent arrives per-element as --cat-accent (set from the DB),
   so nothing here hardcodes a colour. Tints derive from it via color-mix.
   ───────────────────────────────────────── */

.skills-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
    margin-bottom: 22px;
}

.skills-head h2 {
    margin: 0;
    border: none;
    padding: 0;
}

.skills-lede {
    margin: 0;
    max-width: 42ch;
    font-size: 14.5px;
    line-height: 1.6;
    color: var(--muted);
}

.skills-graph {
    --cat-accent: var(--accent);
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.skills-graph-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.skills-hint {
    margin-left: auto;
    font-family: var(--mono);
    font-size: 11.5px;
    letter-spacing: 0.06em;
    color: var(--dim);
}

/* ── Tabs ── */
.skills-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.skills-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 13px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--card);
    cursor: pointer;
    font-family: var(--mono);
    font-size: 13px;
    color: var(--muted);
    transition: border-color .18s ease, background .18s ease, color .18s ease;
}

.skills-tab:hover { border-color: var(--border-2); color: var(--ink); }

.skills-tab.active {
    color: var(--ink);
    border-color: var(--cat-accent);
    background: color-mix(in srgb, var(--cat-accent) 7%, white);
}

.skills-tab-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--border-2);
    transition: background .18s ease;
}

.skills-tab.active .skills-tab-dot { background: var(--cat-accent); }
.skills-tab-count { opacity: .55; }

/* ── Canvas ── */
.skills-graph-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
}

.skills-canvas {
    position: relative;
    height: 430px;
    background-image: radial-gradient(var(--border) 1px, transparent 1px);
    background-size: 22px 22px;
}

.skills-links {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.skills-link {
    stroke: var(--ink);
    stroke-width: 1;
    opacity: .13;
    transition: opacity .25s ease, stroke .25s ease;
}

.skills-link.is-strong {
    stroke: var(--cat-accent);
    opacity: .55;
    stroke-width: 1.25;
}

.skills-link.is-faded { opacity: .05; }

.skills-centre {
    position: absolute;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 112px;
    height: 112px;
    border-radius: 50%;
    background: var(--cat-accent);
    color: #fff;
    text-align: center;
    box-shadow: 0 8px 24px -10px var(--cat-accent);
}

.skills-centre-kicker {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: .1em;
    opacity: .75;
}

.skills-centre-name {
    font-size: 15px;
    font-weight: 700;
    padding-top: 3px;
}

.skills-centre-count {
    font-family: var(--mono);
    font-size: 11px;
    opacity: .75;
    padding-top: 2px;
}

/* ── Nodes ── */
.skills-node {
    position: absolute;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px 14px;
    border-radius: 999px;
    background: var(--card);
    border: 1.5px solid var(--border);
    box-shadow: 0 1px 2px rgba(20, 20, 20, .05);
    cursor: pointer;
    font-family: var(--font);
    white-space: nowrap;
    transition: opacity .25s ease, border-color .2s ease,
                background .2s ease, box-shadow .2s ease;
}

.skills-graph.animate .skills-node {
    animation: nodeIn .4s cubic-bezier(.2, .7, .3, 1) backwards;
    animation-delay: calc(var(--i, 0) * 45ms);
}

@keyframes nodeIn {
    from { opacity: 0; transform: translate(-50%, -50%) scale(.9); }
    to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.skills-node-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border-2);
    transition: background .2s ease;
}

.skills-node-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--ink);
}

.skills-node-level {
    display: inline-flex;
    gap: 3px;
    align-items: center;
}

.lvl-pip {
    display: block;
    width: 6px;
    height: 9px;
    border: 1px solid var(--border-2);
    border-radius: 1px;
}

.lvl-pip.on {
    background: var(--cat-accent);
    border-color: var(--cat-accent);
}

.skills-node.is-dim { opacity: .2; }

.skills-node.is-active,
.skills-node:hover,
.skills-node:focus-visible {
    border-color: var(--cat-accent);
    background: color-mix(in srgb, var(--cat-accent) 6%, white);
    box-shadow: 0 8px 20px -12px rgba(20, 20, 20, .5);
}

.skills-node.is-active .skills-node-dot { background: var(--cat-accent); }

/* ── Detail panel ── */
.skills-detail {
    border-left: 1px solid var(--border);
    padding: 24px 22px;
    display: flex;
    flex-direction: column;
    gap: 13px;
    background: var(--card-2);
    min-height: 430px;
}

.skills-detail-kicker {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: .12em;
    color: var(--dim);
}

.skills-detail-title {
    margin: 0;
    font-size: 20px;
    font-weight: 650;
    color: var(--ink);
    line-height: 1.25;
    letter-spacing: -0.02em;
}

.skills-detail-body {
    margin: 0;
    font-size: 14.5px;
    line-height: 1.6;
    color: var(--muted);
}

.skills-detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.skills-detail-tag,
.skill-tag {
    font-family: var(--mono);
    font-size: 11.5px;
    color: var(--muted);
    background: var(--bg);
    border: 1px solid var(--border);
    padding: 4px 9px;
    border-radius: 5px;
}

.skills-detail-foot {
    margin-top: auto;
    border-top: 1px solid var(--border);
    padding-top: 15px;
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.skills-detail-level {
    display: flex;
    align-items: center;
    gap: 10px;
}

.skills-detail-lvl-label {
    font-size: 13px;
    color: var(--muted);
}

/* ── Fallback list: no JS, and every screen under 860px ── */
.skills-fallback-group { margin-bottom: 40px; }
.skills-fallback-group:last-child { margin-bottom: 0; }

.skills-fallback-group h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 8px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--cat-accent);
    font-size: 17px;
    font-weight: 600;
    color: var(--ink);
}

.skills-fallback-count {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--dim);
    margin-left: auto;
}

.skills-fallback-summary {
    margin: 0 0 16px;
    font-size: 14px;
    color: var(--muted);
    max-width: 62ch;
}

.skill-items {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
    gap: 14px;
}

.skill-item {
    padding: 16px 18px;
    background: var(--card);
    border: 1px solid var(--border);
    border-left: 2px solid var(--cat-accent);
    border-radius: 8px;
}

.skill-item-name {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 4px;
}

.skill-item-desc {
    display: block;
    font-size: 13.5px;
    color: var(--muted);
    line-height: 1.6;
    margin-bottom: 10px;
}

.skill-item-meta {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
}

.skill-item-level { display: inline-flex; gap: 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;
}

/* The graph needs pointer hover and horizontal room; below 860px the
   fallback list is the better experience, not a degraded one. */
.skills-graph { display: none; }
.skills-fallback { display: block; }

@media (min-width: 861px) {
    .js .skills-graph { display: block; }
    .js .skills-fallback { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .skills-node,
    .skills-link,
    .skills-tab { transition: none; }
    .skills-graph.animate .skills-node { animation: none; }
}

/* â”€â”€ EXPERIENCE SECTION â”€â”€ */
.experience-timeline {
    position: relative;
    padding-left: 24px;
}

.experience-timeline::before {
    content: '';
    position: absolute;
    left: 4px;
    top: 8px;
    bottom: 8px;
    width: 1px;
    background: var(--border);
}

.exp-item {
    position: relative;
    padding: 0 0 32px 24px;
}

.exp-item::before {
    content: '';
    position: absolute;
    left: -20px;
    top: 8px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--bg);
    border: 2px solid var(--border-2);
}

.exp-item:last-child {
    padding-bottom: 0;
}

.exp-tag {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--muted);
    background: var(--card-2);
    border: 1px solid var(--border);
    padding: 2px 10px;
    border-radius: 4px;
    display: inline-block;
    margin-bottom: 10px;
}

.exp-item h3 {
    font-size: 16px;
    color: var(--ink);
    margin: 0 0 6px;
}

.exp-item p {
    font-size: 14px;
    color: var(--muted);
    margin: 0;
    line-height: 1.7;
}

/* â”€â”€ EDUCATION & CERTIFICATIONS â”€â”€ */
#education .edu-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 22px 26px;
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 12px;
}

#education .edu-card:last-of-type {
    margin-bottom: 0;
}

.edu-period {
    margin-left: auto;
    font-family: var(--mono);
    font-size: 12px;
    color: var(--dim);
    white-space: nowrap;
}

/* Sub-heading inside a section, below the small uppercase section label. */
.subsection-head {
    font-size: 15px;
    font-weight: 600;
    color: var(--ink);
    margin: 40px 0 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.cert-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.cert-item {
    display: flex;
    align-items: baseline;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.cert-item:last-child {
    border-bottom: none;
}

.cert-main {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
    min-width: 0;
}

.cert-name {
    font-size: 14.5px;
    font-weight: 600;
    color: var(--ink);
}

.cert-name a {
    color: var(--ink);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-color: var(--border-2);
}

.cert-name a:hover {
    text-decoration-color: var(--ink);
}

.cert-issuer {
    font-size: 13.5px;
    color: var(--muted);
}

.cert-date {
    margin-left: auto;
    font-family: var(--mono);
    font-size: 12px;
    color: var(--dim);
    white-space: nowrap;
}

@media (max-width: 600px) {
    .cert-item { flex-direction: column; gap: 2px; }
    .cert-date { margin-left: 0; }
    #education .edu-card { flex-wrap: wrap; }
    .edu-period { margin-left: 0; width: 100%; }
}

/* â”€â”€ ABOUT INTRO (markdown-rendered) â”€â”€ */
.about-intro p {
    font-size: clamp(15px, 1.15vw, 18px);
    color: var(--muted);
    max-width: 62ch;
    line-height: 1.8;
    margin-bottom: 14px;
}

.about-intro p:last-child { margin-bottom: 0; }

.about-intro a {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.about-intro strong { color: var(--ink); font-weight: 600; }

.edu-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.edu-card h3 {
    font-size: 16px;
    color: var(--ink);
    margin: 0 0 2px;
}

.edu-card p {
    font-size: 13.5px;
    color: var(--muted);
    margin: 0;
}

/* â”€â”€ PAGE HEADERS (about / portfolio / contact) â”€â”€ */
#about-hero,
#portfolio-hero,
#contact-hero {
    margin: clamp(40px, 6vw, 80px) auto 0;
}

#about-hero h1,
#portfolio-hero h1,
#contact-hero h1 {
    font-size: clamp(28px, 3.4vw, 48px);
    font-weight: 700;
    color: var(--ink);
    letter-spacing: -0.8px;
    margin-bottom: 14px;
}

#about-hero p,
#portfolio-hero p,
#contact-hero p {
    font-size: clamp(15px, 1.15vw, 18px);
    color: var(--muted);
    max-width: 62ch;
    line-height: 1.8;
}

/* â”€â”€ CONTACT PAGE â”€â”€ */
#contact {
    margin-top: 40px;
}

.contact-cards {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.contact-note {
    font-size: 14px;
    color: var(--muted);
    margin-top: 32px;
}

.contact-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 26px 34px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    transition: border-color 0.15s ease;
    min-width: 150px;
}

.contact-card:hover {
    border-color: var(--ink);
}

.contact-card-icon {
    font-size: 24px;
    color: var(--ink);
}

.contact-card-label {
    font-size: 12px;
    font-family: var(--mono);
    color: var(--muted);
    letter-spacing: 1px;
    text-transform: uppercase;
}

.contact-card:hover .contact-card-label {
    color: var(--ink);
}

/* â”€â”€ PORTFOLIO PROJECT CARDS â”€â”€ */
#projects {
    display: grid;
    /* min() keeps a single card from overflowing a phone narrower than 300px. */
    grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
    gap: 20px;
    margin: 40px auto clamp(56px, 8vw, 96px);
}

.project-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 26px;
    transition: border-color 0.15s ease;
}

.project-card:hover {
    border-color: var(--ink);
}

.project-card h3 {
    font-size: 17px;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 10px;
}

.project-card span {
    font-size: 11px;
    background: var(--card-2);
    color: var(--muted);
    padding: 2px 10px;
    border-radius: 4px;
    display: inline-block;
    margin-bottom: 12px;
    font-family: var(--mono);
    border: 1px solid var(--border);
}

.project-card p {
    font-size: 13.5px;
    color: var(--muted);
    margin-bottom: 16px;
    line-height: 1.7;
}

.project-card a {
    font-size: 13px;
    font-weight: 600;
    color: var(--accent);
}

/* â”€â”€ FOOTER â”€â”€ */
footer {
    text-align: center;
    padding-block: 32px;
    color: var(--dim);
    font-size: 13px;
    border-top: 1px solid var(--border);
    margin-top: 96px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}

footer a {
    color: var(--muted);
}

footer a:hover {
    color: var(--ink);
}

/* â”€â”€ PROJECT DETAIL PAGE â”€â”€
   Overrides the shared --maxw: long-form prose stays at a reading measure
   rather than stretching to the full content column on a wide display. */
#project-detail {
    max-width: 820px;
    margin: clamp(40px, 6vw, 80px) auto;
}

#project-header {
    padding-bottom: 28px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 40px;
}

#project-header h1 {
    font-size: 36px;
    color: var(--ink);
    font-weight: 700;
    letter-spacing: -0.8px;
    margin: 12px 0 16px;
}

.category-badge {
    font-size: 11px;
    background: var(--card-2);
    color: var(--muted);
    padding: 3px 11px;
    border-radius: 4px;
    display: inline-block;
    font-family: var(--mono);
    border: 1px solid var(--border);
}

.short-desc {
    font-size: 16px;
    color: var(--muted);
    margin-bottom: 16px;
    line-height: 1.7;
}

.tools {
    font-size: 14px;
    color: var(--muted);
    margin-bottom: 6px;
}

.tools strong {
    color: var(--ink);
}

.date {
    font-size: 13px;
    color: var(--dim);
    font-family: var(--mono);
}

/* â”€â”€ PROJECT SCREENSHOTS GALLERY â”€â”€ */
.project-screenshots {
    margin-bottom: 48px;
}

.project-screenshots h2 {
    font-size: 12px;
    color: var(--dim);
    text-transform: uppercase;
    letter-spacing: 1.6px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
}

.screenshots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
}

.screenshot-item {
    margin: 0;
}

.screenshot-item img {
    width: 100%;
    border-radius: 8px;
    border: 1px solid var(--border);
    display: block;
}

.screenshot-item figcaption {
    font-size: 12px;
    color: var(--dim);
    margin-top: 6px;
    text-align: center;
}

/* â”€â”€ MARKDOWN CONTENT â”€â”€ */
#project-content {
    color: var(--muted);
    line-height: 1.8;
    font-size: 15.5px;
}

#project-content h1,
#project-content h2,
#project-content h3,
#project-content h4,
#project-content h5,
#project-content h6 {
    font-weight: 600;
    color: var(--ink);
    margin: 40px 0 12px;
    line-height: 1.3;
}

#project-content h1 { font-size: 28px; letter-spacing: -0.5px; }
#project-content h2 {
    font-size: 21px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}
#project-content h3 { font-size: 18px; }
#project-content h4 { font-size: 16px; }

#project-content p {
    margin-bottom: 16px;
}

#project-content a {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 3px;
}

#project-content a:hover {
    color: var(--ink);
}

#project-content ul,
#project-content ol {
    margin: 0 0 16px 22px;
    padding: 0;
}

#project-content ul { list-style: disc; }
#project-content ol { list-style: decimal; }

#project-content li {
    margin-bottom: 6px;
}

#project-content strong {
    color: var(--ink);
    font-weight: 600;
}

#project-content code {
    background: var(--card-2);
    color: var(--ink);
    font-family: var(--mono);
    font-size: 13px;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid var(--border);
}

#project-content pre {
    background: var(--card-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 18px;
    overflow-x: auto;
    margin-bottom: 24px;
}

#project-content pre code {
    background: none;
    border: none;
    padding: 0;
    color: var(--ink);
    font-size: 13px;
    line-height: 1.65;
}

#project-content blockquote {
    border-left: 3px solid var(--border-2);
    margin: 0 0 16px 0;
    padding: 6px 18px;
    color: var(--muted);
}

#project-content hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 40px 0;
}

#project-content img {
    max-width: 100%;
    border-radius: 8px;
    border: 1px solid var(--border);
    display: block;
    margin: 24px auto;
}

#project-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 24px;
    font-size: 14px;
}

#project-content th {
    background: var(--card-2);
    color: var(--ink);
    font-weight: 600;
    text-align: left;
    padding: 10px 14px;
    border: 1px solid var(--border);
}

#project-content td {
    padding: 10px 14px;
    border: 1px solid var(--border);
    color: var(--muted);
}

/* â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€
   CHAT / MESSAGING
   Shared shell for chat/index.html (visitor)
   and chat/conversation.html (owner).
   â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */

/* The chat screen fills the viewport, so the footer's usual
   96px top margin would push it far past the fold. */
.chat-page footer { margin-top: 0; }

#mm-root {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px 20px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    height: calc(100vh - 64px);
    height: calc(100dvh - 64px);
}

/* Header + composer keep their natural height; the thread takes the rest. */
#mm-head,
#mm-input-row { flex: 0 0 auto; }

.mm-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--mono);
    font-size: 0.7rem;
    font-weight: 400;
    color: var(--dim);
    vertical-align: middle;
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--border-2);
    transition: background .3s;
}
.status-dot.connected    { background: var(--ok); }
.status-dot.disconnected { background: var(--danger); }

/* â”€â”€ Thread â”€â”€
   min-height:0 is load-bearing: without it a flex item refuses to shrink
   below its content height, so the thread stretches the page instead of
   scrolling inside itself. */
#mm-thread {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px 22px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
#mm-thread::-webkit-scrollbar { width: 8px; }
#mm-thread::-webkit-scrollbar-thumb {
    background: var(--border-2);
    border-radius: 4px;
}

.msg {
    display: flex;
    flex-direction: column;
    max-width: 72%;
    padding: 10px 15px;
    border-radius: 14px;
    font-size: 0.95rem;
    line-height: 1.6;
    word-break: break-word;
}
.msg-mine  { align-self: flex-end;   background: var(--ink); }
.msg-other { align-self: flex-start; background: var(--card-2); border: 1px solid var(--border); }

.msg-meta { font-size: 0.7rem; font-family: var(--mono); margin-bottom: 4px; }
.msg-mine  .msg-meta { text-align: right; color: rgba(255,255,255,.55); }
.msg-other .msg-meta { color: var(--dim); }

.msg-content { white-space: pre-wrap; }
.msg-mine  .msg-content { color: #fff; }
.msg-other .msg-content { color: var(--text); }

.mm-empty {
    align-self: center;
    margin: auto 0;
    color: var(--dim);
    font-size: 0.88rem;
    text-align: center;
    line-height: 1.8;
}

.mm-typing {
    align-self: flex-start;
    color: var(--dim);
    font-size: 0.8rem;
    font-style: italic;
    padding: 2px 4px;
}

/* â”€â”€ Composer â”€â”€ */
#mm-input-row {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

#mm-input {
    flex: 1;
    background: var(--card);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 13px 16px;
    border-radius: 10px;
    font-size: 0.95rem;
    line-height: 1.55;
    font-family: var(--font);
    resize: none;
    transition: border-color .15s;
}
#mm-input:focus { outline: none; border-color: var(--ink); }
#mm-input:disabled { background: var(--card-2); color: var(--dim); }

#mm-send {
    background: var(--ink);
    color: #fff;
    border: none;
    height: 48px;
    padding: 0 28px;
    border-radius: 10px;
    font-weight: 600;
    font-family: var(--font);
    font-size: 0.9rem;
    cursor: pointer;
    transition: background .15s;
}
#mm-send:hover:not(:disabled) { background: #333940; }
#mm-send:disabled { background: var(--border-2); cursor: default; }

@media (max-width: 860px) {
    #mm-root { padding: 16px; }
    .msg { max-width: 84%; }
}

@media (max-width: 600px) {
    #mm-root {
        padding: 12px 12px 12px;
        gap: 10px;
        height: calc(100vh - 58px);
        height: calc(100dvh - 58px);
    }
    #mm-thread { padding: 14px; border-radius: 10px; }
    .msg { max-width: 88%; font-size: 0.92rem; }
    #mm-send { padding: 0 20px; }
}

/* â”€â”€ ERROR PAGES â”€â”€ */
.error-page {
    min-height: 65vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 24px;
}

.error-code {
    font-family: var(--mono);
    font-size: 13px;
    letter-spacing: 2px;
    color: var(--dim);
    margin-bottom: 16px;
}

.error-title {
    font-size: 30px;
    font-weight: 700;
    color: var(--ink);
    letter-spacing: -0.6px;
    margin-bottom: 12px;
}

.error-msg {
    font-size: 15px;
    color: var(--muted);
    max-width: 420px;
    line-height: 1.8;
    margin-bottom: 28px;
}

.error-path {
    font-family: var(--mono);
    font-size: 13px;
    color: var(--muted);
    background: var(--card-2);
    border: 1px solid var(--border);
    padding: 6px 14px;
    border-radius: 6px;
    margin-bottom: 32px;
    word-break: break-all;
    max-width: 500px;
}

.error-path span {
    color: var(--dim);
}

/* â”€â”€ SCROLL REVEAL (subtle fade-in) â”€â”€ */
.reveal {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.reveal.is-visible {
    opacity: 1;
    transform: none;
}

@media (prefers-reduced-motion: reduce) {
    .reveal { opacity: 1; transform: none; transition: none; }
    .terminal-cursor { animation: none; }
}

/* â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€
   RESPONSIVE â€” MOBILE & TABLET
   â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */

/* â”€â”€ Hamburger button (desktop: hidden) â”€â”€ */
.nav-hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
}

.nav-hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--ink);
    border-radius: 2px;
    transition: transform 0.25s, opacity 0.25s;
}

.nav-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* â”€â”€ Tablet (â‰¤ 860px) â”€â”€
   Only --gutter changes; every container reads it, so no per-container
   padding overrides are needed. The hero collapses to one column on its
   own via auto-fit, and the terminal now stays visible. */
@media (max-width: 860px) {
    :root { --gutter: 24px; }

    #hero {
        min-height: auto;
        padding-block: 48px 56px;
    }

    #skills .skills-grid { grid-template-columns: repeat(2, 1fr); }
}

/* â”€â”€ Mobile (â‰¤ 600px) â”€â”€ */
@media (max-width: 600px) {
    :root { --gutter: 16px; }

    nav { height: 58px; }
    .nav-hamburger { display: flex; }

    .nav-links {
        display: none;
        position: fixed;
        top: 58px;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 2px;
        padding: 10px 16px 18px;
        background: #ffffff;
        border-bottom: 1px solid var(--border);
        z-index: 99;
    }
    .nav-links.open { display: flex; }
    .nav-links a { padding: 10px 14px; }

    #hero { padding-block: 36px 48px; }

    /* Terminal reads as supporting evidence here, not a co-equal column. */
    .hero-terminal { margin-top: 4px; }

    #skills .skills-grid { grid-template-columns: 1fr; }

    .contact-card { padding: 20px 24px; min-width: 120px; }
    .contact-cards { gap: 12px; }

    #projects { margin: 28px auto 56px; }

    #project-header h1 { font-size: 26px; }

    footer { padding-block: 24px; gap: 14px; font-size: 12px; margin-top: 64px; }
}

/* â”€â”€ Very narrow phones (â‰¤ 380px) â”€â”€ */
@media (max-width: 380px) {
    :root { --gutter: 14px; }
    .hero-cta { gap: 8px; }
    .btn-primary, .btn-outline { padding: 10px 18px; font-size: 13px; }
}
