/* ============================================================
   GABRIEL ALCAINE — Swiss-design portfolio
   Type: Barlow Condensed / Grid: strict / Accent: Swiss red
   ============================================================ */

:root {
  --ink: #0d0d0d;
  --paper: #f4f2ee;
  --grey: #8a8781;
  --line: rgba(13, 13, 13, 0.16);
  /* Heritage palette: Swiss garnet for emphasis, Maya blue for wayfinding */
  --grenat: #7c2331;
  --maya: #2e86ab;
  --maya-bright: #6fb4d4;
  --red: var(--grenat);
  --font: "Barlow Condensed", "Arial Narrow", sans-serif;
  --pad: clamp(1.25rem, 4vw, 4rem);
  --ease: cubic-bezier(0.65, 0.05, 0, 1);
}

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

html { scroll-behavior: smooth; }
html.lb-open, html.menu-open { overflow: hidden; }

body {
  font-family: var(--font);
  background: var(--paper);
  color: var(--ink);
  font-weight: 400;
  line-height: 1.4;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
.accent { color: var(--red); font-style: normal; }

::selection { background: var(--red); color: var(--paper); }

/* ---------- brand mark (winding crown / aperture) ---------- */
.mark {
  width: 0.4em; height: 0.4em;
  display: inline-block;
  vertical-align: 0.04em;
  margin-left: 0.08em;
}
@keyframes markSpin { to { transform: rotate(360deg); } }
/* D-badge variant: static D case in Maya blue, crown rotates inside it.
   Sized to cap height so it sits like a letter after the name. */
.mark--d { width: 0.81em; height: 0.72em; vertical-align: 0; margin-left: 0.08em; }
.mark__d { fill: var(--maya); }
.mark__ring {
  transform-box: view-box;
  transform-origin: 51.8% 50%;
  animation: markSpin 16s linear infinite;
}
.preloader__name .mark--d { color: var(--paper); width: 0.9em; height: 0.8em; vertical-align: -0.08em; }

/* ---------- line-reveal primitives ---------- */
.line { display: block; overflow: hidden; }
.line > span { display: inline-block; transform: translateY(110%); }

/* ============ PRELOADER ============ */
.preloader {
  position: fixed; inset: 0; z-index: 1000;
  background: var(--ink); color: var(--paper);
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: var(--pad);
}
.preloader__inner {
  display: flex; justify-content: space-between; align-items: flex-end;
  margin-bottom: 1rem;
}
.preloader__name {
  font-size: clamp(1rem, 2vw, 1.4rem); font-weight: 600;
  letter-spacing: 0.35em;
}
.preloader__count {
  font-size: clamp(4rem, 14vw, 11rem); font-weight: 800;
  line-height: 0.8; font-variant-numeric: tabular-nums;
}
.preloader__bar { height: 2px; background: rgba(244, 242, 238, 0.15); }
.preloader__bar span { display: block; height: 100%; width: 0; background: var(--maya); }

/* ============ CURSOR ============ */
.cursor {
  position: fixed; top: 0; left: 0; z-index: 999;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--maya);
  pointer-events: none;
  transform: translate(-50%, -50%);
  transition: width 0.35s var(--ease), height 0.35s var(--ease), background 0.35s;
  display: flex; align-items: center; justify-content: center;
}
.cursor.is-hover { width: 56px; height: 56px; background: rgba(46, 134, 171, 0.4); }
.cursor.is-view { width: 84px; height: 84px; background: var(--maya); }
.cursor__label {
  font-size: 0.8rem; font-weight: 600; letter-spacing: 0.2em;
  color: var(--paper); opacity: 0;
}
.cursor.is-view .cursor__label { opacity: 1; }
@media (hover: none) { .cursor { display: none; } }

/* ============ HEADER ============ */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 90;
  display: flex; align-items: center; gap: 3rem;
  padding: 1.1rem var(--pad);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(12px);
  transition: transform 0.5s var(--ease);
}
.site-header.is-hidden { transform: translateY(-101%); }
.site-header__logo { font-size: 1.6rem; font-weight: 800; letter-spacing: 0.05em; }
.site-header__nav { display: flex; gap: 2rem; }
.site-header__nav a {
  font-size: 1rem; font-weight: 500; letter-spacing: 0.18em;
  text-transform: uppercase; position: relative;
}
.site-header__nav a::after {
  content: ""; position: absolute; left: 0; bottom: -4px;
  width: 100%; height: 1px; background: var(--red);
  transform: scaleX(0); transform-origin: right;
  transition: transform 0.4s var(--ease);
}
.site-header__nav a:hover::after { transform: scaleX(1); transform-origin: left; }
.site-header__meta {
  margin-left: auto; display: flex; gap: 0.8rem; align-items: baseline;
  font-size: 0.9rem; letter-spacing: 0.2em; color: var(--grey);
}
.clock { font-variant-numeric: tabular-nums; color: var(--maya); }

/* language switcher */
.lang { display: flex; gap: 0.15rem; }
.lang button, .mobile-menu__lang button {
  font-family: var(--font); font-size: 0.95rem; font-weight: 500; letter-spacing: 0.12em;
  background: none; border: none; cursor: pointer; color: var(--grey);
  padding: 0.2rem 0.45rem; border-bottom: 2px solid transparent;
  transition: color 0.3s, border-color 0.3s;
}
.lang button:hover { color: var(--ink); }
.lang button.is-active { color: var(--ink); border-bottom-color: var(--grenat); }
.mobile-menu__lang { display: flex; gap: 1.6rem; margin-top: 2.5rem; }
.mobile-menu__lang button { font-size: 1.4rem; color: rgba(244, 242, 238, 0.5); }
.mobile-menu__lang button.is-active { color: var(--paper); border-bottom-color: var(--maya-bright); }
.mobile-menu .accent-bright { color: var(--maya-bright); }
.site-header__cta {
  font-size: 0.95rem; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase;
  border: 1px solid var(--ink); padding: 0.55rem 1.4rem; border-radius: 99px;
  transition: background 0.35s var(--ease), color 0.35s var(--ease);
}
.site-header__cta:hover { background: var(--red); border-color: var(--red); color: var(--paper); }
.site-header__burger { display: none; }

/* mobile menu */
.mobile-menu {
  position: fixed; inset: 0; z-index: 80; background: var(--ink); color: var(--paper);
  display: flex; align-items: center; padding: var(--pad);
  clip-path: inset(0 0 100% 0);
  transition: clip-path 0.7s var(--ease);
}
.mobile-menu.is-open { clip-path: inset(0 0 0% 0); }
.mobile-menu nav { display: flex; flex-direction: column; gap: 0.4rem; }
.mobile-menu a {
  font-size: clamp(3rem, 11vw, 5rem); font-weight: 800; text-transform: uppercase;
  line-height: 1.05;
}

@media (max-width: 1250px) {
  .site-header { gap: 1.4rem; }
  .site-header__nav { gap: 1.2rem; }
  .site-header__meta { display: none; }
  .site-header .lang { margin-left: auto; }
}

@media (max-width: 900px) {
  .site-header__nav, .site-header__cta, .site-header__meta, .site-header .lang { display: none; }
  .site-header__burger {
    display: flex; flex-direction: column; gap: 6px; margin-left: auto;
    background: none; border: none; cursor: pointer; padding: 6px; z-index: 95;
  }
  .site-header__burger span {
    width: 30px; height: 2px; background: currentColor;
    transition: transform 0.4s var(--ease);
  }
  html.menu-open .site-header { color: var(--paper); background: transparent; border-color: transparent; }
  html.menu-open .site-header__burger span:first-child { transform: translateY(4px) rotate(45deg); }
  html.menu-open .site-header__burger span:last-child { transform: translateY(-4px) rotate(-45deg); }
}

/* ============ HERO ============ */
.hero {
  position: relative; min-height: 100vh;
  padding: calc(5rem + var(--pad)) var(--pad) 0;
  display: flex; flex-direction: column;
}
.hero__grid-lines, .contact__grid-lines {
  position: absolute; inset: 0; pointer-events: none;
  display: grid; grid-template-columns: repeat(4, 1fr);
}
.hero__grid-lines i, .contact__grid-lines i { border-left: 1px solid var(--line); }
.hero__kicker {
  display: flex; justify-content: space-between;
  font-size: 0.85rem; letter-spacing: 0.25em; color: var(--maya);
  padding-bottom: 1.5rem;
}
.hero__title {
  font-size: clamp(4.5rem, 17vw, 15.5rem);
  font-weight: 800; line-height: 0.86; letter-spacing: -0.01em;
  text-transform: uppercase;
}
.hero__title .line:nth-child(2) { text-indent: clamp(2rem, 12vw, 11rem); }
.hero__sub {
  display: flex; justify-content: space-between; align-items: flex-end;
  margin: 2.5rem 0;
}
.hero__statement { font-size: clamp(1.15rem, 2.2vw, 1.6rem); font-weight: 300; max-width: 34ch; }
.hero__scroll {
  display: flex; flex-direction: column; align-items: center; gap: 0.6rem;
  font-size: 0.8rem; letter-spacing: 0.35em; color: var(--grey);
}
.hero__scroll svg { animation: scrollNudge 2.2s var(--ease) infinite; }
@keyframes scrollNudge { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(8px); } }

.hero__image { position: relative; margin: 0 calc(-1 * var(--pad)); }
.hero__image-mask { overflow: hidden; clip-path: inset(0 0 100% 0); }
.hero__image-mask img {
  width: 100%; height: clamp(40vh, 72vh, 82vh); object-fit: cover;
  transform: scale(1.18);
}
.hero__caption {
  display: flex; justify-content: space-between;
  padding: 0.8rem var(--pad);
  font-size: 0.85rem; letter-spacing: 0.22em; color: var(--grey);
  border-bottom: 1px solid var(--line);
}

/* ============ MARQUEE ============ */
.marquee {
  overflow: hidden; border-bottom: 1px solid var(--line);
  padding: 1.1rem 0; white-space: nowrap;
}
.marquee__track { display: inline-flex; will-change: transform; animation: marquee 38s linear infinite; }
.marquee__track span {
  font-size: clamp(1.2rem, 2.6vw, 2rem); font-weight: 500;
  letter-spacing: 0.14em; color: var(--ink);
}
@keyframes marquee { to { transform: translateX(-50%); } }

/* ============ STATEMENT ============ */
.statement { padding: clamp(5rem, 12vw, 10rem) var(--pad); }
.statement__text {
  font-size: clamp(1.8rem, 4.6vw, 3.6rem);
  font-weight: 400; line-height: 1.18; max-width: 26ch;
  text-wrap: balance;
}
.statement__text .w { display: inline-block; opacity: 0.12; transition: opacity 0.4s; }
.statement__foot {
  display: flex; justify-content: space-between; margin-top: 4rem;
  font-size: 0.85rem; letter-spacing: 0.25em; color: var(--maya);
}

/* ============ WORK PILLARS ============ */
.work { border-top: 1px solid var(--line); }
.pillar { border-bottom: 1px solid var(--line); padding: clamp(3rem, 7vw, 6rem) 0 clamp(3.5rem, 7vw, 6rem); }
.pillar__head {
  display: grid; grid-template-columns: auto 1fr auto;
  gap: 2rem; align-items: end;
  padding: 0 var(--pad) 2.5rem;
}
.panel-num {
  font-size: 1rem; font-weight: 600; letter-spacing: 0.3em; color: var(--red);
}
.pillar__title {
  font-size: clamp(3rem, 8.5vw, 7.5rem);
  font-weight: 800; text-transform: uppercase; line-height: 0.9; letter-spacing: -0.01em;
}
.pillar__desc {
  max-width: 30ch; font-size: 1.1rem; font-weight: 300;
  color: var(--ink); justify-self: end; text-align: right;
}
.pillar__count { font-size: 0.9rem; letter-spacing: 0.2em; color: var(--grey); display: block; margin-top: 0.6rem; }

.strip {
  display: flex; gap: 2px;
  overflow-x: auto; scrollbar-width: none;
  cursor: grab; padding: 0 var(--pad);
}
.strip::-webkit-scrollbar { display: none; }
.strip.is-dragging { cursor: grabbing; }
.strip__item {
  flex: 0 0 auto; overflow: hidden; position: relative;
  height: clamp(280px, 44vh, 460px);
}
.strip__item img {
  height: 100%; width: auto;
  transition: transform 0.8s var(--ease), filter 0.8s var(--ease);
  will-change: transform;
}
.strip__item:hover img { transform: scale(1.06); }
.strip__item .strip__idx {
  position: absolute; bottom: 0.6rem; left: 0.7rem;
  font-size: 0.75rem; letter-spacing: 0.2em; color: #fff;
  mix-blend-mode: difference; pointer-events: none;
}

/* ============ COMMERCIAL (horizontal) ============ */
.commercial { background: var(--ink); color: var(--paper); }
.commercial__pin { overflow: hidden; }
.commercial__track {
  display: flex; height: 100vh; width: max-content; align-items: stretch;
}
.commercial__panel {
  flex: 0 0 auto; width: min(88vw, 1100px); height: 100%;
  padding: clamp(5rem, 9vh, 7rem) clamp(2rem, 4vw, 4rem) clamp(2rem, 5vh, 4rem);
  border-right: 1px solid rgba(244, 242, 238, 0.14);
  display: flex; flex-direction: column;
  position: relative;
}
.commercial__panel--intro { width: min(70vw, 760px); justify-content: center; gap: 2rem; }
.commercial__panel--intro h2 {
  font-size: clamp(3.5rem, 9vw, 8rem); font-weight: 800; line-height: 0.88; text-transform: uppercase;
}
.commercial__panel--intro p { max-width: 36ch; font-weight: 300; font-size: 1.2rem; color: rgba(244, 242, 238, 0.7); }
.commercial__drag { font-size: 0.85rem; letter-spacing: 0.3em; color: var(--maya-bright); }
.commercial .panel-num, .fineart .panel-num { color: var(--maya-bright); }
.commercial .accent, .fineart .accent { color: var(--maya-bright); }

.case__tag { font-size: 0.85rem; letter-spacing: 0.3em; color: var(--maya-bright); margin-bottom: 0.8rem; }
.case__client { font-size: clamp(2.2rem, 5vw, 4rem); font-weight: 700; text-transform: uppercase; line-height: 0.95; }
.case__brief { margin: 1rem 0 2rem; max-width: 44ch; font-weight: 300; font-size: 1.05rem; color: rgba(244, 242, 238, 0.65); }
.case__imgs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; flex: 1; min-height: 0; }
.case__imgs figure { overflow: hidden; position: relative; }
.case__imgs figure:first-child { grid-row: span 2; }
.case__imgs img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.8s var(--ease);
}
.case__imgs figure:hover img { transform: scale(1.07); }

/* ============ FILM ============ */
.film { padding: clamp(5rem, 11vw, 9rem) 0 0; border-bottom: 1px solid var(--line); }
.film__head { padding: 0 var(--pad); }
.film__title {
  font-size: clamp(3.5rem, 11vw, 10rem); font-weight: 800;
  text-transform: uppercase; line-height: 0.88; margin-top: 1rem;
}
.film__body {
  padding: 2.5rem var(--pad);
  display: flex; justify-content: space-between; align-items: flex-end; gap: 3rem; flex-wrap: wrap;
}
.film__body p { max-width: 44ch; font-size: 1.25rem; font-weight: 300; }
.btn {
  display: inline-flex; align-items: center; gap: 0.8rem;
  font-family: var(--font); font-size: 1rem; font-weight: 600;
  letter-spacing: 0.2em; text-transform: uppercase;
}
.btn--line { border-bottom: 2px solid var(--red); padding-bottom: 0.4rem; }
.btn__arrow { transition: transform 0.4s var(--ease); }
.btn--line:hover .btn__arrow { transform: translateX(8px); }
.film__strip { overflow: hidden; }
.film__frames { display: flex; gap: 4px; width: max-content; }
.film__frames img {
  height: clamp(160px, 24vh, 260px); width: auto;
  filter: grayscale(1) contrast(1.05);
  transition: filter 0.5s;
}
.film__frames img:hover { filter: grayscale(0); }

/* ============ FINE ART ============ */
.fineart { background: var(--ink); color: var(--paper); padding: clamp(5rem, 11vw, 9rem) var(--pad); }
.fineart__head { display: grid; grid-template-columns: auto 1fr; gap: 2rem; margin-bottom: 4rem; align-items: start; }
.fineart__title { font-size: clamp(3.5rem, 11vw, 10rem); font-weight: 800; text-transform: uppercase; line-height: 0.88; }
.fineart__intro {
  grid-column: 2; max-width: 40ch; justify-self: end; text-align: right;
  font-weight: 300; font-size: 1.15rem; color: rgba(244, 242, 238, 0.65);
}
.fineart__grid {
  columns: 3; column-gap: 6px;
}
.fineart__grid figure {
  break-inside: avoid; margin-bottom: 6px; overflow: hidden; position: relative;
}
.fineart__grid img {
  width: 100%; filter: grayscale(0.35);
  transition: filter 0.6s var(--ease), transform 0.9s var(--ease);
}
.fineart__grid figure:hover img { filter: grayscale(0); transform: scale(1.04); }
@media (max-width: 900px) { .fineart__grid { columns: 2; } }
@media (max-width: 560px) { .fineart__grid { columns: 1; } }

/* ============ ABOUT ============ */
.about { padding: clamp(5rem, 11vw, 9rem) var(--pad) 0; }
.about__head h2 { font-size: clamp(3.5rem, 11vw, 10rem); font-weight: 800; text-transform: uppercase; line-height: 0.88; }
.about__cols {
  display: grid; grid-template-columns: 1.4fr 1fr; gap: clamp(2rem, 6vw, 6rem);
  margin: 3.5rem 0 5rem;
}
.about__lede { font-size: clamp(1.6rem, 3.2vw, 2.6rem); line-height: 1.2; font-weight: 400; margin-bottom: 1.8rem; }
.about__bio p:not(.about__lede) { font-size: 1.2rem; font-weight: 300; max-width: 52ch; color: #3d3b37; }
.about__facts { border-top: 1px solid var(--line); }
.about__facts li {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 1rem 0; border-bottom: 1px solid var(--line);
}
.about__facts span { font-size: 0.85rem; letter-spacing: 0.25em; color: var(--grey); }
.about__facts strong { font-size: 1.25rem; font-weight: 600; }
@media (max-width: 800px) { .about__cols { grid-template-columns: 1fr; } }

/* services */
.services { border-top: 1px solid var(--ink); position: relative; z-index: 2; }
.services li {
  display: flex; align-items: center; gap: 2.5rem;
  padding: 1.6rem 0.5rem;
  border-bottom: 1px solid var(--line);
  cursor: default;
  transition: padding-left 0.45s var(--ease), background 0.45s;
}
.services li:hover { padding-left: 2rem; }
.services__idx { font-size: 0.9rem; letter-spacing: 0.2em; color: var(--red); }
.services h3 {
  font-size: clamp(1.8rem, 4.5vw, 3.4rem); font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.01em; flex: 1;
}
.services__arrow { font-size: 2rem; opacity: 0; transform: translateX(-14px); transition: 0.45s var(--ease); }
.services li:hover .services__arrow { opacity: 1; transform: none; }
.services__preview {
  position: fixed; z-index: 60; width: 300px; height: 380px;
  pointer-events: none; overflow: hidden;
  opacity: 0; transform: scale(0.9);
}
.services__preview img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; }
.services__preview img.is-active { opacity: 1; }

/* ============ CONTACT ============ */
.contact {
  position: relative; min-height: 100vh;
  display: flex; flex-direction: column; justify-content: center; align-items: flex-start;
  padding: 6rem var(--pad) 0;
  background: var(--red); color: var(--paper);
}
.contact__grid-lines i { border-color: rgba(244, 242, 238, 0.14); }
.contact__kicker { font-size: 0.9rem; letter-spacing: 0.3em; }
.contact__title {
  font-size: clamp(4rem, 14vw, 13rem); font-weight: 800;
  text-transform: uppercase; line-height: 0.88; margin: 1.5rem 0;
}
.contact__title .accent { color: var(--maya-bright); }
.contact__sub { font-size: 1.4rem; font-weight: 300; margin-bottom: 2.5rem; }
.btn--big {
  font-size: clamp(1.4rem, 3.4vw, 2.6rem); font-weight: 700; text-transform: none; letter-spacing: 0.02em;
  border: 2px solid var(--paper); padding: 1rem 2.6rem; border-radius: 99px;
  transition: background 0.4s var(--ease), color 0.4s var(--ease);
}
.btn--big:hover { background: var(--paper); color: var(--red); }
.footer {
  width: calc(100% + 2 * var(--pad)); margin: auto calc(-1 * var(--pad)) 0;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem;
  padding: 1.4rem var(--pad);
  border-top: 1px solid rgba(244, 242, 238, 0.3);
  font-size: 0.85rem; letter-spacing: 0.22em;
}

/* ============ LIGHTBOX ============ */
.lightbox {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(13, 13, 13, 0.96);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden;
  transition: opacity 0.45s var(--ease), visibility 0.45s;
}
.lightbox.is-open { opacity: 1; visibility: visible; }
.lightbox__stage { max-width: 88vw; max-height: 84vh; }
.lightbox__stage img { max-width: 88vw; max-height: 84vh; object-fit: contain; }
.lightbox__close, .lightbox__nav {
  position: absolute; background: none; border: none; color: var(--paper);
  font-family: var(--font); font-size: 1.6rem; cursor: pointer; z-index: 2;
  padding: 1rem;
}
.lightbox__close { top: 1rem; right: 1.4rem; }
.lightbox__nav--prev { left: 1rem; top: 50%; transform: translateY(-50%); }
.lightbox__nav--next { right: 1rem; top: 50%; transform: translateY(-50%); }
.lightbox__meta {
  position: absolute; bottom: 1.4rem; left: 0; right: 0;
  display: flex; justify-content: center; gap: 2.5rem;
  color: rgba(244, 242, 238, 0.6);
  font-size: 0.9rem; letter-spacing: 0.28em; text-transform: uppercase;
}

/* ============ REVEAL HELPERS ============ */
.reveal-img { clip-path: inset(0 0 100% 0); }
.reveal-img img { transform: scale(1.15); }

/* ============ REDUCED MOTION ============ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  .line > span { transform: none; }
  .hero__image-mask { clip-path: none; }
  .cursor { display: none; }
}

/* ============ SMALL SCREENS ============ */
@media (max-width: 700px) {
  .hero__kicker { flex-direction: column; gap: 0.3rem; }
  .hero__sub { flex-direction: column; align-items: flex-start; gap: 2rem; }
  .pillar__head { grid-template-columns: 1fr; gap: 1rem; }
  .pillar__desc { justify-self: start; text-align: left; }
  .case__imgs { grid-template-columns: repeat(2, 1fr); }
  .commercial__panel { width: 92vw; }
  .fineart__head { grid-template-columns: 1fr; }
  .fineart__intro { justify-self: start; text-align: left; }
  .footer { flex-direction: column; gap: 0.4rem; }
}
