/* ============================================================
   TOKENS
   Palette comes from the stack itself: Django's forest green
   and Python's yellow, on a cool paper ground.
============================================================ */
:root {
    /* Colors */
    --forest:       #0B3D2C;
    --forest-2:     #0F4A36;
    --forest-line:  rgba(238, 242, 238, 0.16);
    --paper:        #EEF2EE;
    --paper-2:      #E2E9E3;
    --ink:          #15231C;
    --moss:         #5A7266;
    --rule:         #CBD6CF;
    --pollen:       #F4C542;
    --pollen-deep:  #E0AE22;
    --on-forest:    #EEF2EE;
    --on-forest-2:  #A9C2B5;
    --danger:       #B3261E;

    /* Typography */
    --font-display: 'Anybody', 'Arial Narrow', sans-serif;
    --font-body:    'Hanken Grotesk', system-ui, sans-serif;

    /* Type scale (classic: 14 16 18 21 24 36 48 60 72) */
    --fs-sm:   0.875rem;
    --fs-base: 1.0625rem;
    --fs-md:   1.3125rem;
    --fs-lg:   1.5rem;
    --fs-xl:   clamp(1.75rem, 3.2vw, 2.25rem);
    --fs-2xl:  clamp(2.25rem, 5vw, 3.75rem);

    /* Layout */
    --container: 1160px;
    --gutter:    clamp(16px, 4vw, 40px);
    --section-y: clamp(4.5rem, 10vw, 8rem);

    /* Radii — one per tier of hierarchy */
    --r-control: 3px;
    --r-panel:   10px;

    /* Motion */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ============================================================
   RESET & BASE
============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    scroll-behavior: smooth;
    scroll-padding-top: 72px;
}

body {
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: var(--fs-base);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    font-kerning: normal;
}

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

:focus-visible {
    outline: 3px solid var(--pollen);
    outline-offset: 3px;
    border-radius: var(--r-control);
}

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

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

.skip-link {
    position: absolute;
    left: var(--gutter);
    top: -100px;
    z-index: 200;
    padding: 0.5rem 1rem;
    background: var(--pollen);
    color: var(--ink);
    font-weight: 600;
    border-radius: var(--r-control);
}
.skip-link:focus { top: 12px; }

.empty-state { color: var(--moss); font-style: italic; }

/* ============================================================
   BUTTONS
============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55em;
    padding: 0.8rem 1.35rem;
    border: 1.5px solid transparent;
    border-radius: var(--r-control);
    font-family: var(--font-body);
    font-size: var(--fs-base);
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}
.btn--sm   { padding: 0.55rem 0.95rem; font-size: var(--fs-sm); }
.btn--full { width: 100%; }

.btn--pollen { background: var(--pollen); color: var(--ink); }
.btn--pollen:hover { background: var(--pollen-deep); }
.btn--pollen:disabled { opacity: 0.65; cursor: progress; }

.btn--line { border-color: var(--on-forest-2); color: var(--on-forest); }
.btn--line:hover { border-color: var(--on-forest); background: var(--forest-2); }

.btn--ink { background: var(--ink); color: var(--paper); }
.btn--ink:hover { background: var(--forest); }

.btn--quiet { color: var(--ink); border-color: var(--rule); }
.btn--quiet:hover { border-color: var(--ink); }

/* ============================================================
   NAV
============================================================ */
.nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--forest);
    color: var(--on-forest);
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s;
}
.nav.scrolled { border-bottom-color: var(--forest-line); }

.nav__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.nav__logo {
    font-family: var(--font-display);
    font-variation-settings: 'wdth' 120;
    font-weight: 700;
    font-size: 1.0625rem;
    text-decoration: none;
    letter-spacing: 0.01em;
}

.nav__links { display: flex; align-items: center; gap: 0.25rem; }

.nav__link {
    display: block;
    padding: 0.4rem 0.8rem;
    color: var(--on-forest-2);
    font-size: 0.9375rem;
    font-weight: 500;
    text-decoration: none;
    border-radius: var(--r-control);
    transition: color 0.2s;
}
.nav__link:hover,
.nav__link.active { color: var(--on-forest); }
.nav__link.active { text-decoration: underline; text-decoration-color: var(--pollen); text-decoration-thickness: 2px; text-underline-offset: 6px; }

.nav__link--accent { color: var(--ink); background: var(--pollen); margin-left: 0.5rem; }
.nav__link--accent:hover,
.nav__link--accent.active { color: var(--ink); background: var(--pollen-deep); text-decoration: none; }

.nav__hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    padding: 9px;
}
.nav__hamburger span {
    display: block;
    height: 2px;
    background: var(--on-forest);
    transition: transform 0.3s var(--ease-out), opacity 0.2s;
}
.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); }

/* ============================================================
   HERO
============================================================ */
.hero {
    background: var(--forest);
    color: var(--on-forest);
    padding-block: clamp(3rem, 8vw, 6.5rem) clamp(3.5rem, 8vw, 6rem);
    overflow: hidden;
}

.hero__status {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--on-forest-2);
    font-size: var(--fs-sm);
    font-weight: 500;
}
.hero__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--pollen);
    box-shadow: 0 0 0 4px rgba(244, 197, 66, 0.18);
}

/* The one loud thing on the page: the name, set wide. */
.hero__name {
    margin-block: clamp(1.5rem, 4vw, 2.5rem) clamp(2.5rem, 6vw, 4.5rem);
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(3.4rem, 13.5vw, 11.5rem);
    font-variation-settings: 'wdth' 150;
    line-height: 0.86;
    letter-spacing: -0.02em;
}
.hero__word { display: block; }
.hero__word + .hero__word { color: var(--pollen); padding-left: 0.5em; }

.hero__foot {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    gap: clamp(2rem, 6vw, 5rem);
    align-items: end;
    padding-top: 2rem;
    border-top: 1px solid var(--forest-line);
}

.hero__tagline {
    font-family: var(--font-display);
    font-variation-settings: 'wdth' 110;
    font-weight: 600;
    font-size: var(--fs-lg);
    line-height: 1.25;
    margin-bottom: 0.75rem;
}
.hero__desc {
    max-width: 52ch;
    color: var(--on-forest-2);
    font-size: var(--fs-md);
    line-height: 1.5;
}

.hero__now {
    margin-bottom: 1.25rem;
    color: var(--on-forest-2);
}
.hero__now a { color: var(--on-forest); text-underline-offset: 3px; }

.hero__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }

/* ============================================================
   SECTIONS — heading left, content right
============================================================ */
.section { padding-block: var(--section-y); }
.section + .section { border-top: 1px solid var(--rule); }

.section__grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 2.6fr);
    gap: clamp(1.5rem, 5vw, 5rem);
    align-items: start;
}

.section__title {
    font-family: var(--font-display);
    font-variation-settings: 'wdth' 125;
    font-weight: 700;
    font-size: var(--fs-xl);
    line-height: 1.05;
    letter-spacing: -0.01em;
    color: var(--forest);
}

@media (min-width: 861px) {
    .section__title,
    .section__head { position: sticky; top: 104px; }
}

/* ============================================================
   ABOUT
============================================================ */
.about {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 220px;
    gap: 2rem 3rem;
    align-items: start;
}

.about__text { max-width: 62ch; font-size: var(--fs-md); line-height: 1.55; }
.about__text p + p { margin-top: 1em; }

.about__figure { grid-row: span 2; }
.about__avatar {
    width: 100%;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    border-radius: var(--r-panel);
    background: var(--paper-2);
}

.about__details { border-top: 1px solid var(--rule); }
.about__detail {
    display: grid;
    grid-template-columns: 7rem minmax(0, 1fr);
    gap: 1rem;
    padding-block: 0.8rem;
    border-bottom: 1px solid var(--rule);
}
.about__detail dt { color: var(--moss); }
.about__detail dd { overflow-wrap: anywhere; }
.about__detail a { text-decoration-color: var(--rule); text-underline-offset: 3px; }
.about__detail a:hover { text-decoration-color: var(--ink); }

.about__langs { grid-column: 1 / -1; }
.about__subtitle {
    margin-bottom: 0.75rem;
    font-size: var(--fs-base);
    font-weight: 600;
    color: var(--moss);
}

.langs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem 2rem;
}
@media (max-width: 420px) {
    .langs { grid-template-columns: minmax(0, 1fr); }
}
.lang {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.1rem 1rem;
    padding: 0.85rem 0;
    border-top: 2px solid var(--forest);
}
.lang__name {
    font-family: var(--font-display);
    font-variation-settings: 'wdth' 115;
    font-weight: 650;
    font-size: var(--fs-md);
    line-height: 1.2;
}
.lang__level { grid-column: 1; color: var(--moss); font-size: var(--fs-sm); }
.lang .skill__meter { grid-column: 2; grid-row: 1 / span 2; }

/* ============================================================
   SKILLS
============================================================ */
.skills__row {
    display: grid;
    grid-template-columns: 11rem minmax(0, 1fr);
    gap: 1rem 2rem;
    padding-block: 1.4rem;
    border-bottom: 1px solid var(--rule);
}
.skills__row:first-child { padding-top: 0.35rem; }

.skills__cat {
    font-size: var(--fs-base);
    font-weight: 600;
    color: var(--moss);
}

.skills__list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(11.5rem, 1fr));
    gap: 0.9rem 2rem;
}

.skill {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.skill__name { font-weight: 500; }

.skill__meter { display: inline-flex; gap: 3px; flex-shrink: 0; }
.skill__seg {
    width: 9px;
    height: 9px;
    border-radius: 1px;
    background: var(--rule);
}
.skill__seg--on { background: var(--forest); }

/* ============================================================
   EXPERIENCE
============================================================ */
.exp-tabs {
    display: inline-flex;
    margin-top: 1.5rem;
    padding: 3px;
    border: 1px solid var(--rule);
    border-radius: var(--r-control);
}
.exp-tab {
    padding: 0.4rem 0.95rem;
    font-size: var(--fs-sm);
    font-weight: 600;
    color: var(--moss);
    border-radius: 2px;
    transition: background-color 0.2s, color 0.2s;
}
.exp-tab:hover { color: var(--ink); }
.exp-tab--active,
.exp-tab--active:hover { background: var(--forest); color: var(--on-forest); }

.timeline--hidden { display: none; }

.timeline__item {
    display: grid;
    grid-template-columns: 10rem minmax(0, 1fr);
    gap: 0.5rem 2rem;
    padding-block: 1.75rem;
    border-bottom: 1px solid var(--rule);
}
.timeline__item:first-child { padding-top: 0.35rem; }

.timeline__date {
    color: var(--moss);
    font-size: var(--fs-sm);
    font-variant-numeric: tabular-nums;
    padding-top: 0.35rem;
}

.timeline__role {
    font-family: var(--font-display);
    font-variation-settings: 'wdth' 110;
    font-weight: 650;
    font-size: var(--fs-lg);
    line-height: 1.2;
}
.timeline__org { margin-top: 0.2rem; color: var(--moss); }
.timeline__org a { color: var(--ink); text-underline-offset: 3px; }

.timeline__list { margin-top: 1rem; max-width: 64ch; }
.timeline__list li {
    position: relative;
    padding-left: 1.25rem;
}
.timeline__list li + li { margin-top: 0.45rem; }
.timeline__list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.68em;
    width: 7px;
    height: 2px;
    background: var(--forest);
}
.timeline__desc { margin-top: 0.75rem; max-width: 64ch; }

/* ============================================================
   PROJECTS
============================================================ */
.project {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1.5rem 2.5rem;
    padding-block: 2rem;
    border-bottom: 1px solid var(--rule);
}
.project:first-child { padding-top: 0.35rem; }
.project--has-img { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); align-items: center; }

.project__flag {
    display: inline-block;
    margin-bottom: 0.75rem;
    padding: 0.15rem 0.55rem;
    background: var(--pollen);
    color: var(--ink);
    font-size: 0.8125rem;
    font-weight: 600;
    border-radius: var(--r-control);
}

.project__title {
    font-family: var(--font-display);
    font-variation-settings: 'wdth' 125;
    font-weight: 700;
    font-size: var(--fs-xl);
    line-height: 1.1;
    letter-spacing: -0.01em;
}
.project--featured .project__title { font-size: var(--fs-2xl); }

.project__open {
    text-align: left;
    text-decoration: underline;
    text-decoration-color: transparent;
    text-decoration-thickness: 3px;
    text-underline-offset: 0.15em;
    transition: text-decoration-color 0.2s;
}
.project__open:hover { text-decoration-color: var(--pollen); }

.project__desc {
    margin-top: 0.75rem;
    max-width: 58ch;
    font-size: var(--fs-md);
    line-height: 1.5;
    color: var(--moss);
}

.project__tags { display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; margin-top: 1rem; }

.project__actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1.5rem; }

.project__img {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    border-radius: var(--r-panel);
    border: 1px solid var(--rule);
}

/* Tags carry their admin-set colour as a small swatch only */
.tag {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: var(--fs-sm);
    font-weight: 500;
    color: var(--ink);
}
.tag::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--tag-color, var(--moss));
}

/* ============================================================
   CONTACT
============================================================ */
.contact {
    background: var(--forest);
    color: var(--on-forest);
    padding-block: var(--section-y);
}

.contact__grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
    gap: clamp(2.5rem, 6vw, 6rem);
    align-items: start;
}

.contact__title {
    font-family: var(--font-display);
    font-variation-settings: 'wdth' 130;
    font-weight: 800;
    font-size: var(--fs-2xl);
    line-height: 0.98;
    letter-spacing: -0.015em;
}
.contact__lede {
    margin-top: 1.25rem;
    max-width: 44ch;
    color: var(--on-forest-2);
    font-size: var(--fs-md);
    line-height: 1.5;
}

.contact__email {
    display: inline-block;
    margin-top: 2rem;
    font-family: var(--font-display);
    font-variation-settings: 'wdth' 100;
    font-weight: 600;
    font-size: clamp(1.25rem, 2.6vw, 1.75rem);
    color: var(--pollen);
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 6px;
    overflow-wrap: anywhere;
}
.contact__email:hover { color: var(--on-forest); }

.contact__socials { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; margin-top: 2rem; }
.contact__socials a {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--on-forest-2);
    text-decoration: none;
    font-weight: 500;
}
.contact__socials a:hover { color: var(--on-forest); }

.contact__form {
    padding: clamp(1.25rem, 3vw, 2rem);
    background: var(--paper);
    color: var(--ink);
    border-radius: var(--r-panel);
}

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
.form-group { margin-bottom: 1.1rem; }

.form-label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: var(--fs-sm);
    font-weight: 600;
}

.form-input,
.form-textarea {
    width: 100%;
    padding: 0.7rem 0.85rem;
    background: #fff;
    color: var(--ink);
    border: 1.5px solid var(--rule);
    border-radius: var(--r-control);
    font: inherit;
    transition: border-color 0.2s;
}
.form-textarea { resize: vertical; min-height: 140px; }
.form-input::placeholder,
.form-textarea::placeholder { color: #8FA197; }
.form-input:hover,
.form-textarea:hover { border-color: var(--moss); }
.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--forest);
    box-shadow: 0 0 0 3px rgba(244, 197, 66, 0.55);
}

.form-feedback { display: none; margin-bottom: 1rem; padding: 0.7rem 0.9rem; border-radius: var(--r-control); font-weight: 500; }
.form-feedback.success { display: block; background: #DCEBDF; color: var(--forest); }
.form-feedback.error   { display: block; background: #F6DEDC; color: var(--danger); }

/* ============================================================
   FOOTER
============================================================ */
.footer {
    background: var(--forest);
    color: var(--on-forest-2);
    border-top: 1px solid var(--forest-line);
}
.footer__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-block: 1.5rem;
    font-size: var(--fs-sm);
}
.footer__socials { display: flex; gap: 0.25rem; }
.footer__socials a {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: var(--r-control);
    transition: color 0.2s;
}
.footer__socials a:hover { color: var(--pollen); }

/* ============================================================
   MODAL
============================================================ */
.modal {
    position: fixed;
    inset: 0;
    z-index: 300;
    display: grid;
    place-items: center;
    padding: var(--gutter);
}
.modal[hidden] { display: none; }

.modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(11, 61, 44, 0.78);
}

.modal__panel {
    position: relative;
    width: min(960px, 100%);
    max-height: calc(100vh - 2 * var(--gutter));
    overflow-y: auto;
    background: var(--paper);
    color: var(--ink);
    border-radius: var(--r-panel);
}

.modal__close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--paper-2);
    font-size: 1.1rem;
}
.modal__close:hover { background: var(--rule); }

.modal__body { padding: clamp(1.5rem, 4vw, 2.75rem); }

.modal__content--split {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    gap: 2rem;
}

.modal__gallery-main {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    border-radius: var(--r-panel);
    border: 1px solid var(--rule);
}
.modal__gallery-thumbs { display: flex; gap: 0.5rem; margin-top: 0.6rem; overflow-x: auto; }
.modal__gallery-thumb {
    width: 76px;
    height: 52px;
    object-fit: cover;
    border-radius: var(--r-control);
    border: 2px solid transparent;
    opacity: 0.6;
    cursor: pointer;
}
.modal__gallery-thumb.active,
.modal__gallery-thumb:hover { opacity: 1; border-color: var(--forest); }

.modal__title {
    padding-right: 3rem;
    font-family: var(--font-display);
    font-variation-settings: 'wdth' 125;
    font-weight: 700;
    font-size: var(--fs-xl);
    line-height: 1.1;
    color: var(--forest);
}
.modal__tags { display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; margin-top: 1rem; }
.modal__desc { margin-top: 1.25rem; max-width: 64ch; }
.modal__desc p + p { margin-top: 0.8em; }
.modal__actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1.75rem; }
.modal__actions .btn--ghost   { color: var(--ink); border-color: var(--rule); }
.modal__actions .btn--ghost:hover { border-color: var(--ink); }
.modal__actions .btn--primary { background: var(--ink); color: var(--paper); }
.modal__actions .btn--primary:hover { background: var(--forest); }

.modal__error { padding: 2rem 0; text-align: center; color: var(--moss); }
.modal__error i { display: block; margin-bottom: 0.75rem; font-size: 1.75rem; color: var(--danger); }

.modal__loader { display: grid; place-items: center; min-height: 240px; }
.loader-ring {
    width: 36px;
    height: 36px;
    border: 3px solid var(--rule);
    border-top-color: var(--forest);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ============================================================
   RESPONSIVE
============================================================ */
@media (max-width: 860px) {
    .section__grid,
    .hero__foot,
    .contact__grid,
    .project--has-img,
    .modal__content--split { grid-template-columns: minmax(0, 1fr); }

    .about { grid-template-columns: minmax(0, 1fr) 140px; }
    .about__figure { grid-row: 1; grid-column: 2; }
    .about__details { grid-column: 1 / -1; }

    .nav__hamburger { display: flex; }
    .nav__links {
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 0.5rem var(--gutter) 1.25rem;
        background: var(--forest);
        border-bottom: 1px solid var(--forest-line);
        display: none;
    }
    .nav__links.open { display: flex; }
    .nav__link { padding: 0.8rem 0; font-size: var(--fs-md); }
    .nav__link--accent { margin: 0.75rem 0 0; padding: 0.8rem 1rem; text-align: center; }
}

@media (max-width: 600px) {
    .skills__row,
    .timeline__item { grid-template-columns: minmax(0, 1fr); gap: 0.6rem; }
    .timeline__date { padding-top: 0; }

    .about { grid-template-columns: minmax(0, 1fr); }
    .about__figure { grid-column: 1; max-width: 200px; }
    .about__detail { grid-template-columns: 5.5rem minmax(0, 1fr); }

    .form-row { grid-template-columns: minmax(0, 1fr); }

    .hero__name { font-variation-settings: 'wdth' 120; }
    .hero__word + .hero__word { padding-left: 0; }

    .footer__inner { flex-direction: column-reverse; align-items: flex-start; }
}
