/* ===== Hero -> frame -> about section (screens 1 & 2) ===== */
:root {
  --margin: 16px;
  --gap: 16px;
  --spacer: 160px;
  /* brand palette (Mendel & Co brandbook) */
  --charcoal: #191814; /* Charcoal Black */
  --plaster: #EFEBE1;  /* Soft Plaster */
  --clay: #983201;     /* Oxide Clay — accent */
  --ink: var(--charcoal);
  --paper: var(--charcoal); /* matches the card section's --_colors---dark */
  --hero-bg: var(--ink);
  --hero-fg: var(--plaster);
  --tile: #22211c;
  --hair: rgba(239,235,225,.12);
  --muted: rgba(239,235,225,.52);
  --section-height: 100vh;   /* set from JS */
  --frame-top: 160px;        /* set from JS */
  --frame-w: 438px;          /* set from JS */
  --frame-h: 584px;          /* set from JS */
  --sans: "Geist", "Helvetica Neue", Helvetica, Arial, sans-serif;            /* brand: body text */
  --display: "Plus Jakarta Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; /* brand: headlines */
}
@media (min-width: 800px) { :root { --margin: 28px; --gap: 28px; } }

html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }

/* ---------- pinned wrapper / section two ---------- */
.transition-wrapper { position: relative; z-index: 2; overflow-x: clip; font-family: var(--sans); }

.section-two {
  position: relative;
  height: max(100vh, 780px);
  background: var(--paper);
  color: var(--plaster);
  padding: 56px var(--margin) 24px;
  display: flex;
}
@media (min-width: 800px) { .section-two { padding: var(--spacer) var(--margin); } }

.section-two-grid {
  position: relative;
  width: 100%;
  max-width: 1600px;
  margin: auto;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto 1fr auto auto;
  gap: 16px;
}
@media (min-width: 800px) {
  .section-two-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: repeat(3, 1fr);
    gap: var(--gap);
    height: var(--frame-h);      /* columns share the frame's top & bottom edges */
  }
}

.section-two-content { display: contents; }
.section-two-content > * { min-width: 0; }

.section-two-content h2 {
  grid-row: 1; grid-column: 1;
  align-self: start;
  font-size: 40px; line-height: 1; font-weight: 300; letter-spacing: -.04em;
  text-transform: uppercase;
  margin: 0;
}
@media (min-width: 800px) { .section-two-content h2 { font-size: 48px; line-height: .95; } }
@media (min-width: 1200px) { .section-two-content h2 { font-size: 76px; letter-spacing: -.045em; } }

.section-two-content > p {
  grid-row: 3; grid-column: 1;
  align-self: end;
  max-width: 34ch;
  font-size: 15px; line-height: 1.55; font-weight: 300; letter-spacing: -.005em;
  color: rgba(239,235,225,.5);
  margin: 0;
}
.section-two-content > p strong { color: var(--plaster); font-weight: 400; }
@media (min-width: 800px) { .section-two-content > p { grid-row: 2 / span 2; font-size: 20px; line-height: 1.35; letter-spacing: -.02em; max-width: 24ch; } }
@media (min-width: 1200px) { .section-two-content > p { font-size: 28px; line-height: 1.25; letter-spacing: -.03em; max-width: 22ch; } }

/* ---------- bento tiles (sharp corners) ---------- */
.about-stats {
  grid-row: 4; grid-column: 1;
  list-style: none;
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 0;
  position: relative;
  margin: 0; padding: 0;
}
.tile {
  position: relative;
  padding: 10px;
  display: flex; flex-direction: column; justify-content: space-between; gap: 8px;
  min-width: 0;
}
.tile small {
  font-size: 11px; line-height: 1.3; font-weight: 400;
  letter-spacing: 0; color: var(--muted);
}
.tile b { font-size: 22px; line-height: 1; font-weight: 300; letter-spacing: -.05em; font-variant-numeric: tabular-nums; }

/* corner markers: accent-clay squares sit on the grid nodes where tile corners used to be */
.tile::before, .tile::after,
.about-stats::before, .about-stats::after {
  content: ""; position: absolute; width: 5px; height: 5px; background: var(--clay);
  transform: translate(-50%, -50%); pointer-events: none;
}
.tile::before { left: 0; top: 0; }                    /* top-left */
.tile::after { left: 100%; top: 100%; }               /* bottom-right */
.about-stats::before { left: 100%; top: 0; }          /* top-right of the grid */
.about-stats::after { left: 0; top: 100%; }           /* bottom-left of the grid */
.about-stats::before, .about-stats::after { opacity: var(--stats-corners, 1); } /* faded in with the tiles (scroll-transition.js) */

.tile--text { grid-column: 1 / -1; }
.tile-statement { font-size: 15px; line-height: 1.25; font-weight: 300; letter-spacing: -.02em; max-width: 22ch; margin: 0; }

.tile--location { grid-column: 1 / -1; flex-direction: row; align-items: flex-end; justify-content: space-between; }
.loc-place small { display: block; margin-bottom: 8px; }
.loc-place b { display: block; font-size: 18px; letter-spacing: -.03em; }
.loc-clock { text-align: right; }

/* interactive map behind the location tile (assets/js/map.js) */
.tile--location { overflow: visible; }
.tile--location > :not(.loc-map) { position: relative; z-index: 1001; pointer-events: none; } /* above Leaflet panes */
.tile--location .loc-route { pointer-events: auto; }
.loc-map { position: absolute !important; inset: 0; z-index: 0 !important; overflow: hidden; background: var(--charcoal); }
.loc-map::after { /* keeps the address readable over the streets; clicks pass through to the map */
  content: ""; position: absolute; inset: 0; z-index: 450; pointer-events: none;
  background: linear-gradient(to top, rgba(25,24,20,.92) 0%, rgba(25,24,20,.5) 40%, rgba(25,24,20,0) 75%);
}
.loc-map.leaflet-container { font: inherit; background: var(--charcoal); outline: none; cursor: grab; }
.loc-map.leaflet-container.leaflet-drag-target, .loc-map .leaflet-dragging { cursor: grabbing; }
.loc-pin {
  position: absolute; inset: 0;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--clay); box-shadow: 0 0 0 4px rgba(152,50,1,.25);
}
.loc-pin::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  border: 1px solid var(--clay); animation: loc-ping 2.4s cubic-bezier(.17,.84,.44,1) infinite;
}
@keyframes loc-ping { from { transform: scale(1); opacity: .9; } to { transform: scale(4.5); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .loc-pin::after { animation: none; } }
/* zoom buttons + attribution in brand style */
.loc-map .leaflet-control-zoom { border: 0; margin: 14px 0 0 14px; box-shadow: none; display: grid; gap: 4px; }
.loc-map .leaflet-control-zoom a {
  width: 30px; height: 30px; line-height: 28px; border-radius: 0;
  background: rgba(25,24,20,.75); color: var(--plaster);
  border: 1px solid rgba(239,235,225,.35); font: 300 18px/28px var(--sans);
  transition: background-color .3s ease, border-color .3s ease;
}
.loc-map .leaflet-control-zoom a:hover { background: var(--clay); border-color: var(--clay); color: var(--plaster); }
.loc-map .leaflet-control-zoom a.leaflet-disabled { opacity: .35; background: rgba(25,24,20,.75); }
.loc-map .leaflet-control-attribution {
  background: none; padding: 6px 10px; font: 400 9px/1 var(--sans); letter-spacing: .02em; color: rgba(239,235,225,.4);
}
.loc-map .leaflet-control-attribution a { color: inherit; }
.loc-map .leaflet-bottom.leaflet-right { bottom: auto; top: 0; } /* credit top-right, clear of the address */
.loc-place .loc-address { margin: 10px 0 0; color: rgba(239,235,225,.75); }
.loc-route { margin-top: 16px; }
.loc-clock time { display: block; font-size: 18px; line-height: 1; font-weight: 300; letter-spacing: -.02em; font-variant-numeric: tabular-nums; color: var(--muted); }
.loc-clock span { display: block; margin-top: 6px; font-size: 9px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }

@media (min-width: 800px) {
  .about-stats {
    grid-column: 3; grid-row: 1 / span 3;
    height: 100%;
    grid-template-rows: 1.4fr 1fr;
  }
  .tile { padding: 16px; }
  .tile small { font-size: 12px; }
  .tile b { font-size: 30px; }
  .tile-statement { font-size: 22px; max-width: 18ch; }
  .loc-place b { font-size: 20px; white-space: nowrap; }
  .loc-clock time { font-size: 24px; }
}
@media (min-width: 1200px) {
  .tile { padding: 22px; }
  .tile small { font-size: 13px; letter-spacing: -.005em; }
  .tile b { font-size: 42px; }
  .loc-place b { font-size: 30px; }
  .tile-statement { font-size: 30px; line-height: 1.16; letter-spacing: -.03em; }
  .loc-clock time { font-size: 30px; }
}

/* stat tiles: index label on top, number + caption grouped at the bottom */
.tile--stat { justify-content: space-between; }
.tile-index { font-size: 13px; line-height: 1.3; color: var(--muted); }
.stat { display: flex; flex-direction: column; gap: 10px; }
.stat b { font-size: 40px; letter-spacing: -.06em; }
.stat small { font-size: 13px; line-height: 1.35; color: rgba(239,235,225,.7); max-width: 22ch; }
@media (min-width: 800px) {
  .stat b { font-size: 56px; }
  .stat small { font-size: 14px; }
}
@media (min-width: 1200px) {
  .tile-index { font-size: 16px; letter-spacing: -.01em; }
  .stat { gap: 14px; }
  .stat b { font-size: clamp(52px, 4.6vw, 80px); line-height: .9; }
  .stat small { font-size: 16px; letter-spacing: -.01em; }
}

/* ---------- frame slot + mask (the core) ---------- */
.frame-slot {
  position: relative;
  z-index: 5;
  min-width: 0;
  grid-row: 2; grid-column: 1;
  width: min(100%, 340px, 24vh);
  aspect-ratio: 3 / 4;                 /* portrait 3:4 */
  justify-self: center; align-self: center;
}
@media (min-width: 800px) {
  .frame-slot { grid-column: 2; grid-row: 1 / span 3; width: 100%; }
}

.animated-mask {
  position: absolute;
  left: 50%;
  top: calc(var(--frame-top) * -1);
  transform: translateX(-50%);
  width: 102vw;
  height: max(var(--section-height), 100vh);
  overflow: hidden;
  z-index: 5;
  /* clip-path is driven by GSAP */
}

.media-frame {
  position: absolute;
  /* static: exactly the 3:4 slot, never scaled. Only the mask reveals it. */
  top: var(--frame-top); left: 50%;
  width: var(--frame-w); height: var(--frame-h);
  transform: translateX(-50%);
  background: var(--paper);
  overflow: hidden;
}
.media-frame img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; }

.hero {
  position: absolute;
  left: 50%; top: 50vh;
  width: calc(100vw + 2px);
  height: 100vh;
  background: var(--hero-bg);
  color: var(--hero-fg);
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 110px var(--margin) 10vh; /* copy + button lifted ~10% off the bottom */
  z-index: 5;
  overflow: hidden;
}
.hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgba(25,24,20,.1) 0%, rgba(25,24,20,.35) 55%, rgba(25,24,20,.85) 100%);
}
.hero-footer, .hero-content { position: relative; z-index: 2; }
.hero-content {
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}
.hero-copy { max-width: 100%; }
.hero-eyebrow { display: block; font: 500 11px/1.4 var(--sans); letter-spacing: .16em; margin-bottom: 24px; }
.hero-title { font-size: min(52px, 8.4vw); /* "OUR CRAFTSMANSHIP" must fit a 375px phone */ font-weight: 300; line-height: 1; letter-spacing: -.045em; margin: 0; }
@media (min-width: 800px) { .hero-title { font-size: min(96px, 7.6vw); } }
.hero-text { flex-basis: 100%; margin: 0; max-width: none; font-size: 16px; line-height: 1.55; font-weight: 300; opacity: .7; } /* own row under title + button */
@media (min-width: 800px) { .hero-text { font-size: 24px; white-space: nowrap; } } /* one line on desktop */
.hero-button { flex-shrink: 0; }
.hero-footer { width: 100%; max-width: 1600px; margin: 0 auto; font: 500 11px/1.4 var(--sans); letter-spacing: .16em; opacity: .5; }

@media (prefers-reduced-motion: reduce) { .hero { display: none; } }
.tile--location::before, .tile--location::after { z-index: 2; } /* corner markers above the map */
/* every corner marker (incl. the stat tiles' bottom corners that land on the map's top edge) above the map */
.tile::before, .tile::after, .about-stats::before, .about-stats::after { z-index: 3; }
/* stat tiles: number + caption sit right under their label instead of at the bottom */
.tile--stat { justify-content: center; } /* label + number + caption centred vertically in the tile */
.tile--stat .stat { margin-top: 28px; }
@media (min-width: 1200px) { .tile--stat .stat { margin-top: 40px; } }

/* GSAP leaves a transform on each tile, so every tile is its own stacking context and a
   pseudo's z-index can't escape it. Stack the stat tiles (and their bottom corner markers,
   which sit on the map's top edge) above the location tile instead. */
.about-stats .tile { z-index: 1; }
.about-stats .tile--location { z-index: 0; }

/* phones: the zoom buttons sat on top of the address — pinch-zoom does the job there */
@media (max-width: 799px) {
  .loc-map .leaflet-control-zoom { display: none; }
  .tile--location { padding-top: 120px; }
}
