/* ============================================
   AP.LAB — Creative Technology Studio by Alessandra Sprocatti
   Design tokens do Brand Book V1.0
   ============================================ */

:root {
  --ink: #171D1D;
  --ink-2: #1E2626;
  --ink-3: #243030;
  --paper: #F8F9F4;
  --paper-2: #EEF1E8;
  --accent: #D4F474;
  --accent-deep: #5E7A1F;
  --sage: #AAB8AF;
  --sage-dim: #75837B;
  --text-light: #F8F9F4;
  --text-mid: #D7DDD6;
  --border-dark: rgba(170, 184, 175, 0.14);
  --border-light: rgba(23, 29, 29, 0.14);

  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --container: 1140px;
  --gutter: 24px;
  --section-py: 110px;
  --header-h: 72px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ============================================
   BASE
   ============================================ */

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

html { scroll-behavior: smooth; }

body {
  background: var(--ink);
  color: var(--text-light);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

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

button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }

ol, ul { list-style: none; }

::selection { background: var(--accent); color: var(--ink); }

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

.section--light :focus-visible { outline-color: var(--accent-deep); }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ============================================
   TIPOGRAFIA DE SEÇÃO
   ============================================ */

.section { padding: var(--section-py) 0; }

.section-label {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--sage-dim);
  margin-bottom: 14px;
}

.section-label::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  margin-right: 10px;
  vertical-align: 1px;
}

.section--light .section-label::before { background: var(--accent-deep); }

.section-title {
  font-family: var(--font-display);
  font-size: clamp(30px, 4.4vw, 46px);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.02em;
  max-width: 760px;
}

.section-intro {
  font-size: 17px;
  line-height: 1.75;
  color: var(--sage);
  max-width: 640px;
  margin-top: 22px;
  margin-bottom: 56px;
}

/* Zona clara */
.section--light {
  background: var(--paper);
  color: var(--ink);
}

.section--light .section-intro { color: #4A5450; }

/* costura entre zonas */
.section--light + .section--light { padding-top: 0; }

/* ============================================
   BOTÕES
   ============================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 15px;
  padding: 12px 24px;
  border-radius: 10px;
  transition: transform 300ms var(--ease), background 300ms, color 300ms, border-color 300ms, box-shadow 300ms;
}

.btn--lg { padding: 16px 32px; font-size: 16px; }

.btn--primary {
  background: var(--accent);
  color: var(--ink);
}

.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(212, 244, 116, 0.25);
}

.btn--ghost {
  border: 1px solid var(--border-dark);
  color: var(--text-light);
}

.btn--ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

/* ============================================
   HEADER
   ============================================ */

.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--header-h);
  transition: background 400ms, border-color 400ms, backdrop-filter 400ms;
  border-bottom: 1px solid transparent;
}

.header.is-scrolled {
  background: rgba(23, 29, 29, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom-color: var(--border-dark);
}

.header__inner {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.header__brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header__logo { width: 30px; height: 36px; object-fit: contain; }

.header__name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 19px;
  letter-spacing: 0.04em;
}

.header__dot { color: var(--accent); }

.header__nav { display: flex; gap: 32px; }

.header__link {
  font-size: 14.5px;
  color: var(--sage);
  transition: color 250ms;
  position: relative;
}

.header__link::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 100%;
  height: 1.5px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 350ms var(--ease);
}

.header__link:hover { color: var(--text-light); }

.header__link:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

.header__cta { padding: 10px 20px; font-size: 14px; }

.header__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
}

.header__toggle span {
  width: 22px;
  height: 2px;
  background: var(--text-light);
  transition: transform 300ms var(--ease), opacity 300ms;
}

.header__toggle.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.header__toggle.is-open span:nth-child(2) { opacity: 0; }
.header__toggle.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-menu {
  display: none;
  position: fixed;
  inset: var(--header-h) 0 auto 0;
  background: rgba(23, 29, 29, 0.97);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-dark);
  padding: 24px var(--gutter) 32px;
  transform: translateY(-12px);
  opacity: 0;
  pointer-events: none;
  transition: transform 350ms var(--ease), opacity 350ms;
}

.mobile-menu.is-open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.mobile-menu__nav { display: flex; flex-direction: column; gap: 4px; }

.mobile-menu__link {
  font-family: var(--font-display);
  font-size: 20px;
  padding: 12px 0;
  color: var(--text-mid);
  border-bottom: 1px solid var(--border-dark);
}

.mobile-menu__cta { margin-top: 20px; justify-content: center; }

/* ============================================
   HERO
   ============================================ */

.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.hero__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero__content {
  position: relative;
  z-index: 2;
  padding: calc(var(--header-h) + 40px) var(--gutter) 80px;
}

.hero__eyebrow {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--sage);
  margin-bottom: 28px;
}

.hero__title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(26px, 7.2vw, 84px);
  line-height: 1.06;
  letter-spacing: -0.025em;
  max-width: 1000px;
}

.hero__line { display: block; }

.hero__line .word {
  display: inline-block;
  white-space: nowrap;
}

.hero__line--accent { color: var(--accent); }

.hero__line .char {
  display: inline-block;
  font-variation-settings: 'wght' 500;
  will-change: font-variation-settings;
}

.hero__text {
  font-size: 18px;
  line-height: 1.75;
  color: var(--sage);
  max-width: 600px;
  margin-top: 32px;
}

.hero__actions {
  display: flex;
  gap: 16px;
  margin-top: 44px;
  flex-wrap: wrap;
}

.hero__terminal {
  font-family: var(--font-mono);
  font-size: 13.5px;
  color: var(--sage-dim);
  margin-top: 56px;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 20px;
}

.hero__prompt { color: var(--accent); opacity: 0.85; }

.hero__caret {
  display: inline-block;
  width: 8px;
  height: 15px;
  background: var(--accent);
  animation: caret-blink 1.1s steps(1) infinite;
}

@keyframes caret-blink { 50% { opacity: 0; } }

.hero__scroll {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 1px;
  height: 72px;
  overflow: hidden;
  z-index: 2;
}

.hero__scroll-line {
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, transparent, var(--accent));
  animation: scroll-drop 2.2s var(--ease) infinite;
}

@keyframes scroll-drop {
  0% { transform: translateY(-100%); }
  60%, 100% { transform: translateY(100%); }
}

/* ============================================
   SERVIÇOS (zona clara)
   ============================================ */

.services {
  border-top: 1px solid var(--border-light);
}

.service { border-bottom: 1px solid var(--border-light); }

.service__head {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 30px 4px;
  text-align: left;
  transition: padding 350ms var(--ease);
}

.service__head:hover { padding-left: 16px; }

.service__name {
  font-family: var(--font-display);
  font-size: clamp(21px, 2.6vw, 29px);
  font-weight: 500;
  letter-spacing: -0.01em;
  transition: color 250ms;
}

.service__head:hover .service__name { color: var(--accent-deep); }

.service__toggle {
  position: relative;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border-light);
  border-radius: 50%;
  transition: background 300ms, border-color 300ms, transform 400ms var(--ease);
}

.service__toggle::before,
.service__toggle::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 12px;
  height: 1.6px;
  background: var(--ink);
  transform: translate(-50%, -50%);
  transition: transform 400ms var(--ease), background 300ms;
}

.service__toggle::after { transform: translate(-50%, -50%) rotate(90deg); }

.service.is-open .service__toggle {
  background: var(--ink);
  border-color: var(--ink);
  transform: rotate(135deg);
}

.service.is-open .service__toggle::before,
.service.is-open .service__toggle::after { background: var(--accent); }

.service__body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 450ms var(--ease);
}

.service.is-open .service__body { grid-template-rows: 1fr; }

.service__content {
  overflow: hidden;
  padding: 0 4px;
}

.service__content p {
  max-width: 680px;
  font-size: 15.5px;
  line-height: 1.75;
  color: #434D49;
  padding-bottom: 8px;
}

.service.is-open .service__content { padding-bottom: 30px; }

.service__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.service__tags span {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink);
  background: var(--paper-2);
  border: 1px solid var(--border-light);
  padding: 6px 12px;
  border-radius: 100px;
}

/* ============================================
   ABORDAGEM / FLOW (zona clara)
   ============================================ */

.flow {
  position: relative;
  margin-top: 64px;
}

.flow__track {
  position: absolute;
  top: 7px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--border-light);
}

.flow__fill {
  height: 100%;
  width: 0;
  background: var(--accent-deep);
  transition: width 120ms linear;
}

.flow__nodes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 48px;
}

.flow__node { position: relative; padding-top: 36px; }

.flow__dot {
  position: absolute;
  top: 0;
  left: 0;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--sage-dim);
  background: var(--paper);
  transition: border-color 350ms, background 350ms, box-shadow 350ms;
}

.flow__node.is-active .flow__dot {
  border-color: var(--accent-deep);
  background: var(--accent);
  box-shadow: 0 0 0 5px rgba(212, 244, 116, 0.35);
}

.flow__num {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--sage-dim);
  display: block;
  margin-bottom: 8px;
}

.flow__label {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 12px;
}

.flow__text {
  font-size: 15px;
  line-height: 1.7;
  color: #4A5450;
  max-width: 300px;
}

/* ============================================
   EMPRESAS / MARQUEE (zona clara)
   ============================================ */

.section--logos { padding: 64px 0; }

.marquee {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

.marquee__track {
  display: flex;
  width: max-content;
  animation: marquee-roll 46s linear infinite;
}

.marquee:hover .marquee__track { animation-play-state: paused; }

.marquee__group {
  display: flex;
  align-items: stretch;
  gap: 72px;
  padding-right: 72px;
}

@keyframes marquee-roll {
  to { transform: translateX(-50%); }
}

.client {
  display: grid;
  grid-template-rows: 54px auto;
  align-items: center;
  justify-items: center;
  row-gap: 12px;
  min-width: 120px;
}

.client img {
  height: calc(var(--h, 34px) * var(--logo-k, 1));
  width: auto;
  object-fit: contain;
  filter: grayscale(1) opacity(0.62);
  transition: filter 350ms;
}

.client:hover img { filter: grayscale(0) opacity(1); }

.client__wordmark {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 23px;
  letter-spacing: 0.01em;
  color: rgba(23, 29, 29, 0.62);
  line-height: 34px;
  transition: color 350ms;
}

.client:hover .client__wordmark { color: var(--ink); }

.client__caption {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--sage-dim);
  white-space: nowrap;
}

/* ============================================
   TRAJETÓRIA (zona escura)
   ============================================ */

.section--traj { cursor: default; }

.traj-type {
  max-width: 780px;
  margin-top: 26px;
  font-family: var(--font-mono);
  font-size: clamp(14.5px, 1.3vw, 16.5px);
  line-height: 1.85;
  color: var(--text-mid);
}

.traj-type__box { display: grid; }

.traj-type__ghost,
.traj-type__live { grid-area: 1 / 1; }

.traj-type__ghost { visibility: hidden; }

.traj-type__prompt { color: var(--accent); margin-right: 0.6em; white-space: nowrap; }

.traj-type__end { display: none; }
.traj-type.is-done .traj-type__end { display: inline; }

.traj-type .hero__caret { vertical-align: -2px; }

/* ============================================
   SOBRE (zona clara)
   ============================================ */


.about {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 72px;
  align-items: center;
}

.about__photo {
  position: relative;
  max-width: 400px;
}

.about__img {
  width: 100%;
  height: auto;
  border-radius: 14px;
  object-fit: cover;
  position: relative;
}

.about__lead {
  font-size: 17px;
  line-height: 1.75;
  color: #2A3330;
  margin-top: 24px;
}

.about__text {
  font-size: 16px;
  line-height: 1.75;
  color: #4A5450;
  margin-top: 20px;
}

/* ============================================
   CONTATO (zona escura)
   ============================================ */

.section--contact {
  position: relative;
  overflow: hidden;
  padding: 140px 0;
}

.contact__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.5;
}

.contact {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 640px;
  margin: 0 auto;
}

.contact__title {
  font-family: var(--font-display);
  font-size: clamp(30px, 4.6vw, 48px);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.contact__text {
  font-size: 17px;
  line-height: 1.75;
  color: var(--sage);
  margin-top: 24px;
}

.contact__actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  margin-top: 44px;
}

.contact__email {
  font-family: var(--font-mono);
  font-size: 14.5px;
  color: var(--sage);
  border-bottom: 1px solid var(--border-dark);
  padding-bottom: 3px;
  transition: color 250ms, border-color 250ms;
}

.contact__email:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* ============================================
   FOOTER
   ============================================ */

.footer {
  border-top: 1px solid var(--border-dark);
  padding: 56px 0 40px;
}

.footer__inner {
  display: grid;
  grid-template-columns: 1.2fr auto;
  gap: 26px 40px;
  align-items: start;
}

.footer__brand {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.footer__logo { width: 32px; height: 38px; object-fit: contain; margin-right: -3px; }

.footer__identity { display: flex; flex-direction: column; gap: 2px; }

.footer__name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 18px;
  letter-spacing: 0.04em;
}

.footer__tagline { font-size: 13px; color: var(--sage); }

.footer__by { font-size: 12.5px; color: var(--sage-dim); }


.footer__nav {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

.footer__nav a {
  font-size: 14px;
  color: var(--sage);
  transition: color 250ms;
}

.footer__nav a:hover { color: var(--accent); }

.footer__contact a {
  font-family: var(--font-mono);
  font-size: 13.5px;
  color: var(--sage);
  transition: color 250ms;
}

.footer__contact a:hover { color: var(--accent); }

.footer__bottom {
  grid-column: 1 / -1;
  border-top: 1px solid var(--border-dark);
  padding-top: 18px;
  margin-top: 0;
  font-size: 13px;
  color: var(--sage-dim);
}

/* ============================================
   RESPONSIVO
   ============================================ */

@media (max-width: 1024px) {
  :root { --section-py: 84px; }

  .about {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .about__photo { margin: 0 auto; max-width: 320px; }

  .about__content { text-align: center; }

  .about__content .section-label { justify-content: center; }

  .footer__inner {
    grid-template-columns: 1fr;
    gap: 26px;
    text-align: center;
  }

  .footer__brand { justify-content: center; }
  .footer__identity { text-align: left; }
  .footer__nav { justify-content: center; }
  .footer__contact { justify-self: center; }
}

@media (max-width: 768px) {
  :root {
    --section-py: 68px;
    --header-h: 64px;
    --gutter: 20px;
  }

  .header__nav,
  .header__cta { display: none; }

  .header__toggle { display: flex; }

  .mobile-menu { display: block; }

  .hero__content { padding-top: calc(var(--header-h) + 24px); padding-bottom: 64px; }

  .hero__text { font-size: 16px; }

  .hero__actions { flex-direction: column; }

  .hero__actions .btn { width: 100%; }

  .hero__terminal { margin-top: 40px; }

  .hero__scroll { display: none; }

  .service__head { padding: 24px 2px; }
  .service__head:hover { padding-left: 8px; }

  .flow__track {
    top: 0;
    bottom: 0;
    left: 7px;
    right: auto;
    width: 2px;
    height: auto;
  }

  .flow__fill {
    width: 100% !important;
    height: 0;
    transition: height 120ms linear;
  }

  .flow__nodes {
    grid-template-columns: 1fr;
    gap: 44px;
  }

  .flow__node { padding-top: 0; padding-left: 40px; }

  .flow__dot { top: 4px; }

  .flow__text { max-width: none; }


  .marquee__group { gap: 48px; padding-right: 48px; }

  .client { --logo-k: 0.8; grid-template-rows: 44px auto; }

  .client__wordmark { font-size: 19px; line-height: 28px; }

  .section--contact { padding: 96px 0; }

  .contact__actions .btn--lg { width: 100%; }

  .about__lead,
  .about__text,
  .contact__text { text-align: justify; }
}

@media (max-width: 480px) {
  .section-title { font-size: 27px; }
  .flow__label { font-size: 21px; }
}

/* ============================================
   MOVIMENTO REDUZIDO
   ============================================ */

@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;
  }

  .marquee__track {
    animation: none;
    width: auto;
    flex-wrap: wrap;
    justify-content: center;
  }

  .marquee {
    -webkit-mask-image: none;
    mask-image: none;
  }

  .marquee__group { flex-wrap: wrap; justify-content: center; row-gap: 40px; }

  .hero__caret { animation: none; }

  .hero__scroll { display: none; }
}
