/* =========================================================
   Tokens
   ========================================================= */

:root {
    --paper: #FAF9F4;
    --paper-alt: #F1EFE6;
    --surface: #FFFFFF;
    --ink: #12201A;
    --ink-soft: #4B5B52;
    --ink-faint: #8A9A90;
    --border: rgba(18, 32, 26, 0.12);

    --green-950: #08150F;
    --green-900: #10281C;
    --green-800: #1B4332;
    --green-700: #245C42;
    --green-600: #2D6A4F;
    --green-500: #40916C;
    --green-400: #52B788;
    --green-300: #83C5A6;
    --green-100: #D8F3DC;

    --accent: var(--green-700);
    --accent-strong: var(--green-900);
    --on-accent: #F4FAF6;

    --font-display: "Fraunces", ui-serif, Georgia, serif;
    --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

    --container: 1180px;
    --gutter: clamp(1.5rem, 4vw, 4rem);
    --section-pad: clamp(4.5rem, 9vw, 8rem);

    --radius-s: 10px;
    --radius-m: 18px;
    --radius-l: 28px;

    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-soft: cubic-bezier(0.4, 0, 0.2, 1);
    --dur-s: 0.25s;
    --dur-m: 0.55s;
    --dur-l: 0.9s;

    --shadow-card: 0 1px 2px rgba(18,32,26,0.04), 0 12px 32px -16px rgba(18,32,26,0.18);
    --shadow-lift: 0 24px 60px -20px rgba(18,32,26,0.28);

    color-scheme: light;
}

:root[data-theme="dark"] {
    --paper: #0A120E;
    --paper-alt: #0F1B15;
    --surface: #12201A;
    --ink: #EAF2EC;
    --ink-soft: #A9BDB1;
    --ink-faint: #62766B;
    --border: rgba(234, 242, 236, 0.12);

    --accent: var(--green-400);
    --accent-strong: var(--green-300);
    --on-accent: #08150F;

    --shadow-card: 0 1px 2px rgba(0,0,0,0.3), 0 12px 32px -16px rgba(0,0,0,0.55);
    --shadow-lift: 0 24px 70px -20px rgba(0,0,0,0.65);

    color-scheme: dark;
}

/* =========================================================
   Reset
   ========================================================= */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: hidden; }
body, h1, h2, h3, h4, p, ul, ol, figure, blockquote, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; padding: 0; }
input, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.08; }

body {
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    transition: background var(--dur-m) var(--ease-soft), color var(--dur-m) var(--ease-soft);
    overflow-x: hidden;
}

.skip-link {
    position: fixed;
    top: -100px;
    left: 1rem;
    z-index: 999;
    background: var(--accent);
    color: var(--on-accent);
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-s);
    transition: top var(--dur-s) var(--ease-out);
}
.skip-link:focus { top: 1rem; }

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

/* =========================================================
   Layout helpers
   ========================================================= */

.section-inner {
    max-width: var(--container);
    margin-inline: auto;
    padding-inline: var(--gutter);
}

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

.section-label {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 1.25rem;
}

.section-title {
    font-size: clamp(1.9rem, 3.4vw, 3rem);
    max-width: 18ch;
    margin-bottom: 1rem;
}
/* Longer heading: size it to fit its column on one line (desktop/laptop). */
#about-title {
    max-width: none;
    font-size: clamp(1.5rem, 2.5vw, 2.35rem);
}

.section-sub {
    color: var(--ink-soft);
    max-width: 46ch;
    margin-bottom: 2.5rem;
}

/* =========================================================
   Grain + progress
   ========================================================= */

.grain {
    position: fixed;
    inset: 0;
    z-index: 3000;
    pointer-events: none;
    opacity: 0.035;
    mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.scroll-progress {
    position: fixed;
    top: 0; left: 0;
    height: 3px;
    width: 0%;
    background: var(--accent);
    z-index: 2500;
    transition: width 0.08s linear;
}

/* =========================================================
   Navigation
   ========================================================= */

.site-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 2000;
    background: color-mix(in srgb, var(--paper) 78%, transparent);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid transparent;
    transition: border-color var(--dur-s), background var(--dur-m);
}
.site-header.is-scrolled { border-color: var(--border); }

.navbar {
    max-width: var(--container);
    margin-inline: auto;
    padding: 1.1rem var(--gutter);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.nav-mark {
    display: flex;
    align-items: center;
    gap: 0.7rem;
}
.nav-mark-avatar {
    width: 34px; height: 34px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border);
}
.nav-mark-name {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1rem;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: clamp(1rem, 2vw, 2.2rem);
}
.nav-link {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.92rem;
    color: var(--ink-soft);
    position: relative;
    padding-block: 0.3rem;
    transition: color var(--dur-s);
}
.nav-link::after {
    content: "";
    position: absolute;
    left: 0; right: 100%;
    bottom: 0;
    height: 1px;
    background: var(--accent);
    transition: right var(--dur-m) var(--ease-out);
}
.nav-link:hover, .nav-link.is-active { color: var(--ink); }
.nav-link:hover::after, .nav-link.is-active::after { right: 0; }

.nav-actions { display: flex; align-items: center; gap: 0.75rem; }

.theme-toggle {
    width: 38px; height: 38px;
    display: grid; place-items: center;
    border: 1px solid var(--border);
    border-radius: 50%;
    color: var(--ink);
    transition: border-color var(--dur-s), transform var(--dur-s);
}
.theme-toggle:hover { border-color: var(--accent); transform: rotate(15deg); }
.icon-moon { display: none; }
:root[data-theme="dark"] .icon-sun { display: none; }
:root[data-theme="dark"] .icon-moon { display: block; }

.nav-scrim { display: none; }

.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    width: 30px;
}
.hamburger span {
    height: 1.5px;
    background: var(--ink);
    border-radius: 2px;
    transition: transform var(--dur-s) var(--ease-out), opacity var(--dur-s);
}
.hamburger.is-open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.hamburger.is-open span:nth-child(2) { opacity: 0; }
.hamburger.is-open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* =========================================================
   Hero
   ========================================================= */

.hero {
    position: relative;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(6rem, 20vw, 8rem) var(--gutter) 4rem;
}

.hero-inner {
    max-width: var(--container);
    margin-inline: auto;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    font-family: var(--font-mono);
    font-size: 0.82rem;
    letter-spacing: 0.03em;
    color: var(--ink-soft);
    margin-bottom: 1.5rem;
}
.eyebrow-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--green-400);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--green-400) 25%, transparent);
}

.hero-title {
    font-size: clamp(2rem, 5vw, 4.2rem);
    letter-spacing: -0.01em;
}

.hero-lede {
    margin-top: 1.6rem;
    /* width:0 + min-width:100% makes the lede fill its parent without
       contributing to the parent's intrinsic (shrink-to-fit) width — so
       .hero-copy sizes to the title and the lede wraps to that same edge. */
    width: 0;
    min-width: 100%;
    font-size: clamp(1.02rem, 1.3vw, 1.18rem);
    color: var(--ink-soft);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    margin-top: 2.4rem;
}

.hero-social {
    display: flex;
    justify-content: center;
    gap: 1.6rem;
    margin-top: 3rem;
    font-family: var(--font-mono);
    font-size: 0.82rem;
}
.hero-social a {
    color: var(--ink-soft);
    border-bottom: 1px solid transparent;
    padding-bottom: 2px;
    transition: color var(--dur-s), border-color var(--dur-s);
}
.hero-social a:hover { color: var(--accent); border-color: var(--accent); }

.scroll-cue {
    position: absolute;
    bottom: 2.2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    color: var(--ink-faint);
}
.scroll-cue-line {
    width: 1px;
    height: 34px;
    background: linear-gradient(var(--ink-faint), transparent);
    overflow: hidden;
    position: relative;
}
.scroll-cue-line::after {
    content: "";
    position: absolute;
    top: -100%; left: 0;
    width: 100%; height: 100%;
    background: var(--accent);
    animation: cue-run 1.8s ease-in-out infinite;
}
@keyframes cue-run {
    0% { top: -100%; }
    60%, 100% { top: 100%; }
}

/* =========================================================
   Marquee
   ========================================================= */

.marquee {
    background: var(--accent-strong);
    color: var(--on-accent);
    overflow: hidden;
    border-block: 1px solid color-mix(in srgb, var(--on-accent) 15%, transparent);
}
.marquee-track {
    display: flex;
    width: max-content;
    gap: 0.9rem;
    padding-block: 0.85rem;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    letter-spacing: 0.03em;
    white-space: nowrap;
    animation: marquee 32s linear infinite;
}
@keyframes marquee {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

/* =========================================================
   About
   ========================================================= */

.about-grid {
    display: grid;
    /* minmax(0, …) lets tracks shrink below their content's min width so a
       long stat label can never force the column wider than the screen. */
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
    gap: clamp(2.5rem, 5vw, 5rem);
    align-items: start;
}
.about-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border);
    margin-bottom: 1.5rem;
}
.about-copy p { color: var(--ink-soft); margin-bottom: 1.2rem; max-width: 58ch; }
.about-copy p:first-of-type { color: var(--ink); font-size: 1.08rem; }

.about-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}
.stat-card {
    padding: 1.6rem 1.4rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-m);
    box-shadow: var(--shadow-card);
    transition: transform var(--dur-s) var(--ease-out);
}
.stat-card:hover { transform: translateY(-4px); }
.stat-number {
    display: block;
    font-family: var(--font-display);
    font-size: 2.1rem;
    color: var(--accent);
}
.stat-label {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.82rem;
    color: var(--ink-soft);
}

/* =========================================================
   Skills
   ========================================================= */

.skills-table-wrap {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-m);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    overflow-x: auto;
}
.skills-table {
    width: 100%;
    border-collapse: collapse;
}
.skills-table th, .skills-table td {
    padding: 1.1rem 1.5rem;
    text-align: left;
    vertical-align: middle;
}
.skills-table thead th {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ink-faint);
    background: var(--paper-alt);
    font-weight: 500;
    border-bottom: 1px solid var(--border);
}
.skills-table tbody th {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.02rem;
    color: var(--ink);
    white-space: nowrap;
}
.skills-table tbody tr {
    border-bottom: 1px solid var(--border);
    transition: background var(--dur-s);
}
.skills-table tbody tr:last-child { border-bottom: none; }
.skills-table tbody tr:hover { background: var(--paper-alt); }

.tag-row { display: flex; flex-wrap: wrap; gap: 0.55rem; }
.tag {
    font-family: var(--font-mono);
    font-size: 0.76rem;
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    background: var(--paper-alt);
    color: var(--ink-soft);
    border: 1px solid var(--border);
    transition: background var(--dur-s), color var(--dur-s), border-color var(--dur-s);
}
.tag:hover { background: var(--green-100); color: var(--green-900); border-color: var(--green-400); }
:root[data-theme="dark"] .tag:hover { background: var(--green-800); color: var(--green-100); }

/* =========================================================
   Projects
   ========================================================= */

.project-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.project-card {
    position: relative;
    min-height: 300px;
    border-radius: var(--radius-l);
    /* Flex (not block): the front face is the only in-flow child (the back
       panel is absolutely positioned, so flex layout skips it) and its
       default stretch fills the card's full height — otherwise a card with
       a shorter description would render visibly shorter than its grid
       neighbors even though the invisible container height matches. */
    display: flex;
}
/* Deliberately not positioned: the reveal panel below needs .project-card
   (whose height already accounts for the min-height floor) as its
   containing block, not this wrapper, which would otherwise auto-size to
   only the front face's content height and undersize the panel. */
.project-card-inner {
    display: contents;
}

.project-face {
    padding: 2rem;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}
.project-face-front {
    background: var(--surface);
    justify-content: flex-end;
    box-shadow: var(--shadow-card);
    border-radius: var(--radius-l);
}
.project-num {
    font-family: var(--font-mono);
    color: var(--accent);
    font-size: 0.85rem;
    margin-bottom: auto;
}
.project-face-front h3 { font-size: 1.4rem; margin-bottom: 0.6rem; }
.project-face-front p { color: var(--ink-soft); margin-bottom: 1rem; }
.reveal-hint {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--ink-faint);
}

/* Reveal panel: overlays the front face on hover / tap / focus instead of
   3D-flipping, and scrolls internally so long stacks never spill past the
   card's rounded corners on small screens. */
.project-face-back {
    position: absolute;
    inset: 0;
    background: var(--accent-strong);
    color: var(--on-accent);
    /* flex-start (not center): a centered flex container with overflow
       clips content above the scrollable area — for taller stacks the
       start of the content becomes permanently unreachable by scrolling. */
    justify-content: flex-start;
    gap: 0.85rem;
    border-radius: var(--radius-l);
    overflow-y: auto;
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
    transition: opacity var(--dur-m) var(--ease-out), transform var(--dur-m) var(--ease-out);
}
.project-card:hover .project-face-back,
.project-card:focus-within .project-face-back,
.project-card.is-active .project-face-back {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}
.project-face-back h3 { font-size: 1.15rem; }
.project-face-back p { font-size: 0.92rem; opacity: 0.92; }
.project-face-back .tag {
    background: color-mix(in srgb, var(--on-accent) 12%, transparent);
    color: var(--on-accent);
    border-color: color-mix(in srgb, var(--on-accent) 25%, transparent);
}
.project-link {
    margin-top: 0.4rem;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    width: fit-content;
    border-bottom: 1px solid currentColor;
    padding-bottom: 2px;
}

/* =========================================================
   Journey
   ========================================================= */

.journey-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(2rem, 5vw, 4rem);
}
.journey-heading {
    font-size: 1.1rem;
    color: var(--accent);
    margin-bottom: 1.6rem;
}
.timeline { border-left: 1px solid var(--border); }
.timeline-item {
    position: relative;
    padding-left: 1.6rem;
    padding-bottom: 2.2rem;
}
.timeline-item::before {
    content: "";
    position: absolute;
    left: -5px; top: 4px;
    width: 9px; height: 9px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 4px var(--paper);
}
.timeline-item:last-child { padding-bottom: 0; }
.timeline-date {
    font-family: var(--font-mono);
    font-size: 0.76rem;
    color: var(--ink-faint);
}
.timeline-item h4 {
    font-size: 1.08rem;
    margin: 0.35rem 0 0.5rem;
}
.timeline-item p {
    color: var(--ink-soft);
    margin-bottom: 0.8rem;
    max-width: 52ch;
}

/* =========================================================
   Contact
   ========================================================= */

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1.1fr;
    gap: clamp(2.5rem, 5vw, 5rem);
    /* Vertically center the short copy against the taller form so the
       left column doesn't read as a big empty void. */
    align-items: center;
}
.contact-copy p { color: var(--ink-soft); max-width: 44ch; margin-bottom: 0; }

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-l);
    padding: clamp(1.4rem, 2.5vw, 2rem);
    box-shadow: var(--shadow-card);
}
.form-field { display: flex; flex-direction: column; gap: 0.5rem; }
.form-field label {
    font-family: var(--font-mono);
    font-size: 0.76rem;
    color: var(--ink-soft);
}
.form-field input, .form-field textarea {
    background: var(--paper-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-s);
    padding: 0.85rem 1rem;
    transition: border-color var(--dur-s), box-shadow var(--dur-s);
}
.form-field input:focus, .form-field textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}
.form-status { font-size: 0.85rem; color: var(--accent); min-height: 1.2em; }

/* =========================================================
   Buttons
   ========================================================= */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.95rem 1.8rem;
    border-radius: 999px;
    font-size: 0.92rem;
    font-weight: 500;
    transition: transform var(--dur-s) var(--ease-out), box-shadow var(--dur-s), background var(--dur-s), color var(--dur-s), border-color var(--dur-s);
}
.btn span { position: relative; }
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn-primary {
    background: var(--accent-strong);
    color: var(--on-accent);
}
.btn-primary:hover { box-shadow: var(--shadow-lift); }
.btn-ghost {
    border: 1px solid var(--border);
    color: var(--ink);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* =========================================================
   Footer
   ========================================================= */

.site-footer {
    padding-block: 1.5rem 1rem;
    border-top: 1px solid var(--border);
}
.footer-signature {
    display: block;
    font-family: var(--font-display);
    font-size: clamp(1.15rem, 2.2vw, 1.5rem);
    margin-bottom: 1rem;
    transition: color var(--dur-s);
}
.footer-signature:hover { color: var(--accent); }
/* Keeps every rendering of the name — logo, hero, footer signature, and this
   copyright line — on the same display typeface. */
.name-mark { font-family: var(--font-display); font-weight: 600; }
.footer-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid var(--border);
}
.footer-links, .footer-social {
    display: flex;
    flex-wrap: wrap;
    gap: 1.6rem;
    font-size: 0.9rem;
    color: var(--ink-soft);
}
.footer-links a:hover, .footer-social a:hover { color: var(--accent); }
.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.75rem;
    font-size: 0.82rem;
    color: var(--ink-faint);
}
.back-to-top { font-family: var(--font-mono); color: var(--ink-soft); }
.back-to-top:hover { color: var(--accent); }

/* =========================================================
   Reveal animation
   ========================================================= */

.reveal {
    transition: opacity var(--dur-l) var(--ease-out), transform var(--dur-l) var(--ease-out);
}
.js .reveal:not(.is-visible) {
    opacity: 0;
    transform: translateY(28px);
}
.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* =========================================================
   Responsive
   ========================================================= */

@media (max-width: 1024px) {
    .about-grid, .contact-grid { grid-template-columns: minmax(0, 1fr); }
    .project-grid { grid-template-columns: minmax(0, 1fr); }
    /* Single-column cards get much wider, so a shorter min-height avoids
       leaving a large empty gap above the front-face content. */
    .project-card { min-height: 260px; }
}

@media (max-width: 860px) {
    .nav-menu {
        position: fixed;
        top: 0; right: 0;
        height: 100vh;
        width: min(78vw, 320px);
        background: var(--surface);
        flex-direction: column;
        justify-content: center;
        align-items: flex-start;
        gap: 2rem;
        padding: 2rem;
        transform: translateX(100%);
        transition: transform var(--dur-m) var(--ease-out);
        border-left: 1px solid var(--border);
        z-index: 1600;
    }
    .nav-menu.is-open { transform: translateX(0); }
    .nav-scrim {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(8, 21, 15, 0.45);
        opacity: 0;
        visibility: hidden;
        transition: opacity var(--dur-m) var(--ease-soft), visibility var(--dur-m);
        z-index: 1500;
    }
    .nav-scrim.is-open { opacity: 1; visibility: visible; }
    .hamburger { display: flex; }
    .journey-columns { grid-template-columns: 1fr; }
}

/* Below this width the two-column table gets too tight for the category
   names and tag lists to sit side by side, so each row stacks instead. */
@media (max-width: 640px) {
    .skills-table thead { display: none; }
    .skills-table, .skills-table tbody, .skills-table tr, .skills-table th, .skills-table td {
        display: block;
        width: 100%;
    }
    .skills-table tbody tr { padding: 1.1rem 1.25rem; }
    .skills-table tbody th, .skills-table tbody td { padding: 0; }
    .skills-table tbody th {
        white-space: normal;
        margin-bottom: 0.75rem;
    }
}

@media (max-width: 560px) {
    .about-stats { grid-template-columns: 1fr 1fr; }
    .footer-bottom { flex-direction: column; gap: 0.5rem; align-items: flex-start; padding-top: 0.6rem; }
    .project-card { min-height: 300px; }
    .project-face { padding: 1.5rem; }
    .project-face-back { gap: 0.65rem; }
    .project-face-back p { font-size: 0.85rem; }
    /* Keep the two hero buttons side by side (not stacked) on phones. */
    .hero-actions { flex-wrap: nowrap; gap: 0.75rem; }
    .hero-actions .btn { padding: 0.85rem 1.1rem; font-size: 0.85rem; }
    .hero-social { flex-wrap: wrap; gap: 1rem 1.6rem; }

    /* Stack the footer nav + social tightly on phones. */
    .footer-signature { margin-bottom: 0.85rem; }
    .footer-row { gap: 0.75rem; padding-bottom: 0.75rem; }
    .footer-links, .footer-social { gap: 0.5rem 1.1rem; }
}

/* =========================================================
   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;
    }
    .js .reveal:not(.is-visible) { opacity: 1 !important; transform: none !important; }
}
