/*
 * GAB MARTINS — camada da marca sobre o template.
 * Conceito: folha de contato + lápis dermatográfico vermelho.
 * Tokens em docs/BRAND.md. O vermelho só aparece como traço à mão (.gm-mark).
 */
:root {
  --stage: #000000;
  --case: #141414;
  --rule: #2B2B2B;
  --silver: #8E8E8A;
  --sheet: #ECEBE6;
  --grease: #D42A2A;
  --display: 'Big Shoulders Display', 'Arial Narrow', sans-serif;
  --text: 'Hanken Grotesk', Arial, sans-serif;
  --gutter: max(16px, 6vw);
  --ease: cubic-bezier(.65, 0, .35, 1);
}

/* ---------- Base ---------- */
html { background: var(--stage); scroll-behavior: smooth; }
body {
  background: var(--stage);
  color: var(--sheet);
  font-family: var(--text);
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: var(--sheet); color: var(--stage); }
a { color: inherit; }
p { font-size: 1.0625rem; font-weight: 400; line-height: 1.6; color: var(--sheet); max-width: 65ch; }
h1, h2, h3, h4, h5, h6 { color: var(--sheet); }
h1, h2, h3 { font-family: var(--display); font-weight: 800; line-height: .88; letter-spacing: -.005em; }
h4, h5, h6 { font-family: var(--text); text-transform: none; }
img { display: block; }
:focus-visible { outline: 2px solid var(--sheet); outline-offset: 4px; }
input:focus, textarea:focus { border: 0; }

.ms-main-container, .ms-preloader { background-color: var(--stage); }
.ms-container { padding-top: clamp(8rem, 16vh, 12rem); }
.ms-section__block { width: auto; max-width: 100rem; margin: 0 var(--gutter) clamp(4rem, 9vw, 8rem); }
@media (min-width: 1700px) { .ms-section__block { margin-left: auto; margin-right: auto; width: calc(100% - 12vw); } }

.gm-sr, .gm-hp { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.gm-skip { position: fixed; left: 1rem; top: -4rem; z-index: 20; background: var(--sheet); color: var(--stage); padding: .6em 1em; font-weight: 600; }
.gm-skip:focus { top: 1rem; }

/* ---------- Traço de lápis (assinatura) ---------- */
.gm-mark { position: absolute; overflow: visible; pointer-events: none; }
.gm-mark path {
  fill: none;
  stroke: var(--grease);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1 2;
  stroke-dashoffset: 1.05;
  transition: stroke-dashoffset .55s var(--ease);
}
@keyframes gm-draw { from { stroke-dashoffset: 1.05; } to { stroke-dashoffset: 0; } }

/* ---------- Header ---------- */
.ms-header { background: linear-gradient(to bottom, rgba(0,0,0,.92) 0, rgba(0,0,0,.6) 60%, transparent 100%); }
.gm-home .ms-header { background: transparent; }
.ms-header { transition: background-color .35s ease; }
.ms-header.is-scrolled { background: rgba(0,0,0,.94); box-shadow: 0 1px 0 var(--rule); }
@supports (backdrop-filter: blur(8px)) { .ms-header.is-scrolled { background: rgba(0,0,0,.82); backdrop-filter: blur(8px); } }
.ms-nav { padding: 1.25rem var(--gutter); }
.ms-logo { height: clamp(72px, 7vw, 104px); width: clamp(92px, 8.9vw, 132px); }
.ms-logo img { height: 100%; width: auto; }
.gm-lang {
  margin-left: auto; z-index: 7; color: var(--sheet); cursor: pointer;
  font: 600 .95rem/1 var(--text); padding: .7em .6em; letter-spacing: .02em;
}
.gm-lang:hover { color: var(--silver); }
.hamburger { margin-left: 5.5rem; padding: .7em 0; }
.hamburger-label { font-family: var(--text); font-weight: 600; font-size: .95rem; text-transform: none; color: var(--sheet); }
.hamburger-inner, .hamburger-inner:after, .hamburger-inner:before { background-color: var(--sheet); height: 2px; }

/* Menu em tela cheia */
.height-full-viewport { background-color: var(--stage); align-items: flex-start; padding: 0 var(--gutter); }
.ms-navbar { margin: 0; }
.nav-item { width: auto; margin-left: 0; padding: .4em 0; }
.ms-navbar .ms-btn { font-family: var(--display); font-weight: 900 !important; font-size: clamp(3rem, 9vw, 7.5rem); line-height: .9; letter-spacing: 0; padding: 0; }
.nav-item:hover .ms-btn, .nav-item:focus-within .ms-btn { color: var(--sheet); padding-left: 3.2rem; }
.ms-btn::before { background: var(--grease); height: 3px; border-radius: 3px; }
.nav-item.is-current .ms-btn { padding-left: 3.2rem; }
.nav-item.is-current .ms-btn::before, .nav-item:hover .ms-btn::before { width: 2.4rem; }
.nav-item__label { color: var(--silver); padding: .2em 0 0; font-size: .95rem; }
.nav-item:hover .nav-item__label { color: var(--sheet); }
.gm-menu-cats {
  display: flex; flex-wrap: wrap; gap: .4em 1.6em; margin-top: 2.5rem; opacity: 0;
  transition: opacity .6s ease;
}
.is-visible .gm-menu-cats { opacity: 1; transition-delay: .5s; }
.gm-menu-cats a { color: var(--silver); font-weight: 500; }
.gm-menu-cats a:hover { color: var(--sheet); }
body.gm-menu-open { overflow: hidden; }

/* ---------- Títulos de página ---------- */
.ms-page-title { max-width: none; }
.page-header { font-size: clamp(3.75rem, 12vw, 11rem); line-height: .92; margin: 0 0 .3em; text-transform: uppercase; }
.page-desc { width: auto; max-width: 34ch; font-size: clamp(1.15rem, 1.7vw, 1.45rem); line-height: 1.45; color: var(--silver); letter-spacing: 0; }

/* ---------- CTA (texto + traço) ---------- */
.gm-cta {
  position: relative; display: inline-block; cursor: pointer; background: none; border: 0;
  font: 800 clamp(1.5rem, 2.4vw, 2rem)/1 var(--display); text-transform: uppercase; letter-spacing: .01em;
  color: var(--sheet); padding: .1em 0 .45em;
}
.gm-cta .gm-mark--underline { left: -3%; bottom: 0; width: 106%; height: .4em; }
.gm-mark--underline path { stroke-width: 5; }
.gm-cta .gm-mark path { stroke-dashoffset: 0; }
.gm-cta:hover .gm-mark path, .gm-cta:focus-visible .gm-mark path { animation: gm-draw .5s var(--ease); }
.gm-cta[disabled] { opacity: .5; cursor: progress; }

.gm-band {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 1.5rem 3rem;
  border-top: 1px solid var(--rule); padding-top: 2.5rem;
}
.gm-band p { margin: 0; font-size: clamp(1.25rem, 2.2vw, 1.75rem); font-weight: 500; line-height: 1.3; }

/* ---------- Home slider ---------- */
.overlay {
  background:
    linear-gradient(to right, rgba(0,0,0,.92) 0, rgba(0,0,0,.72) 38%, rgba(0,0,0,.25) 75%, rgba(0,0,0,.15) 100%),
    linear-gradient(to bottom, rgba(0,0,0,.7) 0, transparent 30%, transparent 55%, rgba(0,0,0,.9) 100%);
}
.swiper-slide-active .overlay { opacity: 1; }
.slide-inner--info { padding: 0 var(--gutter); bottom: clamp(5.5rem, 12vh, 8rem); max-width: 100%; }
.slide-inner--info h1 {
  /* o tamanho se ajusta à maior palavra (--len): o título ocupa no máximo ~48% da largura */
  --fit: 48vw;
  --cap: 10.5vw;                       /* teto: mantém os títulos num tamanho parecido entre slides */
  font-size: clamp(3rem, min(var(--cap), calc(var(--fit) / (var(--len, 5) * .5))), 11rem);
  line-height: .94; font-weight: 900; margin: 0 0 .22em;
  max-width: min(58vw, 15ch);          /* quebra natural: ~2 linhas para títulos longos */
  text-wrap: balance;
}
.gm-slide-cat { display: inline-block; color: var(--sheet); font-weight: 600; font-size: 1.05rem; margin-bottom: clamp(1.25rem, 2.6vw, 2.25rem); }
.gm-slide-cat:hover { color: var(--silver); }
.gm-slide-sum { color: var(--sheet); opacity: .85; max-width: 34ch; margin: 0 0 1.4rem; font-size: clamp(1rem, 1.3vw, 1.15rem); }
.ms-btn--slider { color: var(--sheet); font-family: var(--text); font-weight: 600; text-transform: none; letter-spacing: .01em; font-size: 1rem; }
.ms-btn--slider::before { background: var(--grease); }
.gm-slide-cta .slide-inner { background: var(--stage); }
.gm-slide-cta .slide-inner--info { top: 50%; bottom: auto; transform: translateY(-50%); }
.gm-slide-cta .gm-slide-sum { color: var(--silver); opacity: 1; }

.swiper-button-prev, .swiper-button-next { font-family: var(--text); font-weight: 600; text-transform: none; letter-spacing: .02em; font-size: .95rem; }
.swiper-button-prev, .swiper-button-next { top: auto; bottom: 2.15rem; margin: 0; }
.swiper-button-prev { left: auto; right: calc(var(--gutter) + min(40vw, 22rem) + 14rem); }
.swiper-button-next { right: calc(var(--gutter) + min(40vw, 22rem) + 1.5rem); }
.expanded-timeline { right: var(--gutter); bottom: 2.4rem; width: min(40vw, 22rem); }
.expanded-timeline__counter {
  position: relative; display: flex; align-items: center; gap: .9em; margin-right: 1.4rem;
  font: 800 1.35rem/1 var(--display); color: var(--sheet);
}
.expanded-timeline__counter span { margin: 0; padding: 0; min-width: 1ch; }
.expanded-timeline__counter span:last-of-type { color: var(--silver); }
.expanded-timeline__counter span:last-of-type::before { content: '/'; margin-right: .9em; color: var(--rule); }
.gm-counter-mark { left: -.62em; top: -.48em; width: 1.95em; height: 1.95em; }
.gm-counter-mark path { stroke-width: 7; }
.gm-counter-mark path { animation: gm-draw .9s var(--ease) 1.4s forwards; }
.gm-counter-mark.is-redraw path { animation: gm-draw .6s var(--ease) forwards; }
.swiper-pagination { background-color: var(--rule); }
.swiper-pagination-progressbar-fill { background: var(--sheet) !important; }

/* ---------- Projetos: folha de contato ---------- */
.filtr-btn { display: flex; flex-wrap: wrap; gap: .4rem 2rem; margin: 0 0 2.5rem; }
.filtr-btn li { position: relative; margin: 0; opacity: .55; }
.filtr-btn h6 {
  position: relative; padding: .3em 0 .45em; margin: 0;
  font: 600 1.05rem/1.2 var(--text); text-transform: none; color: var(--sheet);
}
.filtr-btn h6 .gm-mark--underline { left: -6%; bottom: 0; width: 112%; height: .45em; }
.filtr-btn li.active h6 .gm-mark path { stroke-dashoffset: 0; }

.filtr-container { margin-left: -6px; margin-right: -6px; }
.album-item { padding: 0 6px 2.2rem; }
.album-item a { padding-top: 66.6%; background: var(--case); overflow: visible; }
.album-item__img, .album-item__overlay { overflow: hidden; }
.album-item__cover { background-color: rgba(0,0,0,.72); }
.album-item__overlay h5 {
  font: 500 1.05rem/1.4 var(--text); color: var(--sheet); text-align: left;
  justify-content: flex-start; align-items: flex-end; padding: 1.4em; transform: none;
}
.album-item:hover .album-item__img { transform: scale(1.04); }
.album-item .gm-frame-mark { width: 105%; height: 106%; z-index: 3; left: -2.5%; top: -3%; }
.album-item .gm-frame-mark path { stroke-width: 1.1; }
.album-item .gm-item-meta a { display: inline; padding: 0; position: static; overflow: visible; z-index: auto; background: none; }
.album-item:hover .gm-frame-mark path, .album-item a:focus-visible .gm-frame-mark path { stroke-dashoffset: 0; }
.gm-item-meta {
  display: grid; grid-template-columns: auto 1fr auto; align-items: baseline; gap: .8em;
  padding-top: .85rem; font-size: .95rem;
}
.gm-frame { font: 800 1rem/1 var(--display); color: var(--silver); font-variant-numeric: tabular-nums; }
.gm-item-title { font-weight: 600; color: var(--sheet); }
.gm-item-cat { color: var(--silver); text-align: right; }

/* ---------- Projeto ---------- */
.gm-crumb { display: inline-block; color: var(--silver); font-weight: 600; margin-bottom: clamp(1.25rem, 2.2vw, 2rem); }
.gm-crumb:hover { color: var(--sheet); }
.gm-project-cover { margin: 0 0 clamp(4rem, 8vw, 7rem); }
.gm-project-cover img { width: 100%; height: min(88vh, 62vw); object-fit: cover; background: var(--case); }
.gm-project-cover--top img { object-position: 50% 0; }   /* capas de site: mostra o topo */
.gm-project-body { display: grid; grid-template-columns: minmax(14rem, 1fr) 2fr; gap: 3rem 6vw; align-items: start; }
.gm-project-text p:first-child { font-size: clamp(1.15rem, 1.5vw, 1.35rem); line-height: 1.5; }
.gm-specs { margin: 0; }
.gm-specs > div { display: grid; grid-template-columns: 7.5em 1fr; gap: 1em; padding: .9em 0; border-top: 1px solid var(--rule); }
.gm-specs > div:last-child { border-bottom: 1px solid var(--rule); }
.gm-specs dt { color: var(--silver); font-weight: 400; }
.gm-specs dd { margin: 0; color: var(--sheet); font-weight: 500; }
.gm-specs a:hover { color: var(--silver); }
.ug-gallery-wrapper { background: transparent !important; }

.gm-next { border-top: 1px solid var(--rule); padding-top: 2.5rem; }
.gm-next__label { color: var(--silver); margin: 0 0 1rem; }
.gm-next__title {
  position: relative; display: inline-block; font: 900 clamp(3.5rem, 11vw, 10rem)/.85 var(--display);
  text-transform: uppercase; color: var(--sheet); padding: .1em .15em;
}
.gm-next__title .gm-mark--circle { left: -6%; top: -18%; width: 112%; height: 136%; }
.gm-next__title .gm-mark path { stroke-width: 1.2; }
.gm-next__title:hover .gm-mark path, .gm-next__title:focus-visible .gm-mark path { stroke-dashoffset: 0; }

/* ---------- Estúdio ---------- */
.gm-studio { display: grid; grid-template-columns: 5fr 7fr; gap: 3rem 6vw; align-items: end; }
.gm-portrait { margin: 0; background: var(--case); aspect-ratio: 4 / 5; }
.gm-portrait img, .gm-portrait video { display: block; width: 100%; height: 100%; object-fit: cover; }
.gm-lead { font-size: clamp(1.4rem, 2.4vw, 2.1rem); line-height: 1.25; font-weight: 500; max-width: 26ch; margin-bottom: 1.4em; }
.gm-studio__text p:not(.gm-lead) { color: var(--silver); }
.gm-h3 { font: 800 clamp(2.25rem, 4.5vw, 3.75rem)/.9 var(--display); text-transform: uppercase; margin: 0 0 1.6rem; }

.gm-services li { border-top: 1px solid var(--rule); }
.gm-services li:last-child { border-bottom: 1px solid var(--rule); }
.gm-services a, .gm-services .gm-svc { display: grid; grid-template-columns: 1fr 1.3fr; gap: 1rem 4vw; align-items: center; padding: 1.5rem 0; }
.gm-services h3 { font-size: clamp(2.25rem, 6vw, 5rem); margin: 0; text-transform: uppercase; transition: transform .4s var(--ease); }
.gm-services p { margin: 0; color: var(--silver); transition: color .3s ease; }
.gm-services a:hover h3 { transform: translateX(.25em); }
.gm-services a:hover p { color: var(--sheet); }

.gm-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2rem; list-style: none; margin: 0; }
.gm-steps li { border-top: 1px solid var(--rule); padding-top: 1.2rem; }
.gm-step-n { display: block; font: 900 3.5rem/1 var(--display); color: var(--silver); margin-bottom: .6rem; }
.gm-steps h4 { font-size: 1.15rem; font-weight: 600; margin: 0 0 .4rem; }
.gm-steps p { color: var(--silver); margin: 0; font-size: 1rem; }

/* ---------- Estúdio: Instagram ---------- */
.gm-insta__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .5rem 2rem; margin-bottom: 1.6rem; }
.gm-insta__head .gm-h3 { margin: 0; }
.gm-insta__handle { color: var(--silver); font-weight: 600; font-size: 1.1rem; }
.gm-insta__handle:hover { color: var(--sheet); }
.gm-insta__grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; list-style: none; margin: 0 0 2rem; }
.gm-insta__grid a { display: block; aspect-ratio: 1; overflow: hidden; background: var(--case); }
.gm-insta__grid img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease), opacity .3s ease; }
.gm-insta__grid a:hover img { transform: scale(1.05); opacity: .85; }
@media (max-width: 767px) { .gm-insta__grid { grid-template-columns: repeat(3, 1fr); } }

/* ---------- Contato ---------- */
.gm-contact { display: grid; grid-template-columns: 1fr 1.4fr; gap: 3rem 7vw; align-items: start; }
.gm-form .gm-h3 { font-size: clamp(1.75rem, 3vw, 2.5rem); }
.gm-form .form-group { margin-bottom: 1.6rem; }
.gm-form label { display: block; color: var(--silver); font-size: .95rem; margin-bottom: .35rem; transition: color .2s ease; }
.gm-form .is-focus label { color: var(--sheet); }
.gm-form .form-control {
  width: 100%; background: transparent; color: var(--sheet); border: 0; border-bottom: 1px solid var(--rule);
  border-radius: 0; padding: .55em 0; font: 400 1.125rem/1.4 var(--text); transition: border-color .2s ease;
}
.gm-form .form-control:focus { border: 0; border-bottom: 1px solid var(--sheet); }
.gm-form textarea.form-control { resize: vertical; min-height: 8rem; }
.gm-form span.error, .gm-form label.error { display: block; color: #F28B82; font-size: .9rem; margin-top: .4rem; }
.gm-form .form-control.error { border-bottom-color: #F28B82; }
.gm-form-status { margin-top: 1rem; min-height: 1.6em; color: var(--silver); }
.gm-form-status.is-ok { color: var(--sheet); }

/* ---------- 404 ---------- */
.gm-404__frame { position: relative; display: inline-block; font: 900 clamp(7rem, 22vw, 16rem)/.85 var(--display); margin: 0 0 .2em; }
.gm-404__frame .gm-mark--cross { left: -4%; top: -4%; width: 108%; height: 108%; }
.gm-404__frame .gm-mark path { stroke-width: 1.4; }
.gm-404__frame .gm-mark path { animation: gm-draw .9s var(--ease) 1.2s forwards; }

/* ---------- Footer ---------- */
footer { background: var(--stage) !important; bottom: 0 !important; }
.gm-footer {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 1rem 2.5rem;
  margin: 0 var(--gutter); padding: 2.2rem 0 2.6rem; border-top: 1px solid var(--rule); font-size: .95rem;
}
.gm-footer p { margin: 0; font-size: inherit; color: var(--silver); }
.gm-footer__mail { font-weight: 600; }
.gm-footer__social { display: flex; flex-wrap: wrap; gap: .5rem 1.4rem; }
.gm-footer__social a, .gm-footer__lang { color: var(--sheet); font: 500 .95rem var(--text); cursor: pointer; padding: 0; }
.gm-footer a:hover, .gm-footer__lang:hover { color: var(--silver); }

/* ---------- Responsivo ---------- */
@media (max-width: 991px) {
  .gm-project-body, .gm-studio, .gm-contact { grid-template-columns: 1fr; }
  .gm-steps { grid-template-columns: repeat(2, 1fr); }
  .gm-portrait { max-width: 30rem; }
}
@media (max-width: 767px) {
  body { font-size: 16px; }
  .ms-logo { height: 64px; width: 82px; }
  .ms-nav { padding: 1rem var(--gutter); }
  .gm-services a, .gm-services .gm-svc { grid-template-columns: 1fr; }
  .gm-steps { grid-template-columns: 1fr; }
  .swiper-nav-btn { display: none; }
  .expanded-timeline { left: var(--gutter); right: var(--gutter); width: auto; bottom: 1.6rem; }
  .slide-inner--info h1 { --fit: 88vw; --cap: 15vw; max-width: 100%; }
  .slide-inner--info { bottom: 4.5rem; width: auto; left: 0; right: 0; text-align: left; padding: 0 var(--gutter); }
  .ms-btn--slider { display: flex; background: none; margin: 0; padding: .4em 0; letter-spacing: .01em; }
  .ms-btn--slider::before { display: block; width: 2rem; }
  .expanded-timeline { display: flex; }
  .gm-item-meta { grid-template-columns: auto 1fr; }
  .gm-item-cat { grid-column: 2; text-align: left; }
  .gm-project-cover img { height: 70vh; }
  .gm-specs > div { grid-template-columns: 6em 1fr; }
}

/* ---------- Movimento reduzido ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0s !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .gm-counter-mark path, .gm-404__frame .gm-mark path { stroke-dashoffset: 0; }
  .slide-inner--image { transform: none !important; }
}
