/* ============================================================
   GUILHERME HÚNGARO · presentation (English)
   World: A41 monochrome. Black and white, Barlow Condensed 800/900,
   mono only for data, 1px lines. One dot field behind the whole deck.
   One slide per screen; scrolling snaps to the next slide.
   ============================================================ */

@font-face {
  font-family: "Barlow Condensed";
  src: url("../fonts/BarlowCondensed-ExtraBold.ttf") format("truetype");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Barlow Condensed";
  src: url("../fonts/BarlowCondensed-Black.ttf") format("truetype");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #070707;
  --bg2: #0d0d0d;
  --text: #f7f7f7;
  --soft: #d6d6d6;
  --muted: #b4b4b4;
  --faint: #8e8e8e;
  --line: rgba(255, 255, 255, .12);
  --line2: rgba(255, 255, 255, .22);
  --display: "Barlow Condensed", Impact, sans-serif;
  --body: "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "Cascadia Code", Consolas, "Courier New", monospace;
  --ease-out: cubic-bezier(.23, 1, .32, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  scroll-snap-type: y mandatory;
  scrollbar-color: #2a2a2a #070707;
  scrollbar-width: thin;
}

body {
  background: var(--bg);
  color: var(--text);
  font: 16.5px/1.62 var(--body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

::selection { background: #f7f7f7; color: #070707; }
:focus-visible { outline: 2px solid #f7f7f7; outline-offset: 3px; border-radius: 4px; }

h1, h2, h3 {
  font-family: var(--display);
  text-transform: uppercase;
  line-height: 1;
  letter-spacing: -.012em;
  font-weight: 800;
  text-wrap: balance;
}

img { max-width: 100%; }
ul, ol { list-style: none; }

.wrap { width: 100%; max-width: 1180px; margin-inline: auto; padding-inline: 32px; }

/* ---------- dot field, progress, counter ---------- */

#field {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  display: block;
  z-index: 0;
  pointer-events: none;
}
main { position: relative; z-index: 1; }

.progress {
  position: fixed; top: 0; left: 0; right: 0; height: 2px;
  background: #f7f7f7; transform: scaleX(0); transform-origin: 0 50%;
  z-index: 60; pointer-events: none;
}

.counter {
  position: fixed; right: 28px; bottom: 22px; z-index: 50;
  font: 500 11px var(--mono); letter-spacing: .2em; color: var(--faint);
  font-variant-numeric: tabular-nums;
}
.counter-now { color: var(--soft); }

/* ---------- slides ---------- */

.slide {
  position: relative;
  min-height: 100svh;
  display: flex; align-items: center;
  scroll-snap-align: start;
  padding-block: 72px;
}

.eyebrow {
  font: 500 11px var(--mono); letter-spacing: .24em; text-transform: uppercase;
  color: var(--muted);
}

h2 { font-size: clamp(2.6rem, 5vw, 4.2rem); font-weight: 900; }

.role {
  font: 500 12px var(--mono); letter-spacing: .18em; text-transform: uppercase;
  color: var(--soft);
}

.big {
  display: block;
  font: 900 clamp(2.8rem, 5vw, 4.4rem)/1 var(--display);
  font-variant-numeric: tabular-nums;
  color: #fff; letter-spacing: -.01em;
}
.label {
  display: block; margin-top: 10px;
  font: 500 11px var(--mono); letter-spacing: .18em; text-transform: uppercase;
  color: var(--muted);
}

/* ---------- reveal ---------- */

.js .reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .55s var(--ease-out), transform .55s var(--ease-out);
  transition-delay: calc(var(--order, 0) * 70ms);
}
.js .reveal.on { opacity: 1; transform: none; }

/* ---------- frame (photo or placeholder) ---------- */

.frame {
  position: relative;
  aspect-ratio: var(--ratio, 4 / 5);
  border: 1px solid var(--line2);
  border-radius: 16px;
  background: rgba(13, 13, 13, .72);
  display: grid; place-items: center;
  overflow: visible;
}
.frame img {
  width: 100%; height: 100%; object-fit: cover;
  border-radius: 15px; display: block;
}
.frame::before, .frame::after {
  content: "+"; position: absolute;
  font: 400 14px var(--mono); color: var(--faint); line-height: 1;
}
.frame::before { top: -8px; left: -9px; }
.frame::after { bottom: -8px; right: -9px; }
.frame-label {
  font: 500 11px var(--mono); letter-spacing: .2em; text-transform: uppercase;
  color: var(--faint); text-align: center; padding: 16px;
}

/* ---------- cover ---------- */

.cover { overflow: hidden; }
.cover-fallback { display: none; }
html:not(.js) .cover-fallback {
  display: block; position: absolute;
  top: 44%; left: 50%; transform: translate(-50%, -50%);
  width: min(44vmin, 360px); height: min(44vmin, 360px);
}
.cover-body {
  position: absolute; inset-inline: 0; bottom: 56px; z-index: 2;
  padding-inline: 28px; text-align: center;
}
.cover-sub { font-size: 18px; color: var(--soft); }

/* ---------- about ---------- */

.about-grid {
  display: grid; grid-template-columns: 240px 1fr;
  gap: 72px; align-items: center;
}
.about-text h2 { margin-top: 14px; }
.about-text .role { margin-top: 16px; }
.points { margin-top: 36px; border-top: 1px solid var(--line); }
.point {
  display: grid; grid-template-columns: 220px 1fr; gap: 24px; align-items: baseline;
  padding: 16px 0; border-bottom: 1px solid var(--line);
}
.point h3 { font-size: 1.45rem; font-weight: 800; }
.point p { color: var(--muted); font-size: 16px; }

/* ---------- journey rail: one vertical line through the journey slides ---------- */

.on-rail { --rail-x: max(32px, calc((100% - 1180px) / 2 + 32px)); --rail-gap: 64px; }
.rail {
  position: absolute; top: 0; bottom: 0; left: var(--rail-x);
  border-left: 1px solid var(--line2);
  pointer-events: none;
}
.rail-start .rail { top: var(--rail-top, 50%); }
.rail-end .rail { bottom: var(--rail-bottom, 50%); }
.wrap.rail-content { padding-left: calc(32px + var(--rail-gap)); }
/* the dot sits on the line, at the height of the slide's .node (set by site.js) */
.rail-dot {
  position: absolute; left: var(--rail-x); top: var(--node-y, 50%); z-index: 1;
  width: 13px; height: 13px; border-radius: 50%;
  background: var(--bg); border: 1px solid #f7f7f7;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.journey h2 { margin-top: 18px; max-width: 18ch; }

/* ---------- chapters ---------- */

.chapter-grid {
  display: grid; grid-template-columns: auto 340px;
  gap: 56px; align-items: center; justify-content: start;
}
.years {
  font: 500 12px var(--mono); letter-spacing: .22em; text-transform: uppercase; color: var(--muted);
}
.chapter-text h2 { margin-top: 12px; font-size: clamp(3rem, 6vw, 5.2rem); }
.chapter-text .role { margin-top: 14px; }
/* stack tags: quiet pills under the role, a reference and not a headline */
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.tags li {
  padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px;
  font: 500 10.5px/1.4 var(--mono); letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted);
}
.chapter-text .line { margin-top: 22px; color: var(--muted); font-size: 17px; max-width: 34ch; }
.chapter-text .stat { margin-top: 32px; }
.chapter-text.wide { max-width: 760px; }
.chapter-text.wide .line { max-width: 56ch; }

/* frames are sized by height so the photos always fit the slide */
.frames { display: flex; gap: 20px; align-items: stretch; }
.frames .frame { height: 100%; width: auto; }
.frames.one { height: min(58svh, 500px); }

/* ---------- gallery: one photo or video at a time; drag, or click a side ---------- */

.frames.gallery-wrap { height: auto; flex-direction: column; gap: 14px; align-items: flex-start; }
.gallery-frame { position: relative; }
.gallery-frame::before, .gallery-frame::after {
  content: "+"; position: absolute; z-index: 1;
  font: 400 14px var(--mono); color: var(--faint); line-height: 1;
}
.gallery-frame::before { top: -8px; left: -9px; }
.gallery-frame::after { bottom: -8px; right: -9px; }
.gallery {
  --gh: min(56svh, 480px);
  position: relative; height: var(--gh); aspect-ratio: var(--ratio, 1 / 1);
  border: 1px solid var(--line2); border-radius: 16px; overflow: hidden;
  background: #0b0b0b;
  cursor: grab; touch-action: pan-y; user-select: none; -webkit-user-select: none;
}
.tall .gallery { --gh: min(64svh, 560px); }
.gallery.dragging { cursor: grabbing; }
.gallery-track {
  display: flex; height: 100%;
  transition: transform .55s var(--ease-out);
  will-change: transform;
}
.gallery.dragging .gallery-track { transition: none; }
.gallery-item { flex: 0 0 100%; height: 100%; overflow: hidden; }
.gallery-item img, .gallery-item video {
  display: block; width: 100%; height: 100%; object-fit: cover;
  -webkit-user-drag: none; pointer-events: none;
}
.gallery.contain .gallery-item img, .gallery.contain .gallery-item video { object-fit: contain; }
.gallery-count, .embed-caption {
  font: 500 11px var(--mono); letter-spacing: .2em; color: var(--faint);
  font-variant-numeric: tabular-nums;
}
.gallery-now { color: var(--soft); }

/* ---------- embed: a live site drawn at desktop size and scaled to the frame (site.js) ---------- */

.embed {
  --gh: min(56svh, 480px);
  position: relative; height: var(--gh); aspect-ratio: 4 / 3;
  border: 1px solid var(--line2); border-radius: 16px; overflow: hidden;
  background: #0b0b0b;
  cursor: pointer;
  transition: opacity .22s var(--ease-out), transform .22s var(--ease-out);
}
/* in the slide the site is a locked preview: the wheel scrolls the deck, a click opens it */
.embed iframe {
  position: absolute; top: 0; left: 0;
  width: 960px; height: 720px; border: 0;
  transform-origin: 0 0;
  pointer-events: none;
}
.embed.open { background: #fcfcfc; cursor: auto; }
.embed.open iframe { width: 100%; height: 100%; pointer-events: auto; }
.embed-caption { text-decoration: none; text-transform: uppercase; transition: color .2s; }
.embed-caption:hover { color: var(--soft); }

/* ---------- overlay: an embed or an expandable gallery opens over the deck (site.js) ---------- */

.gallery.expandable { cursor: pointer; transition: opacity .22s var(--ease-out), transform .22s var(--ease-out); }
.embed.open, .gallery.expandable.open {
  position: fixed; inset: 5vh 5vw; z-index: 100;
  width: auto; height: auto; aspect-ratio: auto;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .6);
}
.gallery.expandable.open { cursor: grab; }
.gallery.open .gallery-item img, .gallery.open .gallery-item video { object-fit: contain; }
/* a 16:9 recording inside a 9:16 video: on a wide screen the open box shows the recording, not the black bands */
@media (min-aspect-ratio: 1 / 1) {
  .gallery.open .gallery-item.letterbox video { object-fit: cover; }
}
.embed.fading, .gallery.fading { opacity: 0; transform: scale(.985); }
.overlay-backdrop, .overlay-close { display: none; }
.open ~ .overlay-backdrop {
  display: block; position: fixed; inset: 0; z-index: 99;
  background: rgba(7, 7, 7, .6); cursor: pointer;
  transition: opacity .22s var(--ease-out);
}
.open ~ .overlay-close {
  display: grid; place-items: center; position: fixed; top: 16px; right: 16px; z-index: 101;
  width: 40px; height: 40px; padding: 0;
  border: 1px solid var(--line2); border-radius: 50%;
  background: var(--bg); color: var(--text); cursor: pointer;
  transition: opacity .22s var(--ease-out), border-color .2s;
}
.overlay-close svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.overlay-close:hover { border-color: #f7f7f7; }
.fading ~ .overlay-backdrop, .fading ~ .overlay-close { opacity: 0; }
html.overlay-open { overflow: hidden; }
.overlay-open .counter, .overlay-open .progress { display: none; }

/* ---------- A41: systems in production, one card each (sector, system, impact) ---------- */

.a41 .rail-content { display: flex; flex-direction: column; gap: 48px; }
.systems { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 16px; }
.system {
  display: flex; flex-direction: column;
  padding: 20px 18px 20px;
  background: rgba(13, 13, 13, .72); border: 1px solid var(--line2); border-radius: 12px;
}
.system .tags { margin-top: auto; padding-top: 16px; }
.sector {
  display: block;
  font: 500 10.5px var(--mono); letter-spacing: .18em; text-transform: uppercase; color: var(--faint);
}
.system h3 { margin-top: 12px; font-size: 1.4rem; }
.system p { margin-top: 10px; font-size: 14.5px; line-height: 1.5; color: var(--muted); }

/* ---------- responsive ---------- */

@media (max-width: 880px) {
  html { scroll-snap-type: none; }
  .slide { min-height: auto; padding-block: 88px; }
  .cover { min-height: 100svh; }
  .about-grid, .chapter-grid { grid-template-columns: 1fr; gap: 40px; }
  .about-grid .photo { max-width: 240px; }
  .point { grid-template-columns: 1fr; gap: 4px; }
  .on-rail { --rail-x: 20px; --rail-gap: 36px; }
  .wrap.rail-content { padding-left: calc(20px + var(--rail-gap)); }
  .frames, .frames.one { height: auto; flex-wrap: wrap; }
  .frames .frame { height: auto; width: min(100%, 320px); }
  .gallery, .tall .gallery { height: auto; width: min(100%, 360px); }
  .embed { height: auto; width: min(100%, 560px); }
  .frames.gallery-wrap .gallery-frame:has(.embed) { width: 100%; }
  .systems { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px) {
  .wrap { padding-inline: 20px; }
  .systems { grid-template-columns: 1fr; }
  .cover-body { bottom: 40px; }
  .counter { right: 16px; bottom: 14px; }
}

/* ---------- reduced motion / static mode ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .js .reveal { opacity: 1; transform: none; }
}

body.static .reveal { opacity: 1; transform: none; transition: none; }
