/* ============================================================
   Andy Manea — portfolio
   Brand: Playfair Display (display) + Raleway (text)
   Ink #101010 · Paper #fff · Accent #DB4848
   ============================================================ */

:root {
    --ink: #101010;
    --paper: #ffffff;
    --accent: #DB4848;
    --hair: #E4E1DC;
    --muted: #8a8a8a;

    --font-d: 'Playfair Display', Georgia, serif;
    --font-t: 'Raleway', Helvetica, sans-serif;

    /* one type scale, used everywhere */
    --fs-eyebrow: 11px;
    --fs-title: clamp(30px, 3.4vw, 52px);
    --fs-lede: 15.5px;
    --fs-item: 16.5px;
    --fs-small: 12px;

    --ease: cubic-bezier(.16, 1, .3, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
ul, li { list-style: none; }
button { border: none; background: none; cursor: pointer; }
img { display: block; }
a { color: inherit; text-decoration: none; }

html, body { height: 100%; }

body {
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font-t);
    overflow: hidden;
}

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

/* ------------------------------------------------------------
   Fixed chrome: topbar, progress, dots, cursor
   ------------------------------------------------------------ */

.topbar {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 40;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 26px 4vw;
    pointer-events: none;
    transition: color .5s var(--ease);
}

.topbar__logo {
    pointer-events: auto;
    font-family: var(--font-d);
    font-size: 24px;
    line-height: 1;
}

.topbar__logo span { color: var(--accent); }

.topbar__logo em {
    display: block;
    font-family: var(--font-t);
    font-style: normal;
    font-size: 9px;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-top: 4px;
    opacity: .55;
}

.topbar__nav { pointer-events: auto; display: flex; gap: 34px; }

.navlink {
    font-family: var(--font-t);
    font-size: var(--fs-small);
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: inherit;
    position: relative;
    padding: 4px 0;
    opacity: .6;
    transition: opacity .3s;
}

.navlink::after {
    content: "";
    position: absolute;
    left: 0; bottom: 0;
    width: 100%; height: 1px;
    background: currentColor;
    transform: scaleX(0);
    transform-origin: right;
    transition: transform .45s var(--ease);
}

.navlink:hover { opacity: 1; }
.navlink:hover::after { transform: scaleX(1); transform-origin: left; }

.navlink.is-active { opacity: 1; color: var(--accent); }
.navlink.is-active::after { transform: scaleX(1); background: var(--accent); }

.progress {
    position: fixed;
    left: 4vw; bottom: 30px;
    z-index: 40;
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: var(--fs-small);
    letter-spacing: 2px;
    transition: color .5s var(--ease);
}

.progress__num { font-family: var(--font-d); font-size: 15px; }

.progress__bar {
    width: 110px; height: 1px;
    background: currentColor;
    opacity: .25;
    position: relative;
}

.progress__bar i {
    position: absolute;
    inset: 0;
    background: var(--accent);
    opacity: 1;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .7s var(--ease);
}

.progress__total { opacity: .45; }

.progress__label {
    text-transform: uppercase;
    opacity: .45;
    margin-left: 6px;
}

.slide-dots {
    position: fixed;
    right: 26px; top: 50%;
    transform: translateY(-50%);
    z-index: 40;
    display: flex;
    flex-direction: column;
    gap: 9px;
    transition: color .5s var(--ease);
}

.slide-dots .swiper-pagination-bullet {
    width: 14px; height: 2px;
    border-radius: 0;
    background: currentColor;
    opacity: .25;
    transition: .4s var(--ease);
    display: block;
    margin: 0 !important;
}

.slide-dots .swiper-pagination-bullet-active {
    width: 26px;
    opacity: 1;
    background: var(--accent);
}

/* dark slides flip the fixed chrome to white */
body.on-dark .topbar,
body.on-dark .progress,
body.on-dark .slide-dots { color: #fff; }

.cursor {
    position: fixed;
    z-index: 99;
    width: 10px; height: 10px;
    border-radius: 50%;
    background: var(--accent);
    pointer-events: none;
    transform: translate(-50%, -50%);
    transition: width .3s, height .3s, opacity .3s;
    opacity: 0;
}

body.has-cursor .cursor { opacity: 1; }
body.cursor-grow .cursor { width: 46px; height: 46px; opacity: .35; }

/* ------------------------------------------------------------
   Slides
   ------------------------------------------------------------ */

.swiper { width: 100vw; height: 100vh; }

.slide {
    position: relative;
    overflow: hidden;
    background: var(--wall, var(--paper));
}

.slide--dark { color: #fff; }

/* --- feature layout: media | line | body --- */

.frame {
    height: 100%;
    width: min(1560px, 88vw);
    margin: 0 auto;
    padding-top: 80px;
    display: grid;
    grid-template-columns: minmax(0, 42fr) 1px minmax(0, 50fr);
    column-gap: clamp(36px, 5vw, 90px);
    align-items: center;
}

.frame__media {
    height: min(74vh, 780px);
    overflow: hidden;
    position: relative;
    clip-path: inset(4% 4% 4% 4%);
    transition: clip-path 1.1s var(--ease) .15s;
}

.frame__media img {
    width: 100%; height: 100%;
    object-fit: cover;
    transform: scale(1.12);
    transition: transform 1.4s var(--ease) .15s;
}

.frame__media--contain img { object-fit: contain; }

.is-in .frame__media { clip-path: inset(0 0 0 0); }
.is-in .frame__media img { transform: scale(1); }

.frame__line {
    width: 1px;
    height: min(74vh, 780px);
    background: var(--hair);
    transform: scaleY(0);
    transform-origin: top;
    transition: transform 1.2s var(--ease) .3s;
}

.is-in .frame__line { transform: scaleY(1); }

.frame__body { max-width: 660px; }

/* --- text reveal choreography --- */

[data-r] {
    opacity: 0;
    transform: translateY(34px);
    transition:
        opacity .9s var(--ease) calc(var(--r, 0) * 95ms + 300ms),
        transform .9s var(--ease) calc(var(--r, 0) * 95ms + 300ms);
}

.is-in [data-r] { opacity: 1; transform: none; }

/* --- shared content blocks (one scale for every slide) --- */

.eyebrow {
    font-size: var(--fs-eyebrow);
    letter-spacing: 3.5px;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 20px;
}

.title {
    font-family: var(--font-d);
    font-weight: 400;
    font-size: var(--fs-title);
    line-height: 1.12;
    margin-bottom: 26px;
}

.lede {
    font-size: var(--fs-lede);
    line-height: 1.8;
    max-width: 58ch;
    opacity: .88;
}

.logo { margin-bottom: 30px; }
.logo img { height: 34px; width: auto; }
.logo .invert { filter: invert(1); height: 44px; }

.meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(24px, 3.5vw, 64px);
    margin-top: 46px;
}

.meta h4 {
    font-size: var(--fs-eyebrow);
    letter-spacing: 3px;
    text-transform: uppercase;
    font-weight: 400;
    opacity: .45;
    margin-bottom: 14px;
}

.meta li {
    font-family: var(--font-d);
    font-size: var(--fs-item);
    line-height: 2;
}

.meta a { border-bottom: 1px solid transparent; transition: .3s; }
.meta a:hover { color: var(--accent); border-color: var(--accent); }

.more {
    margin-top: 22px;
    font-size: var(--fs-small);
    letter-spacing: 2px;
    text-transform: uppercase;
    opacity: .4;
}

.cta {
    display: inline-block;
    margin-top: 46px;
    font-family: var(--font-t);
    font-size: 13px;
    letter-spacing: 2px;
    text-transform: uppercase;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--ink);
    transition: color .3s, border-color .3s;
}

.cta span { display: inline-block; transition: transform .4s var(--ease); }

.cta:hover { color: var(--accent); border-color: var(--accent); }
.cta:hover span { transform: translateX(7px); }

.mail {
    display: inline-block;
    font-family: var(--font-d);
    font-size: clamp(22px, 2.4vw, 34px);
    margin: 6px 0 10px;
    border-bottom: 1px solid var(--hair);
    padding-bottom: 8px;
    transition: color .3s, border-color .3s;
}

.mail:hover { color: var(--accent); border-color: var(--accent); }

/* --- index layout (capabilities) --- */

.index {
    height: 100%;
    width: min(1560px, 88vw);
    margin: 0 auto;
    padding-top: 104px;
    padding-bottom: 104px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.index__head {
    display: grid;
    grid-template-columns: minmax(0, 44fr) minmax(0, 52fr);
    column-gap: clamp(36px, 5vw, 90px);
    align-items: end;
}

.index__head .title { margin-bottom: 0; }
.index__head .lede { max-width: 58ch; }

.index__grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: clamp(24px, 3vw, 60px);
    margin-top: clamp(28px, 4.5vh, 56px);
    padding-top: clamp(20px, 3vh, 38px);
    border-top: 1px solid var(--hair);
}

.index__grid h4 {
    font-size: var(--fs-eyebrow);
    letter-spacing: 3px;
    text-transform: uppercase;
    font-weight: 400;
    opacity: .45;
    margin-bottom: 14px;
}

.index__grid li {
    font-family: var(--font-d);
    font-size: var(--fs-item);
    line-height: 1.85;
}

/* --- gallery wall --- */

.wall {
    height: 100%;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 14px;
    padding: 106px 5vw 66px;
}

.wall figure {
    overflow: hidden;
    opacity: 0;
    transform: translateY(46px);
    transition: opacity .9s var(--ease), transform .9s var(--ease);
}

.is-in .wall figure { opacity: 1; transform: none; }

.wall figure:nth-child(1) { transition-delay: .25s; }
.wall figure:nth-child(2) { transition-delay: .32s; }
.wall figure:nth-child(3) { transition-delay: .39s; }
.wall figure:nth-child(4) { transition-delay: .46s; }
.wall figure:nth-child(5) { transition-delay: .53s; }
.wall figure:nth-child(6) { transition-delay: .60s; }
.wall figure:nth-child(7) { transition-delay: .67s; }
.wall figure:nth-child(8) { transition-delay: .74s; }

.wall img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform .8s var(--ease);
}

.wall figure:hover img { transform: scale(1.06); }

/* --- full-bleed single shot --- */

.slide--full .fullshot {
    height: 100%;
    padding: 110px 7vw 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translateY(46px) ;
    transition: opacity 1s var(--ease) .25s, transform 1s var(--ease) .25s;
}

.is-in .fullshot { opacity: 1; transform: none; }

.slide--full .fullshot img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* --- ghost word --- */

.ghost {
    position: absolute;
    z-index: 2;
    left: 3vw; bottom: 1vh;
    font-family: var(--font-d);
    font-size: clamp(70px, 11vw, 190px);
    line-height: 1;
    color: transparent;
    -webkit-text-stroke: 1px currentColor;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 1.2s var(--ease) .5s, transform 1.2s var(--ease) .5s;
    pointer-events: none;
    white-space: nowrap;
}

.slide--dark .ghost { color: transparent; -webkit-text-stroke: 1px #fff; }
.slide:not(.slide--dark) .ghost { -webkit-text-stroke: 1px var(--ink); }

.is-in .ghost { opacity: .16; transform: none; }

/* short desktop viewports — scale the whole system down together */
@media (min-width: 769px) and (max-height: 740px) {
    :root {
        --fs-title: clamp(26px, 2.8vw, 40px);
        --fs-lede: 14.5px;
        --fs-item: 15px;
    }

    .meta { margin-top: 34px; }
    .meta li { line-height: 1.85; }
    .cta { margin-top: 36px; }
    .index { padding-top: 88px; }
    .index .lede { max-width: 84ch; }
    .index__grid li { font-size: 14px; line-height: 1.65; }
    .logo { margin-bottom: 22px; }
    .logo img { height: 30px; }
}

/* ------------------------------------------------------------
   Mobile — free scroll, same reveals
   ------------------------------------------------------------ */

@media (max-width: 768px) {
    body { overflow: auto; overflow-x: hidden; }

    .swiper { height: auto; }
    .swiper-wrapper { display: block; height: auto; }

    .slide { min-height: 100svh; width: 100%; }

    .topbar { padding: 18px 6vw; background: var(--paper); position: fixed; }
    body.on-dark .topbar { color: var(--ink); }
    .topbar__logo { font-size: 20px; }
    .topbar__logo em { display: none; }
    .topbar__nav { gap: 16px; }
    .navlink { letter-spacing: 1.2px; font-size: 11px; }

    .progress, .slide-dots, .cursor { display: none; }

    .frame {
        display: block;
        height: auto;
        width: 88vw;
        padding: 96px 0 56px;
    }

    .frame__media { height: 46vh; margin-bottom: 30px; }
    .frame__line { display: none; }
    .frame__body { max-width: 100%; }

    .index {
        height: auto;
        width: 88vw;
        padding: 96px 0 56px;
        display: block;
    }

    .index__head { display: block; }
    .index__head .title { margin-bottom: 26px; }

    .index__grid { grid-template-columns: 1fr 1fr; gap: 26px; }

    .wall {
        height: auto;
        grid-template-columns: 1fr 1fr;
        grid-template-rows: none;
        padding: 92px 4vw 48px;
    }

    .wall figure { aspect-ratio: 1 / 1; }

    .slide--full .fullshot { padding: 92px 5vw 48px; min-height: 100svh; }

    .ghost { font-size: clamp(48px, 14vw, 90px); }

    .meta { grid-template-columns: 1fr 1fr; }

    .title { font-size: clamp(28px, 8vw, 38px); }
}
