/* ============================================================================
   VÉRTICE — Construção & Engenharia
   Modern clean · dark architectural studio · horizontal scroll track
   ========================================================================== */

:root {
  color-scheme: dark;
  --bg: #0b0c0e;
  --bg-soft: #101114;
  --surface: rgba(255, 255, 255, 0.035);
  --ink: #f2f1ed;
  --muted: #9ba0a6;
  --accent: #ff6b3d;
  --line: rgba(255, 255, 255, 0.08);
  --font-display: "Space Grotesk", "Segoe UI", system-ui, sans-serif;
  --font-body: "Inter", "Segoe UI", system-ui, sans-serif;
  --header-h: 68px;
  --n: 6; /* chapters — keep in sync with the number of .panel elements */
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  overflow-x: hidden;
  letter-spacing: 0.005em;
}

::selection { background: var(--accent); color: #0b0c0e; }

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

/* ---------------------------------------------------------------- layers */

.poster {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(90% 60% at 50% 112%, rgba(255, 255, 255, 0.05) 0%, transparent 60%),
    linear-gradient(180deg, #0b0c0e 0%, #0d0e11 100%);
}

#gl {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  display: block;
}

body.no-webgl #gl { display: none; }

/* ---------------------------------------------------------------- header */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: 0 clamp(1.25rem, 3vw, 2.5rem);
  padding-left: calc(clamp(1.25rem, 3vw, 2.5rem) + env(safe-area-inset-left, 0px));
  padding-right: calc(clamp(1.25rem, 3vw, 2.5rem) + env(safe-area-inset-right, 0px));
  background: rgba(11, 12, 14, 0.6);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--ink);
}

.brand-mark {
  display: block;
  width: 30px;
  height: 30px;
}

.brand-text {
  display: flex;
  flex-direction: column;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.14em;
  font-size: 1rem;
  line-height: 1.15;
}

.brand-text small {
  font-family: var(--font-body);
  font-weight: 400;
  letter-spacing: 0.06em;
  font-size: 0.66rem;
  color: var(--muted);
}

.chapter-links {
  display: flex;
  gap: clamp(1rem, 2.4vw, 2.2rem);
}

.chapter-links a {
  position: relative;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  padding: 0.4rem 0;
  transition: color 0.25s ease;
}

.chapter-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 1px;
  width: 100%;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.chapter-links a:hover,
.chapter-links a[aria-current="true"] { color: var(--ink); }
.chapter-links a[aria-current="true"]::after { transform: scaleX(1); }

.header-actions {
  display: flex;
  align-items: center;
  gap: 1.1rem;
}

.lang-switch {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 500;
}

.lang-switch button {
  background: none;
  border: 0;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
  padding: 0.3rem 0.15rem;
  transition: color 0.2s ease;
}

.lang-switch button[aria-pressed="true"] { color: var(--ink); }
.lang-switch button:hover { color: var(--ink); }

.cta-button {
  display: inline-block;
  background: var(--ink);
  color: #0b0c0e;
  font-weight: 600;
  font-size: 0.88rem;
  letter-spacing: 0.01em;
  text-decoration: none;
  border: 1px solid var(--ink);
  border-radius: 999px;
  padding: 0.6rem 1.4rem;
  cursor: pointer;
  font-family: var(--font-body);
  transition: background 0.25s ease, border-color 0.25s ease, color 0.25s ease, transform 0.25s ease;
}

.cta-button:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #0b0c0e;
}

.cta-button.big {
  padding: 0.95rem 2rem;
  font-size: 0.95rem;
}

.cta-button.ghosted {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}

.cta-button.ghosted:hover {
  border-color: var(--ink);
  background: transparent;
  color: var(--ink);
}

/* ---------------------------------------------------------------- stage / track */

.stage { height: calc(var(--n) * 100vh); position: relative; z-index: 10; }

.track-viewport {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  overflow: clip; /* no scroll box: focus routing stays ours, via JS */
}

.track {
  display: flex;
  height: 100%;
  will-change: transform;
}

.panel {
  position: relative;
  flex: 0 0 100vw;
  height: 100%;
  overflow: hidden;
}

.panel-inner {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: calc(var(--header-h) + 4vh) 8vw 12vh;
}

/* faint chapter numerals drifting on their own layer */
.ghost {
  position: absolute;
  z-index: 1;
  top: 50%;
  right: 4vw;
  transform: translateY(-50%);
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 42vh;
  line-height: 1;
  color: rgba(255, 255, 255, 0.04);
  user-select: none;
  pointer-events: none;
}

.eyebrow {
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  margin-bottom: 1.5rem;
}

h1, h2 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.04;
  letter-spacing: -0.025em;
}

h1 { font-size: clamp(3rem, 7.2vw, 6.8rem); max-width: 14ch; }
h2 { font-size: clamp(2.1rem, 4.4vw, 3.9rem); max-width: 18ch; letter-spacing: -0.02em; }

.lede {
  color: var(--muted);
  font-size: clamp(1rem, 1.3vw, 1.18rem);
  max-width: 50ch;
  margin-top: 1.6rem;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 2.8rem;
}

/* scroll-linked reveals (class toggled by main.js — text is stable while reading) */
[data-reveal] {
  opacity: 0;
  transform: translate3d(0, 28px, 0);
  transition:
    opacity 0.7s ease,
    transform 0.7s cubic-bezier(0.22, 0.61, 0.36, 1);
  transition-delay: calc(var(--d, 0) * 90ms);
}

.panel.is-current [data-reveal] {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

/* ---------------------------------------------------------------- about */

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.5rem;
  width: min(780px, 100%);
  margin-top: 3.2rem;
}

.stat {
  border-top: 1px solid var(--line);
  padding-top: 1.1rem;
}

.stat dt {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2rem, 3.4vw, 3.1rem);
  color: var(--ink);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.stat dd {
  color: var(--muted);
  font-size: 0.82rem;
  margin-top: 0.45rem;
}

/* ---------------------------------------------------------------- services */

.cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  width: min(900px, 100%);
  margin-top: 2.8rem;
}

.card {
  border: 1px solid var(--line);
  background: rgba(11, 12, 14, 0.6);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-radius: 18px;
  padding: 1.7rem 1.8rem;
  transition: border-color 0.3s ease, background 0.3s ease, transform 0.3s ease;
}

.card:hover {
  border-color: rgba(255, 107, 61, 0.45);
  background: rgba(20, 16, 13, 0.72);
  transform: translateY(-2px);
}

.card-num {
  font-family: var(--font-display);
  color: var(--accent);
  font-size: 0.88rem;
  font-weight: 600;
}

.card h3 {
  font-family: var(--font-display);
  font-size: 1.18rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0.75rem 0 0.45rem;
}

.card p { color: var(--muted); font-size: 0.94rem; }

/* ---------------------------------------------------------------- process */

.steps {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.6rem;
  width: min(1060px, 100%);
  margin-top: 3rem;
}

.step {
  border: 1px solid var(--line);
  border-top: 1px solid rgba(255, 107, 61, 0.6);
  background: rgba(11, 12, 14, 0.6);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-radius: 14px;
  padding: 1.3rem 1.4rem;
}

.step-num {
  font-family: var(--font-display);
  color: var(--accent);
  font-size: 0.88rem;
  font-weight: 600;
}

.step h3 {
  font-family: var(--font-display);
  font-size: 1.12rem;
  font-weight: 600;
  margin: 0.75rem 0 0.45rem;
}
.step p { color: var(--muted); font-size: 0.92rem; }

/* ---------------------------------------------------------------- projects */

.projects {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.2rem;
  width: min(1060px, 100%);
  margin-top: 2.8rem;
}

.pcard-media {
  aspect-ratio: 16 / 10;
  border-radius: 14px;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  overflow: hidden;
  position: relative;
}

.pcard-media svg {
  width: 74%;
  height: 74%;
}

.pcard-media.has-art {
  background-size: cover;
  background-position: center;
}

.pcard-media.has-art svg { display: none; }

/* subtle vignette that seats the rendered shot inside the card frame */
.pcard-media.has-art::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(11, 12, 14, 0.1) 0%, rgba(11, 12, 14, 0) 30%, rgba(11, 12, 14, 0.05) 72%, rgba(11, 12, 14, 0.32) 100%);
  pointer-events: none;
}

.pcard:nth-child(1) .pcard-media {
  background:
    linear-gradient(155deg, rgba(255, 107, 61, 0.22), transparent 55%),
    linear-gradient(0deg, rgba(255, 255, 255, 0.03), transparent 60%),
    var(--bg-soft);
}

.pcard:nth-child(2) .pcard-media {
  background:
    radial-gradient(80% 90% at 22% 100%, rgba(255, 107, 61, 0.2), transparent 58%),
    linear-gradient(0deg, rgba(255, 255, 255, 0.03), transparent 60%),
    var(--bg-soft);
}

.pcard:nth-child(3) .pcard-media {
  background:
    linear-gradient(20deg, rgba(120, 150, 190, 0.16), transparent 55%),
    linear-gradient(0deg, rgba(255, 255, 255, 0.03), transparent 60%),
    var(--bg-soft);
}

.pcard h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  margin-top: 1.1rem;
}
.pcard .meta { color: var(--muted); font-size: 0.86rem; margin-top: 0.3rem; }

/* ---------------------------------------------------------------- contact */

.contact-grid {
  display: grid;
  grid-template-columns: 1fr; /* form + info stacked left; the built tower owns the right side */
  width: min(700px, 100%);
  margin-top: 2.6rem;
  align-items: start;
}

.contact-form {
  display: grid;
  gap: 0.85rem;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  font: inherit;
  padding: 0.9rem 1.1rem;
  resize: vertical;
  transition: border-color 0.25s ease, background 0.25s ease;
}

.contact-form input::placeholder,
.contact-form textarea::placeholder { color: rgba(155, 160, 166, 0.7); }

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(255, 107, 61, 0.04);
}

.contact-form .cta-button { justify-self: start; }

.contact-info {
  font-style: normal;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.4rem;
  margin-top: 1.8rem;
  border-top: 1px solid var(--line);
  padding-top: 1.4rem;
  text-shadow: 0 1px 12px rgba(11, 12, 14, 0.9), 0 0 4px rgba(11, 12, 14, 0.7);
}

.info-line {
  color: var(--muted);
  font-size: 0.95rem;
  text-decoration: none;
  line-height: 1.55;
}

a.info-line { color: var(--ink); font-weight: 500; }
a.info-line:hover { color: var(--accent); }

.info-line strong {
  display: block;
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  margin-bottom: 0.3rem;
}

.panel-footer {
  position: absolute;
  z-index: 2;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem 2rem;
  padding: 1.2rem 8vw 1.4rem;
  border-top: 1px solid var(--line);
  background: rgba(11, 12, 14, 0.55);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  font-size: 0.8rem;
  color: var(--muted);
}

/* ---------------------------------------------------------------- fixed UI */

.dots {
  position: fixed;
  z-index: 40;
  right: clamp(0.9rem, 2vw, 1.8rem);
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.dots button {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 0;
  background: rgba(255, 255, 255, 0.22);
  cursor: pointer;
  padding: 0;
  transition: background 0.25s ease, transform 0.25s ease;
}

.dots button:hover { background: rgba(255, 255, 255, 0.5); }

.dots button.is-active {
  background: var(--accent);
  transform: scale(1.35);
}

.progress {
  position: fixed;
  z-index: 40;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: rgba(255, 255, 255, 0.06);
}

.progress-bar {
  height: 100%;
  width: 100%;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
}

.scroll-hint {
  position: fixed;
  z-index: 35;
  left: 50%;
  bottom: 1.9rem;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  color: var(--muted);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  transition: opacity 0.5s ease;
  pointer-events: none;
}

.hint-line {
  width: 1px;
  height: 42px;
  background: linear-gradient(var(--accent), transparent);
  animation: hint-drop 2.2s ease-in-out infinite;
}

@keyframes hint-drop {
  0% { transform: scaleY(0); transform-origin: top; }
  45% { transform: scaleY(1); transform-origin: top; }
  55% { transform: scaleY(1); transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}

body.scrolled .scroll-hint { opacity: 0; }

/* ============================================================
   FLOW MODE — narrow screens: real vertical composition,
   native scroll, canvas keeps a quiet supporting role
   ============================================================ */

.flow .stage { height: auto; }
.flow .track-viewport { position: static; height: auto; overflow: visible; }
.flow .track { display: block; height: auto; will-change: auto; }

.flow .panel {
  width: auto;
  height: auto;
  min-height: 100svh;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(11, 12, 14, 0.1), rgba(11, 12, 14, 0.8) 22%, rgba(11, 12, 14, 0.8) 78%, rgba(11, 12, 14, 0.1));
}

.flow .panel-inner {
  min-height: 100svh;
  justify-content: center;
  padding: calc(var(--header-h) + 3rem) 1.5rem 5rem;
}

.flow .ghost { display: none; }
.flow .dots { display: none; }

.flow h1 { font-size: clamp(2.9rem, 13vw, 4.6rem); }
.flow h2 { font-size: clamp(1.9rem, 8vw, 3rem); }

.flow .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.flow .cards { grid-template-columns: 1fr; }
.flow .steps { grid-template-columns: 1fr; gap: 1.2rem; }
.flow .projects { grid-template-columns: 1fr; width: 100%; }
.flow .contact-grid { grid-template-columns: 1fr; }
.flow .contact-info { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.1rem; margin-top: 1.4rem; }
.flow .chapter-links { display: none; }
.flow .panel-footer { position: static; margin-top: 2.5rem; }

/* thumb-sized CTAs on phones */
.flow .cta-row .cta-button,
.flow .contact-form .cta-button { flex: 1 1 auto; text-align: center; }

/* header on small screens */
@media (max-width: 900px) {
  .chapter-links { display: none; }
  .dots { display: none; }
  .ghost { display: none; }
  .cta-button:not(.big) { display: none; }
}

/* ============================================================
   REDUCED MOTION — no transitions/loops; content appears settled
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .hint-line { animation: none; }
  .chapter-links a::after { transition: none; }
}

/* contact: soft separation from the scene behind (no added darkness) */
.panel-contact h2,
.panel-contact .lede,
.panel-contact .eyebrow {
  text-shadow: 0 1px 14px rgba(0, 0, 0, 0.85), 0 0 5px rgba(0, 0, 0, 0.6);
}

/* soft separation for headlines over the scene (no added darkness) */
h1, h2, .lede {
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.8), 0 0 6px rgba(0, 0, 0, 0.5);
}
