/* ═══════════════════════════════════════════════════════════════════════
   Sarart Barbearia
   Palette and letterforms are the client's own — petrol #1B3846 and gold
   #FCDE54 sampled straight out of their posters and story covers, and Cinzel
   standing in for the Trajan-style letters cast on their shopfront.
   ═══════════════════════════════════════════════════════════════════════ */

@font-face {
  font-family: 'Cinzel';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(fonts/cinzel-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Cinzel';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(fonts/cinzel-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 300 600;
  font-stretch: 100%;
  font-display: swap;
  src: url(fonts/archivo-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 300 600;
  font-stretch: 100%;
  font-display: swap;
  src: url(fonts/archivo-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ─── tokens ─────────────────────────────────────────────────────────── */

:root {
  --ink:        #0e1e26;   /* page ground, one step under their petrol */
  --petrol:     #1b3846;   /* sampled: story-highlight covers */
  --petrol-lo:  #142a35;
  --slate:      #3d5466;   /* sampled: "CONVOCADO" staff cards */
  --gold:       #fcde54;   /* sampled: every poster headline */
  --gold-dim:   #c0a224;   /* sampled: shadowed stars on the staff cards */
  --paper:      #f3f1ec;
  --muted:      #9db0bb;
  --fine:       #7d94a1;
  --line:       rgba(157, 176, 187, .22);

  --wrap: 1200px;
  --pad: 24px;
  --head: 66px;

  --serif: 'Cinzel', 'Times New Roman', serif;
  --sans:  'Archivo', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

@media (min-width: 700px) { :root { --pad: 40px; --head: 76px; } }

/* ─── reset ──────────────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  /* NEVER overflow-x:hidden here — it would make the element a scroll
     container and every animation-timeline: view() would snap to its end. */
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.62;
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; height: auto; }
figure { margin: 0; }
ul, dl, dd { margin: 0; padding: 0; }
li { list-style: none; }
a { color: inherit; }

:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 2px; }

.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--gold); color: var(--ink);
  padding: 12px 18px; z-index: 99; font-weight: 500;
}
.skip:focus { left: 12px; top: 12px; }

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--pad); }

/* ─── the wordmark ───────────────────────────────────────────────────── */

.mark { display: block; line-height: 1; }

.mark__a {
  display: block;
  font-family: var(--serif); font-weight: 400;
  font-size: 19px; letter-spacing: .30em; text-indent: .30em;
  text-transform: uppercase;
}

.mark__b {
  display: block;
  font-family: var(--serif); font-weight: 400;
  font-size: 8px; letter-spacing: .46em; text-indent: .46em;
  text-transform: uppercase; color: var(--muted); margin-top: 5px;
}

/* ─── header ─────────────────────────────────────────────────────────── */

.site {
  position: sticky; top: 0; z-index: 40;
  /* The hero is a bright photograph — sky, glass, trees — and it sits directly
     under the header before it goes solid. The scrim therefore stays near-opaque
     for the header's whole height and only feathers in the last few percent;
     a gradient that fades across the bar leaves the nav at ~1.7:1 over sky. */
  background: linear-gradient(to bottom,
    rgba(14, 30, 38, .96) 0%,
    rgba(14, 30, 38, .93) 72%,
    rgba(14, 30, 38, .55) 89%,
    rgba(14, 30, 38, 0) 100%);
  transition: background-color .3s ease, border-color .3s ease;
  border-bottom: 1px solid transparent;
}

.site.is-stuck {
  background: var(--ink);   /* opaque: any alpha lets headings ghost through */
  border-bottom-color: var(--line);
}

.site__in { height: var(--head); display: flex; align-items: center; gap: 28px; }
.site__mark { text-decoration: none; margin-right: auto; }
.site__nav { display: none; gap: 26px; }

.site__nav a {
  text-decoration: none; font-size: 14px; letter-spacing: .04em;
  color: var(--muted); transition: color .2s ease;
}
.site__nav a:hover { color: var(--paper); }

.site__cta { padding: 9px 18px; font-size: 13px; }

/* With JS the header button waits until the header is solid, so a phone never
   shows the same call to action twice in one viewport. Without JS it stays. */
.js .site__cta { opacity: 0; visibility: hidden; transition: opacity .3s ease; }
.js .site.is-stuck .site__cta { opacity: 1; visibility: visible; }

@media (min-width: 900px) { .site__nav { display: flex; } }

/* ─── buttons ────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 14px 24px; border-radius: 2px;
  font-family: var(--sans); font-size: 14px; font-weight: 500;
  letter-spacing: .06em; text-transform: uppercase; text-decoration: none;
  border: 1px solid transparent; white-space: nowrap;
  transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}

.btn--gold  { background: var(--gold); color: var(--ink); }
.btn--gold:hover { background: #fff0a0; }

.btn--ghost { border-color: var(--line); color: var(--paper); }
.btn--ghost:hover { border-color: var(--gold); color: var(--gold); }

/* over the hero photograph, where a hairline border would disappear */
.btn--glass { background: rgba(10, 20, 26, .55); border-color: rgba(243, 241, 236, .5); color: #fff; }
.btn--glass:hover { background: rgba(10, 20, 26, .8); border-color: var(--gold); color: var(--gold); }

/* Stacked buttons of different label lengths read as ragged on a phone.
   Scoped to the places it applies, so it cannot flatten another row. */
@media (max-width: 540px) {
  .hero__cta .btn,
  .unit__cta .btn { flex: 1 0 100%; }
}

/* ─── hero ───────────────────────────────────────────────────────────── */

.hero { padding-bottom: 0; }

.hero__frame {
  position: relative;
  max-width: 1600px;
  margin-inline: auto;
  isolation: isolate;
}

.hero__frame img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: 50% 20%;
}

/* the scrim that makes the overlaid type legible over any part of the photo */
.hero__frame::after {
  content: '';
  position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(to top,
    rgba(9, 18, 23, .94) 0%,
    rgba(9, 18, 23, .82) 26%,
    rgba(9, 18, 23, .30) 52%,
    rgba(9, 18, 23, .10) 100%);
}

.hero__over {
  position: absolute; z-index: 2;
  left: 0; right: 0; bottom: 0;
  padding: 0 var(--pad) clamp(28px, 5vw, 64px);
}

.hero__over h1 {
  margin: 0;
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(31px, 6.4vw, 62px);
  line-height: 1.08; letter-spacing: .015em;
  max-width: 15ch;
}

.hero__over p {
  margin: 16px 0 0;
  color: #d8e2e8;
  font-size: clamp(15px, 1.6vw, 18px);
  max-width: 40ch;
}

.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }

@media (min-width: 760px) {
  .hero__frame img { aspect-ratio: 16 / 9; object-position: 50% 22%; }
  .hero__over { padding-inline: clamp(32px, 5vw, 72px); }
}

@media (min-width: 1240px) {
  .hero__frame img { aspect-ratio: 21 / 9; }
}

/* ─── bands ──────────────────────────────────────────────────────────── */

.band {
  padding: 78px 0;
  scroll-margin-top: var(--head);
  border-top: 1px solid var(--line);
}

.band--deep { background: var(--petrol-lo); }

@media (min-width: 900px) { .band { padding: 108px 0; } }

h2 {
  margin: 0;
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(28px, 4.2vw, 46px);
  line-height: 1.14; letter-spacing: .015em;
}

h3 { margin: 0; font-family: var(--serif); font-weight: 400; }

h4 {
  margin: 0 0 8px;
  font-size: 12px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--gold-dim); font-weight: 500;
}

/* ─── serviços: a board, no photographs ──────────────────────────────── */

.board { display: grid; gap: 44px; }

.board__head p { margin: 20px 0 0; color: var(--muted); max-width: 46ch; }
.board__fine { font-size: 15px; color: var(--fine) !important; }

.board__links {
  display: flex; flex-direction: column; gap: 8px;
  margin-top: 24px !important;
}

.board__links a {
  color: var(--gold);
  font-size: 15px;
  text-decoration: none;
  border-bottom: 1px solid rgba(252, 222, 84, .32);
  align-self: flex-start;
  padding-bottom: 2px;
}
.board__links a:hover { border-bottom-color: var(--gold); }

.board__cols { display: grid; gap: 38px; }

.grp h3 {
  font-size: 13px; letter-spacing: .22em; text-transform: uppercase;
  color: var(--gold-dim);
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.grp ul { margin-top: 16px; }

.grp li {
  font-family: var(--serif);
  font-size: clamp(17px, 1.7vw, 21px);
  line-height: 1.62;
  letter-spacing: .015em;
}

@media (min-width: 860px) {
  .board { grid-template-columns: minmax(0, .66fr) minmax(0, 1.5fr); gap: 56px; }
  /* Two columns, not three: Cabelo has eight items and Barba only three, so a
     third column would just be a tall empty gap. Barba and Rosto stack. */
  .board__cols { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px 44px; }
  .grp:nth-child(1) { grid-column: 1; grid-row: 1 / 3; }
  .grp:nth-child(2) { grid-column: 2; grid-row: 1; }
  .grp:nth-child(3) { grid-column: 2; grid-row: 2; }
}

/* ─── a casa ─────────────────────────────────────────────────────────── */

.shout {
  font-size: clamp(30px, 5.6vw, 58px);
  max-width: 16ch;
}

.shout__sub { margin: 24px 0 0; color: var(--paper); max-width: 52ch; font-size: 18px; }
.shout__note { margin: 14px 0 0; color: var(--fine); max-width: 52ch; font-size: 15px; }

.casa { display: grid; gap: 18px; margin-top: 46px; }
.casa img { width: 100%; height: 100%; object-fit: cover; border-radius: 2px; }
.casa figure { min-height: 0; }

/* phone: one column, natural-ish shapes, nothing forced */
.casa__a img { aspect-ratio: 3 / 2; }
.casa__b img { aspect-ratio: 4 / 5; object-position: 50% 42%; }
.casa__c img { aspect-ratio: 3 / 2; }
.casa__d img { aspect-ratio: 4 / 5; object-position: 50% 46%; }

@media (min-width: 760px) {
  /* Four photographs at four different sizes, on a 12-column frame. The tall
     one spans both rows, so the block never reads as a uniform gallery grid. */
  .casa {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    grid-template-rows: clamp(230px, 26vw, 320px) clamp(170px, 19vw, 232px);
  }
  .casa__a { grid-column: 1 / 8;  grid-row: 1; }
  .casa__b { grid-column: 8 / 13; grid-row: 1 / 3; }
  .casa__c { grid-column: 1 / 5;  grid-row: 2; }
  .casa__d { grid-column: 5 / 8;  grid-row: 2; }
  .casa img { aspect-ratio: auto; }
  .casa__b img { object-position: 50% 46%; }
  .casa__d img { object-position: 50% 40%; }
}

/* ─── time ───────────────────────────────────────────────────────────── */

.time__head p { margin: 20px 0 0; color: var(--muted); max-width: 48ch; }

.crew {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 44px;
}

.crew img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  object-position: 50% 22%;
  border-radius: 2px;
  filter: saturate(.88);
}

@media (min-width: 640px) {
  .crew { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
}

/* ─── unidades ───────────────────────────────────────────────────────── */

.says { max-width: 62ch; }
.says__sub { margin: 20px 0 0; color: var(--muted); }

.units {
  display: grid; grid-template-columns: minmax(0, 1fr);
  gap: 32px; margin-top: 46px;
}

@media (min-width: 820px) {
  .units { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.unit {
  display: flex; flex-direction: column;
  background: rgba(27, 56, 70, .5);
  border: 1px solid var(--line);
  border-radius: 3px; overflow: hidden;
}

/* 4:3 at the top of the frame: verified with tools/crop-preview.py to keep the
   sign, the door and the street number in shot on both shopfronts. */
.unit__media img {
  width: 100%; aspect-ratio: 4 / 3;
  object-fit: cover; object-position: 50% 0%;
}

.unit__body { padding: 28px 26px 30px; display: flex; flex-direction: column; flex: 1; }

.unit__body h3 { font-size: 27px; letter-spacing: .07em; text-transform: uppercase; }

.unit__addr { margin: 14px 0 0; color: var(--muted); }

.unit__hours {
  margin: 20px 0 0; padding-top: 18px;
  border-top: 1px solid var(--line); font-size: 15px;
}

.unit__hours > div {
  display: flex; justify-content: space-between; gap: 16px; padding: 4px 0;
}
.unit__hours dt { color: var(--muted); }
.unit__hours dd { margin: 0; font-variant-numeric: tabular-nums; }

.unit__cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: auto; padding-top: 26px; }

.practical {
  display: grid; grid-template-columns: minmax(0, 1fr);
  gap: 28px; margin-top: 46px; padding-top: 34px;
  border-top: 1px solid var(--line);
}

@media (min-width: 700px) { .practical { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.practical p { margin: 0; color: var(--muted); font-size: 15px; }
.practical a { color: var(--paper); text-decoration-color: var(--line); }
.practical a:hover { color: var(--gold); }

/* ─── footer ─────────────────────────────────────────────────────────── */

.foot { padding: 64px 0 56px; border-top: 1px solid var(--line); background: var(--ink); }

.foot__mark { margin: 0; line-height: 1; }

.foot__mark .sheen {
  display: block;
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(44px, 11vw, 104px);
  letter-spacing: .16em; text-indent: .16em; text-transform: uppercase;
  color: var(--paper);
}

.foot__sub {
  display: block;
  font-family: var(--serif);
  font-size: clamp(10px, 2.2vw, 17px);
  letter-spacing: .60em; text-indent: .60em; text-transform: uppercase;
  color: var(--muted); margin-top: 13px;
}

/* Their sign is cast letters on a wall; the one thing it does on its own is
   catch the light. A narrow paler band crosses it every nine seconds. */
@supports (-webkit-background-clip: text) or (background-clip: text) {
  .foot__mark .sheen {
    background-image: linear-gradient(100deg,
      var(--paper) 0 42%, var(--gold) 50%, var(--paper) 58% 100%);
    background-size: 320% 100%;
    background-position: 100% 0;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: sheen 9s linear infinite;
  }
}

@keyframes sheen {
  0%, 12%   { background-position: 100% 0; }
  88%, 100% { background-position: 0% 0; }
}

.foot__links { display: flex; flex-wrap: wrap; gap: 22px; margin-top: 38px; }

.foot__links a {
  font-size: 14px; color: var(--muted); text-decoration: none;
  transition: color .2s ease;
}
.foot__links a:hover { color: var(--gold); }

/* ─── reveals ────────────────────────────────────────────────────────── */

/* Only the photograph blocks, scrubbed by scroll position and off the main
   thread. Gated behind .js so a visitor without it never meets opacity:0. */
.js .rv {
  animation: rise linear both;
  animation-timeline: view();
  animation-range: entry 4% cover 24%;
}

@keyframes rise {
  from { opacity: 0; translate: 0 18px; }
  to   { opacity: 1; translate: 0 0; }
}

/* Same choreography where view() is unsupported, driven by an observer. */
.js.no-sdt .rv {
  animation: none;
  opacity: 0; translate: 0 18px;
  transition: opacity .7s ease, translate .7s ease;
}
.js.no-sdt .rv.is-in { opacity: 1; translate: 0 0; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .rv,
  .js.no-sdt .rv {
    animation: none; transition: none; opacity: 1; translate: none;
  }
  .foot__mark .sheen { animation: none; background-position: 50% 0; }
}
