/* ==========================================================================
   Parker Moesta — portfolio
   Dark evergreen (default) / alpine light theme system
   ========================================================================== */

:root {
    --font-display: "Fraunces", Georgia, serif;
    --font-body: "Inter", system-ui, -apple-system, sans-serif;
    --radius: 14px;
    --radius-sm: 9px;
    --container: 1120px;
    --nav-h: 68px;
    --ease: cubic-bezier(.22, .8, .3, 1);
}

:root[data-theme="dark"] {
    --bg: #0a100d;
    --bg-alt: #0e1611;
    --surface: #131e17;
    --surface-2: #18261d;
    --line: rgba(214, 240, 220, .1);
    --text: #e9f1ea;
    --text-muted: #9fb5a6;
    --accent: #5fd68b;
    --accent-2: #a3e635;
    --accent-deep: #2f6b4f;
    --accent-ink: #06130b;
    --halo: #7ee2a8;
    --sky-hi: #101c15;
    --sky-lo: #0a100d;
    --scene-far: #1c3226;
    --scene-mid: #16281e;
    --scene-near: #101d16;
    --scene-tree: #0a130e;
    --orb: #d7f5df;
    --star: rgba(222, 247, 228, .8);
    --shadow: 0 18px 50px rgba(0, 0, 0, .45);
    --card-glow: 0 0 0 1px var(--line), 0 14px 40px rgba(0, 0, 0, .35);
    --contour-ink: rgba(150, 220, 170, .05);
}

:root[data-theme="light"] {
    --bg: #f3f6f0;
    --bg-alt: #eaf0e6;
    --surface: #ffffff;
    --surface-2: #f7faf5;
    --line: rgba(24, 48, 32, .12);
    --text: #182a1e;
    --text-muted: #56695b;
    --accent: #177245;
    --accent-2: #3f6212;
    --accent-deep: #9cc2a6;
    --accent-ink: #f4fbf5;
    --halo: #ffd98a;
    --sky-hi: #eef4ea;
    --sky-lo: #dfe9da;
    --scene-far: #c5d6c0;
    --scene-mid: #a3bf9e;
    --scene-near: #7da37c;
    --scene-tree: #40604a;
    --orb: #ffcf6e;
    --star: rgba(255, 255, 255, 0);
    --shadow: 0 18px 40px rgba(30, 55, 38, .14);
    --card-glow: 0 0 0 1px var(--line), 0 10px 30px rgba(30, 55, 38, .1);
    --contour-ink: rgba(30, 80, 45, .05);
}

/* ---------- base ---------- */

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

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 12px); }

body {
    margin: 0;
    font-family: var(--font-body);
    font-size: 16.5px;
    line-height: 1.65;
    color: var(--text);
    background-color: var(--bg);
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='560' height='560' viewBox='0 0 560 560'%3E%3Cg fill='none' stroke='%23888' stroke-opacity='.055' stroke-width='1.2'%3E%3Cpath d='M120 280c0-90 70-160 160-160s160 70 160 160-70 160-160 160-160-70-160-160z'/%3E%3Cpath d='M160 280c0-67 53-120 120-120s120 53 120 120-53 120-120 120-120-53-120-120z'/%3E%3Cpath d='M200 280c0-45 35-80 80-80s80 35 80 80-35 80-80 80-80-35-80-80z'/%3E%3Cpath d='M60 280c0-122 98-220 220-220s220 98 220 220-98 220-220 220S60 402 60 280z'/%3E%3C/g%3E%3C/svg%3E");
    transition: background-color .45s var(--ease), color .45s var(--ease);
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--font-display); line-height: 1.15; margin: 0 0 .5em; }
p { margin: 0 0 1em; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 24px; }

.skip-link {
    position: absolute; left: -999px; top: 8px; z-index: 200;
    background: var(--accent); color: var(--accent-ink);
    padding: 10px 18px; border-radius: var(--radius-sm); font-weight: 600;
}
.skip-link:focus { left: 8px; }

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

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

/* ---------- buttons ---------- */

.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 12px 24px; border-radius: 999px;
    font-weight: 600; font-size: 15px; line-height: 1;
    border: 1px solid transparent; cursor: pointer;
    transition: transform .2s var(--ease), box-shadow .2s var(--ease), background .2s;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }

.btn-solid {
    background: var(--accent); color: var(--accent-ink);
    box-shadow: 0 6px 22px color-mix(in srgb, var(--accent) 35%, transparent);
}
.btn-solid:hover { box-shadow: 0 10px 28px color-mix(in srgb, var(--accent) 45%, transparent); }

.btn-ghost { border-color: var(--line); color: var(--text); background: transparent; }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.btn-lg { padding: 16px 32px; font-size: 17px; }

/* ---------- nav ---------- */

.site-nav {
    position: fixed; inset: 0 0 auto 0; z-index: 100;
    background: color-mix(in srgb, var(--bg) 82%, transparent);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
}

.site-nav nav {
    max-width: var(--container); margin: 0 auto; height: var(--nav-h);
    display: flex; align-items: center; gap: 20px; padding: 0 24px;
}

.brand {
    display: flex; align-items: center; gap: 10px;
    font-family: var(--font-display); font-weight: 700; font-size: 19px;
    color: var(--text); margin-right: auto;
}
.brand:hover { text-decoration: none; color: var(--accent); }
.brand-mark { width: 26px; height: 26px; }

.nav-menu { display: flex; align-items: center; gap: 22px; }
.nav-menu > a {
    color: var(--text-muted); font-weight: 500; font-size: 15px;
    padding: 6px 2px; position: relative;
}
.nav-menu > a::after {
    content: ""; position: absolute; left: 0; right: 100%; bottom: 0;
    height: 2px; background: var(--accent); transition: right .25s var(--ease);
}
.nav-menu > a:hover { color: var(--text); text-decoration: none; }
.nav-menu > a:hover::after { right: 0; }

.nav-social { display: flex; align-items: center; gap: 6px; padding-left: 10px; border-left: 1px solid var(--line); }
.nav-social a { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; color: var(--text-muted); }
.nav-social a:hover { color: var(--accent); background: var(--surface); }
.nav-social svg { width: 17px; height: 17px; fill: currentColor; }

.theme-toggle {
    display: grid; place-items: center; width: 38px; height: 38px;
    border-radius: 50%; border: 1px solid var(--line);
    background: var(--surface); color: var(--text); cursor: pointer;
    transition: transform .3s var(--ease);
}
.theme-toggle:hover { transform: rotate(18deg) scale(1.06); border-color: var(--accent); }
.theme-toggle svg { width: 17px; height: 17px; fill: currentColor; }
:root[data-theme="dark"] .icon-moon { display: none; }
:root[data-theme="light"] .icon-sun { display: none; }
:root[data-theme="light"] .icon-moon { fill: none; stroke: currentColor; stroke-width: 2; }

.nav-toggle { display: none; }

/* ---------- hero ---------- */

.hero {
    position: relative; min-height: 92vh;
    display: flex; flex-direction: column; justify-content: center;
    overflow: hidden;
    background: linear-gradient(180deg, var(--sky-hi) 0%, var(--sky-lo) 100%);
    padding: calc(var(--nav-h) + 48px) 0 0;
}

.hero::before {
    /* aurora wash, dark theme only */
    content: ""; position: absolute; inset: -10% -20% auto;
    height: 70%;
    background:
        radial-gradient(42% 55% at 28% 38%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%),
        radial-gradient(38% 50% at 62% 26%, color-mix(in srgb, var(--accent-2) 10%, transparent), transparent 70%),
        radial-gradient(30% 45% at 82% 45%, color-mix(in srgb, var(--halo) 9%, transparent), transparent 70%);
    filter: blur(10px);
    animation: aurora 16s ease-in-out infinite alternate;
    pointer-events: none;
}
:root[data-theme="light"] .hero::before { opacity: .5; }

@keyframes aurora {
    from { transform: translateX(-2%) translateY(0) scale(1); }
    to   { transform: translateX(2.5%) translateY(2%) scale(1.05); }
}

.hero-inner {
    position: relative; z-index: 2;
    max-width: var(--container); width: 100%;
    margin: 0 auto; padding: 0 24px 300px;
}

.hero-kicker {
    font-size: 13px; letter-spacing: .18em; text-transform: uppercase;
    color: var(--accent); font-weight: 600; margin-bottom: 18px;
}

.hero h1 {
    font-size: clamp(52px, 8.5vw, 104px);
    font-weight: 700; letter-spacing: -.015em; margin-bottom: 10px;
}
.accent-dot { color: var(--accent); }

.hero-role {
    font-size: clamp(19px, 2.6vw, 26px);
    font-family: var(--font-display); font-weight: 500;
    color: var(--text); margin-bottom: 22px;
}
.role-at { color: var(--text-muted); padding: 0 4px; }

.hero-rotator {
    min-height: 3.4em; max-width: 620px;
    font-size: clamp(16px, 2vw, 19px);
    color: var(--text-muted); margin-bottom: 30px;
    border-left: 2px solid var(--accent); padding-left: 18px;
}
#rotating-text { display: inline-block; transition: opacity .6s var(--ease), transform .6s var(--ease); }
#rotating-text.is-out { opacity: 0; transform: translateY(8px); }

.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; }

/* hero SVG scene */
.hero-scene { position: absolute; inset: auto 0 0 0; z-index: 1; pointer-events: none; }
.scene { display: block; width: 100%; height: clamp(240px, 38vw, 460px); }

.stars circle { fill: var(--star); animation: twinkle 4s ease-in-out infinite; }
.stars circle:nth-child(3n)  { animation-delay: 1.3s; }
.stars circle:nth-child(3n+1){ animation-delay: 2.4s; }
@keyframes twinkle { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }

.orb { fill: var(--orb); }
.orb-craters circle { fill: color-mix(in srgb, var(--orb) 82%, #17301f); }
:root[data-theme="light"] .orb-craters { display: none; }
.ridge-far path  { fill: var(--scene-far); }
.ridge-mid path  { fill: var(--scene-mid); }
.ridge-near path { fill: var(--scene-near); }
.treeline path, .treeline use { fill: var(--scene-tree); }

.scene path, .scene use, .orb { transition: fill .45s var(--ease); }
.ridge, .treeline { will-change: transform; }

/* ---------- sections ---------- */

.section { padding: 110px 0; position: relative; }
.section-alt { background: var(--bg-alt); border-block: 1px solid var(--line); }

.section-kicker {
    font-size: 12.5px; letter-spacing: .2em; text-transform: uppercase;
    color: var(--accent); font-weight: 600; margin-bottom: 10px;
}
.section-title { font-size: clamp(30px, 4.4vw, 46px); letter-spacing: -.01em; max-width: 20ch; }
.section-lede { color: var(--text-muted); max-width: 58ch; margin-bottom: 40px; }

/* ---------- filters ---------- */

.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 36px; }

.chip {
    padding: 8px 18px; border-radius: 999px; font-size: 14px; font-weight: 550;
    font-family: var(--font-body);
    background: transparent; color: var(--text-muted);
    border: 1px solid var(--line); cursor: pointer;
    transition: all .2s var(--ease);
}
.chip:hover { color: var(--accent); border-color: var(--accent); }
.chip.is-active { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

/* ---------- project grid ---------- */

.project-grid {
    display: grid; gap: 26px;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.project-card { border-radius: var(--radius); }
.project-card.is-hidden { display: none; }

.card-trigger {
    display: flex; flex-direction: column; width: 100%; height: 100%;
    padding: 0; text-align: left; cursor: pointer;
    font: inherit; color: inherit;
    background: var(--surface); border: none; border-radius: var(--radius);
    box-shadow: var(--card-glow);
    overflow: hidden;
    transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}
.card-trigger:hover {
    transform: translateY(-6px);
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 55%, transparent),
                0 22px 48px rgba(0, 0, 0, .35),
                0 0 40px color-mix(in srgb, var(--accent) 12%, transparent);
}

.card-media { aspect-ratio: 16 / 10; overflow: hidden; background: var(--surface-2); }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.card-trigger:hover .card-media img { transform: scale(1.05); }

.card-body { padding: 20px 22px 24px; display: flex; flex-direction: column; gap: 6px; }
.card-tag {
    align-self: flex-start; font-size: 11.5px; font-weight: 600;
    letter-spacing: .12em; text-transform: uppercase;
    color: var(--accent);
    background: color-mix(in srgb, var(--accent) 12%, transparent);
    padding: 4px 10px; border-radius: 999px; margin-bottom: 4px;
}
.card-body h3 { font-size: 19.5px; margin: 0; }
.card-body p { font-size: 14.5px; color: var(--text-muted); margin: 0; }

/* ---------- dialogs ---------- */

.project-dialog {
    width: min(680px, calc(100vw - 40px));
    border: 1px solid var(--line); border-radius: var(--radius);
    background: var(--surface); color: var(--text);
    padding: 0 0 28px; box-shadow: var(--shadow);
}
.project-dialog::backdrop { background: rgba(4, 10, 6, .7); backdrop-filter: blur(4px); }

.project-dialog img { width: 100%; max-height: 380px; object-fit: cover; }
.project-dialog h3 { font-size: 24px; padding: 22px 28px 0; }
.project-dialog p { padding: 0 28px; color: var(--text-muted); }
.dialog-links { display: flex; gap: 12px; flex-wrap: wrap; padding: 6px 28px 0; }

.dialog-close {
    position: absolute; top: 12px; right: 12px; z-index: 2;
    width: 38px; height: 38px; border-radius: 50%;
    border: none; cursor: pointer; font-size: 22px; line-height: 1;
    background: color-mix(in srgb, var(--bg) 72%, transparent);
    color: var(--text); backdrop-filter: blur(6px);
}
.dialog-close:hover { background: var(--accent); color: var(--accent-ink); }

/* ---------- timeline ---------- */

.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before {
    content: ""; position: absolute; top: 6px; bottom: 6px; left: 89px;
    width: 2px;
    background: linear-gradient(180deg, var(--accent), color-mix(in srgb, var(--accent) 20%, transparent));
}

.timeline-item {
    display: grid; grid-template-columns: 72px 36px 1fr;
    align-items: start; margin-bottom: 26px;
}

.timeline-year {
    grid-column: 1; text-align: right;
    font-family: var(--font-display); font-weight: 600; font-size: 17px;
    color: var(--accent); padding-top: 20px; white-space: nowrap;
}

.timeline-item::after {
    /* dot */
    content: ""; grid-column: 2; grid-row: 1;
    width: 13px; height: 13px; border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent);
    justify-self: center; margin-top: 26px;
}

.timeline-card {
    grid-column: 3;
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 22px 26px 14px;
    transition: border-color .25s var(--ease), transform .25s var(--ease);
}
.timeline-card:hover { border-color: color-mix(in srgb, var(--accent) 55%, transparent); transform: translateX(4px); }
.timeline-card h3 { font-size: 20px; margin-bottom: 8px; }
.timeline-card p { color: var(--text-muted); font-size: 15.5px; }

/* ---------- about ---------- */

.about-grid {
    display: grid; grid-template-columns: minmax(260px, 380px) 1fr;
    gap: 60px; align-items: start;
}

.about-photo img {
    border-radius: var(--radius);
    box-shadow: var(--card-glow);
    border: 1px solid var(--line);
    position: sticky; top: calc(var(--nav-h) + 24px);
}

.facts { display: grid; gap: 0; margin: 28px 0 30px; border-top: 1px solid var(--line); }
.facts > div {
    display: grid; grid-template-columns: 120px 1fr; gap: 16px;
    padding: 12px 0; border-bottom: 1px solid var(--line);
}
.facts dt {
    font-size: 12px; font-weight: 600; letter-spacing: .14em;
    text-transform: uppercase; color: var(--accent); padding-top: 3px;
}
.facts dd { margin: 0; font-size: 15.5px; }

/* ---------- contact ---------- */

.contact { text-align: center; }
.contact .section-title, .contact .section-lede { margin-inline: auto; }
.contact-cta { margin: 34px 0 26px; }

.contact-links { list-style: none; display: flex; justify-content: center; gap: 26px; padding: 0; margin: 0; flex-wrap: wrap; }
.contact-links a { color: var(--text-muted); font-weight: 550; }
.contact-links a:hover { color: var(--accent); }

/* ---------- footer ---------- */

.site-footer { padding: 44px 0 34px; border-top: 1px solid var(--line); }
.footer-inner { text-align: center; color: var(--text-muted); font-size: 14.5px; }
.footer-inner p { margin-bottom: 6px; }
.footer-note { font-style: italic; opacity: .85; }
.footer-copy { margin-top: 14px; font-size: 13px; }

/* ---------- reveal on scroll ---------- */

.reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }

/* ---------- responsive ---------- */

@media (max-width: 860px) {
    .about-grid { grid-template-columns: 1fr; gap: 36px; }
    .about-photo img { position: static; max-width: 340px; }

    .timeline::before { left: 17px; }
    .timeline-item { grid-template-columns: 36px 1fr; }
    .timeline-year { grid-column: 2; text-align: left; padding: 0 0 4px; grid-row: 1; }
    .timeline-item::after { grid-column: 1; grid-row: 1 / span 2; margin-top: 5px; }
    .timeline-card { grid-column: 2; grid-row: 2; }
}

@media (max-width: 760px) {
    .nav-toggle {
        display: inline-flex; flex-direction: column; justify-content: center; gap: 5px;
        width: 42px; height: 42px; padding: 10px;
        background: transparent; border: 1px solid var(--line); border-radius: var(--radius-sm);
        cursor: pointer;
    }
    .nav-toggle span { display: block; height: 2px; width: 100%; background: var(--text); border-radius: 2px; transition: transform .25s var(--ease), opacity .2s; }
    .nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
    .nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
    .nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

    .nav-menu {
        position: absolute; top: var(--nav-h); left: 0; right: 0;
        flex-direction: column; align-items: flex-start; gap: 4px;
        background: var(--bg); border-bottom: 1px solid var(--line);
        padding: 14px 24px 18px;
        display: none;
    }
    .nav-menu.is-open { display: flex; }
    .nav-menu > a { font-size: 17px; padding: 10px 0; width: 100%; }
    .nav-social { border-left: none; border-top: 1px solid var(--line); padding: 12px 0 0; width: 100%; }

    .section { padding: 76px 0; }
    .hero-inner { padding-bottom: 240px; }
    .hero-rotator { min-height: 4.6em; }
}

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
    .reveal { opacity: 1; transform: none; }
}
