/* =======================================================================
   Kristiina Avel - site styles
   ======================================================================= */

:root {
    --bg:          #f6f3ec;
    --bg-deep:     #ebe6d8;
    --ink:         #1b1a17;
    --ink-soft:    #3d3a32;
    --muted:       #7a756a;
    --line:        #d7d1bf;
    --accent:      #7a5a3a;   /* warm earth brown */
    --accent-2:    #3a5a44;   /* forest green */
    --accent-3:    #b8543a;   /* terracotta */
    --white:       #ffffff;

    --serif: "Fraunces", Georgia, "Times New Roman", serif;
    --sans:  "Inter", -apple-system, Segoe UI, Helvetica, Arial, sans-serif;

    --radius: 14px;
    --shadow-1: 0 10px 30px -12px rgba(27, 26, 23, .25);
    --shadow-2: 0 30px 60px -20px rgba(27, 26, 23, .35);

    --nav-h: 78px;

    --ease: cubic-bezier(.22, 1, .36, 1);
}

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

html { scroll-behavior: smooth; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 17px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a   { color: inherit; text-decoration: none; }

/* paper grain overlay */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image: radial-gradient(rgba(27, 26, 23, .08) 1px, transparent 1px);
    background-size: 3px 3px;
    opacity: .35;
    mix-blend-mode: multiply;
    z-index: 1;
}

.container {
    max-width: 1220px;
    margin: 0 auto;
    padding: 0 32px;
}

/* ---------- typography ---------- */

h1, h2, h3, h4 {
    font-family: var(--serif);
    font-weight: 400;
    letter-spacing: -0.01em;
    line-height: 1.08;
    margin: 0 0 .4em;
    color: var(--ink);
}

h1 { font-size: clamp(2.6rem, 6.2vw, 5.6rem); }
h2 { font-size: clamp(2.1rem, 4.4vw, 3.6rem); }
h3 { font-size: clamp(1.4rem, 2vw, 1.8rem); }

p { margin: 0 0 1em; }

.eyebrow,
.section-eyebrow {
    font-family: var(--sans);
    font-size: .78rem;
    font-weight: 500;
    letter-spacing: .22em;
    text-transform: uppercase;
    color: var(--muted);
    margin: 0 0 1rem;
}

.lead {
    font-family: var(--serif);
    font-size: 1.35rem;
    color: var(--ink-soft);
    font-style: italic;
}

/* ---------- header ---------- */

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    z-index: 50;
    background: rgba(20, 19, 16, .05);
    backdrop-filter: blur(5px) saturate(1.1);
    -webkit-backdrop-filter: blur(5px) saturate(1.1);
    box-shadow: 0 1px 0 rgba(255, 255, 255, .08);
    transition: background .4s var(--ease), backdrop-filter .4s var(--ease), box-shadow .4s var(--ease), color .4s var(--ease);
}

/* over the dark hero: white text */
.site-header .logo,
.site-header .nav a,
.site-header .lang-switch,
.site-header .lang-switch .active {
    color: #fff;
}
.site-header .logo-mark { border-color: rgba(255, 255, 255, .75); }
.site-header .nav a { color: rgba(255, 255, 255, .82); }
.site-header .nav a:hover,
.site-header .nav a.active { color: #eecfa9; }
.site-header .nav a::after { background: #eecfa9; }
.site-header .lang-switch { color: rgba(255, 255, 255, .6); }
.site-header .lang-switch a:hover { color: #eecfa9; }
.site-header .nav-toggle span { background: #fff; }

/* after scrolling past the hero: light surface */
.site-header.scrolled {
    background: rgba(246, 243, 236, .88);
    backdrop-filter: blur(16px) saturate(1.2);
    -webkit-backdrop-filter: blur(16px) saturate(1.2);
    box-shadow: 0 1px 0 rgba(27, 26, 23, .08), 0 10px 30px -20px rgba(27, 26, 23, .25);
}
.site-header.scrolled .logo,
.site-header.scrolled .lang-switch .active { color: var(--ink); }
.site-header.scrolled .logo-mark { border-color: var(--ink); }
.site-header.scrolled .nav a { color: var(--ink-soft); }
.site-header.scrolled .nav a:hover,
.site-header.scrolled .nav a.active { color: var(--accent); }
.site-header.scrolled .nav a::after { background: var(--accent); }
.site-header.scrolled .lang-switch { color: var(--muted); }
.site-header.scrolled .lang-switch a:hover { color: var(--accent); }
.site-header.scrolled .nav-toggle span { background: var(--ink); }

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--serif);
    font-size: 1.1rem;
    color: var(--ink);
    transition: opacity .3s;
}
.logo-mark {
    width: 38px;
    height: 38px;
    border: 1.5px solid var(--ink);
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: .82rem;
    letter-spacing: .04em;
    transition: background .4s var(--ease), color .4s var(--ease), transform .6s var(--ease);
}
.logo:hover .logo-mark {
    background: var(--ink);
    color: var(--bg);
    transform: rotate(-10deg);
}

.nav {
    display: flex;
    gap: 2.3rem;
}
.nav a {
    position: relative;
    font-size: .92rem;
    color: var(--ink-soft);
    padding: 4px 0;
    transition: color .3s;
}
.nav a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 0;
    height: 1px;
    background: var(--accent);
    transition: width .4s var(--ease);
}
.nav a:hover,
.nav a.active {
    color: var(--accent);
}
.nav a:hover::after,
.nav a.active::after { width: 100%; }

.lang-switch {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: .82rem;
    letter-spacing: .08em;
    color: var(--muted);
}
.lang-switch a { transition: color .3s; }
.lang-switch a:hover { color: var(--accent); }
.lang-switch .active { color: var(--ink); font-weight: 600; }

.nav-toggle {
    display: none;
    width: 42px;
    height: 42px;
    background: none;
    border: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 8px;
}
.nav-toggle span {
    display: block;
    height: 1.5px;
    background: var(--ink);
    transition: transform .4s var(--ease), opacity .3s;
}
.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); }

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

.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: calc(var(--nav-h) + 30px) 40px 60px;
    overflow: hidden;
}
.hero-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
}
.hero-bg img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transform: scale(1.08);
    transition: opacity 1.6s var(--ease), transform 8s linear;
    filter: saturate(.85) contrast(1.02);
}
.hero-bg img.active {
    opacity: 1;
    transform: scale(1);
}
.hero-overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(27,26,23,.30) 0%, rgba(27,26,23,.55) 60%, rgba(27,26,23,.75) 100%),
        radial-gradient(circle at 70% 30%, rgba(122,90,58,.35), transparent 60%);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 900px;
    color: #fff;
}
.hero-content .eyebrow { color: rgba(255,255,255,.75); }

.hero-title {
    color: #fff;
    font-size: clamp(2.8rem, 7vw, 6.4rem);
    font-weight: 300;
    line-height: 1.02;
    margin-bottom: 1.4rem;
}
.hero-title span {
    font-style: italic;
    color: #eecfa9;
    font-weight: 400;
}
.hero-sub {
    max-width: 560px;
    font-size: 1.1rem;
    color: rgba(255,255,255,.88);
    margin-bottom: 2.2rem;
}

.hero-cta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .6rem;
    padding: 16px 30px;
    border: 1.5px solid transparent;
    border-radius: 999px;
    font-family: var(--sans);
    font-size: .92rem;
    font-weight: 500;
    letter-spacing: .02em;
    cursor: pointer;
    transition: background .4s var(--ease),
                color .4s var(--ease),
                border-color .4s var(--ease),
                transform .4s var(--ease);
}
.btn-primary {
    background: #fff;
    color: var(--ink);
}
.btn-primary:hover {
    background: var(--accent);
    color: #fff;
    transform: translateY(-2px);
}
.btn-ghost {
    color: #fff;
    border-color: rgba(255,255,255,.6);
}
.btn-ghost:hover {
    background: #fff;
    color: var(--ink);
    transform: translateY(-2px);
}

.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    width: 26px;
    height: 42px;
    border: 1.5px solid rgba(255,255,255,.55);
    border-radius: 14px;
    z-index: 2;
}
.scroll-indicator span {
    position: absolute;
    top: 8px;
    left: 50%;
    width: 3px;
    height: 8px;
    background: #fff;
    border-radius: 3px;
    transform: translateX(-50%);
    animation: scroll-dot 1.8s var(--ease) infinite;
}
@keyframes scroll-dot {
    0%   { transform: translate(-50%, 0);    opacity: 1; }
    60%  { transform: translate(-50%, 14px); opacity: 0; }
    100% { transform: translate(-50%, 0);    opacity: 0; }
}

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

.section {
    position: relative;
    padding: 140px 0 120px;
    z-index: 2;
}

.section-head {
    max-width: 680px;
    margin: 0 auto 60px;
    text-align: center;
}
.section-head h2 {
    position: relative;
    display: inline-block;
}
.section-head h2::after {
    content: "";
    display: block;
    width: 44px;
    height: 1.5px;
    background: var(--accent);
    margin: 18px auto 0;
}
.section-sub {
    color: var(--muted);
    margin-top: 1rem;
}

/* ---------- portfolio ---------- */

.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-bottom: 50px;
}
.filters button {
    background: transparent;
    border: 1px solid var(--line);
    color: var(--ink-soft);
    padding: 10px 22px;
    border-radius: 999px;
    font-size: .85rem;
    font-family: var(--sans);
    cursor: pointer;
    transition: background .35s var(--ease), color .35s var(--ease), border-color .35s var(--ease);
}
.filters button:hover {
    border-color: var(--accent);
    color: var(--accent);
}
.filters button.active {
    background: var(--ink);
    color: var(--bg);
    border-color: var(--ink);
}

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

.card {
    position: relative;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: var(--radius);
    background: var(--bg-deep);
    cursor: pointer;
    box-shadow: var(--shadow-1);
    transition: transform .6s var(--ease), box-shadow .6s var(--ease), opacity .5s var(--ease);
}

.card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 1.2s var(--ease), filter .6s var(--ease);
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow-2); }
.card:hover img { transform: scale(1.08); filter: saturate(1.05); }

.card .card-info {
    position: absolute;
    inset: auto 0 0 0;
    padding: 22px 22px 18px;
    background: linear-gradient(180deg, transparent, rgba(27,26,23,.85));
    color: #fff;
    transform: translateY(15px);
    opacity: 0;
    transition: transform .5s var(--ease), opacity .5s var(--ease);
}
.card:hover .card-info {
    transform: translateY(0);
    opacity: 1;
}
.card-title {
    font-family: var(--serif);
    font-size: 1.15rem;
    line-height: 1.2;
    margin-bottom: 4px;
}
.card-meta {
    font-size: .78rem;
    color: rgba(255,255,255,.75);
    letter-spacing: .05em;
    text-transform: uppercase;
}

.card.is-hidden {
    opacity: 0;
    transform: scale(.92);
    pointer-events: none;
    position: absolute;
    visibility: hidden;
}

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

.about { background: var(--bg-deep); }
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1.1fr;
    gap: 80px;
    align-items: center;
}
.about-image {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-2);
    aspect-ratio: 4 / 5;
}
.about-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 1.2s var(--ease);
}
.about-image:hover img { transform: scale(1.04); }
.about-badge {
    position: absolute;
    top: 20px;
    left: 20px;
    background: var(--bg);
    color: var(--ink);
    padding: 8px 14px;
    border-radius: 999px;
    font-size: .72rem;
    letter-spacing: .15em;
}

.stats {
    display: flex;
    gap: 40px;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid var(--line);
}
.stat-num {
    display: block;
    font-family: var(--serif);
    font-size: 2.8rem;
    color: var(--accent);
    line-height: 1;
}
.stat-label {
    font-size: .8rem;
    color: var(--muted);
    letter-spacing: .05em;
    text-transform: uppercase;
}

/* ---------- exhibitions ---------- */

.timeline {
    list-style: none;
    margin: 0 auto;
    padding: 0;
    max-width: 760px;
    border-left: 1px solid var(--line);
}
.timeline li {
    position: relative;
    padding: 18px 0 18px 38px;
    border-bottom: 1px dashed var(--line);
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 20px;
    align-items: baseline;
    transition: background .3s;
}
.timeline li::before {
    content: "";
    position: absolute;
    left: -6px;
    top: 28px;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: var(--bg);
    border: 2px solid var(--accent);
    transition: background .3s, transform .3s;
}
.timeline li:hover::before { background: var(--accent); transform: scale(1.3); }
.timeline li .year {
    font-family: var(--serif);
    font-size: 1.2rem;
    color: var(--accent);
}
.timeline li .label {
    font-size: 1rem;
    color: var(--ink-soft);
}
.timeline-link {
    color: var(--ink-soft);
    border-bottom: 1px solid var(--line);
    padding-bottom: 1px;
    transition: color .3s var(--ease), border-color .3s var(--ease);
}
.timeline-link::after {
    content: " ↗";
    font-size: .82em;
    color: var(--muted);
    transition: color .3s var(--ease);
}
.timeline-link:hover {
    color: var(--accent);
    border-bottom-color: var(--accent);
}
.timeline-link:hover::after { color: var(--accent); }

/* education now renders with .timeline - no extra styles needed */

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

.contact { background: var(--ink); color: #eee3cf; }
.contact h2 { color: #fff; }
.contact .section-eyebrow { color: rgba(255,255,255,.55); }
.contact .lead { color: rgba(255,255,255,.78); }
.contact-direct { color: rgba(255,255,255,.78); font-size: 1rem; }
.contact-direct a { color: #eecfa9; border-bottom: 1px solid #eecfa9; }

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    align-items: start;
}

.socials {
    display: flex;
    gap: 24px;
    margin-top: 30px;
}
.socials a {
    font-size: .88rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: rgba(255,255,255,.75);
    padding-bottom: 4px;
    border-bottom: 1px solid rgba(255,255,255,.3);
    transition: color .3s, border-color .3s;
}
.socials a:hover { color: #fff; border-bottom-color: #fff; }

.contact-form {
    display: grid;
    gap: 20px;
}
.contact-form label {
    display: block;
    font-size: .8rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: rgba(255,255,255,.6);
}
.contact-form label span { display: block; margin-bottom: 8px; }
.contact-form input,
.contact-form textarea {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(255,255,255,.3);
    color: #fff;
    font-family: var(--sans);
    font-size: 1rem;
    padding: 10px 0;
    transition: border-color .4s var(--ease);
    resize: vertical;
}
.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-bottom-color: #eecfa9;
}
.contact-form .btn-primary {
    justify-self: start;
    background: #eecfa9;
    color: var(--ink);
}
.contact-form .btn-primary:hover {
    background: #fff;
    color: var(--ink);
}
.form-status {
    min-height: 1.4em;
    font-size: .88rem;
    color: #eecfa9;
    margin: 0;
}
.form-status.error { color: #ffb3a0; }

.hp {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.contact-form button[disabled] {
    opacity: .6;
    cursor: progress;
}

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

.site-footer {
    padding: 30px 0;
    background: #141310;
    color: rgba(255,255,255,.55);
    font-size: .85rem;
}
.site-footer .container {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}
.site-footer .made { font-style: italic; }

/* ---------- lightbox ---------- */

.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(20, 19, 16, .94);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 40px;
    opacity: 0;
    transition: opacity .4s var(--ease);
}
.lightbox.open { display: flex; opacity: 1; }
.lightbox figure {
    margin: 0;
    max-width: 90vw;
    max-height: 88vh;
    text-align: center;
    transform: scale(.96);
    transition: transform .5s var(--ease);
}
.lightbox.open figure { transform: scale(1); }
.lightbox img {
    max-width: 100%;
    max-height: 78vh;
    border-radius: 8px;
    box-shadow: var(--shadow-2);
}
.lightbox figcaption {
    color: rgba(255,255,255,.82);
    font-family: var(--serif);
    font-size: 1.15rem;
    margin-top: 16px;
}
.lightbox button {
    position: absolute;
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.25);
    color: #fff;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    font-size: 1.6rem;
    cursor: pointer;
    transition: background .3s, transform .3s;
}
.lightbox button:hover { background: rgba(255,255,255,.2); transform: scale(1.05); }
.lightbox-close { top: 30px; right: 30px; }
.lightbox-prev  { left: 30px;  top: 50%; transform: translateY(-50%); }
.lightbox-next  { right: 30px; top: 50%; transform: translateY(-50%); }
.lightbox-prev:hover { transform: translateY(-50%) scale(1.1); }
.lightbox-next:hover { transform: translateY(-50%) scale(1.1); }

/* ---------- custom cursor (desktop) ---------- */

.cursor,
.cursor-dot {
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 999;
    mix-blend-mode: difference;
}
.cursor {
    width: 34px;
    height: 34px;
    border: 1.5px solid #fff;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width .3s var(--ease), height .3s var(--ease), background .3s var(--ease);
}
.cursor-dot {
    width: 5px;
    height: 5px;
    background: #fff;
    border-radius: 50%;
    transform: translate(-50%, -50%);
}
.cursor.hover {
    width: 60px;
    height: 60px;
    background: rgba(255,255,255,.15);
}
@media (hover: none), (pointer: coarse) {
    .cursor,
    .cursor-dot { display: none; }
}

/* ---------- reveal animation ---------- */

.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 1s var(--ease), transform 1s var(--ease);
}
.reveal.in {
    opacity: 1;
    transform: translateY(0);
}

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

@media (max-width: 1100px) {
    .about-grid,
    .contact-grid { grid-template-columns: 1fr; gap: 50px; }
    .grid { grid-auto-rows: 120px; }
}

@media (max-width: 820px) {
    :root { --nav-h: 68px; }
    .site-header { padding: 0 22px; }
    .nav {
        position: fixed;
        inset: var(--nav-h) 0 auto 0;
        background: var(--bg);
        flex-direction: column;
        align-items: flex-start;
        padding: 30px 32px;
        gap: 1rem;
        transform: translateY(-120%);
        transition: transform .5s var(--ease);
        box-shadow: 0 10px 30px -10px rgba(0,0,0,.2);
    }
    .nav.open { transform: translateY(0); }
    .nav-toggle { display: flex; }

    /* mobile dropdown sits on cream bg - force dark text regardless of header state */
    .site-header .nav a,
    .site-header.scrolled .nav a {
        color: var(--ink);
        font-size: 1.15rem;
    }
    .site-header .nav a:hover,
    .site-header .nav a.active,
    .site-header.scrolled .nav a:hover,
    .site-header.scrolled .nav a.active {
        color: var(--accent);
    }
    .site-header .nav a::after,
    .site-header.scrolled .nav a::after { background: var(--accent); }

    .section { padding: 100px 0 80px; }
    .container { padding: 0 22px; }
    .hero { padding: calc(var(--nav-h) + 20px) 22px 50px; }

    .grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }

    .stats { flex-wrap: wrap; gap: 24px; }
    .stat-num { font-size: 2.2rem; }
    .education li { grid-template-columns: 1fr; gap: 4px; }

    .lightbox-prev { left: 12px;  }
    .lightbox-next { right: 12px; }
}

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