/* =================================================================
   Mars Dolschon — Portfolio
   Dark, minimal, modern. Inspired by media.work / waaber / themarmalade.
   ================================================================= */

:root {
    --bg:        #0a0a0b;
    --bg-soft:   #121214;
    --surface:   #161618;
    --line:      rgba(255,255,255,.10);
    --text:      #f4f4f2;
    --text-dim:  #9a9a98;
    --text-faint:#5a5a58;
    --accent:    #e7e3d8;     /* warm off-white accent */
    --radius:    14px;
    --ease:      cubic-bezier(.22,1,.36,1);
    --container: 1320px;
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-weight: 400;
    line-height: 1;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

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

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

/* Custom scrollbar */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #2a2a2d; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #3a3a3d; }

/* =================== Loader =================== */
.loader {
    position: fixed; inset: 0; z-index: 1000;
    background: var(--bg);
    display: flex; align-items: center; justify-content: center;
    transition: opacity .8s var(--ease), visibility .8s var(--ease);
}
.loader.is-done { opacity: 0; visibility: hidden; }
.loader__mark {
    font-family: 'Noto Sans', sans-serif;
    font-size: clamp(3rem, 12vw, 7rem);
    font-weight: 700;
    color: var(--text);
    animation: markPulse 1.4s var(--ease) infinite;
}
@keyframes markPulse {
    0%,100% { opacity: .25; transform: scale(.96); }
    50%     { opacity: 1;   transform: scale(1); }
}

/* =================== Top bar =================== */
.topbar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 90;
    display: flex; align-items: center; justify-content: space-between;
    padding: 26px clamp(20px, 5vw, 56px);
    transition: background .4s var(--ease), padding .4s var(--ease), backdrop-filter .4s var(--ease);
}
.topbar.is-scrolled {
    background: rgba(10,10,11,.72);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    padding-top: 16px; padding-bottom: 16px;
    border-bottom: 1px solid var(--line);
}
.topbar__brand {
    font-family: 'Noto Sans', sans-serif;
    font-weight: 600; font-size: 1.05rem; letter-spacing: .02em;
}
.topbar__nav { display: flex; align-items: center; gap: clamp(18px, 3vw, 38px); }
.topbar__nav a {
    font-size: .9rem; color: var(--text-dim);
    transition: color .3s var(--ease); position: relative;
}
.topbar__nav a:hover { color: var(--text); }
.topbar__cta {
    border: 1px solid var(--line); border-radius: 100px;
    padding: 8px 18px; color: var(--text) !important;
    transition: background .3s var(--ease), color .3s var(--ease) !important;
}
.topbar__cta:hover { background: var(--accent); color: #000 !important; border-color: var(--accent); }

/* =================== Hero =================== */
.hero {
    position: relative; height: 100svh; min-height: 600px;
    display: flex; align-items: flex-end;
    overflow: hidden;
}
.hero__video {
    position: absolute; inset: 0; width: 100%; height: 100%;
    object-fit: cover; z-index: 0;
    transform: scale(1.04);
}
.hero__video--empty {
    background: radial-gradient(120% 120% at 50% 20%, #1b1b1f 0%, #0a0a0b 70%);
}
.hero__overlay {
    position: absolute; inset: 0; z-index: 1;
    background:
        linear-gradient(to top, rgba(10,10,11,.92) 0%, rgba(10,10,11,.25) 45%, rgba(10,10,11,.5) 100%);
}
.hero__content {
    position: relative; z-index: 2;
    /*padding: 0 clamp(20px, 5vw, 56px) clamp(60px, 9vh, 110px);*/
    width: 100%; max-width: var(--container); margin: 0 auto;
}
.hero__eyebrow {
    font-size: .85rem; letter-spacing: .18em; text-transform: uppercase;
    color: var(--text-dim); margin-bottom: 22px;
}
.hero__title {
    font-family: 'Noto Sans', sans-serif;
    font-weight: 600; line-height: .5; letter-spacing: -.02em;
    font-size: clamp(2.8rem, 5vw, 6rem);
}
.hero__sub {
    margin-top: 22px; color: var(--text-dim);
    font-size: clamp(.95rem, 2vw, 1.25rem); letter-spacing: .02em;
}
.hero__scroll {
    position: absolute; right: clamp(20px, 5vw, 56px); bottom: clamp(40px, 8vh, 80px);
    z-index: 3; display: flex; flex-direction: column; align-items: center; gap: 12px;
    color: var(--text-dim);
}
.hero__scroll-line {
    width: 1px; height: 46px; background: linear-gradient(var(--text-dim), transparent);
    animation: scrollLine 2s var(--ease) infinite;
}
@keyframes scrollLine { 0%{transform:scaleY(0);transform-origin:top} 40%{transform:scaleY(1);transform-origin:top} 60%{transform:scaleY(1);transform-origin:bottom} 100%{transform:scaleY(0);transform-origin:bottom} }
.hero__scroll-text { font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; writing-mode: vertical-rl; }

/* =================== Shared bits =================== */
.section-label {
    font-size: .8rem; letter-spacing: .18em; text-transform: uppercase;
    color: var(--text-faint); margin-bottom: 24px;
}

/* =================== About =================== */
.about { padding: clamp(90px, 16vh, 200px) clamp(20px, 5vw, 56px); border-bottom: 1px solid var(--line); }
.about__inner { max-width: var(--container); margin: 0 auto; }
.about__text {
    font-family: 'Noto Sans', sans-serif;
    font-weight: 400; letter-spacing: -.01em;
    font-size: clamp(1.5rem, 4vw, 3.2rem); line-height: 1.18;
    max-width: 18ch + 40ch; color: var(--text);
}
.about__text { max-width: 60rem; }
.about__meta {
    display: grid; grid-template-columns: repeat(3, 1fr);
    gap: 30px; margin-top: clamp(50px, 8vh, 90px);
}
.about__meta-block { display: flex; flex-direction: column; gap: 8px; padding-top: 22px; border-top: 1px solid var(--line); }
.about__meta-label { font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; color: var(--text-faint); }
.about__meta-value { font-size: 1.02rem; color: var(--text); }
.about__email { transition: color .3s var(--ease); }
.about__email:hover { color: var(--text-dim); }

/* =================== Work grid =================== */
.work { padding: clamp(90px, 16vh, 200px) clamp(20px, 5vw, 56px); max-width: var(--container); margin: 0 auto; }
.work__head { margin-bottom: clamp(40px, 6vh, 70px); }
.work__title { font-family: 'Noto Sans', sans-serif; font-weight: 600; font-size: clamp(2rem, 6vw, 4rem); letter-spacing: -.02em; }

.grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: clamp(16px, 2.2vw, 32px);
}
.card {
    position: relative; cursor: pointer;
    border-radius: var(--radius); overflow: hidden;
    background: var(--surface);
}
.card__media {
    position: relative; overflow: hidden;
    aspect-ratio: 16 / 10; background: var(--bg-soft);
}
.card__media img, .card__media video {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform .9s var(--ease), filter .6s var(--ease);
    filter: saturate(.95);
}
.card:hover .card__media img, .card:hover .card__media video { transform: scale(1.06); filter: saturate(1.05); }
.card:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.card__play {
    position: absolute; inset: 0; margin: auto;
    width: 60px; height: 60px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0,0,0,.4); backdrop-filter: blur(6px);
    border: 1px solid rgba(255,255,255,.25); color: #fff;
    transition: transform .4s var(--ease), background .4s var(--ease);
}
.card:hover .card__play { transform: scale(1.08); background: rgba(0,0,0,.6); }

.card__caption {
    display: flex; align-items: baseline; justify-content: space-between; gap: 14px;
    padding: 16px 18px 18px;
}
.card__title { font-size: 1rem; font-weight: 500; }
.card__type { font-size: .76rem; letter-spacing: .12em; text-transform: uppercase; color: var(--text-faint); }

.work__empty { padding: 60px 0; color: var(--text-dim); }
.work__empty-hint { margin-top: 10px; color: var(--text-faint); font-size: .95rem; }
.work__empty code { background: var(--surface); padding: 2px 7px; border-radius: 6px; color: var(--accent); font-size: .88em; }

/* =================== Footer =================== */
.footer { padding: clamp(5px, 5vh, 5px) clamp(20px, 5vw, 56px) 50px; border-top: 1px solid var(--line); }
.footer__inner { max-width: var(--container); margin: 0 auto; }
.footer__big {
    font-family: 'Noto Sans', sans-serif; font-weight: 600;
    font-size: clamp(2.6rem, 9vw, 7rem); line-height: .98; letter-spacing: -.02em;
}
.footer__email {
    display: inline-block; margin-top: 36px;
    font-size: clamp(1.1rem, 3vw, 1.8rem); color: var(--text-dim);
    border-bottom: 1px solid var(--line); padding-bottom: 4px;
    transition: color .3s var(--ease), border-color .3s var(--ease);
}
.footer__email:hover { color: var(--text); border-color: var(--text); }
.footer__bottom {
    display: flex; flex-wrap: wrap; gap: 12px;
    margin-top: clamp(10px, 10vh, 10px); padding-top: 10px;
    font-size: .85rem; color: var(--text-faint);
}

/* =================== Lightbox =================== */
.lightbox {
    position: fixed; inset: 0; z-index: 500;
    background: rgba(6,6,7,.94); backdrop-filter: blur(10px);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; visibility: hidden; transition: opacity .45s var(--ease), visibility .45s var(--ease);
}
.lightbox.is-open { opacity: 1; visibility: visible; }
.lightbox__stage {
    max-width: 88vw; max-height: 82vh;
    display: flex; align-items: center; justify-content: center;
    transform: scale(.97); opacity: 0;
    transition: transform .5s var(--ease), opacity .5s var(--ease);
}
.lightbox.is-open .lightbox__stage { transform: scale(1); opacity: 1; }
.lightbox__stage img, .lightbox__stage video {
    max-width: 88vw; max-height: 82vh; width: auto; height: auto;
    border-radius: 8px; box-shadow: 0 30px 80px rgba(0,0,0,.6);
}
.lightbox__caption {
    position: absolute; bottom: 28px; left: 0; right: 0; text-align: center;
    color: var(--text-dim); font-size: .9rem; letter-spacing: .04em;
}
.lightbox__close {
    position: absolute; top: 22px; right: 26px; z-index: 2;
    width: 48px; height: 48px; border-radius: 50%;
    background: rgba(255,255,255,.06); border: 1px solid var(--line);
    color: var(--text); cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: background .3s var(--ease), transform .3s var(--ease);
}
.lightbox__close:hover { background: rgba(255,255,255,.14); transform: rotate(90deg); }
.lightbox__nav {
    position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
    width: 56px; height: 56px; border-radius: 50%;
    background: rgba(255,255,255,.05); border: 1px solid var(--line);
    color: var(--text); cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: background .3s var(--ease);
}
.lightbox__nav:hover { background: rgba(255,255,255,.14); }
.lightbox__nav--prev { left: 22px; }
.lightbox__nav--next { right: 22px; }

/* =================== Reveal animations =================== */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }

/* =================== Responsive =================== */
@media (max-width: 760px) {
    .topbar__nav a:not(.topbar__cta) { display: none; }
    .grid { grid-template-columns: 1fr; }
    .about__meta { grid-template-columns: 1fr; gap: 0; }
    .about__meta-block { margin-top: 18px; }
    .hero__scroll { display: none; }
    .lightbox__nav { width: 46px; height: 46px; }
    .lightbox__nav--prev { left: 10px; }
    .lightbox__nav--next { right: 10px; }
}

@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; scroll-behavior: auto !important; }
    .reveal { opacity: 1; transform: none; transition: none; }
}
