/* ============================================================
   Nossa Labs — Design System
   Warm paper + ink, brand red accent, expressive display type.
   ============================================================ */

/* ---------- Tokens ---------- */
:root {
  /* Color */
  --ink:        #16120F;
  --ink-soft:   #2A241F;
  --paper:      #F2ECE1;
  --paper-2:    #E9E1D2;
  --paper-3:    #DED4C2;
  --red:        #F9423A;
  --red-hover:  #FB7B75;
  --red-ink:    #C7271F;
  --white:      #FFFFFF;

  --text:        var(--ink);
  --text-muted:  color-mix(in srgb, var(--ink) 58%, transparent);
  --text-faint:  color-mix(in srgb, var(--ink) 38%, transparent);
  --line:        color-mix(in srgb, var(--ink) 14%, transparent);
  --line-strong: color-mix(in srgb, var(--ink) 26%, transparent);

  /* Type */
  --font-display: "Bricolage Grotesque", "Inter", sans-serif;
  --font-serif:   "Instrument Serif", Georgia, serif;
  --font-body:    "Inter", system-ui, sans-serif;

  /* Layout */
  --container: 1280px;
  --container-narrow: 940px;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --section-y: clamp(5rem, 12vw, 11rem);
  --radius: 18px;
  --radius-lg: 28px;

  /* Motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

body {
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--text);
  font-size: clamp(1rem, 0.97rem + 0.18vw, 1.0625rem);
  line-height: 1.62;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; border: none; background: none; }
ul { list-style: none; padding: 0; }

::selection { background: var(--red); color: var(--white); }
:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; border-radius: 4px; }

/* Subtle film grain overlay */
body::after {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none; z-index: 9999;
  opacity: 0.035; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Typography ---------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.0;
  letter-spacing: -0.025em;
  text-wrap: balance;
}
.display {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(3rem, 1.2rem + 8.6vw, 8.5rem);
  line-height: 0.92;
  letter-spacing: -0.04em;
  text-wrap: balance;
}
.h1 { font-size: clamp(2.4rem, 1.4rem + 4.4vw, 5rem); line-height: 0.98; letter-spacing: -0.03em; }
.h2 { font-size: clamp(1.9rem, 1.2rem + 3.2vw, 3.6rem); line-height: 1.0; letter-spacing: -0.028em; }
.h3 { font-size: clamp(1.25rem, 1.05rem + 0.9vw, 1.6rem); line-height: 1.1; letter-spacing: -0.02em; }

.serif { font-family: var(--font-serif); font-weight: 400; font-style: italic; letter-spacing: -0.01em; }
.accent { color: var(--red); }

.eyebrow {
  display: inline-flex; align-items: center; gap: 0.6em;
  font-family: var(--font-body);
  font-size: 0.78rem; font-weight: 600;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--text-muted);
}
.eyebrow::before {
  content: ""; width: 26px; height: 1px; background: var(--red);
  display: inline-block;
}
.eyebrow.is-center::before { display: none; }

.lead {
  font-size: clamp(1.15rem, 1.02rem + 0.7vw, 1.5rem);
  line-height: 1.5; color: var(--text-muted);
  letter-spacing: -0.01em; max-width: 56ch;
}

/* ---------- Layout helpers ---------- */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.container.narrow { max-width: var(--container-narrow); }
.section { padding-block: var(--section-y); position: relative; }
.section.tight { padding-block: clamp(3.5rem, 8vw, 6.5rem); }
.stack > * + * { margin-top: 1.5rem; }
.center { text-align: center; }
.center .lead, .center .eyebrow { margin-inline: auto; }

/* Inverse (dark) sections */
.inverse {
  background: var(--ink);
  color: var(--paper);
  --text: var(--paper);
  --text-muted: color-mix(in srgb, var(--paper) 60%, transparent);
  --text-faint: color-mix(in srgb, var(--paper) 38%, transparent);
  --line: color-mix(in srgb, var(--paper) 16%, transparent);
  --line-strong: color-mix(in srgb, var(--paper) 30%, transparent);
}
.surface { background: var(--paper-2); }

/* ---------- Buttons ---------- */
.btn {
  position: relative; display: inline-flex; align-items: center; gap: 0.6em;
  font-weight: 600; font-size: 0.98rem; letter-spacing: -0.01em;
  padding: 0.95em 1.6em; border-radius: 100px;
  transition: transform 0.4s var(--ease), background 0.3s, color 0.3s, box-shadow 0.4s;
  will-change: transform;
}
.btn svg { width: 1.05em; height: 1.05em; transition: transform 0.4s var(--ease); }
.btn:hover svg { transform: translate(3px, -3px); }

.btn-primary { background: var(--red); color: var(--white); box-shadow: 0 1px 0 rgba(0,0,0,0.04); }
.btn-primary:hover { background: var(--red-hover); transform: translateY(-3px); box-shadow: 0 16px 34px -14px var(--red); }

.btn-ghost { border: 1.5px solid var(--line-strong); color: var(--text); }
.btn-ghost:hover { border-color: var(--text); transform: translateY(-3px); }

.btn-lg { padding: 1.15em 2em; font-size: 1.05rem; }

.btn-group { display: flex; flex-wrap: wrap; gap: 0.85rem; align-items: center; }
.center .btn-group { justify-content: center; }

/* Text link with animated underline */
.link {
  display: inline-flex; align-items: center; gap: 0.45em;
  font-weight: 600; color: var(--text);
  background-image: linear-gradient(var(--red), var(--red));
  background-size: 0% 1.5px; background-position: 0 100%; background-repeat: no-repeat;
  padding-bottom: 2px; transition: background-size 0.4s var(--ease), color 0.3s;
}
.link:hover { background-size: 100% 1.5px; color: var(--red); }
.link svg { width: 0.9em; transition: transform 0.4s var(--ease); }
.link:hover svg { transform: translate(2px,-2px); }

/* ============================================================
   Header / Nav
   ============================================================ */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  transition: background 0.4s var(--ease), box-shadow 0.4s, padding 0.4s;
  padding-block: 1.25rem;
}
.nav.scrolled {
  background: color-mix(in srgb, var(--paper) 80%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  box-shadow: 0 1px 0 var(--line);
  padding-block: 0.8rem;
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 2rem; }
.nav-logo img { height: 26px; width: auto; }
.nav-links { display: flex; align-items: center; gap: 2.4rem; }
.nav-link {
  font-weight: 500; font-size: 0.97rem; color: var(--text-muted);
  position: relative; transition: color 0.3s;
}
.nav-link::after {
  content: ""; position: absolute; left: 0; bottom: -6px; height: 2px; width: 0;
  background: var(--red); transition: width 0.35s var(--ease);
}
.nav-link:hover, .nav-link.active { color: var(--text); }
.nav-link.active::after, .nav-link:hover::after { width: 100%; }
.nav-right { display: flex; align-items: center; gap: 1.6rem; }
.nav-cta { padding: 0.7em 1.3em; font-size: 0.92rem; }

.nav-toggle { display: none; width: 44px; height: 44px; align-items: center; justify-content: center; flex-direction: column; gap: 5px; }
.nav-toggle span { display: block; width: 24px; height: 2px; background: var(--ink); transition: transform 0.35s var(--ease), opacity 0.25s; }
.nav.open .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav.open .nav-toggle span:nth-child(2) { opacity: 0; }
.nav.open .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 860px) {
  .nav-toggle { display: flex; }
  .nav-right .nav-cta { display: none; }
  .nav-links {
    position: fixed; inset: 0 0 0 auto; width: min(80vw, 340px);
    flex-direction: column; align-items: flex-start; justify-content: center;
    gap: 1.5rem; padding: 2rem var(--gutter);
    background: var(--ink); color: var(--paper);
    transform: translateX(100%); transition: transform 0.5s var(--ease);
    box-shadow: -30px 0 80px rgba(0,0,0,0.3);
  }
  .nav.open .nav-links { transform: translateX(0); }
  .nav-links .nav-link { color: var(--paper); font-size: 1.6rem; font-family: var(--font-display); }
  .nav-links .nav-cta { display: inline-flex; margin-top: 1rem; }
}

/* ============================================================
   Hero
   ============================================================ */
.hero {
  min-height: 100svh; display: flex; flex-direction: column; justify-content: center;
  padding-top: clamp(7rem, 14vh, 10rem); padding-bottom: clamp(2rem, 6vh, 4rem);
  position: relative; overflow: hidden;
}
.hero-grid {
  display: grid; grid-template-columns: 1.35fr 0.65fr; gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
}
.hero-title { margin-bottom: 1.6rem; }
.hero-title .line { display: block; overflow: hidden; }
.hero-title .line > span { display: block; }
.hero .lead { margin-bottom: 2.4rem; }
.hero-meta {
  margin-top: clamp(3rem, 7vh, 5rem); display: flex; gap: clamp(2rem,5vw,4rem); flex-wrap: wrap;
  border-top: 1px solid var(--line); padding-top: 1.6rem;
}
.hero-meta .stat-num { font-family: var(--font-display); font-size: 2rem; font-weight: 600; line-height: 1; letter-spacing: -0.03em; }
.hero-meta .stat-label { font-size: 0.82rem; color: var(--text-muted); margin-top: 0.3rem; }

/* Hero image column */
.hero-visual { position: relative; }
.hero-img-stack { display: grid; gap: 1rem; }
.hero-img {
  border-radius: var(--radius); overflow: hidden; position: relative;
  box-shadow: 0 30px 60px -30px rgba(0,0,0,0.4);
}
.hero-img img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 4/5; transition: transform 1.2s var(--ease); }
.hero-img:hover img { transform: scale(1.05); }
.hero-badge {
  position: absolute; z-index: 3; bottom: -18px; left: -18px;
  background: var(--red); color: var(--white);
  border-radius: 100px; padding: 0.7em 1.2em; font-weight: 600; font-size: 0.9rem;
  box-shadow: 0 18px 40px -16px var(--red);
  display: flex; align-items: center; gap: 0.5em;
}

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-visual { display: none; }
}

/* ---------- Marquee ---------- */
.marquee {
  display: flex; overflow: hidden; user-select: none;
  -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; flex-shrink: 0; gap: clamp(2rem,5vw,4rem); padding-right: clamp(2rem,5vw,4rem); align-items: center; animation: scroll-x 36s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-item {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(1.4rem, 1rem + 1.6vw, 2.4rem); letter-spacing: -0.02em;
  color: var(--text); white-space: nowrap; display: inline-flex; align-items: center; gap: clamp(2rem,5vw,4rem);
}
.marquee-item::after { content: "✳"; color: var(--red); font-size: 0.7em; }
@keyframes scroll-x { to { transform: translateX(-100%); } }

.marquee-band { border-block: 1px solid var(--line); padding-block: clamp(1.6rem, 3vw, 2.4rem); }

/* ============================================================
   Manifesto / editorial
   ============================================================ */
.manifesto-eyebrow { margin-bottom: 2rem; }
.manifesto-text {
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(1.7rem, 1.1rem + 2.7vw, 3.2rem);
  line-height: 1.18; letter-spacing: -0.025em; max-width: 20ch;
}
.manifesto-grid { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: clamp(2rem,6vw,6rem); align-items: start; }
.manifesto-body { display: grid; gap: 1.4rem; }
.manifesto-body p { color: var(--text-muted); font-size: clamp(1rem,0.95rem+0.4vw,1.18rem); }
.def {
  display: flex; gap: 1rem; padding: 1.1rem 0; border-top: 1px solid var(--line);
}
.def-term { font-family: var(--font-serif); font-style: italic; font-size: 1.6rem; color: var(--red); min-width: 4.5ch; }
.def-desc { color: var(--text-muted); align-self: center; }
@media (max-width: 760px) { .manifesto-grid { grid-template-columns: 1fr; } }

/* ============================================================
   Cards grid (capabilities / services)
   ============================================================ */
.grid { display: grid; gap: 1.1rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 960px) { .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 680px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

.card {
  background: var(--paper-2); border: 1px solid var(--line);
  border-radius: var(--radius); padding: clamp(1.6rem, 2.4vw, 2.2rem);
  transition: transform 0.5s var(--ease), background 0.4s, border-color 0.4s, box-shadow 0.5s;
  position: relative; overflow: hidden;
}
.inverse .card { background: color-mix(in srgb, var(--paper) 5%, transparent); }
.card:hover { transform: translateY(-6px); box-shadow: 0 30px 50px -30px rgba(0,0,0,0.35); border-color: var(--line-strong); }
.card-num {
  font-family: var(--font-serif); font-style: italic; font-size: 1.3rem; color: var(--red);
  margin-bottom: 1.4rem;
}
.card-icon {
  width: 52px; height: 52px; border-radius: 14px; background: var(--paper-3);
  display: grid; place-items: center; margin-bottom: 1.3rem; transition: background 0.4s, transform 0.5s var(--ease);
}
.inverse .card-icon { background: color-mix(in srgb, var(--paper) 10%, transparent); }
.card:hover .card-icon { background: var(--red); transform: rotate(-6deg) scale(1.05); }
.card-icon img { width: 26px; height: 26px; transition: filter 0.4s; }
.card:hover .card-icon img { filter: brightness(0) invert(1); }
.card h3 { margin-bottom: 0.8rem; }
.card ul { display: grid; gap: 0.55rem; }
.card li { color: var(--text-muted); font-size: 0.95rem; padding-left: 1.3rem; position: relative; line-height: 1.45; }
.card li::before { content: ""; position: absolute; left: 0; top: 0.6em; width: 6px; height: 6px; border-radius: 2px; background: var(--red); }

/* Big feature card (home capabilities) */
.feature {
  display: grid; gap: 1.1rem; grid-template-columns: repeat(4, 1fr); grid-auto-rows: 1fr;
}
.feature .card { display: flex; flex-direction: column; justify-content: space-between; min-height: 230px; }
.feature .card.span-2 { grid-column: span 2; }
.feature .card.is-accent { background: var(--red); color: var(--white); border-color: transparent; --text-muted: rgba(255,255,255,0.85); }
.feature .card.is-accent .card-num { color: var(--white); }
.feature .card .card-top { display: flex; align-items: center; justify-content: space-between; }
.feature .card h3 { font-size: clamp(1.3rem, 1rem + 1vw, 1.9rem); margin: 1.5rem 0 0.5rem; }
.feature .card p { color: var(--text-muted); font-size: 0.96rem; }
@media (max-width: 960px) { .feature { grid-template-columns: repeat(2,1fr); } .feature .card.span-2 { grid-column: span 2; } }
@media (max-width: 680px) { .feature { grid-template-columns: 1fr; } .feature .card.span-2 { grid-column: span 1; } }

/* ============================================================
   Section header (label + heading + lead split)
   ============================================================ */
.sec-head { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1.5rem,4vw,4rem); align-items: end; margin-bottom: clamp(2.5rem,5vw,4rem); }
.sec-head.single { grid-template-columns: 1fr; }
.sec-head .h2 { max-width: 16ch; }
@media (max-width: 760px) { .sec-head { grid-template-columns: 1fr; align-items: start; } }

/* ============================================================
   Stats band
   ============================================================ */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(1.5rem,3vw,2.5rem); }
.stat { border-top: 2px solid var(--line-strong); padding-top: 1.3rem; }
.stat-value { font-family: var(--font-display); font-weight: 600; font-size: clamp(2.6rem, 1.6rem + 3.6vw, 4.6rem); line-height: 0.95; letter-spacing: -0.04em; color: var(--red); }
.stat-value .unit { color: var(--text); }
.stat-desc { margin-top: 0.8rem; color: var(--text-muted); font-size: 0.95rem; max-width: 24ch; }
@media (max-width: 860px) { .stats { grid-template-columns: repeat(2,1fr); gap: 2rem 1.5rem; } }
@media (max-width: 460px) { .stats { grid-template-columns: 1fr; } }

/* ============================================================
   Clients — editorial list
   ============================================================ */
.client-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.1rem; }
@media (max-width: 760px) { .client-grid { grid-template-columns: 1fr; } }
.client {
  background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: clamp(1.6rem, 2.6vw, 2.4rem); transition: transform 0.5s var(--ease), box-shadow 0.5s, border-color 0.4s;
}
.client:hover { transform: translateY(-5px); box-shadow: 0 28px 48px -30px rgba(0,0,0,0.3); border-color: var(--line-strong); }
.client-head { display: flex; align-items: center; gap: 0.9rem; margin-bottom: 1.1rem; }
.client-logo { width: 46px; height: 46px; border-radius: 12px; object-fit: cover; background: var(--white); border: 1px solid var(--line); }
.client-name { font-family: var(--font-display); font-weight: 600; font-size: 1.3rem; letter-spacing: -0.02em; }
.client p { color: var(--text-muted); font-size: 0.96rem; }
.client .metric { color: var(--red); font-weight: 600; }

/* ============================================================
   Team
   ============================================================ */
.team-feature { display: grid; grid-template-columns: 0.85fr 1.15fr; gap: clamp(2rem,5vw,4.5rem); align-items: center; }
.team-photo { border-radius: var(--radius-lg); overflow: hidden; aspect-ratio: 4/5; }
.team-photo img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease); }
.team-photo:hover img { transform: scale(1.04); }
.team-info .eyebrow { margin-bottom: 1.2rem; }
.team-info h2 { margin-bottom: 1.2rem; }
.team-info p { color: var(--text-muted); margin-bottom: 1.6rem; max-width: 52ch; }
@media (max-width: 820px) { .team-feature { grid-template-columns: 1fr; } .team-photo { max-width: 440px; } }

.team-note {
  border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(1.8rem,3vw,2.6rem);
  display: grid; grid-template-columns: auto 1fr; gap: 1.6rem; align-items: center; background: var(--paper-2);
}
.team-note .globe { font-size: 2.4rem; }
@media (max-width: 560px) { .team-note { grid-template-columns: 1fr; } }

/* ============================================================
   CTA / Footer
   ============================================================ */
.cta {
  text-align: center; padding-block: clamp(5rem, 12vw, 10rem);
}
.cta .display { margin-bottom: 2rem; }
.cta .display .serif { color: var(--red); }

.footer { background: var(--ink); color: var(--paper); padding-top: clamp(4rem,8vw,7rem); padding-bottom: 2.5rem; }
.footer-top { display: grid; grid-template-columns: 1.4fr 1fr; gap: 3rem; align-items: start; padding-bottom: clamp(3rem,6vw,5rem); border-bottom: 1px solid color-mix(in srgb, var(--paper) 16%, transparent); }
.footer-word { font-family: var(--font-display); font-weight: 600; font-size: clamp(3rem, 1.5rem + 8vw, 9rem); line-height: 0.85; letter-spacing: -0.04em; color: var(--paper); }
.footer-word .serif { color: var(--red); }
.footer-links { display: flex; gap: 4rem; flex-wrap: wrap; }
.footer-col h4 { font-family: var(--font-body); font-size: 0.78rem; letter-spacing: 0.16em; text-transform: uppercase; color: color-mix(in srgb,var(--paper) 50%, transparent); margin-bottom: 1rem; font-weight: 600; }
.footer-col a { display: block; padding: 0.35rem 0; color: color-mix(in srgb,var(--paper) 78%, transparent); transition: color 0.3s; }
.footer-col a:hover { color: var(--red); }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; padding-top: 2rem; color: color-mix(in srgb,var(--paper) 50%, transparent); font-size: 0.88rem; }
@media (max-width: 760px) { .footer-top { grid-template-columns: 1fr; } }

/* ============================================================
   Scroll reveal
   ============================================================ */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out); }
.reveal.in { opacity: 1; transform: none; }
.reveal[data-delay="1"] { transition-delay: 0.08s; }
.reveal[data-delay="2"] { transition-delay: 0.16s; }
.reveal[data-delay="3"] { transition-delay: 0.24s; }
.reveal[data-delay="4"] { transition-delay: 0.32s; }

/* Hero line mask reveal */
.hero-title .line > span { transform: translateY(110%); transition: transform 1s var(--ease); }
.hero-title.in .line > span { transform: none; }
.hero-title .line:nth-child(2) > span { transition-delay: 0.1s; }
.hero-title .line:nth-child(3) > span { transition-delay: 0.2s; }
