/* Lucas Salgado — base do site (visual do estudo do Motto, 2026-10-27)
   Estúdio editorial em grafite: fundo claro por padrão, modo noturno no botão.
   Motion monocromático: textos sobem linha a linha, imagens se revelam por máscara.
   Páginas e seções ficam em paginas.css. */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("../fonts/bricolage-grotesque.woff") format("woff");
  font-weight: 200 800;
  font-stretch: 75% 100%;
  font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  --bg: #F1EFEF;          /* off-white: fundo padrão */
  --surface: #E8E4E0;
  --fg: #191717;          /* grafite */
  --muted: color-mix(in srgb, var(--fg) 72%, var(--bg));
  --accent: #D2BFA1;      /* areia: forma, fio, bloco */
  --accent-text: #191717; /* areia só vira texto sobre fundo escuro */
  --hover: #7D7C7C;       /* cinza: só em texto grande */
  --line: rgba(25, 23, 23, .14);
  --ph: #dcd7d2;          /* fundo de imagem ausente */
  --ink: #191717; --paper: #F1EFEF;           /* fixos nos dois temas: chapa de transição */
  /* Vidro: só em camadas que ficam por cima do conteúdo e deixam o contexto visível */
  --glass: color-mix(in srgb, var(--bg) 58%, transparent);
  --glass-edge: color-mix(in srgb, var(--fg) 14%, transparent);
  --glass-hi: inset 0 1px 0 color-mix(in srgb, var(--fg) 12%, transparent);
  --glass-blur: blur(18px) saturate(1.25);

  --f-display: "Bricolage Grotesque", "Helvetica Neue", Arial, sans-serif;
  --f-body: "Bricolage Grotesque", "Helvetica Neue", Arial, sans-serif;

  --s-hero: clamp(2.6rem, 8.4vw, 8.2rem);
  --s-h2: clamp(1.9rem, 4.4vw, 3.6rem);
  --s-h3: clamp(1.3rem, 2.2vw, 1.75rem);
  --s-body: 1.0625rem;
  --s-small: .8125rem;

  /* pesos: equilíbrio da família, nem pesado nem fino (decisão de Lucas, 2026-10-27) */
  --w-display: 500;
  --w-titulo: 500;
  --w-sub: 600;

  /* cantos: a interface é arredondada (menu, botões); fotos e cartões seguem a mesma linguagem */
  --raio-img: clamp(18px, 2.2vw, 30px);
  --raio-card: clamp(14px, 1.6vw, 22px);
  --raio-campo: 14px;

  --max: 1360px;
  --gut: max(16px, 4vw);
  color-scheme: light;
}
/* Modo noturno: só quando o visitante escolhe no botão do header */
:root[data-theme="dark"] {
  --bg: #191717; --surface: #211f1d; --fg: #F1EFEF; --muted: color-mix(in srgb, var(--fg) 68%, var(--bg));
  --accent: #D2BFA1; --accent-text: #D2BFA1; --hover: #D2BFA1; --line: rgba(241, 239, 239, .12); --ph: #2a2725;
  color-scheme: dark;
}

/* Enquanto o motion se prepara, a página espera (com saída de segurança) */
html.pre body { opacity: 0; animation: mostra 0s 2.5s forwards; }
@keyframes mostra { to { opacity: 1; } }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font-family: var(--f-body); font-size: var(--s-body); line-height: 1.55;
  font-variation-settings: "opsz" 14;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--bg); }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
::selection { background: var(--accent); color: var(--ink); }

.wrap {
  max-width: var(--max); margin-inline: auto;
  padding-left: max(var(--gut), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gut), env(safe-area-inset-right, 0px));
}
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 16px; top: -100px; z-index: 70; background: var(--fg); color: var(--bg); padding: 12px 18px; border-radius: 999px; text-decoration: none; }
.skip:focus { top: 12px; }
.label {
  font-size: var(--s-small); letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); font-weight: 500;
}
h1, h2, h3 { font-family: var(--f-display); margin: 0; text-wrap: balance; font-weight: var(--w-titulo); }
h2 { font-size: var(--s-h2); line-height: 1.02; letter-spacing: -.02em; font-variation-settings: "opsz" 96, "wdth" 100; }
h3 { font-size: var(--s-h3); line-height: 1.15; letter-spacing: -.01em; }
p { margin: 0; }
.note { font-size: .92rem; color: var(--muted); }
.link { font-weight: 600; text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--line); transition: text-decoration-color .2s; }
.link:hover { text-decoration-color: currentColor; }


/* ---------- Header ---------- */
header.top {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  padding-top: 12px;
  padding-left: max(var(--gut), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gut), env(safe-area-inset-right, 0px));
  margin-bottom: -76px;
}
.top .wrap {
  display: flex; align-items: center; gap: 24px;
  padding: 8px 8px 8px 20px; border-radius: 999px;
  background: var(--glass); border: 1px solid var(--glass-edge);
  /* --sx/--sy: a sombra interna se desloca quando um botão dentro do header é pressionado */
  box-shadow: var(--glass-hi), inset calc(var(--sx, 0) * 1px) calc(var(--sy, 0) * 1px) 14px rgba(25, 23, 23, calc(var(--sa, 0)));
  backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  :root { --glass: color-mix(in srgb, var(--bg) 92%, transparent); }
}
.brand { display: inline-flex; align-items: center; text-decoration: none; flex: none; }
/* O logo da identidade, pintado na cor do texto para servir aos dois temas */
.brand__logo {
  display: block; width: 84px; height: 37px; background: var(--fg);
  -webkit-mask: url("../img/logo.svg") left center / contain no-repeat;
  mask: url("../img/logo.svg") left center / contain no-repeat;
}
nav.menu { display: flex; gap: 22px; margin-left: auto; }
nav.menu a { text-decoration: none; font-size: .95rem; color: var(--muted); transition: color .2s; }
nav.menu a:hover, nav.menu a[aria-current="true"], nav.menu a[aria-current="page"] { color: var(--fg); }
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  border: 1px solid var(--fg); background: var(--fg); color: var(--bg);
  font: 600 .95rem/1 var(--f-body); padding: 13px 18px; border-radius: 999px;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background .2s, color .2s;
}
.btn:hover { background: transparent; color: var(--fg); }
.btn.ghost { background: transparent; color: var(--fg); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--fg); }
.btn[disabled] { opacity: .4; cursor: not-allowed; }
.btn[hidden] { display: none; }
.btn .arrow { transition: transform .3s; }
.btn:hover .arrow { transform: translateX(3px); }
.theme-toggle {
  display: inline-grid; place-items: center; width: 44px; height: 44px; flex: none;
  border-radius: 50%; border: 1px solid var(--line); background: transparent; color: var(--fg); cursor: pointer;
  transition: border-color .2s, background .2s;
}
.theme-toggle:hover { border-color: var(--fg); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: block; }
:root[data-theme="dark"] .theme-toggle .moon { display: none; }
.menu-btn { display: none; }

/* ---------- Botões reativos: o lado tocado afunda, o oposto sobe, a luz acompanha ---------- */
.btn, .theme-toggle, .pills span, .escolha span, .opcao { position: relative; isolation: isolate; overflow: hidden; }
.lit { position: absolute; inset: 0; border-radius: inherit; pointer-events: none; overflow: hidden; z-index: -1; }
.frame > .lit { z-index: 2; }
.lit i {
  position: absolute; left: var(--px, 50%); top: var(--py, 50%); width: 0; height: 0;
  border-radius: 50%; transform: translate(-50%, -50%); opacity: 0;
}
.lit .s { background: radial-gradient(circle, var(--ink) 0%, transparent 68%); }
.lit .g { left: var(--gx, 50%); top: var(--gy, 50%); background: radial-gradient(circle, var(--paper) 0%, transparent 62%); mix-blend-mode: soft-light; }
:root[data-theme="dark"] .lit .g { mix-blend-mode: screen; }

/* Inspetor de ajuste dos botões (abre em #ajustes) */
.inspector {
  position: fixed; z-index: 45; right: max(16px, env(safe-area-inset-right, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  width: min(320px, calc(100% - 32px)); max-height: calc(100% - 120px); overflow: auto;
  padding: 16px 18px; border-radius: 18px; display: grid; gap: 12px; font-size: .85rem;
  background: var(--glass); border: 1px solid var(--glass-edge); box-shadow: var(--glass-hi), 0 12px 40px rgba(25, 23, 23, .18);
  backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
}
.inspector[hidden] { display: none; }
.inspector header { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.inspector header b { font-size: .95rem; }
.inspector label { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; align-items: center; }
.inspector label span { color: var(--muted); }
.inspector label output { font-variant-numeric: tabular-nums; }
.inspector input[type="range"] { grid-column: 1 / -1; width: 100%; accent-color: var(--fg); }
.inspector .row { display: flex; gap: 8px; flex-wrap: wrap; }
.inspector .btn { padding: 10px 14px; font-size: .85rem; }
.inspector pre { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font: .75rem/1.45 ui-monospace, "SF Mono", Menlo, monospace; color: var(--muted); }
.inspector .x { all: unset; cursor: pointer; padding: 4px 8px; border-radius: 8px; }
.inspector .x:focus-visible { outline: 2px solid var(--accent); }

@media (max-width: 760px) {
  nav.menu { display: none; }
  .top .theme-toggle { margin-left: auto; width: 40px; height: 40px; }
  .top .btn { padding: 10px 14px; font-size: .875rem; }
  .top .wrap { padding-left: 16px; gap: 10px; }
  .menu-btn { display: inline-flex; }
}
@media (max-width: 480px) { .top__cta { display: none; } }

/* Menu do celular: vidro sobre a página */
.painel {
  position: fixed; inset: 0; z-index: 40; display: flex; flex-direction: column;
  padding: calc(12px + env(safe-area-inset-top, 0px)) var(--gut) calc(24px + env(safe-area-inset-bottom, 0px));
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
  visibility: hidden; opacity: 0; transition: opacity .35s, visibility 0s .35s;
}
.painel.is-open { visibility: visible; opacity: 1; transition: opacity .35s; }
.painel__top { display: flex; justify-content: space-between; align-items: center; padding: 8px 8px 8px 20px; }
.painel nav { display: grid; gap: 2px; margin-top: 40px; }
.painel nav a {
  font-size: clamp(2.4rem, 11vw, 3.6rem); font-weight: var(--w-titulo); letter-spacing: -.025em; line-height: 1.08;
  font-variation-settings: "opsz" 96, "wdth" 100; text-decoration: none;
  transform: translateY(24px); opacity: 0; transition: transform .5s cubic-bezier(.2, .7, .1, 1), opacity .5s;
}
.painel.is-open nav a { transform: none; opacity: 1; }
.painel.is-open nav a:nth-child(2) { transition-delay: .05s; }
.painel.is-open nav a:nth-child(3) { transition-delay: .1s; }
.painel.is-open nav a:nth-child(4) { transition-delay: .15s; }
.painel.is-open nav a:nth-child(5) { transition-delay: .2s; }
.painel > .btn { margin-top: auto; justify-content: center; }

/* ---------- Imagens: moldura arredondada ---------- */
.media { position: relative; max-width: 100%; }
.frame { position: relative; overflow: hidden; background: var(--ph); width: 100%; height: 100%; border-radius: var(--raio-img); }
.frame img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .8s cubic-bezier(.2, .7, .1, 1); }
.tag-sim {
  position: absolute; left: 12px; bottom: 12px; z-index: 1; font-size: .72rem; letter-spacing: .06em; text-transform: uppercase;
  background: var(--glass); color: var(--fg); padding: 5px 8px; border-radius: 999px;
  border: 1px solid var(--glass-edge); box-shadow: var(--glass-hi);
  backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
}

/* ---------- Rodapé ---------- */
footer.foot { border-top: 1px solid var(--line); padding-block: 48px 40px; margin-top: clamp(72px, 10vw, 136px); }
.foot .wrap { display: grid; gap: 40px; }
.foot-cta { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 32px; align-items: end; padding-bottom: clamp(32px, 5vw, 64px); border-bottom: 1px solid var(--line); }
.foot-cta h2 { margin-top: 14px; max-width: 16ch; }
.foot-cta p:not(.label) { color: var(--muted); max-width: 44ch; margin-top: 18px; }
.foot-cta__acoes { display: grid; gap: 18px; justify-items: start; }
@media (max-width: 860px) { .foot-cta { grid-template-columns: 1fr; } }
.foot .sign { display: flex; align-items: flex-end; font-size: clamp(2.4rem, 9vw, 8rem); line-height: .9; }
.sign__logo {
  display: block; height: 1.2em; aspect-ratio: 170 / 75; background: var(--fg);
  -webkit-mask: url("../img/logo.svg") left bottom / contain no-repeat;
  mask: url("../img/logo.svg") left bottom / contain no-repeat;
}
.foot-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 18px 32px; color: var(--muted); font-size: .92rem; }
.foot-row nav { display: flex; gap: 22px; flex-wrap: wrap; }
.foot-row a { text-decoration: none; color: var(--fg); }
.foot-row a:hover { text-decoration: underline; text-underline-offset: 4px; }
.socials a { display: inline-flex; align-items: center; gap: 8px; }
.socials svg { width: 16px; height: 16px; fill: currentColor; flex: none; }
.clock { font-variant-numeric: tabular-nums; }

/* ---------- Motion (só com GSAP carregado: classe .motion no html) ---------- */
.wm { display: inline-block; overflow: hidden; vertical-align: top; padding: .06em .08em .12em; margin: -.06em -.08em -.12em; }
.wi { display: inline-block; will-change: transform; }
.hairline { position: absolute; inset: 0 0 auto; height: 1px; background: var(--line); transform-origin: left; }
.motion .frame img { position: absolute; inset: -8% 0 auto; height: 116%; }

/* Transição: chapa de vidro grafite com o nome do destino */
.pt { position: fixed; inset: 0; z-index: 50; pointer-events: none; visibility: hidden; }
.pt-b {
  position: absolute; inset: 0;
  display: flex; align-items: flex-end; padding: max(24px, 5vw);
  background: color-mix(in srgb, var(--ink) 52%, transparent);
  border-top: 1px solid color-mix(in srgb, var(--paper) 22%, transparent);
  backdrop-filter: blur(28px) saturate(1.3); -webkit-backdrop-filter: blur(28px) saturate(1.3);
}
.pt-mask { overflow: hidden; padding-bottom: .1em; }
.pt-title {
  display: block; color: var(--paper); font-weight: var(--w-display); letter-spacing: -.03em; line-height: .95;
  font-size: clamp(2.6rem, 10vw, 9rem); font-variation-settings: "opsz" 96, "wdth" 100;
}

/* Cursor: ponto que vira o + de registro sobre projetos */
.cursor {
  position: fixed; left: 0; top: 0; z-index: 60; pointer-events: none; display: none;
  width: 84px; height: 84px; margin: -42px 0 0 -42px; border-radius: 50%;
  background: var(--accent); color: var(--ink);
  place-content: center; justify-items: center; gap: 2px; font-size: .78rem; font-weight: 600;
  transform: scale(.12); transition: transform .35s cubic-bezier(.2, .7, .1, 1), background .25s;
}
.cursor span { opacity: 0; transition: opacity .2s; }
.motion.fine .cursor { display: grid; }
.cursor.link { transform: scale(.32); background: var(--fg); }
.cursor.view {
  transform: scale(1); color: var(--fg);
  background: color-mix(in srgb, var(--accent) 22%, transparent);
  border: 1px solid var(--glass-edge); box-shadow: var(--glass-hi);
  backdrop-filter: blur(10px) saturate(1.4); -webkit-backdrop-filter: blur(10px) saturate(1.4);
}
.cursor.view span { opacity: 1; }
.cursor.off { transform: scale(0); }

/* Quem ativou "reduzir movimento" no aparelho: mesmas entradas, sem os efeitos mais fortes (paralaxe, zoom, cursor, chapa de transição) */
html.calmo { scroll-behavior: auto; }
html.calmo .pt, html.calmo .cursor { display: none !important; }

/* ---------- Seletor de idioma (PT | EN) ---------- */
.lang { display: inline-flex; align-items: center; flex: none; border: 1px solid var(--line); border-radius: 999px; padding: 3px; font-size: .78rem; font-weight: 600; letter-spacing: .06em; }
.lang a, .lang span { display: inline-grid; place-items: center; min-width: 34px; height: 32px; padding-inline: 8px; border-radius: 999px; text-decoration: none; color: var(--muted); transition: color .2s, background .2s; }
.lang a:hover { color: var(--fg); }
.lang [aria-current="true"] { background: var(--fg); color: var(--bg); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-width: 760px) { .lang { margin-left: auto; } .lang + .theme-toggle { margin-left: 0; } .top .theme-toggle { margin-left: 0; } }
