/* ============================================================
   WERONIKA'S PORTFOLIO
   Global Library / Academia Design System
   ============================================================ */


/* ============================================================
   01. DESIGN TOKENS
   ============================================================ */

:root,
[data-theme="light"] {
    --surface: #f7f3e9;
    --surface-container-low: #f1ece1;
    --surface-container: #e9e2d5;
    --surface-container-high: #dfd6c7;
    --surface-container-highest: #d7ccbc;
    --surface-container-lowest: #fffdf8;

    --on-surface: #211b17;
    --on-surface-variant: #5a5149;
    --on-surface-muted: #8a8177;

    --primary: #351d16;
    --primary-container: #4b2d24;
    --on-primary: #fffaf2;
    --primary-fixed-dim: #684338;

    --secondary: #8d5051;
    --secondary-container: #e9c0bd;
    --on-secondary-container: #713d3e;

    --tertiary: #304029;
    --tertiary-container: #d5dfc9;
    --on-tertiary-container: #42553a;

    --outline-variant: #d1c3b5;
    --outline-soft: rgba(53, 29, 22, 0.10);

    --shadow-ambient: 0 8px 30px rgba(53, 29, 22, 0.055);
    --shadow-nav: 0 8px 35px rgba(53, 29, 22, 0.075);
    --shadow-elevated: 0 22px 55px rgba(53, 29, 22, 0.13);
    --shadow-small: 0 4px 14px rgba(53, 29, 22, 0.07);

    --nav-bg: rgba(247, 243, 233, 0.82);
    --nav-border: rgba(53, 29, 22, 0.08);

    --ambient-glow:
        radial-gradient(
            circle at 15% 0%,
            rgba(141, 80, 81, 0.075),
            transparent 42%
        );

    --ambient-glow-two:
        radial-gradient(
            circle at 85% 15%,
            rgba(48, 64, 41, 0.055),
            transparent 38%
        );

    --ease-smooth: cubic-bezier(0.22, 1, 0.36, 1);
    --ease-gentle: cubic-bezier(0.4, 0, 0.2, 1);
}


[data-theme="dark"] {
    --surface: #141210;
    --surface-container-low: #1b1816;
    --surface-container: #24201d;
    --surface-container-high: #2c2824;
    --surface-container-highest: #36312c;
    --surface-container-lowest: #0e0c0a;

    --on-surface: #eee8de;
    --on-surface-variant: #b8afa4;
    --on-surface-muted: #756e66;

    --primary: #e8d8c7;
    --primary-container: #684338;
    --on-primary: #211611;
    --primary-fixed-dim: #4b2d24;

    --secondary: #cb8f8e;
    --secondary-container: #5d302f;
    --on-secondary-container: #f2c8c5;

    --tertiary: #94a684;
    --tertiary-container: #24321d;
    --on-tertiary-container: #a8b99a;

    --outline-variant: #473d36;
    --outline-soft: rgba(232, 216, 199, 0.10);

    --shadow-ambient: 0 10px 35px rgba(0, 0, 0, 0.28);
    --shadow-nav: 0 8px 35px rgba(0, 0, 0, 0.38);
    --shadow-elevated: 0 25px 65px rgba(0, 0, 0, 0.52);
    --shadow-small: 0 5px 18px rgba(0, 0, 0, 0.28);

    --nav-bg: rgba(20, 18, 16, 0.84);
    --nav-border: rgba(232, 216, 199, 0.08);

    --ambient-glow:
        radial-gradient(
            circle at 15% 0%,
            rgba(141, 80, 81, 0.10),
            transparent 42%
        );

    --ambient-glow-two:
        radial-gradient(
            circle at 85% 15%,
            rgba(148, 166, 132, 0.07),
            transparent 38%
        );
}

/* =========================================================
   AUTO-HIDING NAVIGATION
   ========================================================= */

   .site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    transition:
        transform 0.35s var(--ease-smooth, ease),
        opacity 0.25s ease;
}

.site-header.nav-hidden {
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
}


/* ============================================================
   02. RESET
   ============================================================ */

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

html {
    min-height: 100%;
    scroll-behavior: smooth;
    background: var(--surface);
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;

    background-color: var(--surface);
    color: var(--on-surface);

    font-family: "Work Sans", sans-serif;
    font-size: 1rem;
    line-height: 1.65;

    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;

    transition:
        background-color 0.45s var(--ease-gentle),
        color 0.45s var(--ease-gentle);

    overflow-x: hidden;
}


/* ============================================================
   03. AMBIENT BACKGROUND
   ============================================================ */

.ambient-background {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

.ambient-glow {
    position: absolute;
    inset: 0;
    opacity: 1;
}

.ambient-glow--one {
    background: var(--ambient-glow);
}

.ambient-glow--two {
    background: var(--ambient-glow-two);
}

.ambient-grain {
    position: absolute;
    inset: -50%;
    opacity: 0.025;
    pointer-events: none;

    background-image:
        url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='.4'/%3E%3C/svg%3E");
}


/* ============================================================
   04. TYPOGRAPHY
   ============================================================ */

.display-lg {
    font-family: "Noto Serif", serif;
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 700;
    letter-spacing: -0.035em;
    line-height: 1.04;
    color: var(--primary);
    text-wrap: balance;
}

.headline-md {
    font-family: "Noto Serif", serif;
    font-size: clamp(1.6rem, 3vw, 2.15rem);
    font-weight: 600;
    line-height: 1.2;
    color: var(--on-surface);
    letter-spacing: -0.025em;
    text-wrap: balance;
}

.title-md {
    font-family: "Work Sans", sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--on-surface);
}

.body-lg {
    font-family: "Work Sans", sans-serif;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.75;
    color: var(--on-surface-variant);
}

.label-md {
    font-family: "Work Sans", sans-serif;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.13em;
    text-transform: uppercase;
    color: var(--on-surface-muted);
}


/* ============================================================
   05. NAVIGATION
   ============================================================ */

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 0.75rem 1rem;

    animation: nav-arrive 0.8s var(--ease-smooth) both;
}

.site-nav {
    position: relative;

    display: flex;
    align-items: center;

    width: min(1320px, 100%);
    min-height: 70px;

    margin: 0 auto;
    padding: 0.7rem clamp(1rem, 3vw, 2rem);

    background: var(--nav-bg);

    border: 1px solid var(--nav-border);
    border-radius: 0.8rem;

    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);

    box-shadow: var(--shadow-nav);

    transition:
        background-color 0.45s ease,
        border-color 0.45s ease,
        box-shadow 0.45s ease;
}

.site-nav::before,
.site-nav::after {
    content: "";
    position: absolute;
    height: 1px;
    background: var(--secondary);
}

.site-nav::before {
    left: 1.5rem;
    right: 1.5rem;
    bottom: -4px;
    opacity: 0.3;
}

.site-nav::after {
    left: 3rem;
    right: 3rem;
    bottom: -7px;
    opacity: 0.12;
}


/* ---------- Brand ---------- */

.site-brand {
    display: flex;
    flex-direction: column;
    flex-shrink: 0;

    text-decoration: none;
    line-height: 1;

    transition:
        transform 0.35s var(--ease-smooth),
        opacity 0.25s ease;
}

.site-brand:hover {
    transform: translateY(-2px);
}

.site-brand__name {
    font-family: "Noto Serif", serif;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--primary);
}

.site-brand__label {
    margin-top: 0.25rem;

    font-family: "Work Sans", sans-serif;
    font-size: 0.55rem;
    font-weight: 600;

    letter-spacing: 0.22em;
    text-transform: uppercase;

    color: var(--on-surface-muted);
}


/* ---------- Navigation links ---------- */

.nav-links {
    display: flex;
    align-items: center;

    gap: clamp(1rem, 2.8vw, 2.25rem);

    margin-left: auto;
    margin-right: clamp(1rem, 2vw, 2rem);
}

.nav-link {
    position: relative;

    padding: 0.5rem 0;

    font-family: "Work Sans", sans-serif;
    font-size: 0.75rem;
    font-weight: 500;

    letter-spacing: 0.075em;
    text-transform: uppercase;

    color: var(--on-surface-variant);
    text-decoration: none;

    transition:
        color 0.25s ease,
        transform 0.3s var(--ease-smooth);
}

.nav-link::before {
    content: "✦";

    position: absolute;
    left: 50%;
    bottom: -0.35rem;

    transform: translate(-50%, 4px) scale(0);

    font-size: 0.45rem;
    color: var(--secondary);

    opacity: 0;

    transition:
        transform 0.35s var(--ease-smooth),
        opacity 0.25s ease;
}

.nav-link::after {
    content: "";

    position: absolute;
    left: 0;
    bottom: 0;

    width: 100%;
    height: 1px;

    background: var(--secondary);

    transform: scaleX(0);
    transform-origin: right;

    transition: transform 0.4s var(--ease-smooth);
}

.nav-link:hover {
    color: var(--on-surface);
    transform: translateY(-1px);
}

.nav-link:hover::before,
.nav-link.active::before {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
}

.nav-link:hover::after,
.nav-link.active::after {
    transform: scaleX(1);
    transform-origin: left;
}

.nav-link.active {
    color: var(--on-surface);
    font-weight: 600;
}


/* ---------- Theme toggle ---------- */

.theme-toggle {
    position: relative;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 40px;
    height: 40px;

    flex-shrink: 0;

    border: 1px solid var(--outline-soft);
    border-radius: 50%;

    background: var(--surface-container);
    color: var(--primary);

    cursor: pointer;
    overflow: hidden;

    transition:
        background-color 0.35s ease,
        border-color 0.35s ease,
        transform 0.35s var(--ease-smooth),
        box-shadow 0.35s ease;
}

.theme-toggle:hover {
    transform: rotate(8deg) scale(1.06);
    background: var(--surface-container-high);
    box-shadow: var(--shadow-small);
}

.theme-toggle:active {
    transform: scale(0.94);
}

.theme-toggle__track {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 100%;
    height: 100%;
}

.theme-toggle__icon {
    position: absolute;

    font-family: "Noto Serif", serif;
    font-size: 1.05rem;
    line-height: 1;

    transition:
        opacity 0.3s ease,
        transform 0.45s var(--ease-smooth);
}

[data-theme="light"] .theme-icon-light {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

[data-theme="light"] .theme-icon-dark {
    opacity: 0;
    transform: rotate(-45deg) scale(0.5);
}

[data-theme="dark"] .theme-icon-light {
    opacity: 0;
    transform: rotate(45deg) scale(0.5);
}

[data-theme="dark"] .theme-icon-dark {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}


/* ============================================================
   06. PAGE CONTENT
   ============================================================ */

.site-main {
    position: relative;
    flex: 1 0 auto;
}

.page-transition {
    animation: page-arrive 0.7s 0.08s var(--ease-smooth) both;
}


/* ============================================================
   07. LAYOUT UTILITIES
   ============================================================ */

.container {
    width: 100%;
    max-width: 1200px;

    margin: 0 auto;

    padding: 0 clamp(1.25rem, 5vw, 4rem);
}

.container-narrow {
    width: 100%;
    max-width: 780px;

    margin: 0 auto;

    padding: 0 clamp(1.25rem, 5vw, 4rem);
}

.section {
    padding: clamp(4rem, 8vw, 7rem) 0;
}

.section-alt {
    padding: clamp(4rem, 8vw, 7rem) 0;

    background:
        linear-gradient(
            180deg,
            transparent,
            var(--surface-container-low) 12%,
            var(--surface-container-low) 88%,
            transparent
        );
}


/* ============================================================
   08. BUTTONS
   ============================================================ */

.btn {
    position: relative;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    gap: 0.55rem;

    padding: 0.75rem 1.45rem;

    border: 1px solid transparent;
    border-radius: 0.35rem;

    font-family: "Work Sans", sans-serif;
    font-size: 0.78rem;
    font-weight: 600;

    letter-spacing: 0.06em;
    text-transform: uppercase;

    text-decoration: none;

    cursor: pointer;
    overflow: hidden;

    transition:
        color 0.3s ease,
        background-color 0.3s ease,
        border-color 0.3s ease,
        transform 0.35s var(--ease-smooth),
        box-shadow 0.35s ease;
}

.btn::before {
    content: "";

    position: absolute;
    inset: 0;

    background:
        linear-gradient(
            110deg,
            transparent 25%,
            rgba(255, 255, 255, 0.12) 50%,
            transparent 75%
        );

    transform: translateX(-120%);

    transition: transform 0.7s var(--ease-smooth);
}

.btn:hover::before {
    transform: translateX(120%);
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-elevated);
}

.btn:active {
    transform: translateY(-1px);
}

.btn-primary {
    background: var(--primary-container);
    color: var(--on-primary);
}

.btn-primary:hover {
    background: var(--primary-fixed-dim);
    color: var(--on-primary);
}

.btn-secondary {
    background: var(--secondary-container);
    color: var(--on-secondary-container);
}

.btn-secondary:hover {
    background: var(--secondary);
    color: var(--on-primary);
}


/* ============================================================
   09. CARDS
   ============================================================ */

.card {
    position: relative;

    overflow: hidden;

    background: var(--surface-container-lowest);

    border: 1px solid var(--outline-variant);
    border-radius: 0.45rem;

    box-shadow: var(--shadow-ambient);

    transition:
        background-color 0.45s ease,
        border-color 0.45s ease,
        transform 0.45s var(--ease-smooth),
        box-shadow 0.45s var(--ease-smooth);
}

.card::before {
    content: "";

    position: absolute;
    top: 0;
    left: 0;

    width: 100%;
    height: 2px;

    background:
        linear-gradient(
            90deg,
            transparent,
            var(--secondary),
            transparent
        );

    opacity: 0;

    transform: scaleX(0.5);

    transition:
        opacity 0.4s ease,
        transform 0.5s var(--ease-smooth);
}

.card:hover {
    transform: translateY(-7px);
    box-shadow: var(--shadow-elevated);
}

.card:hover::before {
    opacity: 0.75;
    transform: scaleX(1);
}

[data-theme="dark"] .card {
    background: rgba(36, 32, 29, 0.68);

    border-color:
        rgba(232, 216, 199, 0.10);

    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.card-title {
    letter-spacing: -0.015em;
}

.redirect-link {
    font-family: "Work Sans", sans-serif;

    font-size: 0.72rem;
    font-weight: 600;

    letter-spacing: 0.09em;
    text-transform: uppercase;
}


/* ============================================================
   10. TAGS
   ============================================================ */

.tag-list {
    display: flex;
    flex-wrap: wrap;

    gap: 0.45rem;
    margin-bottom: 1rem;
}

.tag {
    display: inline-flex;
    align-items: center;

    padding: 0.25rem 0.55rem;

    border: 1px solid var(--outline-soft);
    border-radius: 0.2rem;

    background: var(--surface-container-highest);
    color: var(--on-surface-variant);

    font-family: "Work Sans", sans-serif;
    font-size: 0.67rem;
    font-weight: 600;

    letter-spacing: 0.07em;
    text-transform: uppercase;

    transition:
        background-color 0.25s ease,
        color 0.25s ease,
        transform 0.25s var(--ease-smooth);
}

.tag:hover {
    transform: translateY(-1px);
}

.tag.tag-wip {
    background: var(--tertiary-container);
    color: var(--on-tertiary-container);
}


/* ============================================================
   11. INPUTS
   ============================================================ */

.field {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.field label {
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--on-surface-variant);
}

.field input,
.field textarea {
    width: 100%;

    background: transparent;

    border: 1px solid transparent;
    border-bottom-color: var(--outline-variant);

    padding: 0.65rem 0;

    font-family: "Work Sans", sans-serif;
    font-size: 1rem;

    color: var(--on-surface);
    outline: none;

    transition:
        border-color 0.3s ease,
        box-shadow 0.3s ease,
        padding 0.3s ease;
}

.field input:focus,
.field textarea:focus {
    border-bottom-color: var(--secondary);

    box-shadow:
        0 6px 16px rgba(0, 0, 0, 0.05);

    padding-left: 0.35rem;
}


/* ============================================================
   12. PULL QUOTE
   ============================================================ */

.pull-quote {
    position: relative;

    margin: 2.5rem 0;
    padding-left: 2rem;

    border-left: 2px solid var(--secondary);

    font-family: "Noto Serif", serif;
    font-size: clamp(1.25rem, 2.5vw, 1.55rem);

    font-style: italic;
    font-weight: 400;

    line-height: 1.5;

    color: var(--secondary);
    opacity: 0.95;
}


/* ============================================================
   13. FOOTER
   ============================================================ */

.site-footer {
    position: relative;

    margin-top: auto;

    background: var(--surface-container-low);

    border-top: 1px solid var(--outline-variant);

    transition:
        background-color 0.45s ease,
        border-color 0.45s ease;
}

.footer-decoration {
    display: flex;
    align-items: center;
    justify-content: center;

    gap: 0.65rem;
    padding-top: 1.6rem;

    color: var(--secondary);
    opacity: 0.55;
}

.footer-decoration span {
    display: block;

    width: 4px;
    height: 4px;

    border-radius: 50%;

    background: currentColor;
}

.footer-decoration span:nth-child(2) {
    width: 7px;
    height: 7px;
}

.footer-inner {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;

    gap: 3rem;

    width: min(1200px, 100%);

    margin: 0 auto;

    padding:
        2rem
        clamp(1.25rem, 5vw, 4rem)
        2.25rem;
}

.footer-brand-block {
    max-width: 24rem;
}

.footer-kicker {
    display: block;

    margin-bottom: 0.45rem;

    font-family: "Work Sans", sans-serif;
    font-size: 0.63rem;
    font-weight: 600;

    letter-spacing: 0.16em;
    text-transform: uppercase;

    color: var(--secondary);
}

.footer-brand {
    display: block;

    font-family: "Noto Serif", serif;
    font-size: 1.25rem;
    font-weight: 600;

    letter-spacing: -0.015em;

    color: var(--primary);
}

.footer-tagline {
    margin-top: 0.45rem;

    font-family: "Noto Serif", serif;
    font-size: 0.9rem;
    font-style: italic;

    color: var(--on-surface-muted);

    line-height: 1.5;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;

    justify-content: flex-end;

    gap: 0.6rem 1.5rem;
}

.footer-links a {
    position: relative;

    padding-bottom: 0.2rem;

    color: var(--on-surface-variant);

    font-family: "Work Sans", sans-serif;
    font-size: 0.72rem;
    font-weight: 600;

    letter-spacing: 0.07em;
    text-transform: uppercase;

    text-decoration: none;

    transition:
        color 0.25s ease,
        transform 0.3s var(--ease-smooth);
}

.footer-links a::after {
    content: "";

    position: absolute;

    left: 0;
    bottom: 0;

    width: 100%;
    height: 1px;

    background: var(--secondary);

    transform: scaleX(0);
    transform-origin: right;

    transition: transform 0.35s var(--ease-smooth);
}

.footer-links a:hover {
    color: var(--secondary);
    transform: translateY(-1px);
}

.footer-links a:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

.footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;

    width: min(1200px, 100%);

    margin: 0 auto;

    padding:
        1rem
        clamp(1.25rem, 5vw, 4rem)
        1.35rem;

    border-top: 1px solid var(--outline-variant);
}

.footer-copy {
    font-size: 0.7rem;
    letter-spacing: 0.05em;
    color: var(--on-surface-muted);
}

.footer-mark {
    font-family: "Noto Serif", serif;
    font-size: 0.9rem;
    color: var(--secondary);
    opacity: 0.7;
}


/* ============================================================
   14. ANIMATIONS
   ============================================================ */

@keyframes nav-arrive {
    from {
        opacity: 0;
        transform: translateY(-15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes page-arrive {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* ============================================================
   15. ACCESSIBILITY
   ============================================================ */

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

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

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}


/* ============================================================
   16. RESPONSIVE
   ============================================================ */

@media (max-width: 850px) {
    .nav-links {
        gap: 1rem;
    }
}

@media (max-width: 768px) {
    .footer-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 2rem;
    }

    .footer-links {
        justify-content: flex-start;
    }
}

@media (max-width: 680px) {
    .site-header {
        padding: 0.55rem 0.6rem;
    }

    .site-nav {
        min-height: 62px;
        padding: 0.6rem 0.8rem;
    }

    .site-brand__name {
        font-size: 0.95rem;
    }

    .theme-toggle {
        width: 37px;
        height: 37px;
    }

    .nav-links {
        display: none;
    }
}

@media (max-width: 420px) {
    .footer-bottom {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
}