/* ============================================================
   LOCAPPONI — structural & typographic styles.
   Colors are applied with Tailwind utility classes in markup;
   layout / type / motion live here using the design tokens.
   ============================================================ */

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--color-paper);
  color: var(--color-ink);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; }

a { color: inherit; text-decoration: none; }

/* Custom elements are display:inline by default — make them block so
   their backgrounds/layout wrap their block content correctly. */
site-header,
site-footer,
hero-gallery,
brand-statement,
section-heading,
project-list,
project-card,
project-detail { display: block; }

/* shared layout container */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* uppercase display helper */
.u-display {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  font-weight: 600;
  line-height: 1.02;
}

/* ===========================================================
   Header
   =========================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--color-paper);   /* solid 100% white */
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: clamp(0.6rem, 1.1vw, 0.9rem);
}
.brand { display: inline-flex; align-items: center; }

/* Wordmark rendered from logo.svg via CSS mask so it recolors with
   `color` and the url() stays correct from any page depth. */
.brand-logo {
  display: block;
  width: 110px;          /* header & footer share one size */
  height: 14px;
  -webkit-mask: url("../assets/logo.svg") no-repeat center / contain;
  mask: url("../assets/logo.svg") no-repeat center / contain;
  background-color: currentColor;
}
.brand-logo--header { color: var(--color-ink); }
.brand-logo--footer { color: var(--color-on-dark); }

.site-header__meta {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 3vw, 2.5rem);
}
.clock {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.link-contact {
  font-family: var(--font-body);
  text-transform: uppercase;
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  position: relative;
}
.link-contact::after {
  content: "";
  position: absolute;
  left: 0; bottom: -3px;
  width: 100%; height: 1.5px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dur) var(--ease-out);
}
.link-contact:hover::after { transform: scaleX(1); }

@media (max-width: 640px) {
  .clock { display: none; }
}

/* ===========================================================
   Hero
   =========================================================== */
.hero {
  position: relative;
  min-height: clamp(560px, 86vh, 920px);
  display: grid;
  place-items: center;
}
.hero__title {
  font-family: var(--font-display);
  text-transform: uppercase;
  font-weight: 300;
  font-size: var(--fs-display);
  letter-spacing: var(--tracking-tight);
  line-height: 1;
  text-align: center;
  margin: 0;
  z-index: 2;
}
.hero__gallery {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;          /* centers the in-flow title; images are absolute */
  place-items: center;
}
/* Uniform images pinned to the orbit centre at every breakpoint;
   JS (animations.js) sets the per-frame transform. */
.hero-img {
  position: absolute;
  left: 50%;
  top: 50%;
  width: clamp(88px, 14vw, 185px);
  aspect-ratio: 3 / 2;
  overflow: hidden;
  border-radius: 5px;
  transform: translate(-50%, -50%);   /* fallback before JS places them */
  will-change: transform;
}
.hero-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* mobile — same orbit logic, just a smaller wordmark and a touch less height */
@media (max-width: 767px) {
  .hero { min-height: 80vh; }
  .hero__title { font-size: clamp(1.85rem, 11vw, 3.25rem); }
}

/* ===========================================================
   Statement block
   =========================================================== */
.statement {
  padding-block: clamp(2.5rem, 7vw, 6rem) clamp(1.5rem, 4vw, 3rem);
}
.statement__text {
  font-family: var(--font-display);
  text-transform: uppercase;
  font-weight: 400;
  font-size: var(--fs-statement);
  line-height: var(--lh-display);
  letter-spacing: var(--ls-display);
  max-width: none;   /* fill the container width (like the reference) */
  margin: 0;
}
.statement__lead { color: var(--color-ink); }

/* ===========================================================
   Section heading (↘ PROJETOS SELECIONADOS)
   =========================================================== */
.section-heading {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-block: clamp(1rem, 3vw, 2.5rem) clamp(1.25rem, 2.5vw, 2rem);
}
.section-heading__icon {
  width: calc(var(--fs-40) * 0.66);   /* ~cap height of the heading */
  height: calc(var(--fs-40) * 0.66);
  flex: none;
  color: #a3a3a3;
}
.section-heading__icon svg {
  display: block;
  width: 100%;
  height: 100%;
}
.section-heading__title {
  font-family: var(--font-display);
  text-transform: uppercase;
  font-weight: 400;
  font-size: var(--fs-heading);
  line-height: var(--lh-display);
  letter-spacing: var(--ls-display);
  margin: 0;
}

/* ===========================================================
   Project cards
   =========================================================== */
.project-list {
  display: flex;
  flex-direction: column;
  gap: clamp(0.75rem, 1.6vw, 1.25rem);
  padding-bottom: clamp(3rem, 7vw, 6rem);
}
.project-card {
  position: relative;
  display: block;
  border-radius: var(--radius-card);
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: var(--color-ink);
  isolation: isolate;
}
@media (max-width: 600px) {
  .project-card { aspect-ratio: 4 / 5; }
}
.project-card__media {
  position: absolute;
  inset: 0;
  z-index: -1;
}
.project-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.9s var(--ease-out);
}
.project-card:hover .project-card__media img { transform: scale(1.04); }
.project-card__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 55%, rgba(0,0,0,0.35) 100%);
  pointer-events: none;
}
.project-card__tags {
  position: absolute;
  right: clamp(1rem, 2vw, 1.75rem);
  bottom: clamp(1rem, 2vw, 1.75rem);
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.tag {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  font-weight: 600;
  font-size: var(--fs-tag);
  line-height: 1;
  padding: 8px 24px;
  border-radius: var(--radius-pill);
  background: rgba(20, 20, 22, 0.26);
  color: #fff;
  border: none;
  white-space: nowrap;
}
/* screen-reader-only project title for accessibility */
.project-card__label {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

/* ===========================================================
   Footer / CTA
   =========================================================== */
.site-footer {
  background: var(--color-ink);
  color: var(--color-on-dark);
}
.site-footer__cta {
  text-align: center;
  padding-block: clamp(3rem, 9vw, 7rem) clamp(2rem, 6vw, 4rem);
}
.site-footer__title {
  font-family: var(--font-display);
  text-transform: uppercase;
  font-weight: 400;
  font-size: var(--fs-cta);
  letter-spacing: var(--ls-display);
  line-height: var(--lh-display);
  margin: 0 0 clamp(1.5rem, 3vw, 2.5rem);
}
.btn-whatsapp {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  font-weight: 600;
  font-size: 16px;
  line-height: 1;
  padding: 16px 24px;
  border-radius: 16px;
  background: #3E4045;
  color: #fff;
  transition: background var(--dur) var(--ease-out), transform var(--dur) var(--ease-out);
}
.btn-whatsapp:hover { background: #4a4d53; transform: translateY(-2px); }
.site-footer__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: clamp(2rem, 5vw, 3.5rem);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.footer-socials {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  font-weight: 400;
  font-size: 20px;
}
.footer-socials a { transition: opacity var(--dur) var(--ease-out); }
.footer-socials a:hover { opacity: 0.6; }
.footer-socials__sep { opacity: 0.4; }
.footer-wordmark {
  display: inline-flex;
  align-items: center;
  transition: opacity var(--dur) var(--ease-out);
}
.footer-wordmark:hover { opacity: 0.7; }

@media (max-width: 600px) {
  .site-footer__bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.5rem;
  }
  .footer-socials { font-size: 16px; }
}

/* ===========================================================
   Project detail page
   =========================================================== */
.proj {
  padding-block: clamp(2rem, 6vw, 5rem) clamp(3rem, 7vw, 6rem);
}
.proj__back {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  font-weight: 600;
  font-size: var(--fs-meta);
  color: var(--color-muted);
  margin-bottom: clamp(1.5rem, 4vw, 3rem);
  transition: color var(--dur) var(--ease-out);
}
.proj__back:hover { color: var(--color-ink); }
/* title + tags share one row: title left, tags right (same height) */
.proj header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem 2rem;
}
.proj__title {
  font-family: var(--font-display);
  text-transform: uppercase;
  font-weight: 400;
  font-size: var(--fs-cta);
  line-height: 1.02;
  letter-spacing: var(--tracking-tight);
  margin: 0;
}
.proj__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0;
  flex: none;
}
.proj__tag {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  font-weight: 600;
  font-size: var(--fs-tag);
  line-height: 1;
  padding: 8px 20px;
  border-radius: var(--radius-pill);
  border: none;
  background: #ededed;
  color: var(--color-ink);
}
.proj__cover {
  margin-top: clamp(1.5rem, 4vw, 3rem);
  border-radius: var(--radius-card);
  overflow: hidden;
  aspect-ratio: 16 / 8;
  background: var(--color-ink);
}
.proj__cover img { width: 100%; height: 100%; object-fit: cover; }

.proj__meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: clamp(1.5rem, 3vw, 2.5rem);
  margin-top: clamp(2.5rem, 6vw, 4.5rem);
  padding-bottom: clamp(2rem, 4vw, 3rem);
  border-bottom: 1px solid var(--color-line);
}
.proj__meta dt {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  font-weight: 700;
  font-size: var(--fs-tag);
  color: var(--color-muted);
  margin-bottom: 0.4rem;
}
.proj__meta dd { margin: 0; font-size: var(--fs-body); }

.proj__body {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.25rem;
  max-width: 62ch;
  margin-top: clamp(2.5rem, 5vw, 4rem);
  font-size: clamp(1.05rem, 1.5vw, 1.3rem);
  line-height: 1.65;
}

/* ---- Case-study narrative ---- */
.proj__lead {
  max-width: 26ch;
  margin: clamp(2.5rem, 5vw, 4rem) 0 0;
  font-family: var(--font-display);
  text-transform: uppercase;
  font-weight: 400;
  font-size: clamp(1.4rem, 2.6vw, 2rem);
  line-height: 1.12;
  letter-spacing: var(--ls-display);
}
.proj__story {
  display: flex;
  flex-direction: column;
  gap: clamp(3rem, 7vw, 6rem);
  margin-top: clamp(3rem, 7vw, 6rem);
}
.proj-chapter,
.proj-method {
  display: grid;
  grid-template-columns: 4rem minmax(0, 1fr);
  gap: clamp(1.25rem, 3vw, 3rem);
  align-items: start;
}
.proj-chapter__index {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.5rem, 2vw, 1.9rem);
  color: var(--color-faint);
  line-height: 1;
  padding-top: 0.35em;
}
.proj-chapter__kicker {
  display: block;
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  font-weight: 600;
  font-size: var(--fs-tag);
  color: var(--color-muted);
  margin-bottom: 0.75rem;
}
.proj-chapter__heading {
  font-family: var(--font-display);
  text-transform: uppercase;
  font-weight: 400;
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  line-height: 1.08;
  letter-spacing: var(--ls-display);
  margin: 0 0 1rem;
}
.proj-chapter__text {
  margin: 0;
  max-width: 56ch;
  font-size: clamp(1.05rem, 1.4vw, 1.25rem);
  line-height: 1.6;
  color: #3a3a3a;
}

/* Results stats */
.proj-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: clamp(1.5rem, 3vw, 2.5rem);
  margin-top: 0.5rem;
}
.proj-stat { border-top: 1px solid var(--color-ink); padding-top: 1rem; }
.proj-stat__value {
  display: block;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.25rem, 5vw, 3.25rem);
  line-height: 1;
  letter-spacing: var(--ls-display);
}
.proj-stat__label {
  display: block;
  margin-top: 0.6rem;
  font-size: var(--fs-meta);
  color: var(--color-muted);
}

/* Methodology map — the wide diagram breaks out of the indented text
   column to span the full section width, centered for balance. */
.proj-method__scroll {
  grid-column: 1 / -1;
  min-width: 0;
  margin-top: clamp(1.5rem, 3vw, 2.5rem);
}
.proj-method__map {
  display: block;
  width: 100%;
  max-width: 60rem;
  height: auto;
  margin-inline: auto;
}

@media (max-width: 640px) {
  .proj-chapter,
  .proj-method { grid-template-columns: 1fr; gap: 0.75rem; }
  .proj-chapter__index { padding-top: 0; }
  /* The diagram is too wide to read when squeezed to phone width, so it
     keeps a legible size and scrolls sideways, bleeding to the screen edges. */
  .proj-method__scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-inline: calc(var(--gutter) * -1);
    padding-inline: var(--gutter);
  }
  .proj-method__map { min-width: 34rem; max-width: none; margin-inline: 0; }
}
/* Interleaved visuals — sit between the narrative chapters, full container
   width to contrast with the indented text and pace the read. */
.proj-figure {
  margin: 0;
  border-radius: var(--radius-img);
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: var(--color-ink);
}
.proj-figure--wide { aspect-ratio: 16 / 8; }
.proj-figure img { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (max-width: 600px) {
  .proj-figure,
  .proj-figure--wide { aspect-ratio: 4 / 3; }
}

.proj__next {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: clamp(3rem, 7vw, 5.5rem);
  padding-top: clamp(2rem, 4vw, 3rem);
  border-top: 1px solid var(--color-line);
}
.proj__next-label {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  font-weight: 600;
  font-size: var(--fs-tag);
  color: var(--color-muted);
}
.proj__next-title {
  font-family: var(--font-display);
  text-transform: uppercase;
  font-weight: 400;
  font-size: var(--fs-heading);
  letter-spacing: var(--tracking-tight);
  margin-top: 0.3rem;
  transition: opacity var(--dur) var(--ease-out);
}
.proj__next:hover .proj__next-title { opacity: 0.55; }

/* ===========================================================
   Reveal animation initial states (only applied when JS adds
   the .has-gsap flag, so content is visible without JS).
   =========================================================== */
.has-gsap [data-reveal] { opacity: 0; }

/* Manifesto — per-line mask reveal (line wrappers built by JS) */
.m-line { display: block; overflow: hidden; }
.m-line__inner { display: block; }
.m-word { display: inline; }

/* Lenis smooth scroll (recommended base) */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }
.lenis.lenis-smooth iframe { pointer-events: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .has-gsap [data-reveal] { opacity: 1 !important; transform: none !important; }
  [data-manifesto] { visibility: visible !important; }
}
