@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=DM+Sans:opsz,wght@9..40,300;9..40,400;9..40,500;9..40,600;9..40,700&family=Space+Mono:wght@400;700&display=swap');

:root {
    color-scheme: dark;
    --bg: #0a0812;
    --bg-soft: #140f1e;
    --panel: #1e182c;
    --text: #f0ebe3;
    --muted: rgba(240, 235, 227, .62);
    --faint: rgba(240, 235, 227, .38);
    --gold: #d4a853;
    --gold-light: #ecc872;
    --red: #cc131f;
    --line: rgba(240, 235, 227, .09);
    --gold-line: rgba(212, 168, 83, .24);
    --shadow: 0 24px 70px rgba(0, 0, 0, .34);
    --display: 'Bebas Neue', system-ui, sans-serif;
    --body: 'DM Sans', system-ui, sans-serif;
    --mono: 'Space Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    overflow-x: hidden;
    background:
        radial-gradient(circle at 90% 4%, rgba(212, 168, 83, .09), transparent 28rem),
        var(--bg);
    color: var(--text);
    font-family: var(--body);
    line-height: 1.72;
    -webkit-font-smoothing: antialiased;
}
body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 99;
    pointer-events: none;
    opacity: .018;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.7' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
img { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; }
::selection { background: rgba(212, 168, 83, .3); color: #fff; }

.skip-link {
    position: fixed;
    top: .75rem;
    left: .75rem;
    z-index: 200;
    padding: .7rem 1rem;
    border-radius: 999px;
    background: var(--gold);
    color: var(--bg);
    font-weight: 700;
    transform: translateY(-160%);
    transition: transform .2s ease;
}
.skip-link:focus { transform: translateY(0); }
.wrap { width: min(1180px, calc(100% - 2.5rem)); margin-inline: auto; }
.narrow { width: min(760px, calc(100% - 2.5rem)); margin-inline: auto; }

.site-header {
    position: absolute;
    inset: 0 0 auto;
    z-index: 20;
    padding-top: 1.25rem;
}
.site-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: .7rem .75rem .7rem 1.2rem;
    border: 1px solid rgba(240, 235, 227, .1);
    border-radius: 999px;
    background: rgba(10, 8, 18, .68);
    box-shadow: 0 12px 34px rgba(0, 0, 0, .2);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
}
.logo img {
    width: 158px;
    height: auto;
    filter: brightness(0) invert(1);
    opacity: .8;
}
.nav-actions { display: flex; align-items: center; gap: .55rem; }
.back-link,
.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .55rem;
    min-height: 42px;
    border: 0;
    border-radius: 999px;
    color: rgba(240, 235, 227, .66);
    text-decoration: none;
    transition: color .2s ease, background .2s ease;
}
.back-link { padding: .65rem 1rem; font-family: var(--mono); font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; }
.theme-toggle { width: 42px; cursor: pointer; background: transparent; }
.back-link:hover,
.theme-toggle:hover { color: var(--gold-light); background: rgba(212, 168, 83, .09); }
.back-link svg,
.theme-toggle svg { width: 17px; height: 17px; }
.icon-sun { display: none; }

.hero {
    position: relative;
    min-height: min(900px, 94svh);
    display: flex;
    align-items: flex-end;
    isolation: isolate;
    overflow: hidden;
}
.hero-media,
.hero-media::after,
.hero-media::before { position: absolute; inset: 0; }
.hero-media { z-index: -2; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; }
.hero-media::before {
    content: '';
    z-index: 1;
    background: linear-gradient(90deg, rgba(10, 8, 18, .93) 0%, rgba(10, 8, 18, .68) 47%, rgba(10, 8, 18, .18) 100%);
}
.hero-media::after {
    content: '';
    z-index: 2;
    background: linear-gradient(0deg, var(--bg) 0%, transparent 36%, rgba(10, 8, 18, .18) 100%);
}
.maxik-page .hero-media img { object-position: 50% 42%; }
.education-page .hero-media img { object-position: 50% 35%; }
.hero-copy { padding-top: 10rem; padding-bottom: clamp(4.5rem, 10vw, 8rem); }
.hero-copy,
.hero-copy h1 { color: #f0ebe3; }
.hero-copy .lead { color: rgba(240, 235, 227, .72); }
.hero-copy .fact { color: rgba(240, 235, 227, .78); }
.eyebrow {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin: 0 0 1.2rem;
    color: rgba(236, 200, 114, .82);
    font-family: var(--mono);
    font-size: .72rem;
    letter-spacing: .22em;
    text-transform: uppercase;
}
.eyebrow::before { content: ''; width: 1.8rem; height: 1px; background: var(--gold); }
h1,
h2,
h3 { margin-top: 0; text-wrap: balance; }
h1 {
    max-width: 850px;
    margin-bottom: 1.5rem;
    font-family: var(--display);
    font-size: clamp(4.1rem, 10vw, 9rem);
    font-weight: 400;
    line-height: .88;
    letter-spacing: .01em;
    text-transform: uppercase;
}
h1 .gold {
    color: transparent;
    background: linear-gradient(135deg, var(--gold-light), var(--gold), #b78935);
    -webkit-background-clip: text;
    background-clip: text;
}
.lead {
    max-width: 680px;
    margin: 0;
    color: rgba(240, 235, 227, .72);
    font-size: clamp(1rem, 2vw, 1.18rem);
    line-height: 1.75;
}
.hero-facts { display: flex; flex-wrap: wrap; gap: .4rem 2.2rem; margin-top: 2rem; }
.fact {
    color: rgba(240, 235, 227, .82);
    font-size: 1.05rem;
    font-weight: 500;
}

.story-section { padding: clamp(5rem, 10vw, 9rem) 0; }
.story-section.alt { background: var(--bg-soft); }
.story-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, .64fr);
    gap: clamp(3rem, 8vw, 7.5rem);
    align-items: start;
}
.section-label {
    margin: 0 0 .5rem;
    color: var(--faint);
    font-size: .95rem;
}
h2 {
    margin-bottom: 1.6rem;
    font-family: var(--display);
    font-size: clamp(3rem, 6vw, 5.3rem);
    font-weight: 400;
    line-height: .95;
    text-transform: uppercase;
}
h2 em { color: var(--gold-light); font-style: normal; }
.prose p { margin: 0 0 1.35rem; color: var(--muted); font-size: 1.02rem; }
.prose p:last-child { margin-bottom: 0; }
.prose strong { color: var(--text); }
.side-note {
    position: sticky;
    top: 2rem;
    padding: 0;
}
.side-note .big {
    display: block;
    margin: 0 0 .8rem;
    color: var(--gold-light);
    font-family: var(--display);
    font-size: clamp(4rem, 8vw, 6.5rem);
    line-height: .9;
}
.side-note .section-label { margin-bottom: .9rem; color: var(--gold-light); font-family: var(--display); font-size: 1.7rem; line-height: 1.1; text-transform: uppercase; }
.side-note p { margin: 0; color: var(--muted); }
.mini-fact { margin-top: 1.6rem; }
.mini-fact strong { display: block; color: var(--text); font-family: var(--display); font-size: 1.7rem; font-weight: 400; line-height: 1.1; text-transform: uppercase; }
.mini-fact span { color: var(--faint); font-size: .95rem; }

.gallery { padding: 0 0 clamp(5rem, 10vw, 9rem); }
.gallery-head { display: flex; align-items: end; justify-content: space-between; gap: 2rem; margin-bottom: 1.75rem; }
.gallery-head h2 { margin-bottom: 0; }
.gallery-head p { max-width: 360px; margin: 0 0 .55rem; color: var(--faint); }
.photo-row {
    display: flex;
    gap: 1rem;
    max-width: calc(var(--sum) * 640px);
}
.photo-rows { display: grid; gap: 1rem; }
.photo-rows .photo-row { max-width: none; }
.photo {
    flex: var(--ar) 1 0;
    min-width: 0;
    margin: 0;
    overflow: hidden;
    border-radius: 20px;
    background: var(--panel);
}
.photo button {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: none;
    cursor: zoom-in;
}
.photo button:focus-visible { outline: 2px solid var(--gold-light); outline-offset: -4px; border-radius: 20px; }
.photo img { width: 100%; height: auto; aspect-ratio: var(--ar); object-fit: cover; transition: transform .8s cubic-bezier(.22, 1, .36, 1); }
.photo:hover img { transform: scale(1.035); }

.lightbox {
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    padding: 0;
    border: 0;
    background: rgba(10, 8, 18, .96);
    color: #f0ebe3;
}
.lightbox[open] { display: grid; place-items: center; }
.lightbox::backdrop { background: rgba(10, 8, 18, .96); }
.lightbox img { max-width: min(92vw, 1100px); max-height: 82dvh; width: auto; height: auto; object-fit: contain; border-radius: 12px; }
.lb-caption { position: absolute; left: 0; right: 0; bottom: 1.25rem; margin: 0; padding: 0 4.5rem; text-align: center; color: var(--muted); font-size: .88rem; }
.lb-btn {
    position: absolute;
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border: 1px solid var(--gold-line);
    border-radius: 50%;
    background: rgba(10, 8, 18, .6);
    color: var(--gold-light);
    cursor: pointer;
    transition: background .2s ease;
}
.lb-btn:hover { background: rgba(212, 168, 83, .16); }
.lb-btn:focus-visible { outline: 2px solid var(--gold-light); outline-offset: 3px; }
.lb-btn svg { width: 20px; height: 20px; }
.lb-close { top: 1.25rem; right: 1.25rem; }
.lb-prev { left: 1.25rem; top: 50%; transform: translateY(-50%); }
.lb-next { right: 1.25rem; top: 50%; transform: translateY(-50%); }

.skills-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2rem 2.5rem; margin-top: 2.5rem; }
.skill-card h3 { margin: 0 0 .3rem; color: var(--gold-light); font-family: var(--display); font-size: 2.2rem; font-weight: 400; line-height: 1; text-transform: uppercase; }
.skill-card p { margin: 0; color: var(--muted); font-size: .95rem; }

.goal-band {
    position: relative;
    padding: clamp(5rem, 10vw, 8rem) 0;
    overflow: hidden;
    background: linear-gradient(125deg, #20182d, #100d18 62%);
}
.goal-band::before {
    content: '';
    position: absolute;
    width: 28rem;
    height: 28rem;
    right: -8rem;
    top: -12rem;
    border-radius: 50%;
    background: rgba(212, 168, 83, .1);
    filter: blur(4px);
}
.goal-grid { position: relative; display: grid; grid-template-columns: 1fr auto; gap: 3rem; align-items: end; }
.goal-grid h2 { max-width: 770px; margin-bottom: 1rem; }
.goal-grid p { max-width: 690px; margin: 0; color: var(--muted); }
.cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .7rem;
    min-height: 54px;
    padding: .9rem 1.5rem;
    border-radius: 999px;
    background: var(--gold);
    color: #0a0812;
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-decoration: none;
    text-transform: uppercase;
    box-shadow: 0 0 30px rgba(212, 168, 83, .13);
    transition: transform .2s ease, background .2s ease;
}
.cta:hover { transform: translateY(-2px); background: var(--gold-light); }
.cta svg { width: 18px; height: 18px; }

.next-project { padding: clamp(4.5rem, 9vw, 7rem) 0; }
.next-card {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr) auto;
    gap: clamp(1.4rem, 4vw, 2.5rem);
    align-items: center;
    text-decoration: none;
}
.next-card:hover h2 { color: var(--gold-light); }
.next-card h2 { transition: color .25s ease; }
.next-card img { width: 180px; height: 126px; object-fit: cover; border-radius: 15px; }
.next-card .section-label { margin-bottom: .3rem; }
.next-card h2 { margin: 0; font-size: clamp(2rem, 4vw, 3.4rem); }
.arrow { display: grid; place-items: center; width: 48px; height: 48px; margin-right: .75rem; color: var(--gold-light); }
.arrow svg { width: 20px; height: 20px; }

.site-footer { padding: 2.2rem 0; border-top: 1px solid var(--line); }
.footer-row { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; color: var(--faint); font-size: .82rem; }
.footer-row a { color: var(--muted); text-underline-offset: .2em; }
.footer-row a:hover { color: var(--gold-light); }

body.light {
    color-scheme: light;
    --bg: #f5f0e8;
    --bg-soft: #ede7db;
    --panel: #e5ddd1;
    --text: #2a2520;
    --muted: rgba(42, 37, 32, .69);
    --faint: rgba(42, 37, 32, .5);
    --line: rgba(42, 37, 32, .11);
    --gold-line: rgba(160, 120, 48, .3);
    --shadow: 0 24px 70px rgba(42, 37, 32, .12);
}
body.light::before { opacity: .012; }
body.light .story-section:not(.alt),
body.light .gallery,
body.light .next-project { background: var(--bg); }
body.light .goal-band { background: linear-gradient(125deg, #e5ddd1, #f5f0e8 62%); }
body.light .goal-band::before { background: rgba(212, 168, 83, .15); }
body.light .skill-card h3,
body.light .mini-fact strong { color: var(--text); }
body.light .goal-grid p { color: var(--muted); }
body.light .icon-moon { display: none; }
body.light .icon-sun { display: block; }

@media (max-width: 850px) {
    .hero { min-height: 820px; }
    .hero-media::before { background: linear-gradient(0deg, rgba(10, 8, 18, .98) 4%, rgba(10, 8, 18, .62) 58%, rgba(10, 8, 18, .25) 100%); }
    .story-grid { grid-template-columns: 1fr; }
    .side-note { position: static; }
    .gallery-head { align-items: start; flex-direction: column; gap: .6rem; }
    .goal-grid { grid-template-columns: 1fr; align-items: start; }
}

@media (max-width: 620px) {
    .wrap,
    .narrow { width: min(100% - 1.5rem, 1180px); }
    .site-header { padding-top: .75rem; }
    .site-nav { padding: .55rem .55rem .55rem .85rem; }
    .logo img { width: 118px; }
    .back-link { width: 42px; padding: 0; }
    .back-link span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
    .hero { min-height: 760px; }
    .hero-copy { padding-top: 8.5rem; padding-bottom: 4rem; }
    h1 { font-size: clamp(3.65rem, 19vw, 6rem); }
    .lead { font-size: .98rem; }
    .fact { font-size: .61rem; }
    .story-section { padding-block: 4.5rem; }
    .skills-grid { grid-template-columns: 1fr; }
    .photo-row { flex-direction: column; gap: .75rem; max-width: none; }
    .photo { flex: none; }
    .goal-grid { gap: 2rem; }
    .cta { width: 100%; }
    .next-card { grid-template-columns: 88px minmax(0, 1fr) auto; gap: 1rem; }
    .next-card img { width: 88px; height: 88px; }
    .next-card h2 { font-size: 1.75rem; }
    .arrow { width: 38px; height: 38px; margin-right: 0; }
    .footer-row { align-items: flex-start; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
