/* Portefólio — estilos base. Fonte única: Inter (Google Fonts).
   Para alojar a fonte localmente: descarrega Inter de rsms.me/inter,
   coloca os .woff2 em /fonts e substitui o <link> do Google Fonts por @font-face aqui. */

/* ── Sistema tipográfico ─────────────────────────────────────────
   Estilos: H1XL, H1, H2, H3, Lead, P1, P2, P3, Label (nomenclatura designsystems.com).
   Escala responsiva com clamp(): mínimo em mobile (≈360px), máximo em desktop (≈1600px).
   Regra Inter: títulos grandes com tracking negativo e entrelinha apertada;
   texto corrido com tracking neutro e entrelinha generosa. */
:root {
  --h1xl:  clamp(2.5rem, 1.6rem + 4.2vw, 6rem);     /* 40 → 96 */
  --h1:    clamp(2rem,   1.4rem + 2.8vw, 4rem);     /* 32 → 64 */
  --h2:    clamp(1.5rem, 1.15rem + 1.6vw, 2.5rem);  /* 24 → 40 */
  --h3:    clamp(1.25rem, 1.1rem + .7vw, 1.75rem);  /* 20 → 28 */
  --lead:  clamp(1.125rem, 1.05rem + .4vw, 1.375rem); /* 18 → 22 */
  --p1:    1.125rem;  /* 18 */
  --p2:    1rem;      /* 16 */
  --p3:    .875rem;   /* 14 */
  --label: .75rem;    /* 12, maiúsculas */

  /* modo escuro por defeito */
  --bg: #121212;
  --fg: #ecebe8;
  --muted: #8f8f8f;
  --line: #2c2c2c;
  --accent: #ff5a3d;
  --pad: clamp(1.25rem, 4vw, 4rem);   /* margem lateral única para todo o site */
  --measure: 68ch;                    /* largura máxima de leitura do texto corrido */
}
/* modo claro, ativado pelo botão (data-theme="light" no <html>) */
:root[data-theme="light"] { --bg: #f7f6f3; --fg: #141414; --muted: #6b6b6b; --line: #d9d7d2; --accent: #e84028; }
:root { color-scheme: dark; }
:root[data-theme="light"] { color-scheme: light; }

.t-h1xl  { font-size: var(--h1xl); line-height: 1.02; letter-spacing: -0.035em; font-weight: 600; }
.t-h1, h1 { font-size: var(--h1); line-height: 1.08; letter-spacing: -0.03em; font-weight: 600; }
.t-h2    { font-size: var(--h2); line-height: 1.15; letter-spacing: -0.02em; font-weight: 600; }
.t-h3    { font-size: var(--h3); line-height: 1.25; letter-spacing: -0.015em; font-weight: 600; }
.t-lead  { font-size: var(--lead); line-height: 1.5; letter-spacing: -0.01em; font-weight: 400; }
.t-p1    { font-size: var(--p1); line-height: 1.6; }
.t-p2    { font-size: var(--p2); line-height: 1.6; }
.t-p3    { font-size: var(--p3); line-height: 1.5; }
.t-label { font-size: var(--label); line-height: 1.3; letter-spacing: .08em; text-transform: uppercase; font-weight: 500; }

*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  /* reserva sempre o espaço da barra de scroll (macOS com rato) para o layout não saltar entre páginas */
  scrollbar-gutter: stable;
  overflow-y: scroll; /* fallback para Safari < 18 sem scrollbar-gutter */
}
::selection { background: var(--accent); color: #fff; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font-family: "Inter", system-ui, sans-serif;
  font-size: var(--p2); line-height: 1.6;
  font-feature-settings: "cv11", "ss01"; /* alternativas Inter: a de um só andar, dígitos abertos */
  -webkit-font-smoothing: antialiased;
  min-height: 100vh; display: flex; flex-direction: column;
}
h1 { margin: 0 0 clamp(2rem, 5vw, 4rem); }
a { color: inherit; text-decoration-color: var(--accent); text-underline-offset: 3px; }
a:hover, a:focus-visible { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* Largura total: só a margem lateral --pad limita o conteúdo */
.wrap { width: 100%; padding: 0 var(--pad); flex: 1; display: flex; flex-direction: column; }
main { flex: 1; }

header.site { display: flex; justify-content: space-between; align-items: center; padding: var(--pad) 0 clamp(3rem, 8vw, 6rem); position: relative; z-index: 2; }
header.site .name { text-decoration: none; }
header.site nav { display: flex; align-items: center; gap: 1.5rem; }
header.site nav a { text-decoration: none; color: var(--muted); }
header.site nav a[aria-current="page"], header.site nav a:hover { color: var(--fg); }

/* Botão de tema */
.theme-toggle { background: none; border: 0; padding: 0; width: 1.25rem; height: 1.25rem; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.theme-toggle:hover { color: var(--accent); }
.theme-toggle svg { width: 100%; height: 100%; }
.theme-toggle .sun { display: none; }
:root[data-theme="light"] .theme-toggle .sun { display: block; }
:root[data-theme="light"] .theme-toggle .moon { display: none; }

/* Landing: slideshow em fullscreen atrás da quote */
.home { color: #fff; }
.home header.site .name, .home header.site nav a, .home .theme-toggle, .home footer.site { color: rgba(255,255,255,.85); }
.home footer.site { border-color: rgba(255,255,255,.25); position: relative; z-index: 2; }
.home main { position: relative; z-index: 2; }
.slideshow { position: fixed; inset: 0; z-index: 0; overflow: hidden; background: #000; }
.slideshow img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 1.6s ease; }
.slideshow img.on { opacity: 1; }
.slideshow::after { content: ""; position: absolute; inset: 0; background: rgba(0,0,0,.35); } /* legibilidade */
@media (prefers-reduced-motion: reduce) { .slideshow img { transition: none; } }
.quote { margin: 0; display: flex; flex-direction: column; justify-content: center; min-height: 55vh; }
.quote blockquote { margin: 0; max-width: 18ch; }
.quote blockquote p { margin: 0; }
.quote figcaption { margin-top: 2rem; color: var(--muted); }

/* Bio */
.bio { display: grid; grid-template-columns: repeat(12, 1fr); column-gap: 1.5rem; }
.bio h1 { grid-column: 1 / -1; }
.bio .text { grid-column: 1 / span 7; }
.bio .text p { margin: 0 0 1.5rem; max-width: var(--measure); }
.placeholder { border-bottom: 1px dashed var(--accent); }
@media (max-width: 800px) { .bio .text { grid-column: 1 / -1; } }

footer.site { margin-top: 6rem; padding: 1rem 0 var(--pad); border-top: 1px solid var(--line); color: var(--muted); }
footer.site a { margin-right: 1.5rem; }

/* Filtros */
.filters { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; margin: 0 0 2rem; }
.filters button { font-family: inherit; background: none; border: 0; padding: 0; color: var(--muted); cursor: pointer; }
.filters button[aria-pressed="true"] { color: var(--fg); text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 4px; }

/* Lista: Projeto | Cliente | Ano | Ícone — colunas alinhadas em toda a largura */
.works { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.works > li { border-bottom: 1px solid var(--line); }
.work summary {
  display: grid; grid-template-columns: 6fr 4fr 5rem 1.5rem; column-gap: 1.5rem; align-items: center;
  padding: 1rem 0; cursor: pointer; list-style: none;
}
.work summary::-webkit-details-marker { display: none; }
.work summary:hover .title, .work[open] .title { color: var(--accent); }
.work .client { color: var(--muted); }
.work .year { color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; }
.work .icon { /* o SVG funciona como máscara e herda a cor do texto, em qualquer tema */
  width: 1.25rem; height: 1.25rem; justify-self: end; background: var(--muted);
  -webkit-mask: var(--src) center / contain no-repeat; mask: var(--src) center / contain no-repeat; }
.work summary:hover .icon, .work[open] .icon { background: var(--accent); }

.panel { display: grid; grid-template-columns: 6fr 4fr 5rem 1.5rem; column-gap: 1.5rem; padding: .5rem 0 3rem; }
.panel .info { grid-column: 1; }
.panel .info p { margin: 0 0 1rem; max-width: var(--measure); }
.panel .tags { color: var(--muted); }
.media { grid-column: 2 / -1; display: grid; gap: .75rem; align-content: start; }
.media img, .media video { width: 100%; height: auto; display: block; background: var(--line); }
.embed { position: relative; aspect-ratio: var(--ratio, 16 / 9); }
.embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.permalink { color: var(--muted); }

.work[open] .panel { animation: reveal .25s ease-out; }
@keyframes reveal { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .work[open] .panel { animation: none; } }

.notice { padding: 1rem; border: 1px solid var(--accent); }

@media (max-width: 800px) {
  .work summary { grid-template-columns: 1fr auto 1.25rem; row-gap: .15rem; }
  .work .title { grid-column: 1 / -1; }
  .work .client { grid-column: 1; }
  .panel { display: block; }
  .media { margin-top: 1.25rem; }
}
