/* ============================================================
   H4 MÍDIA — design tokens
   ============================================================ */
:root {
  --roxo: #463b80;
  --roxo-deep: #221c3f;
  --roxo-void: #14101f;
  --laranja: #ffa617;
  --laranja-dim: #e6960f;
  --branco: #fefefe;
  --ink-soft: rgba(254, 254, 254, 0.74);
  --ink-faint: rgba(254, 254, 254, 0.46);
  --line: rgba(254, 254, 254, 0.14);

  --font-display: "Montserrat", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;

  --content-w: 620px;
  --side-pad: 8vw;
  --glow: 0.08;
  --rig-center: 84%;
}

/* ============================================================
   Reset / base
   ============================================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  margin: 0;
  font-family: var(--font-display);
  color: var(--branco);
  background: var(--roxo-void);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

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

a {
  color: inherit;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--laranja);
  color: var(--roxo-void);
  padding: 12px 18px;
  font-weight: 600;
  z-index: 200;
}

.skip-link:focus {
  left: 24px;
  top: 24px;
}

:focus-visible {
  outline: 3px solid var(--laranja);
  outline-offset: 3px;
}

.accent-italic {
  font-style: italic;
  font-weight: 700;
  color: var(--laranja);
}

#bg-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(120% 90% at 50% 0%, #2a2350 0%, var(--roxo-void) 62%);
}

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.98rem;
  text-decoration: none;
  padding: 16px 30px;
  border-radius: 999px;
  border: 2px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  cursor: pointer;
  white-space: nowrap;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-accent {
  background: var(--laranja);
  color: var(--roxo-void);
  box-shadow: 0 10px 30px rgba(255, 166, 23, 0.3);
}

.btn-accent:hover {
  background: var(--laranja-dim);
}

.btn-small {
  padding: 10px 20px;
  font-size: 0.86rem;
}

.btn-large {
  padding: 20px 40px;
  font-size: 1.1rem;
}

/* ============================================================
   Header (minimal, floats over the canvas)
   ============================================================ */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 60;
  display: flex;
  justify-content: center;
  pointer-events: none;
  background: linear-gradient(
    to bottom,
    rgba(20, 16, 31, 0.92) 0%,
    rgba(20, 16, 31, 0.7) 55%,
    rgba(20, 16, 31, 0) 100%
  );
  padding-bottom: 36px;
}

.header-inner {
  width: 100%;
  max-width: 1400px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px var(--side-pad);
  pointer-events: none;
}

.header-inner > * {
  pointer-events: auto;
}

.brand-mark {
  height: 48px;
  width: auto;
}

/* ============================================================
   Chapter side navigation
   ============================================================ */
.chapter-nav {
  position: fixed;
  right: 26px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.chapter-nav button {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--ink-faint);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 4px;
  transition: color 0.25s ease;
}

.chapter-nav button span {
  display: block;
}

.chapter-nav button.is-active {
  color: var(--laranja);
  font-weight: 600;
}

.chapter-nav button::before {
  content: "";
  display: block;
  width: 5px;
  height: 5px;
  margin: 0 auto 8px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.6;
}

/* ============================================================
   The lamp — fixed companion, glows brighter per chapter
   ============================================================ */
.lamp {
  position: fixed;
  top: 50%;
  left: var(--rig-center);
  width: min(30vw, 300px);
  transform: translate(-50%, -50%);
  z-index: 1;
  pointer-events: none;
}

.lamp-halo {
  position: absolute;
  inset: -40%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 166, 23, 0.55) 0%, rgba(255, 166, 23, 0) 68%);
  opacity: var(--glow);
  transition: opacity 0.8s ease;
  filter: blur(4px);
}

.lamp-svg {
  position: relative;
  width: 100%;
  height: auto;
  overflow: visible;
}

.lamp-base path,
.lamp-base rect {
  fill: rgba(254, 254, 254, 0.1);
}

.lamp-glow-shape path,
.lamp-glow-shape rect {
  fill: var(--laranja);
}

.lamp-glow-shape {
  opacity: var(--glow);
  transition: opacity 0.8s ease;
  filter: drop-shadow(0 0 26px rgba(255, 166, 23, 0.75));
}

@media (max-width: 980px) {
  .lamp {
    display: none;
  }
}

/* ============================================================
   Chapters
   ============================================================ */
main {
  position: relative;
  z-index: 2;
}

.chapter {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 140px var(--side-pad) 120px;
}

.chapter-content {
  max-width: var(--content-w);
}

.chapter-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  color: var(--laranja);
  margin: 0 0 20px;
}

.chapter-label {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  color: var(--laranja);
  margin: 0 0 18px;
}

.chapter-headline {
  font-size: clamp(2.4rem, 6vw, 4.4rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.015em;
  margin: 0 0 26px;
}

.chapter-title {
  font-size: clamp(2.1rem, 4.6vw, 3.4rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin: 0 0 44px;
}

.chapter-sub {
  font-size: 1.15rem;
  color: var(--ink-soft);
  max-width: 480px;
  margin: 0 0 40px;
}

.chapter-actions {
  margin-bottom: 28px;
}

.scroll-hint {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ink-faint);
  letter-spacing: 0.06em;
}

.strike-wrap {
  position: relative;
  display: inline-block;
}

.strike {
  color: var(--ink-faint);
}

.strike-wrap::after {
  content: "";
  position: absolute;
  left: -2%;
  right: -2%;
  top: 52%;
  height: 3px;
  background: var(--laranja);
  transform: rotate(-3deg);
}

/* ============================================================
   Story list (serviços)
   ============================================================ */
.story-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.story-list li {
  padding: 34px 0;
  border-top: 1px solid var(--line);
}

.story-list li:last-child {
  border-bottom: 1px solid var(--line);
}

.story-tag {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--laranja);
  letter-spacing: 0.06em;
  margin: 0 0 12px;
}

.story-list h3,
.values-list h3 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 10px;
}

.story-list p,
.values-list p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 1rem;
  max-width: 480px;
}

/* ============================================================
   Missão / valores
   ============================================================ */
.mission {
  font-size: clamp(1.3rem, 2.6vw, 1.65rem);
  font-weight: 600;
  line-height: 1.45;
  margin: 0 0 60px;
  max-width: 560px;
}

.values-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px 48px;
}

.values-list li {
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

/* ============================================================
   Portfólio
   ============================================================ */
.portfolio-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
  max-width: 560px;
}

.case-card {
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(255, 166, 23, 0.28);
  background: var(--roxo-deep);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  transition: transform 0.2s ease;
}

.case-card:hover {
  transform: translateY(-4px);
}

.browser-frame {
  background: #100c1c;
}

.browser-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  background: #1c1730;
}

.browser-bar .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(254, 254, 254, 0.25);
}

.browser-url {
  margin-left: 10px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink-faint);
}

.browser-frame img {
  display: block;
  width: 100%;
  height: 220px;
  object-fit: cover;
  object-position: top;
}

.case-info {
  padding: 20px 22px 24px;
}

.case-info h3 {
  margin: 0 0 4px;
  font-size: 1.15rem;
}

.case-info p {
  margin: 0 0 14px;
  font-size: 0.92rem;
  color: var(--ink-soft);
}

.case-link {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--laranja);
}

.case-link:hover {
  text-decoration: underline;
}

/* ============================================================
   Capítulo final
   ============================================================ */
.chapter-final {
  text-align: left;
  flex-direction: column;
  align-items: flex-start;
  padding-bottom: 200px;
}

/* Sits in normal document flow below the CTA — not fixed, not tied
   to the lamp's position at all. Centered on the full page width,
   fades up into view as the scroll reaches it. */
.final-mark {
  align-self: center;
  width: min(45vw, 620px);
  height: auto;
  margin-top: 160px;
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 1.1s ease, transform 1.1s ease;
}

.final-mark.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  position: relative;
  z-index: 2;
  background: var(--roxo-void);
  border-top: 1px solid var(--line);
  padding: 40px var(--side-pad);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  max-width: 1400px;
  margin: 0 auto;
}

.footer-mark {
  height: 58px;
  opacity: 0.9;
}

.footer-info {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  font-size: 0.86rem;
  color: var(--ink-soft);
}

.footer-info a {
  text-decoration: none;
}

.footer-info a:hover {
  color: var(--laranja);
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 980px) {
  :root {
    --side-pad: 6vw;
  }
  .chapter-nav {
    display: none;
  }
  .chapter {
    padding: 120px var(--side-pad) 90px;
    min-height: auto;
  }
  .values-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .chapter {
    padding: 108px 6vw 72px;
  }
  .chapter-actions .btn,
  .btn-large {
    width: 100%;
    justify-content: center;
  }
  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}
