/* ============================================================
   Color Tokens — liquid glass, dark olive, single theme
   ============================================================ */
:root {
    --bg:             #232d17;
    --bg-mid:         #3a4a29;
    --surface:        rgba(251, 246, 234, 0.08);
    --surface-hover:  rgba(251, 246, 234, 0.13);
    --surface-active: rgba(251, 246, 234, 0.24);
    --border:         rgba(251, 246, 234, 0.15);
    --border-strong:  rgba(251, 246, 234, 0.28);
    --accent:         #e0ae5f;
    --accent-green:   #8fa671;
    --text:           #fbf6ea;
    --text-muted:     rgba(251, 246, 234, 0.64);
    --text-subtle:    rgba(251, 246, 234, 0.42);
    --nav-bg:         rgba(251, 246, 234, 0.09);
    --blob-sage:      #8fa671;
    --blob-tan:       #d9c6a0;
    --blob-gold:      #c79a4b;
    /* Single dark world by design — no light-mode override. Also makes
       native form controls (scrollbars, etc.) render dark. */
    color-scheme: dark;
}

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

html { scroll-behavior: smooth; }

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: 'Sora', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    font-size: 15px;
    line-height: 1.65;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Sora', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    color: var(--text);
    margin: 0 0 0.4rem 0;
    letter-spacing: -0.01em;
}

a {
    color: var(--accent);
    text-decoration: none;
}
a:hover { text-decoration: underline; opacity: 0.85; }

ul { margin: 0.4rem 0; padding-left: 1.4rem; }
li { margin-bottom: 6px; line-height: 1.5; }
p  { margin: 0 0 10px 0; }

/* ============================================================
   Ambient mesh background — fixed behind everything
   ============================================================ */
.mesh {
    position: fixed;
    inset: 0;
    z-index: -2;
    overflow: hidden;
    background:
        radial-gradient(120% 90% at 15% -10%, var(--bg-mid) 0%, transparent 55%),
        var(--bg);
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.55;
    will-change: transform;
}
.blob-1 { width: 52vw; height: 52vw; top: -14vw; left: -10vw; background: var(--blob-sage); animation: drift1 34s ease-in-out infinite; }
.blob-2 { width: 44vw; height: 44vw; top: 18vw; right: -14vw; background: var(--blob-gold); opacity: 0.32; animation: drift2 40s ease-in-out infinite; }
.blob-3 { width: 48vw; height: 48vw; bottom: -20vw; left: 20vw; background: var(--blob-tan); opacity: 0.26; animation: drift3 46s ease-in-out infinite; }

@keyframes drift1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50%      { transform: translate(6vw, 8vw) scale(1.08); }
}
@keyframes drift2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50%      { transform: translate(-7vw, 5vw) scale(0.94); }
}
@keyframes drift3 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50%      { transform: translate(4vw, -6vw) scale(1.06); }
}
@media (prefers-reduced-motion: reduce) {
    .blob { animation: none; }
    html  { scroll-behavior: auto; }
}

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

/* ============================================================
   Hero
   ============================================================ */
.hero {
    max-width: 860px;
    margin: 0 auto;
    padding: 90px 40px 70px 40px;
}

.hero-label {
    color: var(--accent-green);
    font-size: 13px;
    letter-spacing: 1px;
    margin: 0 0 14px 0;
}

.hero-name {
    font-size: clamp(2.2rem, 5vw, 3.6rem);
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.02em;
    margin: 0 0 14px 0;
    line-height: 1.05;
}

.hero-title {
    display: inline-block;
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.7;
    margin: 0 0 30px 0;
    padding: 12px 20px;
    max-width: 100%;
    background: linear-gradient(160deg, var(--surface-hover), var(--surface));
    backdrop-filter: blur(28px) saturate(150%);
    -webkit-backdrop-filter: blur(28px) saturate(150%);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow:
        0 12px 28px rgba(10, 14, 6, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.hero-links {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: -12px;
}

.hero-links a {
    display: inline-flex;
    align-items: center;
    padding: 11px 22px;
    border: 1px solid var(--accent);
    border-radius: 999px;
    background: var(--accent);
    color: var(--bg);
    font-size: 14px;
    font-weight: 600;
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    box-shadow:
        0 10px 24px rgba(10, 14, 6, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.25);
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
    text-decoration: none;
}
.hero-links a:hover {
    transform: translateY(-1px);
    filter: brightness(1.08);
    box-shadow:
        0 14px 30px rgba(10, 14, 6, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    text-decoration: none;
    opacity: 1;
}

/* ============================================================
   Layout
   ============================================================ */
.content {
    max-width: 860px;
    margin: 0 auto 64px auto;
    padding: 0 40px;
}

/* ============================================================
   Section Headers
   ============================================================ */
.section-header {
    margin-bottom: 24px;
}

.section-header h3 {
    font-size: 28px;
    font-weight: 700;
    text-transform: none;
    letter-spacing: -0.01em;
    color: var(--text);
    margin: 0;
}

.section-header h3::before {
    content: '';
}

/* ============================================================
   Cards — shared by experience-item and section-tile
   ============================================================ */
.section-tile,
.experience-item {
    background: linear-gradient(160deg, var(--surface-hover), var(--surface));
    backdrop-filter: blur(28px) saturate(150%);
    -webkit-backdrop-filter: blur(28px) saturate(150%);
    border: 1px solid var(--border);
    box-shadow:
        0 18px 40px rgba(10, 14, 6, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.10);
    margin-bottom: 20px;
    padding: 26px 30px;
    border-radius: 22px;
    transition: background 0.2s ease, border-color 0.2s ease,
                box-shadow 0.2s ease, transform 0.2s ease;
}

.section-tile:hover,
.experience-item:hover {
    background: linear-gradient(160deg, var(--surface-active), var(--surface-hover));
    border-color: var(--border-strong);
    box-shadow:
        0 26px 56px rgba(10, 14, 6, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.22);
    transform: translateY(-3px);
}

/* ============================================================
   Experience Cards
   ============================================================ */
.experience-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 6px;
}

.experience-header h6 {
    margin: 0;
    font-size: 17px;
    color: var(--text);
    font-weight: 700;
    flex: 1;
    min-width: 180px;
}

.experience-duration {
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-style: normal;
    color: var(--text-subtle);
    font-size: 12px;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.experience-company {
    margin: 0 0 3px 0;
    font-weight: 600;
    color: var(--accent);
    font-size: 15px;
}

.experience-location {
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    margin: 0 0 14px 0;
    color: var(--text-subtle);
    font-size: 12px;
}

.experience-location a { color: var(--accent); }

.experience-bullets {
    margin: 0;
    padding-left: 18px;
    color: var(--text-muted);
}

.experience-bullets li {
    margin-bottom: 5px;
    font-size: 15px;
    line-height: 1.6;
}
.experience-bullets li::marker { color: var(--blob-sage); }

/* Project subsection labels */
.subsection-label {
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-size: 10.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-subtle);
    margin: 14px 0 8px 0;
}

/* ============================================================
   Skill Tags
   ============================================================ */
.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 4px;
}

.skill-tag {
    display: inline-block;
    padding: 5px 10px;
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 11.5px;
    color: var(--text-muted);
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    letter-spacing: 0.02em;
}

/* ============================================================
   Education
   ============================================================ */
.education-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
}

.education-column p {
    color: var(--text-muted);
    font-size: 15px;
    margin: 0 0 8px 0;
}

.education-column p strong { color: var(--text); }

/* ============================================================
   Workshops / Cert Items
   ============================================================ */
.cert-item {
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 15px;
}

.cert-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.workshop-table {
    width: 100%;
    border-collapse: collapse;
    color: var(--text-muted);
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-size: 13px;
}

.workshop-table td {
    border: none;
    padding: 10px 16px 10px 0;
    vertical-align: middle;
    white-space: nowrap;
}

.workshop-table td:last-child {
    padding-right: 0;
}

.workshop-table tr:last-child td {
    padding-bottom: 0;
}

.workshop-table tr:not(:last-child) td {
    border-bottom: 1px solid var(--border);
}

/* ============================================================
   Additional Experience
   ============================================================ */
.additional-experience {
    opacity: 0.8;
}
.additional-experience:hover {
    opacity: 1;
}

.additional-role {
    margin-bottom: 14px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
}
.additional-role:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.role-title {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
}

/* ============================================================
   Navigation — fixed glass panel, top-right
   ============================================================ */
.nav-container {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 1px;
    padding: 14px;
    min-width: 148px;
    background: linear-gradient(160deg, var(--surface-hover), var(--surface));
    backdrop-filter: blur(28px) saturate(150%);
    -webkit-backdrop-filter: blur(28px) saturate(150%);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow:
        0 18px 40px rgba(10, 14, 6, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.10);
    z-index: 100;
}

.nav-link {
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-size: 12.5px;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    text-decoration: none;
    text-align: right;
    padding: 7px 8px;
    border-radius: 9px;
    transition: color 0.15s ease, background 0.15s ease, padding-right 0.15s ease;
}
.nav-link:hover {
    color: var(--text);
    background: var(--surface-hover);
    text-decoration: none;
    opacity: 1;
    padding-right: 12px;
}

.nav-top {
    color: var(--accent);
    font-weight: 600;
    font-size: 12.5px;
    padding-bottom: 11px;
    margin-bottom: 5px;
    border-bottom: 1px solid var(--border);
}

/* ============================================================
   Anchor offset (so fixed nav doesn't cover section headings)
   ============================================================ */
.anchor {
    display: block;
    height: 80px;
    margin-top: -80px;
    visibility: hidden;
}

/* ============================================================
   Mobile footer
   ============================================================ */
.mobile-footer {
    display: none;
    position: fixed;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    gap: 8px;
    white-space: nowrap;
}

.mobile-footer .nav-link {
    flex-shrink: 0;
    white-space: nowrap;
    padding: 7px 15px;
    font-size: 13.5px;
    line-height: 1.4;
    color: var(--text-muted);
    text-align: center;
    border-radius: 999px;
    background: linear-gradient(160deg, var(--surface-hover), var(--surface));
    backdrop-filter: blur(28px) saturate(150%);
    -webkit-backdrop-filter: blur(28px) saturate(150%);
    border: 1px solid var(--border);
    box-shadow: 0 6px 16px rgba(10, 14, 6, 0.25);
}
.mobile-footer .nav-link:hover {
    background: var(--surface-hover);
    color: var(--accent);
    padding-right: 15px;
}

/* ============================================================
   Resume modal — same scrim + glass frame as awardfiller's preview
   ============================================================ */
.resume-modal-open,
.resume-modal-open body { overflow: hidden; }

.resume-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 40px;
    background: rgba(10, 14, 6, 0.72);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.resume-modal-overlay[hidden] { display: none; }

.resume-modal {
    display: flex;
    flex-direction: column;
    width: min(860px, 100%);
    max-height: 100%;
    background: linear-gradient(160deg, var(--surface-hover), var(--surface));
    backdrop-filter: blur(28px) saturate(150%);
    -webkit-backdrop-filter: blur(28px) saturate(150%);
    border: 1px solid var(--border);
    border-radius: 26px;
    box-shadow:
        0 30px 70px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.14);
    overflow: hidden;
    position: relative;
}

.resume-modal-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px 10px 22px;
    border-bottom: 1px solid var(--border);
}

.resume-modal-title {
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-size: 13px;
    color: var(--text-muted);
}

.resume-modal-actions {
    display: flex;
    gap: 8px;
}

.resume-modal-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 32px;
    padding: 0 14px;
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-size: 13px;
    line-height: 1;
    color: var(--text);
    background: linear-gradient(160deg, var(--surface-active), var(--surface-hover));
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
    cursor: pointer;
    text-decoration: none;
    transition: border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.resume-modal-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    text-decoration: none;
    opacity: 1;
    transform: scale(1.04);
}
.resume-modal-close {
    width: 52px;
    padding: 0;
    font-size: 20px;
}

.resume-modal-toast {
    position: absolute;
    top: 64px;
    left: 50%;
    transform: translate(-50%, -6px);
    max-width: calc(100% - 32px);
    padding: 9px 16px;
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-size: 13px;
    color: var(--bg);
    background: var(--accent);
    border-radius: 999px;
    box-shadow: 0 10px 24px rgba(10, 14, 6, 0.45);
    overflow-wrap: anywhere;
    text-align: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}
.resume-modal-toast.is-visible {
    opacity: 1;
    transform: translate(-50%, 0);
}

.resume-modal-pages {
    flex: 0 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    outline: none;
}

.resume-modal-page {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 12px 30px rgba(10, 14, 6, 0.4);
}

.resume-modal-status {
    margin: auto;
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
    padding: 80px 0;
}

@media (max-width: 768px) {
    .resume-modal-overlay { padding: 12px; }
    .resume-modal { border-radius: 20px; }
    .resume-modal-bar { padding: 8px 10px 8px 16px; }
    .resume-modal-pages { padding: 10px; gap: 10px; }
    .resume-modal-page { border-radius: 6px; }
}

/* ============================================================
   News feed (homepage) + its "view all" modal
   ============================================================ */
.news-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.news-expand {
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-size: 13px;
    color: var(--text-muted);
    background: none;
    border: none;
    padding: 4px 0;
    cursor: pointer;
    transition: color 0.15s ease;
}
.news-expand:hover { color: var(--accent); }

.news-list {
    --news-line: 1.6em;
    --news-gap: 0.5em;
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 15px;
    line-height: var(--news-line);
    color: var(--text-muted);
    scrollbar-width: thin;
    scrollbar-color: var(--border-strong) transparent;
}
.news-list::-webkit-scrollbar { width: 6px; }
.news-list::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }
.news-list:focus { outline: none; }
.news-list:focus-visible { outline: 1px dashed var(--accent); outline-offset: 4px; }

/* Inline feed shows ~4 lines (4 one-line items + the gaps between them),
   then scrolls; the full history lives in the modal. */
.news-tile .news-list {
    max-height: calc(4 * var(--news-line) + 3 * var(--news-gap));
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 10px;
}
/* Fade the bottom edge while there's more to scroll — macOS hides
   scrollbars until you scroll, so this is the "there's more" cue.
   news-modal.js toggles .news-more based on the scroll position. */
.news-tile .news-list.news-more {
    -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 1.1em), rgba(0, 0, 0, 0.3));
            mask-image: linear-gradient(to bottom, #000 calc(100% - 1.1em), rgba(0, 0, 0, 0.3));
}

.news-item {
    display: grid;
    grid-template-columns: 76px 1fr;
    gap: 14px;
    margin: 0 0 var(--news-gap) 0;
    line-height: inherit;
}
.news-item:last-child { margin-bottom: 0; }

.news-date {
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-size: 12px;
    color: var(--accent-green);
    white-space: nowrap;
    padding-top: 0.1em;
}

.news-text strong { color: var(--text); }

.news-modal { width: min(680px, 100%); }
.news-modal-list {
    flex: 0 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 20px 24px;
}

@media (max-width: 768px) {
    .news-item { grid-template-columns: 1fr; gap: 0; }
    .news-date:empty { display: none; }
    .news-modal-list { padding: 14px 16px; }
}

/* ============================================================
   Responsive
   ============================================================ */
/* Phones in landscape are wider than 768px, so also match on short height */
@media (max-width: 768px), (max-height: 500px) and (orientation: landscape) {
    .nav-container  { display: none; }
    .mobile-footer  { display: flex; }
}

@media (max-width: 768px) {
    .hero {
        padding: 70px 20px 48px 20px;
    }

    .content {
        padding: 0 20px;
        margin-bottom: 44px;
    }

    .hero-name { font-size: 2rem; }

    .experience-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .experience-duration { text-align: left; }
    .experience-header h6 { min-width: auto; }

    .education-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    /* .workshop-table td has white-space: nowrap for the desktop 3-column
       layout; on narrow viewports that forces the table wider than its
       container (table-layout: auto ignores width:100% once nowrap content
       needs more room), which overflows the page horizontally. Letting it
       wrap and stacking the columns keeps it inside the viewport. */
    .workshop-table, .workshop-table tbody, .workshop-table tr {
        display: block;
        width: 100%;
    }
    .workshop-table tr {
        padding: 10px 0;
    }
    .workshop-table td {
        display: block;
        white-space: normal;
        padding: 2px 0;
        border-bottom: none !important;
    }
    .workshop-table tr:not(:last-child) {
        border-bottom: 1px solid var(--border);
    }
}
