/* ===================================================================
   Brainjumps — "gold-foil engineering blueprint"
   Vanilla CSS. Bricolage Grotesque + Hanken Grotesk + Space Mono.
   Palette sampled from the logo: gold #E4B138 on charcoal.
   =================================================================== */

:root {
  --bg:        #141311;
  --bg-soft:   #1a1916;
  --bg-card:   #201e1a;
  --surface:   rgba(255, 252, 244, 0.035);
  --surface-2: rgba(255, 252, 244, 0.06);
  --border:    rgba(228, 177, 56, 0.14);
  --border-2:  rgba(228, 177, 56, 0.34);

  --text:      #f5f1e8;
  --text-dim:  #b6b0a1;
  --text-mute: #7d7768;

  --gold:      #e4b138;
  --gold-lt:   #f6cf63;
  --gold-dk:   #a87f2a;
  --grad:      linear-gradient(115deg, #f6cf63 0%, #e4b138 46%, #b8862c 100%);

  --radius:   16px;
  --radius-sm:11px;
  --maxw:     1180px;
  --ease:     cubic-bezier(.22, 1, .36, 1);

  --font-body: 'Hanken Grotesk', system-ui, sans-serif;
  --font-head: 'Libre Franklin', system-ui, -apple-system, sans-serif;
  --font-mono: 'Space Mono', ui-monospace, monospace;
}

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

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.62;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  position: relative;
}

/* film grain overlay for depth — kills the flat digital look */
body::after {
  content: ""; position: fixed; inset: 0; z-index: 9999; pointer-events: none;
  opacity: .05; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%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");
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; padding: 0; }
::selection { background: var(--gold); color: #141311; }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 28px; }

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 200;
  background: var(--gold); color: #141311; padding: 10px 16px; font-weight: 700; font-family: var(--font-mono);
}
.skip-link:focus { left: 0; }

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

/* ---------- shared headings ---------- */
.eyebrow {
  font-family: var(--font-mono); font-size: .8rem; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; color: var(--gold); margin-bottom: 20px;
}
h1, h2, h3 { font-family: var(--font-head); font-weight: 700; line-height: 1.04; letter-spacing: -.02em; }
.grad {
  background: var(--grad); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}

.section { padding: clamp(72px, 10vw, 150px) 0; position: relative; }
.section--alt { background: var(--bg-soft); border-block: 1px solid var(--border); }
.section__head { max-width: 660px; margin-bottom: 64px; }
.section__head h2 { font-size: clamp(2.1rem, 5vw, 3.4rem); margin-bottom: 22px; }
.section__lead { color: var(--text-dim); font-size: 1.1rem; max-width: 56ch; }

/* ---------- buttons ---------- */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 30px; border-radius: 100px; font-family: var(--font-mono); font-weight: 700; font-size: .9rem;
  letter-spacing: .01em; cursor: pointer; border: 1px solid transparent; overflow: hidden;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), background .3s var(--ease), border-color .3s var(--ease);
  white-space: nowrap;
}
.btn--primary { background: var(--grad); color: #18140a; box-shadow: 0 10px 34px -12px rgba(228,177,56,.6); }
.btn--primary::after {
  content: ""; position: absolute; inset: 0; transform: translateX(-120%);
  background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,.55) 50%, transparent 70%);
}
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 16px 44px -12px rgba(228,177,56,.72); }
.btn--primary:hover::after { transform: translateX(120%); transition: transform .7s var(--ease); }
.btn--ghost { background: var(--surface); border-color: var(--border-2); color: var(--text); }
.btn--ghost:hover { background: var(--surface-2); border-color: var(--gold); transform: translateY(-2px); }
.btn--block { width: 100%; }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 100; border-bottom: 1px solid transparent;
  transition: background .3s var(--ease), border-color .3s var(--ease);
}
.nav.is-scrolled {
  background: rgba(20, 19, 17, .8); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom-color: var(--border);
}
.nav__inner { display: flex; align-items: center; justify-content: space-between; height: 78px; }
.brand { display: inline-flex; align-items: center; gap: 11px; }
.brand__mark { width: 36px; height: 36px; object-fit: contain; }
.brand__name { font-family: var(--font-head); font-weight: 700; font-size: 1.22rem; letter-spacing: -.02em; }

.nav__links { display: flex; align-items: center; gap: 34px; }
.nav__links a { color: var(--text-dim); font-size: .92rem; font-weight: 500; transition: color .2s; display: inline-flex; align-items: baseline; gap: 6px; }
.nav__links a:hover { color: var(--text); }
.nav__idx { font-family: var(--font-mono); font-size: .68rem; color: var(--gold); }
.nav__links .btn { color: var(--text); }
.nav__links .btn .nav__idx { display: none; }

.nav__toggle { display: none; flex-direction: column; gap: 5px; background: none; border: 0; cursor: pointer; padding: 8px; }
.nav__toggle span { width: 24px; height: 2px; background: var(--text); border-radius: 2px; transition: transform .3s var(--ease), opacity .2s; }
.nav__toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav__toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- hero ---------- */
.hero { position: relative; overflow: hidden; padding: clamp(96px, 17vh, 180px) 0 clamp(80px, 11vw, 130px); }
.hero__bg { position: absolute; inset: 0; z-index: 0; }
.orb {
  position: absolute; width: 560px; height: 560px; border-radius: 50%; filter: blur(80px); opacity: .42;
  background: radial-gradient(circle, rgba(228,177,56,.5), transparent 70%);
  top: -180px; right: -120px; animation: float 20s var(--ease) infinite;
}
@keyframes float { 50% { transform: translate(-50px, 60px) scale(1.12); } }

.grid-lines {
  position: absolute; inset: 0;
  background-image: linear-gradient(var(--border) 1px, transparent 1px), linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 75% 65% at 60% 35%, #000 25%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 75% 65% at 60% 35%, #000 25%, transparent 78%);
  opacity: .55;
}

.hero__watermark {
  position: absolute; top: 50%; right: -40px; transform: translateY(-50%);
  width: clamp(360px, 44vw, 660px); opacity: .07; pointer-events: none; filter: saturate(1.3);
}

/* circuit traces that draw on load */
.circuit { position: absolute; top: 50%; right: -30px; transform: translateY(-50%); width: clamp(420px, 50vw, 760px); opacity: .5; }
.circuit g { stroke: var(--gold); }
.circuit .nodes { fill: var(--gold); stroke: none; }
.circuit path { stroke-dasharray: 1; stroke-dashoffset: 1; stroke-linecap: round; stroke-linejoin: round; animation: draw 2.4s var(--ease) forwards; }
.circuit path:nth-child(1) { animation-delay: .2s; }
.circuit path:nth-child(2) { animation-delay: .45s; }
.circuit path:nth-child(3) { animation-delay: .7s; }
.circuit path:nth-child(4) { animation-delay: .95s; }
.circuit path:nth-child(5) { animation-delay: 1.2s; }
.circuit path:nth-child(6) { animation-delay: 1.45s; }
.circuit .nodes circle { opacity: 0; transform-box: fill-box; transform-origin: center; animation: pop .5s var(--ease) forwards 1.8s; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(0); } to { opacity: 1; transform: scale(1); } }

.hero__inner { position: relative; z-index: 1; max-width: 800px; }
.hero__title { font-size: clamp(2.6rem, 7vw, 4.9rem); font-weight: 700; letter-spacing: -.03em; margin-bottom: 28px; }
.hero__lead { font-size: clamp(1.06rem, 2vw, 1.28rem); color: var(--text-dim); max-width: 560px; margin-bottom: 40px; }
.hero__cta { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 72px; }
.hero__stats { display: flex; gap: 56px; flex-wrap: wrap; }
.hero__stats li { display: flex; flex-direction: column; gap: 4px; position: relative; padding-left: 18px; }
.hero__stats li::before { content: ""; position: absolute; left: 0; top: 6px; bottom: 6px; width: 2px; background: var(--grad); }
.hero__stats strong { font-family: var(--font-head); font-size: 1.85rem; font-weight: 700; letter-spacing: -.02em; }
.hero__stats strong .plus { color: var(--gold); }
.hero__stats span { color: var(--text-mute); font-size: .82rem; font-family: var(--font-mono); }

.hero__scroll { position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%); z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.hero__scroll span { font-family: var(--font-mono); font-size: .68rem; letter-spacing: .25em; text-transform: uppercase; color: var(--text-mute); }
.hero__scroll i { width: 1px; height: 38px; background: linear-gradient(var(--gold), transparent); animation: scrolldot 2s var(--ease) infinite; }
@keyframes scrolldot { 0%,100% { transform: scaleY(.4); transform-origin: top; opacity: .4; } 50% { transform: scaleY(1); opacity: 1; } }
@media (max-width: 720px) { .hero__scroll { display: none; } .hero__watermark { right: -130px; opacity: .05; } .circuit { display: none; } }

/* ---------- marquee ---------- */
.marquee { overflow: hidden; border-block: 1px solid var(--border); background: var(--bg-soft); padding: 20px 0; }
.marquee__track { display: flex; align-items: center; gap: 30px; width: max-content; animation: scroll 34s linear infinite; }
.marquee__track span { font-family: var(--font-head); font-weight: 700; font-size: 1.15rem; color: var(--text-dim); white-space: nowrap; }
.marquee__track i { color: var(--gold); font-size: .7rem; font-style: normal; }
@keyframes scroll { to { transform: translateX(-50%); } }
.marquee:hover .marquee__track { animation-play-state: paused; }

/* ---------- bento / cards ---------- */
.bento { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.card {
  position: relative; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 38px 34px; overflow: hidden;
  transition: transform .3s var(--ease), border-color .3s var(--ease), background .3s var(--ease);
}
/* circuit-node corner accent */
.card::after {
  content: ""; position: absolute; top: 16px; right: 16px; width: 7px; height: 7px; border-radius: 50%;
  background: var(--gold); box-shadow: 0 0 0 4px rgba(228,177,56,.12); opacity: .5; transition: opacity .3s, box-shadow .3s;
}
.card:hover { transform: translateY(-5px); background: var(--surface-2); border-color: var(--border-2); }
.card:hover::after { opacity: 1; box-shadow: 0 0 0 5px rgba(228,177,56,.22), 0 0 16px rgba(228,177,56,.5); }
.card--wide { grid-column: span 2; }
.card--accent { background: linear-gradient(135deg, rgba(228,177,56,.13), rgba(168,127,42,.04)); }
.card__id { font-family: var(--font-mono); font-size: .75rem; color: var(--gold-dk); position: absolute; top: 20px; left: 34px; }
.card__icon {
  width: 52px; height: 52px; border-radius: 13px; display: grid; place-items: center;
  background: var(--surface-2); border: 1px solid var(--border); margin: 18px 0 22px;
}
.card__icon svg { width: 25px; height: 25px; fill: none; stroke: var(--gold-lt); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.card h3 { font-size: 1.5rem; margin-bottom: 13px; }
.card p { color: var(--text-dim); margin-bottom: 22px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tags li {
  font-family: var(--font-mono); font-size: .76rem; color: var(--text-dim);
  background: rgba(228,177,56,.06); border: 1px solid var(--border); padding: 5px 11px; border-radius: 7px;
}

/* ---------- approach ---------- */
.approach__grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.feature {
  position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 36px; transition: border-color .3s var(--ease), transform .3s var(--ease), background .3s;
}
.feature:hover { border-color: var(--border-2); transform: translateY(-4px); background: var(--surface-2); }
.feature__num { font-family: var(--font-mono); font-weight: 700; font-size: 2rem; color: transparent; -webkit-text-stroke: 1px var(--gold-dk); display: block; }
.feature h3 { font-size: 1.35rem; margin: 16px 0 11px; }
.feature p { color: var(--text-dim); }

/* ---------- stack ---------- */
.stack { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.stack__col { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 34px; }
.stack__col h3 { font-size: 1rem; margin-bottom: 20px; padding-bottom: 18px; border-bottom: 1px solid var(--border); }
.stack__tag { font-family: var(--font-mono); font-weight: 700; color: var(--gold); font-size: .95rem; }
.stack__col li { padding: 10px 0; color: var(--text-dim); display: flex; align-items: center; gap: 12px; font-size: 1.02rem; }
.stack__col li::before { content: ""; width: 7px; height: 7px; border-radius: 1px; background: var(--gold); transform: rotate(45deg); flex-shrink: 0; opacity: .8; }

/* ---------- collective ---------- */
.collective { display: grid; grid-template-columns: 1.05fr .95fr; gap: 60px; align-items: center; }
.collective__text h2 { font-size: clamp(1.9rem, 3.6vw, 2.7rem); margin-bottom: 22px; }
.collective__text p { color: var(--text-dim); margin-bottom: 18px; }
.collective__text .btn { margin-top: 12px; }
.collective__values { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.value {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 24px; display: flex; flex-direction: column; gap: 8px; transition: border-color .3s, transform .3s;
}
.value:hover { border-color: var(--border-2); transform: translateY(-3px); }
.value strong { font-family: var(--font-head); font-size: 1.08rem; font-weight: 700; }
.value span { color: var(--text-mute); font-size: .9rem; line-height: 1.5; }

/* ---------- contact ---------- */
.contact__inner { max-width: 700px; margin: 0 auto; }
.contact__inner .section__head { margin: 0 auto 48px; text-align: center; }
.contact__inner .section__lead { margin-inline: auto; }
.contact__form { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.field { display: flex; flex-direction: column; gap: 9px; }
.field--full { grid-column: span 2; }
.field label { font-family: var(--font-mono); font-size: .82rem; color: var(--text-dim); display: inline-flex; align-items: baseline; gap: 7px; }
.field__idx { color: var(--gold); font-size: .7rem; }
.field input, .field textarea {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 14px 16px; color: var(--text); font-family: var(--font-body); font-size: 1rem;
  transition: border-color .2s, background .2s, box-shadow .2s; resize: vertical;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--gold); background: var(--surface-2); box-shadow: 0 0 0 4px rgba(228,177,56,.1); }
.contact__form .btn { grid-column: span 2; }
.contact__hint { grid-column: span 2; text-align: center; color: var(--text-mute); font-size: .85rem; font-family: var(--font-mono); }

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--border); padding: 56px 0; }
.footer__inner { display: flex; justify-content: space-between; align-items: flex-start; gap: 30px; flex-wrap: wrap; }
.footer__brand { display: flex; gap: 14px; align-items: center; }
.footer__brand p { color: var(--text-mute); font-size: .9rem; margin-top: 4px; }
.footer__meta { display: flex; flex-direction: column; gap: 7px; text-align: right; color: var(--text-mute); font-size: .85rem; font-family: var(--font-mono); }
.footer__meta a { color: var(--text-dim); }
.footer__meta a:hover { color: var(--gold); }

/* ---------- scroll reveal ---------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }

/* ===================================================================
   Responsive
   =================================================================== */
@media (max-width: 920px) {
  .bento, .stack, .approach__grid { grid-template-columns: 1fr 1fr; }
  .card--wide { grid-column: span 2; }
  .collective { grid-template-columns: 1fr; gap: 40px; }
}

@media (max-width: 720px) {
  .nav__links {
    position: fixed; inset: 78px 0 auto 0; flex-direction: column; gap: 2px; align-items: stretch;
    background: rgba(20,19,17,.98); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    padding: 18px 28px 30px; border-bottom: 1px solid var(--border);
    transform: translateY(-130%); transition: transform .38s var(--ease); pointer-events: none;
  }
  .nav__links.is-open { transform: translateY(0); pointer-events: auto; }
  .nav__links a { padding: 14px 4px; font-size: 1.05rem; border-bottom: 1px solid var(--border); }
  .nav__links .btn { margin-top: 14px; border: 1px solid var(--border-2); justify-content: center; }
  .nav__toggle { display: flex; }

  .bento, .stack, .approach__grid, .collective__values, .contact__form { grid-template-columns: 1fr; }
  .card--wide { grid-column: auto; }
  .field--full, .contact__form .btn, .contact__hint { grid-column: auto; }
  .footer__inner { flex-direction: column; }
  .footer__meta { text-align: left; }
}
