/* ================= Mariano Crag Studio — Portfolio ================= */
:root {
  --bg: #111111;
  --fg: #ffffff;
  --muted: #888888;
  --line: rgba(255, 255, 255, 0.12);
  --accent: #E8FF59;       /* default lime accent — overridable via tweaks */
  --accent-ink: #0a0a0a;
  --panel: #0a0a0a;
  --ff-display: "Archivo", "Archivo Black", "Helvetica Neue", sans-serif;
  --ff-display-alt: "Anton", "Bebas Neue", "Impact", sans-serif;
  --ff-serif: "Instrument Serif", "Times New Roman", serif;
  --ff-body: "Space Grotesk", "Inter", system-ui, sans-serif;
  --ff-mono: "JetBrains Mono", "IBM Plex Mono", monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: var(--bg); color: var(--fg); font-family: var(--ff-body); -webkit-font-smoothing: antialiased; }
body { overflow-x: hidden; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; background: none; border: none; color: inherit; }

/* —— theme variants —— */
body[data-theme="light"] { --bg: #f4f1ea; --fg: #0a0a0a; --muted: #555; --line: rgba(0,0,0,0.12); --panel: #ebe6dc; --accent-ink: #0a0a0a; }
body[data-theme="mix"]   { --bg: #000; --fg: #fff; --muted: #888; }

/* =============== TOP NAV =============== */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 22px 32px;
  mix-blend-mode: difference;
  color: #fff;
  pointer-events: none;
}
.nav > * { pointer-events: auto; }
.nav__left, .nav__right { display: flex; gap: 28px; align-items: center; font-family: var(--ff-display); font-weight: 700; font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; }
.nav__right { justify-content: flex-end; }
.nav__brand { font-family: var(--ff-display); font-weight: 900; font-size: 16px; letter-spacing: -0.01em; text-align: center; }
.nav__brand b { font-style: italic; font-family: var(--ff-serif); font-weight: 400; font-size: 18px; }
.nav__link { opacity: 0.9; transition: opacity 0.15s; cursor: pointer; }
.nav__link:hover { opacity: 0.5; }
.nav__lang { display: inline-flex; gap: 8px; }
.nav__lang button { font: inherit; opacity: 0.4; }
.nav__lang button[aria-current="true"] { opacity: 1; }

.nav__drop {
  position: fixed; top: 54px; left: 32px; z-index: 48;
  display: flex; flex-direction: column; gap: 2px;
  background: #1a1a1a;
  border: 1px solid rgba(255,255,255,0.08);
  padding: 10px 0;
  border-radius: 4px;
  min-width: 160px;
}
.nav__drop__item {
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.6);
  padding: 8px 20px;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}
.nav__drop__item:hover { color: #fff; background: rgba(255,255,255,0.05); }

@media (max-width: 720px) {
  .nav__drop { left: 16px; }
  .nav { padding: 14px 16px; grid-template-columns: auto 1fr auto; gap: 12px; }
  .nav__left { gap: 14px; font-size: 10px; }
  .nav__right { gap: 14px; font-size: 10px; }
  .nav__brand { font-size: 13px; }
  .nav__brand b { font-size: 15px; }
  .nav__hide-mobile { display: none; }
}

/* =============== HERO STATIC (block 1) =============== */
.hero-static {
  position: relative;
  height: 100vh;
  overflow: hidden;
  background: var(--bg);
}

.hero__sticky {
  position: sticky; top: 0;
  height: 100vh; width: 100%;
  overflow: hidden;
  background: var(--bg);
}
.hero__sticky::after {
  content: "";
  position: absolute; bottom: 0; left: 0; right: 0;
  height: 28vh;
  background: linear-gradient(to bottom, transparent, #111111);
  z-index: 10;
  pointer-events: none;
}
.ambient-light {
  position: fixed;
  width: 70vw; height: 70vw;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 0;
  will-change: top, left, background;
}
.page-content {
  position: relative;
  z-index: 1;
}

.hero__bg {
  position: absolute; inset: 0;
  z-index: 0;
  background: #111111;
  overflow: hidden;
}
.hero__bg::before {
  content: "";
  position: absolute; inset: 0;
  opacity: 0.09;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
  pointer-events: none;
}
.hero__bg::after {
  content: "";
  position: absolute;
  width: 75vw;
  height: 75vw;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(160, 60, 255, 0.28) 0%, rgba(110, 30, 210, 0.10) 40%, transparent 68%);
  animation: lightMove 22s ease-in-out infinite;
  top: -15%;
  left: -15%;
}
@keyframes lightMove {
  0%   { transform: translate(0%,   0%); }
  25%  { transform: translate(65%,  25%); }
  50%  { transform: translate(45%,  75%); }
  75%  { transform: translate(-5%,  50%); }
  100% { transform: translate(0%,   0%); }
}

.hero__text {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  text-align: center;
  padding: 0 24px;
  z-index: 2;
  pointer-events: none;
}
.hero__text h1 {
  font-family: var(--ff-display);
  font-weight: 900;
  font-size: clamp(20px, 3.5vw, 56px);
  line-height: 0.94;
  letter-spacing: -0.035em;
  max-width: 16ch;
  text-wrap: balance;
}
.hero__text h1 em {
  font-style: italic;
  font-family: var(--ff-serif);
  font-weight: 400;
  letter-spacing: -0.02em;
}
.hero__caption {
  position: absolute;
  left: 50%; transform: translateX(-50%);
  bottom: 14vh;
  font-family: var(--ff-display);
  font-size: 11px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--fg);
  opacity: 0.65;
  z-index: 3;
}
.hero__scroll {
  position: absolute; left: 50%; transform: translateX(-50%);
  bottom: 28px;
  font-family: var(--ff-mono); font-size: 10px; letter-spacing: 0.25em; text-transform: uppercase;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  z-index: 4;
  opacity: 0.6;
}
.hero__scroll::after { content: ""; width: 1px; height: 28px; background: currentColor; animation: scrollLine 1.6s ease-in-out infinite; }
@keyframes scrollLine { 0%, 100% { transform: scaleY(0.3); transform-origin: top; } 50% { transform: scaleY(1); } }

/* The growing image stack */
.hero__stage {
  position: absolute; inset: 0;
  z-index: 1;
  pointer-events: none;
}
.hero__tile {
  position: absolute;
  background-size: cover;
  background-position: center;
  will-change: transform, opacity;
  border-radius: 2px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.45);
}

/* Final reveal grid (stage 4) — proper masonry-ish */
.hero__grid {
  position: absolute; inset: 0;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-auto-rows: minmax(110px, 1fr);
  gap: 8px;
  padding: 8px;
  opacity: 0;
  pointer-events: none;
  z-index: 0;
}
.hero__grid .gtile {
  background-size: cover; background-position: center;
  border-radius: 2px;
}
.hero__grid .span-2c { grid-column: span 2; }
.hero__grid .span-2r { grid-row: span 2; }

@media (max-width: 720px) {
  .hero { height: 380vh; }
  .hero__grid { grid-template-columns: repeat(3, 1fr); }
  .hero__caption { bottom: 18vh; font-size: 10px; }
  .hero__text h1 { font-size: clamp(29px, 5vw, 56px); }
}

/* =============== SECTION BASE =============== */
.section { padding: 140px 32px; position: relative; border-top: none; }
.section--tight { padding: 80px 32px; }
.section__eyebrow {
  font-family: var(--ff-mono);
  font-size: 11px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 32px;
  display: flex; align-items: center; gap: 16px;
}
.section__eyebrow::before { content: ""; width: 24px; height: 1px; background: currentColor; }
.section__title {
  font-family: var(--ff-display);
  font-weight: 900;
  font-size: clamp(36px, 4.2vw, 62px);
  line-height: 0.92;
  letter-spacing: -0.035em;
  text-wrap: balance;
  max-width: 18ch;
}
.section__title em { font-style: italic; font-family: var(--ff-serif); font-weight: 400; color: var(--accent); }

@media (max-width: 720px) {
  .section { padding: 80px 18px; }
  .section--tight { padding: 50px 18px; }
}

/* =============== ABOUT =============== */
.about { display: grid; grid-template-columns: 1.1fr 1fr; gap: 80px; align-items: start; position: relative; z-index: 1; }

#about { overflow: hidden; }
#about::before {
  content: "";
  position: absolute;
  width: 55vw; height: 55vw;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(232, 180, 40, 0.16) 0%, rgba(200, 120, 20, 0.06) 45%, transparent 68%);
  top: -5%; right: -10%;
  z-index: 0;
  pointer-events: none;
  animation: aboutLight 28s ease-in-out infinite;
}
#about::after {
  content: "";
  position: absolute; inset: 0;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
  pointer-events: none;
  z-index: 0;
}
@keyframes aboutLight {
  0%   { transform: translate(0%,    0%); }
  25%  { transform: translate(-20%,  55%); }
  50%  { transform: translate(-45%,  30%); }
  75%  { transform: translate(-10%,  80%); }
  100% { transform: translate(0%,    0%); }
}
.about__lead {
  font-family: var(--ff-display);
  font-weight: 900;
  font-size: clamp(32px, 4.2vw, 62px);
  line-height: 1.0;
  letter-spacing: -0.025em;
  text-wrap: balance;
  margin-top: 0;
}
.about__lead em { font-style: italic; font-family: var(--ff-serif); font-weight: 400; color: var(--accent); }
.about__avatar { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; object-position: center top; margin-bottom: 24px; display: block; }
.about__body p { font-size: 18px; line-height: 1.5; color: var(--muted); margin-bottom: 20px; max-width: 48ch; }
.about__body p strong { color: var(--fg); font-weight: 500; }
.about__meta { margin-top: 32px; display: grid; grid-template-columns: 1fr 1fr; gap: 18px; font-family: var(--ff-mono); font-size: 12px; letter-spacing: 0.05em; }
.about__meta div { padding: 14px 0; border-top: 1px solid var(--line); }
.about__meta div span { display: block; color: var(--muted); font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; margin-bottom: 6px; }

@media (max-width: 820px) {
  .about { grid-template-columns: 1fr; gap: 40px; }
}

/* =============== SERVICES =============== */
.services { border-top: none; }
.services__row {
  display: grid;
  grid-template-columns: 80px 1.2fr 1fr 1.5fr;
  gap: 32px;
  align-items: center;
  padding: 36px 0;
  border-bottom: 1px solid var(--line);
  position: relative;
  transition: padding 0.3s ease;
}
.services__row:hover { padding: 56px 0; }
.services__row:hover .services__title { color: var(--accent); }
.services__row:hover .services__preview { opacity: 1; }
.services__num { font-family: var(--ff-mono); font-size: 12px; color: var(--muted); letter-spacing: 0.1em; }
.services__title {
  font-family: var(--ff-display);
  font-weight: 900;
  font-size: clamp(28px, 3.5vw, 48px);
  line-height: 1.0;
  letter-spacing: -0.025em;
  transition: color 0.25s;
}
.services__cat { font-family: var(--ff-mono); font-size: 11px; letter-spacing: 0.15em; text-transform: uppercase; color: var(--muted); }
.services__desc { color: var(--muted); font-size: 15px; line-height: 1.5; max-width: 36ch; }
.services__preview {
  width: 100px; height: 80px; border-radius: 2px;
  opacity: 0.0; transition: opacity 0.25s;
  background-size: cover; background-position: center;
  justify-self: end;
}

@media (max-width: 820px) {
  .services__row { grid-template-columns: 40px 1fr; gap: 14px; padding: 24px 0; align-items: start; }
  .services__row:hover { padding: 24px 0; }
  .services__title { font-size: 28px; grid-column: 2; }
  .services__cat { grid-column: 2; }
  .services__desc { grid-column: 2; }
  .services__preview { display: none; }
  .services__num { grid-row: 1 / 4; }
}

/* =============== PORTFOLIO GRID =============== */
.portfolio { border-top: none; padding-top: 60px; }
.portfolio__head { display: flex; justify-content: space-between; align-items: end; margin-bottom: 56px; gap: 32px; flex-wrap: wrap; }
.portfolio__filters { display: flex; gap: 6px; flex-wrap: wrap; }
.portfolio__filter {
  font-family: var(--ff-mono); font-size: 11px;
  letter-spacing: 0.12em; text-transform: uppercase;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 100px;
  color: var(--muted);
  transition: all 0.18s;
}
.portfolio__filter[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.portfolio__filter:hover { color: var(--fg); }
.portfolio__filter[aria-pressed="true"]:hover { color: var(--accent-ink); }

.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
.proj {
  position: relative;
  overflow: hidden;
  background: #111;
  border-radius: 2px;
  cursor: pointer;
  aspect-ratio: 4/3;
}
.proj__media {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  transition: transform 0.6s cubic-bezier(.2,.7,.2,1), filter 0.4s;
}
.proj:hover .proj__media { transform: scale(1.04); filter: brightness(0.6); }
.proj__meta {
  position: absolute; left: 18px; right: 18px; bottom: 18px;
  display: flex; justify-content: space-between; align-items: end;
  gap: 12px;
  opacity: 0; transform: translateY(8px);
  transition: opacity 0.25s, transform 0.25s;
  color: #fff;
}
.proj:hover .proj__meta { opacity: 1; transform: translateY(0); }
.proj__name { font-family: var(--ff-display); font-weight: 900; font-size: 22px; letter-spacing: -0.02em; }
.proj__cat { font-family: var(--ff-mono); font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; opacity: 0.7; }
.proj__num { font-family: var(--ff-mono); font-size: 10px; letter-spacing: 0.2em; opacity: 0.6; }

@media (max-width: 820px) {
  .grid { grid-template-columns: repeat(2, 1fr); gap: 6px; }
  .proj__name { font-size: 16px; }
}

/* =============== BRANDS MARQUEE =============== */
.brands { border-top: none; padding: 80px 0; overflow: hidden; }
.brands__title {
  text-align: center;
  font-family: var(--ff-serif);
  font-style: italic;
  font-size: clamp(40px, 4.2vw, 62px);
  line-height: 1;
  letter-spacing: -0.02em;
  margin-bottom: 56px;
  padding: 0 32px;
}
.brands__title em {
  font-family: var(--ff-display);
  font-style: normal;
  font-weight: 900;
  letter-spacing: -0.04em;
  color: var(--accent);
}
.marquee { display: flex; gap: 32px; white-space: nowrap; animation: marqueeMove 35s linear infinite; }
.marquee__item {
  flex-shrink: 0;
  display: inline-flex; align-items: center; gap: 32px;
}
.marquee__item img { height: 160px; width: auto; object-fit: contain; display: block; }
@keyframes marqueeMove { to { transform: translateX(-50%); } }

@media (max-width: 720px) {
  .marquee { animation-duration: 10s; }
}

/* =============== PHOTO GALLERY =============== */
.gallery { border-top: none; }
.gallery__grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
.gallery__tile { aspect-ratio: 4/3; background-size: cover; background-position: center; }

@media (max-width: 720px) {
  .gallery__grid { grid-template-columns: repeat(2, 1fr); }
}

.gallery__cta {
  margin-top: 48px;
  display: flex;
  justify-content: center;
}
.gallery__cta-link {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--ff-mono); font-size: 11px;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  padding-bottom: 4px;
  transition: color 0.2s, border-color 0.2s;
}
.gallery__cta-link:hover { color: var(--fg); border-color: var(--fg); }
.gallery__cta-link svg { width: 14px; height: 14px; }

/* =============== CONTACT =============== */
.contact { border-top: none; padding: 140px 32px 0; }
.contact__head {
  font-family: var(--ff-display);
  font-weight: 900;
  font-size: clamp(36px, 4.2vw, 62px);
  line-height: 0.88;
  letter-spacing: -0.04em;
  text-wrap: balance;
  margin-bottom: 60px;
}
.contact__head em { font-style: italic; font-family: var(--ff-serif); font-weight: 400; color: var(--accent); }
.contact__form { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 28px; max-width: 920px; }
.contact__row { display: flex; flex-direction: column; gap: 8px; }
.contact__row.full { grid-column: 1 / -1; }
.contact__row label { font-family: var(--ff-mono); font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); }
.contact__row input, .contact__row textarea, .contact__row select {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--line);
  color: var(--fg);
  font: 400 22px/1.4 var(--ff-display);
  letter-spacing: -0.01em;
  padding: 12px 0;
  outline: none;
  transition: border-color 0.2s;
}
.contact__row select option { background: #111; color: #fff; }
.contact__row textarea { resize: vertical; min-height: 100px; font-family: var(--ff-body); font-size: 16px; line-height: 1.5; }
.contact__row input:focus, .contact__row textarea:focus, .contact__row select:focus { border-bottom-color: var(--accent); }
.contact__submit {
  grid-column: 1 / -1;
  justify-self: start;
  margin-top: 24px;
  font-family: var(--ff-display); font-weight: 900;
  font-size: 22px; letter-spacing: -0.01em;
  padding: 22px 40px;
  background: var(--accent); color: var(--accent-ink);
  border-radius: 100px;
  display: inline-flex; align-items: center; gap: 14px;
  transition: transform 0.18s, background 0.2s;
}
.contact__submit:hover { transform: translate(2px, -2px); }
.contact__submit svg { width: 18px; height: 18px; }

.contact__quick {
  margin-top: 80px;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px;
  border-top: none; padding-top: 32px;
}
.contact__quick > div span { display: block; font-family: var(--ff-mono); font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.contact__quick > div a, .contact__quick > div p { font-family: var(--ff-display); font-weight: 700; font-size: 18px; letter-spacing: -0.01em; }
.contact__quick > div a:hover { color: var(--accent); }

@media (max-width: 720px) {
  .contact { padding: 60px 18px; }
  .contact__form { grid-template-columns: 1fr; }
  .contact__quick { grid-template-columns: 1fr 1fr; gap: 18px; }
}

/* =============== FOOTER =============== */
.footer { padding: 32px 32px 32px; }
.footer__big {
  font-family: var(--ff-display);
  font-weight: 900;
  font-size: clamp(36px, 5.5vw, 88px);
  line-height: 0.82;
  letter-spacing: -0.05em;
  text-wrap: balance;
  margin-bottom: 48px;
}
.footer__big em { font-style: italic; font-family: var(--ff-serif); font-weight: 400; color: var(--accent); }
.footer__row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; font-family: var(--ff-mono); font-size: 11px; letter-spacing: 0.1em; }
.footer__row span { display: block; color: var(--muted); font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; margin-bottom: 6px; }
.footer__socials { display: flex; gap: 20px; }
.footer__socials a:hover { color: var(--accent); }

@media (max-width: 720px) {
  .footer { padding: 32px 18px 24px; }
  .footer__row { grid-template-columns: 1fr 1fr; gap: 18px; }
}

/* =============== UTILITY =============== */
.no-select { user-select: none; }
.tagline-pill {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--ff-mono); font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase;
  padding: 8px 14px; border: 1px solid var(--line); border-radius: 100px;
  color: var(--muted);
}
.tagline-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); display: inline-block; }

/* Light theme adjustments */
body[data-theme="light"] .nav { mix-blend-mode: difference; }
body[data-theme="light"] .hero__sticky { background: var(--bg); }
body[data-theme="light"] .proj { background: #ddd6c6; }
body[data-theme="light"] .contact__row select option { background: #fff; color: #000; }
