/* =========================================================
   TANGΣNTS — homepage sections
   ========================================================= */

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding-top: 128px;
  padding-bottom: var(--s-700);
  overflow: hidden;
}
.hero-grid {
  display: grid;
  gap: var(--s-400);
  align-items: center;
}
.hero-copy { display: grid; gap: var(--s-300); max-width: 680px; position: relative; z-index: 1; }
.hero-copy h1 { max-width: 680px; }
.hero-sub { max-width: 560px; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: var(--s-100); }

.hero-visual {
  position: relative;
  height: 340px;
  margin-inline: calc(var(--gutter) * -1);
}
.hero-visual canvas { width: 100%; height: 100%; }

@media (min-width: 1024px) {
  /* Content starts right under the floating nav instead of floating mid viewport */
  .hero { padding-top: 136px; padding-bottom: var(--s-800); }
  .hero-grid { grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.7fr); gap: 0; }
  .hero-copy, .hero-copy h1 { max-width: 780px; }
  .hero-visual { height: 520px; margin-inline: 0 calc(var(--gutter) * -1); }
}

/* ---------- Trust strip ---------- */
.trust {
  border-block: 1px solid var(--line);
  padding-block: var(--s-400);
}
.trust-inner { display: grid; gap: var(--s-300); align-items: center; }
@media (min-width: 900px) {
  .trust-inner { grid-template-columns: 280px minmax(0, 1fr); }
}
.marquee {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.marquee-track {
  display: flex;
  width: max-content;
  gap: var(--s-600);
  animation: marquee 40s linear infinite;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
.is-offscreen .marquee-track { animation-play-state: paused; }
@keyframes marquee {
  to { transform: translate3d(calc(-50% - var(--s-600) / 2), 0, 0); }
}
.logo {
  flex: none;
  display: grid;
  place-items: center;
  width: 144px;
  height: 40px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-sm);
  font-size: 12px;
  line-height: 16px;
  color: var(--text-faint);
}
@media (prefers-reduced-motion: reduce) {
  .marquee { -webkit-mask-image: none; mask-image: none; }
  .marquee-track { animation: none; flex-wrap: wrap; width: auto; gap: var(--s-200); }
  .marquee-track [data-clone] { display: none; }
}

/* ---------- Services ---------- */
/* Bento: one wide tile for the core offer, two tiles under it */
.services-grid { display: grid; gap: var(--s-200); }
.service {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--s-400);
  padding: var(--s-300);
}
.service-top { display: grid; gap: var(--s-200); }
.service-outcome { color: var(--text-muted); font-size: 18px; line-height: 28px; }
.service-wide {
  background: color-mix(in srgb, var(--accent) 7%, var(--surface-2));
  border-color: color-mix(in srgb, var(--accent) 24%, transparent);
}
@media (min-width: 900px) {
  .services-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .service-wide {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: center;
    gap: var(--s-600);
    padding: var(--s-500);
  }
  .service-wide .t-h3 { font-size: 30px; line-height: 36px; letter-spacing: -0.025em; }
}

/* Mini animated examples: idle by default, play on hover or when in view on touch */
.mini {
  position: relative;
  display: grid;
  gap: var(--s-75);
  min-height: 168px;
  padding: var(--s-200);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--bg);
  font-size: 14px;
  line-height: 20px;
  align-content: start;
}
.mini-label {
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
  color: var(--text-faint);
  margin-bottom: var(--s-50);
}

/* Flow */
.flow-row {
  display: grid;
  grid-template-columns: 16px 1fr auto;
  align-items: center;
  gap: var(--s-75);
  padding: var(--s-75) var(--s-100);
  border-radius: var(--r-sm);
  color: var(--text-faint);
  background: transparent;
  transition: color 300ms ease, background-color 300ms ease, transform 500ms var(--ease-out), opacity 300ms ease;
  opacity: 0.5;
  transform: translateX(-4px);
}
.flow-row time { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.is-playing .flow-row { opacity: 1; transform: none; color: var(--text); background: var(--surface); }
.is-playing .flow-row .icon { color: var(--accent); }
.is-playing .flow-row:nth-of-type(2) { transition-delay: 450ms; }
.is-playing .flow-row:nth-of-type(3) { transition-delay: 900ms; }

/* Chat */
.bubble {
  max-width: 85%;
  padding: var(--s-75) var(--s-100);
  border-radius: var(--r-sm);
  font-size: 14px;
  line-height: 20px;
}
.bubble-user { justify-self: end; background: var(--surface); color: var(--text-muted); }
.bubble-ai {
  position: relative;
  justify-self: start;
  min-height: 32px;
  border: 1px solid var(--line-strong);
  color: var(--text);
  opacity: 0.5;
  transition: opacity 300ms ease, border-color 300ms ease;
}
.bubble-ai .answer { display: inline-block; opacity: 0; filter: blur(4px); transition: opacity 400ms ease, filter 400ms ease; }
.typing { position: absolute; left: var(--s-100); top: 50%; display: flex; gap: 3px; transform: translateY(-50%); transition: opacity 200ms ease; }
.typing i { width: 4px; height: 4px; border-radius: 50%; background: var(--text-faint); }
.is-playing .bubble-ai { opacity: 1; border-color: var(--accent); }
.is-playing .typing { opacity: 0; transition-delay: 900ms; }
.is-playing .typing i { animation: blink 900ms ease-in-out 1; }
.is-playing .typing i:nth-child(2) { animation-delay: 150ms; }
.is-playing .typing i:nth-child(3) { animation-delay: 300ms; }
.is-playing .bubble-ai .answer { opacity: 1; filter: none; transition-delay: 950ms; }
@keyframes blink { 50% { background: var(--accent); transform: translateY(-2px); } }

/* Record */
.rec-frame { border: 1px solid var(--line-strong); border-radius: var(--r-sm); overflow: hidden; }
.rec-body { display: grid; gap: var(--s-50); padding: var(--s-100); }
.rec-h { font-weight: 600; color: var(--text-faint); transition: color 300ms ease; }
.rec-p { margin-bottom: var(--s-75); font-size: 12px; line-height: 16px; color: var(--text-faint); }
.is-playing .mini-rec .rec-h { color: var(--text); }
.rec-status {
  position: relative;
  justify-self: start;
  display: inline-grid;
  height: 24px;
  padding: 0 var(--s-100);
  border-radius: 4px;
  background: var(--surface);
  color: var(--text-muted);
  font-weight: 600;
  overflow: hidden;
  transition: background-color 300ms ease, color 300ms ease;
}
.rec-status > span { grid-area: 1 / 1; display: inline-flex; align-items: center; gap: 4px; transition: transform 400ms var(--ease-drawer), opacity 300ms ease; }
.cta-b { transform: translateY(100%); opacity: 0; }
.is-playing .rec-status { background: var(--accent); color: var(--on-accent); transition-delay: 600ms; }
.is-playing .cta-a { transform: translateY(-100%); opacity: 0; transition-delay: 1100ms; }
.is-playing .cta-b { transform: none; opacity: 1; transition-delay: 1100ms; }

/* ---------- Tagline (scroll scrubbed) ---------- */
.tagline { padding-block: var(--s-900); }
.tagline-text {
  max-width: 960px;
  font-size: 36px;
  line-height: 40px;
  font-weight: 600;
  letter-spacing: -0.03em;
  text-wrap: balance;
}
@media (min-width: 768px) { .tagline-text { font-size: 48px; line-height: 1.08; } }
@media (min-width: 1200px) { .tagline-text { font-size: 60px; line-height: 1.05; } }
.tagline-text .word {
  display: inline;
  color: color-mix(in srgb, var(--text) calc(55% + var(--p, 0) * 45%), transparent);
  transition: color 300ms var(--ease-out);
}
.tagline-text .word.is-accent { color: color-mix(in srgb, var(--accent) calc(55% + var(--p, 0) * 45%), transparent); }

/* ---------- Work ---------- */
.section-head-row {
  max-width: none;
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: var(--s-300);
}
.section-head-row > div:first-child { display: grid; gap: var(--s-200); max-width: 680px; }

.work-grid { display: grid; gap: var(--s-200); }
@media (min-width: 700px) { .work-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* The featured project leads as a 2x2 tile; the other five fill around it */
@media (min-width: 1100px) {
  .work-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .work-card.is-feature { grid-column: span 2; grid-row: span 2; grid-template-rows: 1fr auto; }
  .work-card.is-feature .work-media { aspect-ratio: auto; min-height: 100%; }
  /* The tall tile crops a 16:10 cover; keep its left edge, where covers put their headline */
  .work-card.is-feature .work-media img { object-position: left center; }
  .work-card.is-feature .work-art.is-feature { font-size: 220px; }
  .work-card.is-feature h3 { font-size: 24px; line-height: 32px; }
}

.work-card { display: grid; grid-template-rows: auto 1fr; padding: var(--s-75); }
.work-card:first-child { border-color: var(--line-strong); }
.work-media {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 10;
  border-radius: var(--r-sm);
  background: var(--surface);
  overflow: hidden;
}
.work-media img, .work-art {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 900ms var(--ease-drawer);
}
.work-art {
  display: grid;
  place-items: center;
  font-size: 128px;
  line-height: 1;
  font-weight: 600;
  letter-spacing: -0.04em;
  color: var(--line-strong);
}
.work-art.is-feature { color: var(--accent); opacity: 0.85; }
/* Empty cover slot until a real image is added in content.js */
.work-art.is-empty {
  position: absolute;
  inset: var(--s-200);
  width: auto; height: auto;
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-sm);
}
.work-body { display: grid; align-content: start; gap: var(--s-75); padding: var(--s-200) var(--s-100) var(--s-100); }
.work-tags { display: flex; flex-wrap: wrap; gap: var(--s-75); }
.tag {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 var(--s-75);
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  font-size: 12px;
  line-height: 16px;
  font-weight: 500;
  color: var(--text-muted);
}
.work-body h3 { display: flex; align-items: center; justify-content: space-between; gap: var(--s-100); font-size: 20px; line-height: 28px; }
.work-body h3 .icon { color: var(--text-faint); transition: transform 400ms var(--ease-out), color 200ms ease; }
.work-result { color: var(--text-muted); font-size: 14px; line-height: 20px; transition: color 300ms ease; }
@media (hover: hover) and (pointer: fine) {
  .work-card:hover .work-media img,
  .work-card:hover .work-art { transform: scale(1.05); }
  .work-card:hover .work-result { color: var(--text); }
  .work-card:hover h3 .icon { color: var(--accent); transform: translate(2px, -2px); }
}

/* ---------- How we work ---------- */
.steps {
  position: relative;
  display: grid;
  gap: var(--s-400);
  padding-left: var(--s-400);
}
.steps::before,
.steps::after {
  content: "";
  position: absolute;
  left: 4px; top: 6px; bottom: 6px;
  width: 1px;
  background: var(--line-strong);
}
.steps::after {
  background: var(--accent);
  transform-origin: top;
  transform: scaleY(var(--progress, 0));
  transition: transform 300ms linear;
}
.step { position: relative; display: grid; gap: var(--s-75); }
.step::before {
  content: "";
  position: absolute;
  left: calc(var(--s-400) * -1);
  top: 6px;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--line-strong);
  transition: background-color 300ms ease, border-color 300ms ease;
}
.step.is-active::before { background: var(--accent); border-color: var(--accent); }
.step p { color: var(--text-muted); max-width: 320px; }

@media (min-width: 900px) {
  .steps { grid-template-columns: repeat(4, minmax(0, 1fr)); padding-left: 0; padding-top: var(--s-400); gap: var(--s-300); }
  .steps::before, .steps::after { left: 4px; right: 0; top: 4px; bottom: auto; width: auto; height: 1px; }
  .steps::after { transform-origin: left; transform: scaleX(var(--progress, 0)); }
  .step::before { left: 0; top: calc(var(--s-400) * -1); }
}

.edge {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--s-100) var(--s-300);
  align-items: center;
  margin-top: var(--s-700);
  padding: var(--s-300);
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface-2);
}
.edge-mark {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 64px; height: 64px;
  border-radius: var(--r);
  background: var(--bg);
  border: 1px solid var(--line-strong);
  font-size: 36px;
  line-height: 1;
  font-weight: 600;
  color: var(--accent);
}
.edge-text { font-size: 18px; line-height: 28px; font-weight: 500; max-width: 720px; }
.edge-small { align-self: start; }
@media (min-width: 768px) { .edge { padding: var(--s-400); } .edge-text { font-size: 20px; line-height: 28px; } }

/* ---------- Models ---------- */
/* Rows, not cards: a hairline between rows only */
.model { display: grid; gap: var(--s-100); padding-block: var(--s-400); }
.model + .model { border-top: 1px solid var(--line); }
.model-name { font-size: 30px; line-height: 36px; letter-spacing: -0.025em; }
.model-equity .model-name { color: var(--accent-text); }
.model > p { max-width: 520px; color: var(--text-muted); font-size: 18px; line-height: 28px; }
.model .link-arrow { margin-top: var(--s-75); }
@media (min-width: 900px) {
  .model {
    grid-template-columns: minmax(0, 0.7fr) minmax(0, 1.3fr) 200px;
    align-items: baseline;
    gap: var(--s-400);
    padding-block: var(--s-500);
  }
  .model-name { font-size: 36px; line-height: 40px; }
  .model .link-arrow { margin-top: 0; justify-self: end; }
}

/* ---------- Results ---------- */
.stats {
  display: grid;
  gap: var(--s-300);
  margin: 0;
  border-top: 1px solid var(--line-strong);
}
.stat { display: grid; gap: var(--s-100); padding-top: var(--s-300); }
.stat dt { font-size: 14px; line-height: 20px; color: var(--text-muted); }
.stat dd { margin: 0; }
.stat .num {
  font-family: var(--font);
  font-size: 60px;
  line-height: 1;
  font-weight: 600;
  letter-spacing: -0.04em;
  color: var(--accent-text);
}
@media (min-width: 768px) {
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stat { padding-right: var(--s-300); }
  .stat + .stat { padding-left: var(--s-300); border-left: 1px solid var(--line); }
  .stat .num { font-size: 72px; }
}
.stats-note { margin-top: var(--s-300); }

.quotes { margin-top: var(--s-800); }
.quotes-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 100%;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  border-radius: var(--r);
}
.quotes-track::-webkit-scrollbar { display: none; }
.quote {
  scroll-snap-align: start;
  display: grid;
  gap: var(--s-400);
  padding: var(--s-400) var(--s-300);
  border-radius: var(--r);
  background: var(--surface-2);
}
@media (min-width: 768px) { .quote { padding: var(--s-600); } }
.quote blockquote p { max-width: 860px; font-size: 24px; line-height: 32px; font-weight: 500; letter-spacing: -0.015em; }
@media (min-width: 768px) { .quote blockquote p { font-size: 30px; line-height: 36px; } }
.quote figcaption { display: flex; align-items: center; gap: var(--s-200); font-size: 14px; line-height: 20px; color: var(--text-muted); }
.quote strong { color: var(--text); font-weight: 600; }
.avatar {
  display: grid;
  place-items: center;
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--bg);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-faint);
  filter: grayscale(1);
}
.quotes-controls { display: flex; align-items: center; justify-content: flex-end; gap: var(--s-100); margin-top: var(--s-200); }
.quotes-dots { display: flex; gap: var(--s-75); }
.quotes-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--line-strong); transition: background-color 300ms ease; }
.quotes-dots i.is-on { width: 20px; border-radius: 3px; background: var(--accent); }

/* ---------- FAQ ---------- */
.faq-grid { display: grid; gap: var(--s-300); }
@media (min-width: 1024px) { .faq-grid { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: var(--s-700); } }
.faq-list { border-top: 1px solid var(--line); }
.faq-list details { border-bottom: 1px solid var(--line); }
.faq-list summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-200);
  min-height: 64px;
  padding-block: var(--s-200);
  font-size: 18px;
  line-height: 28px;
  font-weight: 600;
  list-style: none;
  cursor: pointer;
  transition: color 200ms ease;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary .icon { color: var(--text-faint); transition: transform 300ms var(--ease-out), color 200ms ease; }
.faq-list details[open] summary .icon { transform: rotate(45deg); color: var(--accent); }
@media (hover: hover) and (pointer: fine) {
  .faq-list summary:hover { color: var(--accent-text); }
}
.faq-list details p { padding-bottom: var(--s-300); max-width: 620px; color: var(--text-muted); }
.faq-list details[open] p { animation: faqIn 400ms var(--ease-out); }
@keyframes faqIn { from { opacity: 0; transform: translateY(-4px); } }

/* ---------- Final CTA ---------- */
.cta { position: relative; overflow: hidden; border-top: 1px solid var(--line); }
.cta-grid { position: relative; display: grid; gap: var(--s-600); align-items: start; }
@media (min-width: 1024px) { .cta-grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: var(--s-700); } }
.cta-copy { position: relative; display: grid; gap: var(--s-400); }
.cta-copy h2 { max-width: 680px; }
.cta-mark {
  position: absolute;
  right: -8%;
  top: -40px;
  z-index: 0;
  font-size: 360px;
  line-height: 1;
  font-weight: 700;
  color: var(--accent);
  opacity: 0.06;
  pointer-events: none;
  user-select: none;
}
@media (min-width: 1024px) { .cta-mark { right: auto; left: 52%; top: -80px; font-size: 520px; } }
.cta-copy > :not(.cta-mark) { position: relative; z-index: 1; }
.next-steps { display: grid; gap: var(--s-100); }
.next-steps li { display: flex; gap: var(--s-200); align-items: baseline; color: var(--text-muted); }
.next-steps .num { font-size: 12px; line-height: 16px; color: var(--accent); }
.cta-alt { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-300); }

.cta-form { position: relative; z-index: 1; padding: var(--s-300); background: var(--surface-2); }
@media (min-width: 768px) { .cta-form { padding: var(--s-400); } }
.form-state { display: grid; gap: var(--s-300); }
.form-state[hidden] { display: none; }
.field-row { display: grid; gap: var(--s-300); }
@media (min-width: 560px) { .field-row { grid-template-columns: 1fr 1fr; } }
.btn-block { width: 100%; min-height: 48px; }
.submit-loading { display: none; }
.is-sending .submit-label { display: none; }
.is-sending .submit-loading { display: inline; }
.is-sending [data-submit] { opacity: 0.7; pointer-events: none; }
.form-error { color: #e3a091; }
:root[data-theme="light"] .form-error { color: #a5432f; }
.form-privacy { text-align: center; }
.form-success { display: grid; gap: var(--s-200); justify-items: start; padding-block: var(--s-400); outline: none; }
.form-success[hidden] { display: none; }
.success-icon {
  display: grid;
  place-items: center;
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  animation: pop 500ms var(--ease-out);
}
@keyframes pop { from { transform: scale(0.8); opacity: 0; } }
