/* =========================================================
   THIDIAS.COM — estilo base
   Layout: tudo escala a partir de um canvas de 1920px (como no
   ReadyMag). 1vw = 19.2px no desktop grande. Coluna esquerda fixa
   em ~8vw; tiles de projeto em largura total, proporção 1920x937.
   ========================================================= */

@font-face { font-family: "Gotham Ultra"; src: url("../fonts/gotham-ultra.woff") format("woff"); font-weight: 800; font-display: swap; }
@font-face { font-family: "Bergen Mono"; src: url("../fonts/bergen-mono-regular.woff") format("woff"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Bergen Mono"; src: url("../fonts/bergen-mono-semibold.woff") format("woff"); font-weight: 600 700; font-display: swap; }

:root {
  /* cor */
  --paper: #f8f8f8;      /* fundo */
  --ink: #1c1c1c;        /* texto principal */
  --ink-soft: #3d3d3d;   /* texto secundário */
  --white: #ffffff;
  --chip: rgba(20, 20, 20, .88);
  --gold: #d4b25a;
  --silver: #c3c6cb;
  --bronze: #b5784a;

  /* tipo */
  --display: "Gotham Ultra", "Arial Black", "Helvetica Neue", Arial, sans-serif;
  --mono: "Bergen Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  /* escala (16px e 24px no canvas de 1920) */
  --fs-body: max(10px, .833vw);
  --fs-title: max(13px, 1.25vw);
  --fs-marquee: max(16px, 2vw);
  --fs-small: max(8px, .52vw);

  /* grid */
  --gutter: max(16px, 7.9vw);
  --col: max(220px, 14vw);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--mono);
  font-size: var(--fs-body);
  line-height: 1.45;
  letter-spacing: .02em;
  text-transform: uppercase;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: .2em; }
:focus-visible { outline: 1px solid currentColor; outline-offset: 3px; }
::selection { background: #a2a2a2; }

/* ---------- marquee ---------- */
.marquee {
  overflow: hidden;
  white-space: nowrap;
  font-family: var(--display);
  font-size: var(--fs-marquee);
  line-height: 1;
  padding-block: .35em .25em;
  letter-spacing: .01em;
}
.marquee__track { display: inline-flex; animation: marquee 60s linear infinite; }
.marquee__track span { padding-right: .3em; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- intro (primeira dobra) ---------- */
.intro {
  min-height: calc(100svh - var(--fs-marquee) * 1.6);
  padding: max(24px, 4vw) var(--gutter) max(24px, 3vw);
  display: flex;
  flex-direction: column;
  gap: max(14px, 1.6vw);
}
.intro nav { margin-bottom: max(24px, 3.4vw); }
.intro__bio { margin-top: .2em; }
.agencies { margin-top: max(10px, 1.6vw) !important; }
.nav { display: flex; flex-direction: column; gap: .15em; list-style: none; margin: 0; padding: 0; }
.intro__photo { width: max(64px, 5.25vw); aspect-ratio: 101 / 112; object-fit: cover; }
.intro__bio { max-width: var(--col); margin: 0; }
.agencies { list-style: none; margin: 0; padding: 0; }
.agencies li { text-decoration: line-through; text-decoration-thickness: 1px; }
.agencies li:last-child { text-decoration: none; }
.intro__foot { margin-top: auto; display: flex; align-items: flex-end; gap: max(28px, 3vw); }
.intro__foot sup { font-size: .8em; }
.arrow { font-size: 2em; line-height: 1; display: inline-block; animation: nudge 2.4s ease-in-out infinite; }
@keyframes nudge { 50% { transform: translateY(.25em); } }

/* ---------- tiles de projeto ---------- */
.work { display: flex; flex-direction: column; }
.tile {
  position: relative;
  aspect-ratio: 1920 / 1124; /* +20% sobre 1920x937 */
 
  max-width: 100%;
  overflow: hidden;
  background: #111;
  color: var(--white);
}
.tile__media { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: var(--focus, 50% 50%); transition: transform 1.2s cubic-bezier(.2,.7,.2,1); }
.tile__link { position: absolute; inset: 0; z-index: 1; }
.tile__link:hover { text-decoration: none; }
.tile:hover .tile__media { transform: scale(1.03); }
.tile::after { /* leve gradiente só onde fica o texto */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to top, rgba(0,0,0,.45), rgba(0,0,0,0) 45%);
}
.tile--light { color: var(--ink); }
.tile--light::after { display: none; }

.caption {
  position: absolute; z-index: 2; pointer-events: none;
  left: var(--gutter); bottom: max(20px, 5vw);
  width: var(--col);
  display: flex; flex-direction: column; gap: .9em;
}
.caption h3 { margin: 0; font-family: var(--display); font-weight: 800; font-size: var(--fs-title); line-height: 1.05; letter-spacing: .03em; }
.caption h3 span { display: block; }
.caption p { margin: 0; }

/* ---------- ícones de prêmio + hover ---------- */
.awards {
  position: absolute; z-index: 3;
  left: var(--gutter); top: max(16px, 3.6vw);
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; align-items: center; gap: max(8px, 1.1vw);
  width: max(34px, 3.6vw);
  transform: translateX(-12%);
}
.award { position: relative; display: flex; flex-direction: column; align-items: center; }
.award button {
  all: unset; cursor: default; display: flex; flex-direction: column; align-items: center; gap: .25em;
}
.award img { width: max(22px, 2.7vw); height: max(20px, 2.3vw); object-fit: contain; }
.award .sl { font-size: var(--fs-small); letter-spacing: .06em; }
.award button:focus-visible { outline: 1px solid var(--white); outline-offset: 4px; }

.tip {
  position: absolute; left: calc(100% + max(10px, 1vw)); top: 50%;
  transform: translate(-6px, -50%);
  opacity: 0; visibility: hidden;
  transition: opacity .2s, transform .2s, visibility 0s .2s;
  background: var(--chip); color: var(--white);
  padding: .8em 1em; white-space: nowrap;
  display: flex; flex-direction: column; gap: .45em;
  backdrop-filter: blur(6px);
}
.award:hover .tip, .award button:focus-visible + .tip, .award.is-open .tip {
  opacity: 1; visibility: visible; transform: translate(0, -50%); transition: opacity .2s, transform .2s;
}
.tip strong { font-family: var(--display); font-weight: 800; letter-spacing: .04em; }
.tip ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 1.1em; }
.tip li { display: flex; align-items: center; gap: .4em; }
.dot { width: .75em; height: .75em; border-radius: 50%; flex: none; }
.dot--gold { background: var(--gold); }
.dot--silver { background: var(--silver); }
.dot--bronze { background: var(--bronze); }
.dot--sl { border: 1px solid currentColor; }
.dot--gp { background: var(--white); box-shadow: 0 0 0 2px var(--gold); }

/* ---------- about ---------- */
.about, .awards-list, .contact, .end { padding-inline: var(--gutter); }
.about { padding-block: max(200px, 28vw) max(32px, 4vw); display: flex; flex-direction: column; gap: 1.3em; }
.about h2, .awards-list h2 { margin: 0; font-family: var(--display); font-weight: 800; font-size: var(--fs-title); letter-spacing: .03em; }
.about .tagline { font-weight: 600; }
.about p { margin: 0; max-width: max(300px, 41vw); }

/* ---------- prêmios (muro de texto) ---------- */
.awards-list { padding-block: max(32px, 4vw); }
.awards-list h2 { margin-bottom: 1.2em; }
.awards-list h4 { margin: 1.6em 0 .25em; font-family: var(--display); font-weight: 800; font-size: var(--fs-body); letter-spacing: .04em; }
.awards-list ul { list-style: none; margin: 0; padding: 0; color: var(--ink-soft); }
.awards-list b { color: var(--ink); font-weight: 600; }

/* ---------- contato + fim ---------- */
.contact { padding-block: max(40px, 5vw) 0; }
.contact ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .5em; }
.contact li { display: flex; align-items: center; gap: .8em; }
.contact svg { width: 1.3em; height: 1.3em; flex: none; }
.end { padding-block: max(48px, 6vw) max(32px, 3vw); display: flex; align-items: flex-end; gap: max(28px, 3vw); }

/* ---------- telas pequenas ---------- */
@media (max-width: 700px) {
  .tile { aspect-ratio: 4 / 5; }
  .caption { width: auto; right: var(--gutter); }
  .tip { white-space: normal; width: max-content; max-width: 62vw; }
}

@media (prefers-reduced-motion: reduce) {
  .marquee__track, .arrow { animation: none; }
  .tile__media { transition: none; }
  html { scroll-behavior: auto; }
}

/* ---------- easter eggs (desktop) ---------- */
.intro { position: relative; }
.intro__foot { position: relative; z-index: 2; }
.stamp { display: flex; flex-direction: column; gap: .2em; }
.reset {
  all: unset; cursor: pointer; font: inherit; letter-spacing: inherit; text-transform: uppercase;
  color: var(--ink-soft);
}
.reset:hover { text-decoration: underline; text-underline-offset: .2em; color: var(--ink); }
.reset:focus-visible { outline: 1px solid currentColor; outline-offset: 3px; }

[data-drag] { position: relative; z-index: 2; }
nav[data-drag], p[data-drag], ul[data-drag] { width: fit-content; }
@media (pointer: fine) and (min-width: 701px) {
  [data-drag] { cursor: grab; user-select: none; -webkit-user-select: none; }
  [data-drag].is-dragging { cursor: grabbing; z-index: 4; }
  [data-drag].is-dragging, .is-resetting { transition: transform .5s cubic-bezier(.2,.7,.2,1); }
  [data-drag].is-dragging { transition: transform .08s linear; }
}

.grid-overlay {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  display: grid; grid-template-columns: repeat(12, 1fr); column-gap: max(8px, 1vw);
  padding-inline: var(--gutter);
  background: repeating-linear-gradient(to bottom, transparent 0 calc(var(--fs-body) * 1.45 - 1px), rgba(28,28,28,.07) calc(var(--fs-body) * 1.45 - 1px) calc(var(--fs-body) * 1.45));
  opacity: 0; transition: opacity .25s;
}
.grid-overlay span { background: rgba(255, 60, 60, .06); border-inline: 1px solid rgba(255, 60, 60, .18); }
.intro.is-arranging .grid-overlay { opacity: 1; }

.marquee { position: relative; }
.marquee.is-physical .marquee__track { visibility: hidden; animation-play-state: paused; }
.marquee-canvas { position: absolute; top: 0; left: 0; z-index: 6; pointer-events: none; }

/* =========================================================
   PÁGINAS DE CASE
   Coluna central de 2/3 da tela (1280px no canvas de 1920).
   Blocos de mídia encostados, como no ReadyMag.
   ========================================================= */
.case-page { --case-w: min(66.67vw, 1280px); }
.case-wrap { width: var(--case-w); margin-inline: auto; }
.case-head { padding-block: max(44px, 4.5vw) max(40px, 5vw); display: flex; flex-direction: column; gap: max(28px, 4.5vw); }
.back { align-self: flex-start; }
.case-intro { margin: 0; font-size: max(12px, 1.05vw); line-height: 1.5; }
.case-role { margin: 0; color: var(--ink-soft); }

.case { display: flex; flex-direction: column; gap: max(2px, .2vw); padding-bottom: max(48px, 6vw); }
.case-label {
  display: flex; align-items: center; gap: 1em;
  margin-top: max(24px, 3vw); margin-bottom: max(6px, .5vw);
  font-size: max(9px, .68vw); letter-spacing: .08em;
}
.case-label::after { content: ""; flex: 1; height: 1px; background: currentColor; opacity: .5; }
.case-label:first-child { margin-top: 0; }

.row { display: grid; gap: max(2px, .2vw); grid-template-columns: var(--cols, 1fr); }
.row > figure { margin: 0; min-width: 0; display: flex; flex-direction: column; gap: .5em; }
.row img, .row video { width: 100%; height: 100%; object-fit: cover; background: #e9e9e9; }
.row--fit img, .row--fit video { height: auto; }
.row figcaption { font-size: max(9px, .68vw); letter-spacing: .08em; display: flex; align-items: center; gap: 1em; order: -1; }
.row figcaption::after { content: ""; flex: 1; height: 1px; background: currentColor; opacity: .5; }

.film { position: relative; background: #000; }
.film video { width: 100%; aspect-ratio: 16 / 9; height: auto; object-fit: contain; display: block; }

.case-next {
  border-top: 1px solid rgba(28,28,28,.25);
  padding-block: max(28px, 3vw) max(40px, 5vw);
  display: flex; justify-content: space-between; align-items: flex-end; gap: 2em; flex-wrap: wrap;
}
.case-next a.next { display: flex; flex-direction: column; gap: .4em; }
.case-next a.next strong { font-family: var(--display); font-weight: 800; font-size: var(--fs-title); letter-spacing: .03em; line-height: 1.05; }
.case-next a.next:hover { text-decoration: none; }
.case-next a.next:hover strong { text-decoration: underline; text-underline-offset: .15em; }

@media (max-width: 700px) {
  .case-page { --case-w: calc(100vw - 32px); }
  .row.stack-mobile { grid-template-columns: 1fr; }
}
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* vídeos 9:16 e mosaico do case Xuxa */
.row.r916 figure { aspect-ratio: 9 / 16; }
.has-sound { position: relative; cursor: pointer; }
.snd {
  all: unset; position: absolute; right: .8em; bottom: .8em; z-index: 2; cursor: pointer;
  font-size: max(9px, .62vw); letter-spacing: .08em; text-transform: uppercase;
  color: #fff; background: rgba(0,0,0,.55); padding: .45em .7em;
}
.snd:focus-visible { outline: 1px solid #fff; outline-offset: 2px; }
.pending { margin: 0; background: repeating-linear-gradient(45deg, #ececec 0 10px, #e4e4e4 10px 20px); display: grid; place-items: center; min-height: 100%; }
.pending span { font-size: max(9px, .68vw); letter-spacing: .08em; color: var(--ink-soft); }
.mosaic {
  display: grid; gap: max(2px, .2vw);
  grid-template-columns: 1.45fr .73fr 1fr 1.8fr;
  grid-template-rows: 1fr .55fr .78fr;
  grid-template-areas: "a b d e" "a c d e" "a c f f";
  aspect-ratio: 526 / 272;
}
.mosaic > div { min-width: 0; min-height: 0; }
.mosaic figure { margin: 0; height: 100%; }
.mosaic video, .mosaic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.m-a { grid-area: a; } .m-b { grid-area: b; } .m-c { grid-area: c; } .m-d { grid-area: d; } .m-e { grid-area: e; } .m-f { grid-area: f; }
@media (max-width: 700px) {
  .mosaic { aspect-ratio: auto; grid-template-columns: 1fr 1fr; grid-template-rows: auto; grid-template-areas: "a b" "a c" "d e" "f f"; }
  .m-b, .m-c, .m-d, .m-e { aspect-ratio: 1; } .m-f { aspect-ratio: 3/1; }
  .row.r916 { grid-template-columns: 1fr 1fr 1fr; }
}

/* espaçamentos entre capítulos */
.case-label { margin-top: max(48px, 6.5vw); margin-bottom: max(10px, .8vw); }
.case-gap { height: max(40px, 5vw); }
.row.eqh figure { height: 100%; }
@media (max-width: 700px) {
  .row.eqh { aspect-ratio: auto !important; grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .row.eqh figure { height: auto; }
  .row.eqh figure:nth-child(1) { aspect-ratio: 9/16; } .row.eqh figure:nth-child(2), .row.eqh figure:nth-child(3) { aspect-ratio: 4/5; } .row.eqh figure:nth-child(4) { aspect-ratio: 1.1; }
  .row.r916:has(> figure:nth-child(4)) { grid-template-columns: 1fr 1fr; }
}

/* legendas dos filmes: branco, padrão */
.film video::cue {
  color: #fff; background: transparent;
  font-family: "Helvetica Neue", Arial, sans-serif; font-size: 1.05em; line-height: 1.3;
  text-shadow: 0 0 4px rgba(0,0,0,.9), 0 1px 2px rgba(0,0,0,.9);
}
.row.press img { background: transparent; padding-block: max(8px, 1vw); }

/* =========================================================
   CASES ANTIGOS: diagramação original do ReadyMag
   ========================================================= */
.rm { position: relative; aspect-ratio: var(--ar); margin-bottom: max(48px, 6vw); }
.rm > * { position: absolute; left: var(--x); top: var(--y); width: var(--w); height: var(--h); margin: 0; }
.rm-m { overflow: hidden; background: #e9e9e9; }
.rm-m img, .rm-m video { width: 100%; height: 100%; object-fit: cover; display: block; }
.rm-film { background: #000; }
.rm-film video { object-fit: contain; }
.rm-t { font-size: max(9px, .68vw); letter-spacing: .08em; white-space: nowrap; line-height: 1; display: flex; align-items: center; height: auto !important; }
.rm-t--inv { color: #f8f8f8; }
.rm-line::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: currentColor; opacity: .5; }
.rm-line--v { width: 1px; }
.rm-line--v::before { left: 0; right: auto; top: 0; width: 1px; height: 100%; background: var(--c); opacity: 1; }
.rm-dot { border-radius: 50%; background: #f8f8f8; will-change: transform; }
.rm-rect { background: var(--c); left: 50% !important; width: 100vw !important; transform: translateX(-50%); z-index: 0; }
.rm > :not(.rm-rect) { z-index: 1; }
.rm-film video { width: 100%; height: 100%; }
@media (max-width: 700px) {
  .rm { aspect-ratio: var(--mar); }
  .rm > * { left: var(--mx); top: var(--my); width: var(--mw); height: var(--mh); }
  .rm > .d-only { display: none; }
}
.rm > .pending { min-height: 0; }
@media (max-width: 700px) { .rm > .rm-t--inv, .rm > .rm-dot, .rm > .rm-line--v { display: none; } }

/* Before/After por cursor */
.rm-ba { --p: 50%; cursor: ew-resize; touch-action: pan-y; user-select: none; }
.rm-ba > img, .rm-ba__before img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.rm-ba__before { position: absolute; inset: 0; clip-path: inset(0 calc(100% - var(--p)) 0 0); }
.rm-ba__bar { position: absolute; top: 0; bottom: 0; left: var(--p); width: 1px; background: #f8f8f8; transform: translateX(-.5px); pointer-events: none; }
.rm-ba__bar i { position: absolute; top: 50%; left: 50%; width: 14px; height: 14px; border-radius: 50%; background: #f8f8f8; transform: translate(-50%, -50%); }
.rm-ba__lb { position: absolute; bottom: max(10px, 1vw); color: #f8f8f8; font-size: max(8px, .544vw); letter-spacing: .08em; text-transform: uppercase; pointer-events: none; text-shadow: 0 0 6px rgba(0,0,0,.35); }
.rm-ba__lb--b { left: max(10px, 1vw); } .rm-ba__lb--a { right: max(10px, 1vw); }

/* páginas de case: textos 20% menores e próximo projeto 40% menor */
.case-page .back, .case-page .case-role, .case-page .case-next a.next span { font-size: calc(var(--fs-body) * .8); }
.case-page .case-intro { font-size: max(9.6px, .84vw); }
.case-page .case-label, .case-page .row figcaption, .case-page .rm-t, .case-page .snd { font-size: max(7.5px, .544vw); }
.case-page .case-next a.next strong { font-size: calc(var(--fs-title) * .6); }

.about h2 { scroll-margin-top: max(40px, 4vw); }
.case-page .back { display: flex; align-items: baseline; gap: .7em; }
.case-page .back a.arr { text-decoration: none; }
.case-page .back a.arr:hover { opacity: .6; }
.case-page .back, .case-page .back a { font-size: max(9.6px, .84vw); }
