/* --------------------------------------------------------------------------
   Erika portfolio — deep khaki, motion & editorial polish
   -------------------------------------------------------------------------- */

:root {
    color-scheme: dark;
    --bg: #1a1f17;
    --bg-elevated: #232920;
    --bg-subtle: #2b3228;
    --ink: #f3f1e9;
    --ink-muted: #9ea494;
    --border: rgba(243, 241, 233, 0.1);
    --accent: #d1c278;
    --accent-soft: rgba(209, 194, 120, 0.18);
    --accent-glow: rgba(209, 194, 120, 0.22);
    --teal: #b3c9a8;
    --on-light: #161b14;
    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
    --ease-spring: cubic-bezier(0.34, 1.35, 0.64, 1);
    --radius: 12px;
    --radius-lg: 20px;
    --font-sans: "Plus Jakarta Sans", system-ui, sans-serif;
    --font-serif: "Fraunces", Georgia, serif;
    --shadow: 0 18px 52px rgba(4, 6, 3, 0.65);
    --max: 1100px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: var(--font-sans);
    font-size: 1.05rem;
    line-height: 1.65;
    color: var(--ink);
    background: var(--bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    isolation: isolate;
}

@media (prefers-reduced-motion: no-preference) {
    body::before {
        content: "";
        position: fixed;
        inset: -15%;
        z-index: -1;
        pointer-events: none;
        background:
            radial-gradient(circle at 18% 24%, rgba(209, 194, 120, 0.13), transparent 44%),
            radial-gradient(circle at 86% 68%, rgba(179, 201, 168, 0.09), transparent 48%);
        animation: atmosphere-drift 28s ease-in-out infinite alternate;
    }
}

@keyframes atmosphere-drift {
    from {
        transform: translate(0, 0) scale(1);
    }

    to {
        transform: translate(3%, -2.5%) scale(1.05);
    }
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    padding: 0.5rem 1rem;
    background: var(--ink);
    color: var(--on-light);
    z-index: 100;
}

.skip-link:focus {
    left: 1rem;
    top: 1rem;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

code {
    font-size: 0.9em;
    background: var(--accent-soft);
    padding: 0.12em 0.35em;
    border-radius: 4px;
}

/* Header */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: blur(14px) saturate(1.05);
    -webkit-backdrop-filter: blur(14px) saturate(1.05);
    border-bottom: 1px solid var(--border);
    transition: box-shadow 0.4s var(--ease-out), border-color 0.35s;
}

.site-header.is-scrolled {
    box-shadow: 0 10px 40px rgba(2, 4, 1, 0.45);
    border-bottom-color: rgba(243, 241, 233, 0.07);
}

.site-header__inner {
    max-width: var(--max);
    margin: 0 auto;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.site-logo {
    font-family: var(--font-serif);
    font-weight: 600;
    font-size: 1.35rem;
    color: var(--ink);
    text-decoration: none;
    letter-spacing: -0.02em;
    transition: color 0.3s var(--ease-out), transform 0.35s var(--ease-spring);
}

.site-logo:hover {
    color: var(--accent);
    transform: translateY(-1px);
}

@media (prefers-reduced-motion: reduce) {
    .site-logo:hover {
        transform: none;
    }
}

.site-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 1rem;
    justify-content: flex-end;
}

.site-nav__link {
    position: relative;
    font-size: 0.92rem;
    font-weight: 500;
    color: var(--ink-muted);
    text-decoration: none;
    padding: 0.35rem 0 0.4rem;
    transition: color 0.25s var(--ease-out);
}

.site-nav__link::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--teal) 75%, var(--accent)));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s var(--ease-out);
}

.site-nav__link:hover {
    color: var(--ink);
}

.site-nav__link:hover::after,
.site-nav__link.is-current::after {
    transform: scaleX(1);
}

.site-nav__link.is-current {
    color: var(--ink);
}

/* Main */
.site-main {
    flex: 1;
    width: 100%;
    max-width: var(--max);
    margin: 0 auto;
    padding: 2.5rem 1.5rem 4.5rem;
}

/* Scroll-reveal (progressive enhancement: needs html.js) */
html.js .js-reveal {
    opacity: 0;
    transform: translate3d(0, 1.25rem, 0);
    transition:
        opacity 0.75s var(--ease-out),
        transform 0.75s var(--ease-out);
    will-change: opacity, transform;
}

html.js .js-reveal.is-visible {
    opacity: 1;
    transform: translate3d(0, 0, 0);
    will-change: auto;
}

.home-grid article.js-reveal:nth-child(2) {
    transition-delay: 0.1s;
}

.home-grid article.js-reveal:nth-child(3) {
    transition-delay: 0.2s;
}

.home-grid article.js-reveal:nth-child(4) {
    transition-delay: 0.3s;
}

.project-list .js-reveal:nth-child(1) {
    transition-delay: 0.04s;
}

.project-list .js-reveal:nth-child(2) {
    transition-delay: 0.1s;
}

.project-list .js-reveal:nth-child(3) {
    transition-delay: 0.16s;
}

.project-list .js-reveal:nth-child(4) {
    transition-delay: 0.22s;
}

.project-list .js-reveal:nth-child(5) {
    transition-delay: 0.28s;
}

/* Hero */
.hero {
    position: relative;
    padding: 1.25rem 0 2.75rem;
}

.hero--home::after {
    content: "";
    position: absolute;
    top: -4%;
    right: -8%;
    width: min(52vw, 420px);
    height: min(52vw, 420px);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(209, 194, 120, 0.12) 0%, transparent 68%);
    pointer-events: none;
    z-index: 0;
}

.hero--home > * {
    position: relative;
    z-index: 1;
}

.hero__kicker {
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--accent);
    margin: 0 0 1rem;
}

.hero__spark {
    display: inline-block;
    font-size: 1em;
    filter: drop-shadow(0 0 10px var(--accent-glow));
    animation: sparkle-bob 2.8s var(--ease-spring) infinite;
}

@keyframes sparkle-bob {
    0%,
    100% {
        transform: translateY(0) rotate(-4deg) scale(1);
    }

    50% {
        transform: translateY(-4px) rotate(6deg) scale(1.12);
    }
}

.hero__title {
    font-family: var(--font-serif);
    font-size: clamp(2rem, 5vw, 3.15rem);
    font-weight: 600;
    line-height: 1.12;
    letter-spacing: -0.035em;
    margin: 0 0 1.35rem;
    text-wrap: balance;
}

.hero__title-accent {
    font-style: italic;
    font-weight: 400;
    color: var(--teal);
    text-shadow: 0 0 40px rgba(179, 201, 168, 0.12);
}

.hero__lead {
    max-width: 38rem;
    margin: 0 0 1.85rem;
    color: var(--ink-muted);
    font-size: 1.09rem;
    line-height: 1.72;
}

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

@media (prefers-reduced-motion: no-preference) {
    .hero--home .hero__kicker {
        animation: hero-in 0.85s var(--ease-out) both;
    }

    .hero--home .hero__title {
        animation: hero-in 0.9s var(--ease-out) 0.08s both;
    }

    .hero--home .hero__lead {
        animation: hero-in 0.95s var(--ease-out) 0.18s both;
    }

    .hero--home .hero__actions {
        animation: hero-in 1s var(--ease-out) 0.28s both;
    }
}

@keyframes hero-in {
    from {
        opacity: 0;
        transform: translate3d(0, 1.5rem, 0);
    }

    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.68rem 1.35rem;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 999px;
    text-decoration: none;
    border: 2px solid transparent;
    cursor: pointer;
    transition:
        background 0.25s var(--ease-out),
        color 0.25s var(--ease-out),
        border-color 0.25s var(--ease-out),
        transform 0.3s var(--ease-spring),
        box-shadow 0.3s var(--ease-out);
}

.btn--primary {
    background: #e0dbc4;
    color: var(--on-light);
    box-shadow: 0 4px 20px rgba(209, 194, 120, 0.15);
}

.btn--primary:hover {
    background: #d4c97a;
    color: var(--on-light);
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(209, 194, 120, 0.22);
}

.btn--primary:active {
    transform: translateY(0);
}

.btn--ghost {
    background: transparent;
    color: var(--ink);
    border-color: var(--border);
}

.btn--ghost:hover {
    border-color: rgba(243, 241, 233, 0.28);
    background: var(--bg-subtle);
    transform: translateY(-1px);
}

.btn--ghost:active {
    transform: translateY(0);
}

.btn--disabled {
    opacity: 0.45;
    cursor: not-allowed;
    background: #3d463a;
    color: var(--ink-muted);
}

/* Home grid */
.home-grid {
    display: grid;
    gap: 1.25rem;
}

@media (min-width: 768px) {
    .home-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.5rem;
    }
}

.home-card {
    position: relative;
    background: linear-gradient(165deg, color-mix(in srgb, var(--bg-elevated) 100%, var(--accent) 2.5%), var(--bg-elevated));
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.55rem 1.55rem 1.85rem;
    box-shadow: var(--shadow);
    transition:
        transform 0.45s var(--ease-out),
        box-shadow 0.45s var(--ease-out),
        border-color 0.35s;
}

.home-card:hover {
    border-color: rgba(209, 194, 120, 0.14);
}

@media (prefers-reduced-motion: no-preference) {
    .home-card:hover {
        transform: translateY(-5px);
        box-shadow:
            0 26px 64px rgba(2, 4, 1, 0.55),
            0 0 0 1px rgba(209, 194, 120, 0.08);
    }
}

.home-card__icon {
    font-size: 1.85rem;
    display: block;
    margin-bottom: 0.85rem;
    transition: transform 0.45s var(--ease-spring);
}

.home-card:hover .home-card__icon {
    transform: scale(1.06) rotate(-4deg);
}

.home-card__title {
    font-family: var(--font-serif);
    font-size: 1.35rem;
    margin: 0 0 0.75rem;
}

.home-card__text {
    margin: 0 0 1rem;
    color: var(--ink-muted);
    font-size: 0.98rem;
}

.home-card__link {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--accent);
    text-decoration: none;
}

.home-card__link:hover {
    text-decoration: underline;
}

.stretched-link::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
}

/* Page head */
.page-head {
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.page-title {
    font-family: var(--font-serif);
    font-size: clamp(1.85rem, 4vw, 2.5rem);
    font-weight: 600;
    margin: 0 0 0.75rem;
    letter-spacing: -0.02em;
    text-wrap: balance;
}

.page-title__emoji {
    font-family: var(--font-sans);
    font-weight: 400;
    font-size: 0.85em;
    vertical-align: middle;
}

.page-lead {
    margin: 0;
    max-width: 40rem;
    color: var(--ink-muted);
    font-size: 1.05rem;
}

/* Projects */
.project-list {
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.project-card {
    display: grid;
    gap: 1.5rem;
    background: linear-gradient(170deg, color-mix(in srgb, var(--bg-elevated) 100%, var(--teal) 2%), var(--bg-elevated));
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: border-color 0.35s var(--ease-out), box-shadow 0.45s var(--ease-out);
}

.project-card:hover {
    border-color: rgba(209, 194, 120, 0.12);
    box-shadow:
        0 22px 56px rgba(2, 4, 1, 0.5),
        0 0 0 1px rgba(179, 201, 168, 0.06);
}

@media (min-width: 900px) {
    .project-card {
        grid-template-columns: minmax(220px, 1fr) 1.4fr;
        align-items: stretch;
    }
}

.project-card__visual {
    min-height: 200px;
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    padding: 1rem;
    background: linear-gradient(145deg, #2f362b, #181c16);
}

.project-card__visual--hasimg {
    padding: 0;
    align-items: stretch;
    justify-content: stretch;
    background: #0f110d;
    overflow: hidden;
}

.project-card__visual--hasimg img {
    width: 100%;
    height: 100%;
    min-height: 220px;
    object-fit: cover;
    display: block;
    transition: transform 0.85s var(--ease-out);
}

@media (prefers-reduced-motion: no-preference) {
    .project-card:hover .project-card__visual--hasimg img {
        transform: scale(1.045);
    }
}

@media (min-width: 900px) {
    .project-card__visual--hasimg img {
        min-height: 100%;
    }
}

.project-card__visual--1 {
    background: linear-gradient(145deg, #3a4234, #1b2018);
}

.project-card__visual--2 {
    background: linear-gradient(145deg, #2d3228, #121510);
}

.project-card__visual--3 {
    background: linear-gradient(145deg, #363d30, #141712);
}

.project-card__visual--4 {
    background: linear-gradient(145deg, #2f3629, #171c15);
}

.project-card__visual-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: rgba(243, 241, 233, 0.94);
    text-shadow: 0 1px 3px rgba(2, 4, 1, 0.65);
    max-width: 14rem;
    line-height: 1.35;
}

.project-card__body {
    padding: 1.5rem 1.5rem 1.75rem;
}

.project-card__tagline {
    margin: 0.35rem 0 0.75rem;
    color: var(--ink-muted);
    font-size: 1rem;
}

.project-card__title {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    margin: 0;
}

.project-card__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.project-card__tags li {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: var(--accent-soft);
    color: var(--accent);
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
}

.project-card__sections {
    display: grid;
    gap: 1.25rem;
    margin-top: 1.5rem;
}

@media (min-width: 600px) {
    .project-card__sections {
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
    }
}

.project-block__label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--teal);
    margin: 0 0 0.35rem;
}

.project-block p {
    margin: 0;
    font-size: 0.95rem;
    color: var(--ink-muted);
}

/* About */
.about-layout {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.about-profile {
    margin: 0;
    max-width: 280px;
}

.about-profile__img {
    width: 100%;
    height: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    display: block;
}

.about-profile__caption {
    margin-top: 0.65rem;
    font-size: 0.92rem;
    color: var(--ink-muted);
}

.about-layout__main {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

@media (min-width: 768px) {
    .about-layout {
        display: grid;
        grid-template-columns: minmax(200px, 260px) 1fr;
        gap: 2rem 2.5rem;
        align-items: start;
    }

    .about-profile {
        grid-column: 1;
        position: sticky;
        top: 5rem;
    }

    .about-layout__main {
        grid-column: 2;
    }
}

.prose__heading {
    font-family: var(--font-serif);
    font-size: 1.45rem;
    margin: 0 0 1rem;
}

.prose p {
    margin: 0 0 1rem;
    color: var(--ink-muted);
    max-width: 42rem;
}

.prose p:last-child {
    margin-bottom: 0;
}

.prose__list {
    margin: 0;
    padding-left: 1.2rem;
    color: var(--ink-muted);
    max-width: 42rem;
}

.prose__list li {
    margin-bottom: 0.75rem;
}

.prose__list li:last-child {
    margin-bottom: 0;
}

.prose__list--check {
    list-style: none;
    padding-left: 0;
}

.prose__list--check li {
    padding-left: 1.35rem;
    position: relative;
}

.prose__list--check li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--teal);
    font-weight: 700;
}

.pullquote {
    margin: 1rem 0 1.25rem;
    padding: 1.25rem 1.5rem;
    border-left: 4px solid var(--accent);
    background: var(--bg-subtle);
    border-radius: 0 var(--radius) var(--radius) 0;
}

.pullquote p {
    margin: 0;
    font-family: var(--font-serif);
    font-size: 1.2rem;
    color: var(--ink);
}

.prose--highlight {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem 1.5rem 1.75rem;
    box-shadow: var(--shadow);
}

.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.tag-cloud li {
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.4rem 0.85rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--bg-subtle);
}

/* Contact */
.contact-layout {
    display: grid;
    gap: 1.5rem;
}

@media (min-width: 700px) {
    .contact-layout {
        grid-template-columns: 1fr 1fr;
        align-items: start;
    }
}

.contact-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem 1.5rem 1.75rem;
    box-shadow: var(--shadow);
}

.contact-card__title {
    font-family: var(--font-serif);
    font-size: 1.35rem;
    margin: 0 0 1.25rem;
}

.contact-card__note,
.contact-card__hint {
    margin: 0 0 1rem;
    color: var(--ink-muted);
    font-size: 0.98rem;
}

.contact-card__hint {
    font-size: 0.9rem;
}

.contact-links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 1.15rem;
}

.contact-links__label {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ink-muted);
    margin-bottom: 0.25rem;
}

.contact-links__value {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--accent);
    text-decoration: none;
    word-break: break-word;
}

.contact-links__value:hover {
    text-decoration: underline;
}

/* Footer */
.site-footer {
    border-top: 1px solid var(--border);
    background: var(--bg-elevated);
    margin-top: auto;
}

.site-footer__inner {
    max-width: var(--max);
    margin: 0 auto;
    padding: 1.25rem 1.25rem 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
    justify-content: space-between;
    align-items: center;
    font-size: 0.88rem;
    color: var(--ink-muted);
}

.site-footer__copy {
    margin: 0;
}

.site-footer__dev {
    margin: 0;
}

.site-footer__nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 1.1rem;
    align-items: center;
}

.site-footer__nav a {
    color: var(--ink-muted);
    text-decoration: none;
    font-weight: 500;
}

.site-footer__nav a:hover {
    color: var(--accent);
}

/* Focus (keyboard) */
:focus {
    outline: none;
}

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

.site-logo:focus-visible,
.site-nav__link:focus-visible {
    outline-offset: 4px;
    border-radius: 2px;
}

.stretched-link:focus-visible {
    outline-offset: 4px;
    border-radius: var(--radius-lg);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    body::before {
        animation: none !important;
    }

    .hero__spark {
        animation: none !important;
    }

    .hero--home .hero__kicker,
    .hero--home .hero__title,
    .hero--home .hero__lead,
    .hero--home .hero__actions {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }

    .home-card {
        transition: none;
    }

    .home-card:hover {
        transform: none;
    }

    .home-card:hover .home-card__icon {
        transform: none;
    }

    html.js .js-reveal {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
        will-change: auto !important;
    }

    .project-card:hover .project-card__visual--hasimg img {
        transform: none !important;
    }
}
