/* ============================================================
   Fabiana Machado — portfolio
   Design language: cinematic editing-room. Tinted near-black,
   violet accent, timecode/mono labels, serif italic emphasis.
   ============================================================ */

:root {
  color-scheme: dark;
  --bg: #0b0a11;
  --bg-raised: #14121c;
  --ink: #f0eef6;
  --muted: rgba(240, 238, 246, 0.64);
  --faint: rgba(240, 238, 246, 0.4);
  --line: rgba(240, 238, 246, 0.12);
  --panel: rgba(240, 238, 246, 0.045);
  --panel-strong: rgba(240, 238, 246, 0.085);
  --accent: #7c5cff;
  --accent-soft: #a893ff;
  --accent-glow: rgba(124, 92, 255, 0.28);
  --max: 1180px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font-sans: "Archivo", ui-sans-serif, system-ui, sans-serif;
  --font-serif: "Instrument Serif", Georgia, serif;
  --font-mono: "Spline Sans Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(1100px 520px at 82% -6%, rgba(124, 92, 255, 0.14), transparent 62%),
    radial-gradient(900px 640px at -12% 30%, rgba(124, 92, 255, 0.07), transparent 58%),
    var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img, iframe { display: block; }
a { color: inherit; }

h1, h2, h3, p, dl, dd, figure, blockquote { margin: 0; }

h1, h2 {
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  text-wrap: balance;
}

h1 em, h2 em {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--accent-soft);
}

.mono {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.slate {
  color: var(--accent-soft);
}

.slate::before {
  content: "[ ";
  color: var(--faint);
}

.slate::after {
  content: " ]";
  color: var(--faint);
}

/* ---------- scroll playhead ---------- */

.playhead {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 60;
  height: 2px;
  background: rgba(240, 238, 246, 0.07);
}

.playhead span {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-soft));
  transform: scaleX(0);
  transform-origin: left;
}

/* ---------- topbar ---------- */

.topbar {
  position: fixed;
  inset: 2px 0 auto 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px clamp(16px, 3vw, 36px);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.topbar__brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 750;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.topbar__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
}

.topbar__nav {
  display: flex;
  gap: clamp(14px, 2.5vw, 28px);
}

.topbar__nav a {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  transition: color 200ms var(--ease);
}

.topbar__nav a:hover { color: var(--ink); }

/* ---------- layout ---------- */

.hero, .section {
  width: min(100% - 40px, var(--max));
  margin: 0 auto;
}

.section {
  padding: clamp(76px, 10vw, 136px) 0;
  border-top: 1px solid var(--line);
}

.section__header {
  display: grid;
  gap: 16px;
  max-width: 780px;
  margin-bottom: clamp(30px, 4vw, 52px);
}

.section__header h2 {
  font-size: clamp(2.3rem, 4.6vw, 4.4rem);
}

.section__lead {
  color: var(--muted);
  font-size: clamp(1.02rem, 1.4vw, 1.18rem);
  max-width: 56ch;
}

/* ---------- buttons ---------- */

.button {
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-family: var(--font-sans);
  font-size: 0.94rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-decoration: none;
  transition: transform 220ms var(--ease), border-color 220ms var(--ease),
    background 220ms var(--ease), box-shadow 220ms var(--ease);
}

.button:hover { transform: translateY(-2px); }
.button:active { transform: translateY(0); }

.button--primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 28px -8px var(--accent-glow);
}

.button--primary:hover {
  background: #8d70ff;
  box-shadow: 0 14px 38px -8px rgba(124, 92, 255, 0.45);
}

.button--outline {
  border-color: rgba(240, 238, 246, 0.22);
  background: transparent;
}

.button--outline:hover {
  border-color: var(--accent-soft);
  background: var(--panel);
}

.button--small { min-height: 42px; padding: 0 16px; font-size: 0.86rem; }
.button--big { min-height: 60px; padding: 0 30px; font-size: 1.04rem; }

/* ---------- hero ---------- */

.hero {
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 0.86fr);
  align-items: center;
  gap: clamp(30px, 5vw, 80px);
  padding: clamp(96px, 12vh, 150px) 0 clamp(40px, 6vh, 70px);
}

.hero__content {
  display: grid;
  gap: 22px;
  align-content: center;
  max-width: 640px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  justify-self: start;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
}

.chip__pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #59d98c;
  box-shadow: 0 0 0 0 rgba(89, 217, 140, 0.5);
  animation: pulse 2.4s var(--ease) infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(89, 217, 140, 0.5); }
  70% { box-shadow: 0 0 0 9px rgba(89, 217, 140, 0); }
  100% { box-shadow: 0 0 0 0 rgba(89, 217, 140, 0); }
}

h1 {
  font-size: clamp(3rem, 6.4vw, 5.9rem);
  font-weight: 850;
}

.hero__lead {
  max-width: 56ch;
  color: rgba(240, 238, 246, 0.82);
  font-size: clamp(1.08rem, 1.7vw, 1.32rem);
  line-height: 1.5;
}

.hero__proof {
  color: var(--muted);
  font-size: 1rem;
}

.hero__proof strong { color: var(--accent-soft); }

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding-top: 4px;
}

.hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  color: var(--faint);
  padding-top: 6px;
}

.hero__media {
  position: relative;
  min-height: clamp(540px, 82svh, 860px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg-raised);
  box-shadow: 0 40px 120px -40px rgba(124, 92, 255, 0.25);
}

.hero__media img {
  width: 100%;
  height: 100%;
  min-height: inherit;
  object-fit: cover;
  object-position: 36% center;
  transform: scale(1.06);
  will-change: transform;
}

.hero__media-tag {
  position: absolute;
  left: 16px;
  bottom: 14px;
  padding: 7px 12px;
  border-radius: 8px;
  background: rgba(11, 10, 17, 0.66);
  backdrop-filter: blur(8px);
  color: var(--muted);
}

/* hero entrance */

.hero-anim {
  opacity: 0;
  transform: translateY(26px);
  animation: rise 900ms var(--ease) forwards;
  animation-delay: calc(var(--d, 0) * 110ms + 80ms);
}

.hero-anim[data-i="0"] { --d: 0; }
.hero-anim[data-i="1"] { --d: 1; }
.hero-anim[data-i="2"] { --d: 2; }
.hero-anim[data-i="3"] { --d: 3; }
.hero-anim[data-i="4"] { --d: 4; }
.hero-anim[data-i="5"] { --d: 5; }

@keyframes rise {
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- marquee ---------- */

.marquee {
  overflow: hidden;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--bg-raised);
  padding: 16px 0;
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

.marquee__track {
  display: flex;
  align-items: center;
  gap: 34px;
  width: max-content;
  animation: marquee 34s linear infinite;
}

.marquee__track span {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.marquee__track i {
  font-style: normal;
  color: var(--accent);
  font-size: 0.7rem;
}

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

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

/* ---------- showreel ---------- */

.intro {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(0, 0.72fr);
  align-items: center;
  gap: clamp(30px, 5vw, 76px);
}

.intro .section__header { margin-bottom: 0; }

.intro__points {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 12px;
  color: var(--muted);
}

.intro__points li {
  display: flex;
  gap: 12px;
  align-items: baseline;
}

.intro__points li::before {
  content: "→";
  color: var(--accent);
  font-weight: 700;
}

.intro-video {
  aspect-ratio: 9 / 16;
  width: min(100%, 380px);
  justify-self: end;
  overflow: hidden;
  border: 1px solid rgba(124, 92, 255, 0.4);
  border-radius: 20px;
  background: var(--panel);
  box-shadow: 0 30px 90px -20px var(--accent-glow);
}

.intro-video iframe,
.intro-video video {
  width: 100%;
  height: 100%;
  border: 0;
  object-fit: cover;
  background: #000;
}

/* ---------- portfolio ---------- */

.portfolio { display: grid; gap: clamp(38px, 5vw, 68px); }
.portfolio .section__header { margin-bottom: 0; }

.portfolio-group { display: grid; gap: 20px; }

.portfolio-group__title {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: baseline;
  column-gap: 14px;
  row-gap: 4px;
}

.portfolio-group__title p {
  grid-column: 2;
  color: var(--muted);
  font-size: 0.95rem;
}

.count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--accent-soft);
}

.portfolio-group h3 {
  font-size: clamp(1.45rem, 2.3vw, 2.1rem);
  font-weight: 750;
  letter-spacing: -0.02em;
  line-height: 1.05;
}

.portfolio-grid, .metric-grid, .proof-grid, .service-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.work-card, .metric, .proof-card, .service-item {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}

.work-card {
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  text-decoration: none;
  transition: transform 300ms var(--ease), border-color 300ms var(--ease),
    background 300ms var(--ease), box-shadow 300ms var(--ease);
}

.work-card:hover {
  transform: translateY(-6px);
  border-color: rgba(124, 92, 255, 0.65);
  background: var(--panel-strong);
  box-shadow: 0 24px 60px -24px var(--accent-glow);
}

.work-card__media {
  position: relative;
  overflow: hidden;
}

.work-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  filter: saturate(0.8) contrast(1.06);
  transition: transform 500ms var(--ease), filter 500ms var(--ease);
}

.video-card img { aspect-ratio: 9 / 16; }
.image-card img { aspect-ratio: 4 / 5; object-position: 50% 22%; }

.video-card video {
  display: block;
  width: 100%;
  aspect-ratio: 9 / 16;
  object-fit: cover;
  background: #000;
}

.video-card--wide video { aspect-ratio: 16 / 9; object-fit: contain; }

.portfolio-grid { align-items: start; }

.work-card:hover img {
  transform: scale(1.05);
  filter: saturate(1.05) contrast(1.1);
}

.play {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  padding-left: 4px;
  border-radius: 50%;
  background: rgba(11, 10, 17, 0.62);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(240, 238, 246, 0.25);
  color: var(--ink);
  font-size: 0.9rem;
  opacity: 0;
  transform: scale(0.85);
  transition: opacity 260ms var(--ease), transform 260ms var(--ease);
}

.work-card:hover .play { opacity: 1; transform: scale(1); }

.work-card__label {
  min-height: 74px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  padding: 14px 16px;
  color: rgba(240, 238, 246, 0.88);
  font-weight: 650;
  font-size: 0.95rem;
  line-height: 1.3;
}

.work-card__label em {
  font-style: normal;
  color: var(--faint);
}

/* ---------- metrics ---------- */

.metric {
  display: grid;
  gap: 12px;
  padding: clamp(22px, 2.6vw, 30px);
}

.metric strong {
  color: var(--accent-soft);
  font-size: clamp(2.1rem, 3.8vw, 3.6rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 0.95;
}

.metric span { color: var(--muted); }

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

.about {
  display: grid;
  grid-template-columns: minmax(300px, 0.72fr) minmax(0, 1fr);
  gap: clamp(30px, 5vw, 76px);
  align-items: center;
}

.about__media {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg-raised);
  min-height: clamp(420px, 60svh, 640px);
}

.about__media img {
  width: 100%;
  height: 100%;
  min-height: inherit;
  object-fit: cover;
  object-position: 60% center;
}

.about__content { display: grid; gap: 18px; }

.about__content h2 { font-size: clamp(2.1rem, 4vw, 3.6rem); }

.about__content > p { color: var(--muted); max-width: 58ch; }

.about__links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 4px;
}

.in-badge {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 5px;
  background: #0a66c2;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
}

.about__facts {
  display: grid;
  gap: 12px;
  margin-top: 8px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.about__facts > div {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 14px;
  align-items: baseline;
}

.about__facts dt { color: var(--faint); }
.about__facts dd { color: var(--muted); font-size: 0.95rem; }

/* ---------- services & process ---------- */

.service-item {
  display: grid;
  gap: 12px;
  padding: clamp(22px, 2.6vw, 30px);
  transition: border-color 300ms var(--ease), background 300ms var(--ease);
}

.service-item:hover {
  border-color: rgba(124, 92, 255, 0.5);
  background: var(--panel-strong);
}

.service-item__index { color: var(--accent-soft); }

.service-item h3 {
  font-size: 1.25rem;
  font-weight: 750;
  letter-spacing: -0.01em;
}

.service-item p { color: var(--muted); font-size: 0.96rem; }

.process {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin: clamp(30px, 4vw, 48px) 0 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.process li {
  display: grid;
  gap: 8px;
  padding: 22px 0 0;
  border-top: 2px solid var(--line);
}

.process li > span { color: var(--accent-soft); }

.process strong { font-size: 1.05rem; letter-spacing: -0.01em; }

.process p { color: var(--muted); font-size: 0.93rem; }

/* ---------- proof ---------- */

.proof-card {
  min-height: 200px;
  display: grid;
  align-content: space-between;
  gap: 22px;
  padding: clamp(22px, 2.6vw, 30px);
}

.proof-card > p:first-child {
  font-family: var(--font-serif);
  font-size: 1.28rem;
  line-height: 1.4;
  color: rgba(240, 238, 246, 0.9);
}

.proof-card cite {
  color: var(--muted);
  font-style: normal;
  font-size: 0.88rem;
  font-weight: 600;
}

.proof-card cite .mono { color: var(--faint); }

.proof-card--logos p { color: var(--muted); }
.proof-card__label { color: var(--ink); font-weight: 750; }

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

.contact { border-top: 1px solid var(--line); }

.contact__inner {
  position: relative;
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 20px;
  padding: clamp(48px, 7vw, 92px) clamp(20px, 5vw, 80px);
  border: 1px solid rgba(124, 92, 255, 0.35);
  border-radius: 22px;
  background:
    radial-gradient(640px 300px at 50% -10%, rgba(124, 92, 255, 0.2), transparent 70%),
    var(--bg-raised);
  overflow: hidden;
}

.contact h2 {
  font-size: clamp(2.3rem, 4.8vw, 4.4rem);
  max-width: 18ch;
}

.contact__lead {
  color: var(--muted);
  max-width: 52ch;
  font-size: clamp(1rem, 1.4vw, 1.15rem);
}

.contact__actions { padding-top: 6px; }

.contact__alt {
  color: var(--faint);
  font-size: 0.92rem;
  max-width: 52ch;
}

.contact__alt a {
  color: var(--muted);
  text-underline-offset: 3px;
  transition: color 200ms var(--ease);
}

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

/* ---------- footer ---------- */

.footer {
  width: min(100% - 40px, var(--max));
  margin: 0 auto;
  padding: 34px 0 44px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  color: var(--faint);
  font-size: 0.88rem;
}

.footer .mono { font-size: 0.68rem; }

.footer nav { display: flex; gap: 18px; }

.footer a {
  color: var(--muted);
  text-decoration: none;
  transition: color 200ms var(--ease);
}

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

/* ---------- reveal on scroll ---------- */

.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 800ms var(--ease), transform 800ms var(--ease);
}

.stagger > * {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 700ms var(--ease), transform 700ms var(--ease);
  transition-delay: calc(var(--stagger-i, 0) * 90ms);
}

.reveal.is-visible,
.stagger.is-visible > * {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
  }

  .hero-anim, .reveal, .stagger > * { opacity: 1; transform: none; }
  .marquee__track { animation: none; }
}

/* ---------- responsive ---------- */

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

  .hero, .intro, .about, .contact { grid-template-columns: 1fr; }

  .hero {
    min-height: auto;
    padding-top: 96px;
  }

  .hero__media { min-height: 62svh; }

  .intro-video { justify-self: start; }

  .about__media { min-height: 54svh; order: 1; }
  .about__content { order: 0; }

  .metric-grid, .proof-grid, .service-list, .process {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .hero, .section, .footer { width: min(100% - 28px, var(--max)); }

  .hero { padding: 88px 0 56px; }

  .hero__media { min-height: 480px; }

  h1 { font-size: clamp(2.6rem, 13vw, 4.2rem); }

  .hero__actions, .hero__actions .button { width: 100%; }

  .intro-video { width: min(100%, 330px); }

  .section__header h2, .contact h2 {
    font-size: clamp(2rem, 10.5vw, 3rem);
  }

  .about__facts > div { grid-template-columns: 1fr; gap: 4px; }

  .portfolio-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }

  .work-card__label { min-height: 0; padding: 12px; font-size: 0.85rem; }

  .contact__actions, .contact__actions .button { width: 100%; }
}
