/* ─── NAV ────────────────────────────────────────────────────────── */

.top-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--nav-h);
  display: flex; align-items: center; gap: 24px;
  padding: 0 34px;
  background: rgba(247, 244, 239, 0);
  transition: background .3s ease, box-shadow .3s ease, backdrop-filter .3s ease;
}
.top-nav.stuck {
  background: rgba(247, 244, 239, .85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 1px 0 var(--border);
}

.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; flex-shrink: 0; }
.brand-name {
  font-family: var(--mono); font-size: 12px; font-weight: 500;
  color: var(--ink); letter-spacing: .06em;
}

.nav-links { display: flex; gap: 26px; margin-left: auto; }
.nav-links a {
  font-size: 13.5px; color: var(--ink-mid); text-decoration: none;
  transition: color .2s;
}
.nav-links a:hover { color: var(--accent); }

.nav-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.btn-login {
  display: inline-flex; align-items: center;
  font-family: var(--sans); font-size: 14px; font-weight: 600;
  color: var(--ink-mid); text-decoration: none;
  border: 1px solid var(--border-hi); border-radius: 9px;
  padding: 9px 18px; background: rgba(255, 255, 255, .6);
  transition: color .2s, border-color .2s, background .2s, transform .15s;
}
.btn-login:hover {
  color: var(--accent); border-color: var(--accent);
  background: #fff; transform: translateY(-1px);
}

.btn-nav-cta {
  display: inline-flex; align-items: center;
  font-family: var(--sans); font-size: 14px; font-weight: 600;
  color: #fff; text-decoration: none;
  border-radius: 9px; padding: 10px 18px;
  background: linear-gradient(180deg, #FF6A40, var(--ms-red));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.3), 0 3px 0 var(--accent-deep);
  transition: transform .1s ease, box-shadow .1s ease;
}
.btn-nav-cta:hover {
  transform: translateY(-1px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.3), 0 4px 0 var(--accent-deep);
}
.btn-nav-cta:active {
  transform: translateY(2px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 1px 0 var(--accent-deep);
}

.nav-burger {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: none; cursor: pointer; padding: 8px;
  margin-left: auto;
}
.nav-burger span { display: block; width: 22px; height: 2px; background: var(--ink); border-radius: 2px; transition: transform .25s, opacity .25s; }
.nav-burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(3.5px) rotate(45deg); }
.nav-burger[aria-expanded="true"] span:nth-child(2) { transform: translateY(-3.5px) rotate(-45deg); }

/* ─── HERO ───────────────────────────────────────────────────────── */

.hero {
  position: relative;
  padding: calc(var(--nav-h) + 72px) 24px 0;
  display: flex; flex-direction: column; align-items: center;
}

/* Clipping lives on the background layers, not the hero — the bench preview
   deliberately overhangs the hero and must not be cut off. */
.hero-bg { position: absolute; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }

.bg-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(20, 34, 46, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20, 34, 46, .035) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(circle at 50% 34%, #000 0%, transparent 76%);
  -webkit-mask-image: radial-gradient(circle at 50% 34%, #000 0%, transparent 76%);
}

.bg-glow {
  position: absolute; inset: 0;
  background:
    radial-gradient(460px 420px at 50% 62%, rgba(242, 80, 34, .10), transparent 70%),
    radial-gradient(560px 380px at 20% 26%, rgba(0, 164, 239, .07), transparent 70%),
    radial-gradient(500px 380px at 82% 20%, rgba(127, 186, 0, .06), transparent 70%);
  animation: drift 18s ease-in-out infinite alternate;
}
@keyframes drift {
  from { transform: translateY(0) scale(1); }
  to   { transform: translateY(-14px) scale(1.04); }
}

.bg-tiles {
  position: absolute; inset: 0;
  -webkit-mask-image: radial-gradient(circle at 50% 40%, #000 45%, transparent 92%);
  mask-image: radial-gradient(circle at 50% 40%, #000 45%, transparent 92%);
}
.bg-tiles i {
  position: absolute; width: 72px; height: 72px; border-radius: 3px;
  box-shadow: inset 0 0 0 1px rgba(20, 34, 46, .05);
  opacity: 0; animation: tileBreathe 7s ease-in-out infinite;
}
@keyframes tileBreathe {
  0%, 100% { opacity: 0; }
  45%, 55% { opacity: 1; }
}
@media (max-width: 760px) { .bg-tiles { display: none; } }

.hero-inner {
  position: relative; z-index: 1;
  text-align: center; max-width: 860px;
}
.hero h1 {
  font-size: clamp(38px, 5.8vw, 70px);
  line-height: 1.06;
  margin-bottom: 20px;
}
.hero-sub {
  font-size: 16px; line-height: 1.62; color: var(--ink-mid);
  max-width: 620px; margin: 0 auto;
}
.hero-cta {
  display: flex; gap: 12px; justify-content: center; flex-wrap: wrap;
  margin-top: 32px;
}
.work-types {
  display: flex; gap: 9px; justify-content: center; flex-wrap: wrap;
  margin-top: 26px;
}
.work-types span {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 11px; letter-spacing: .04em;
  color: var(--ink-mid); background: #fff;
  border: 1px solid var(--border); padding: 8px 14px; border-radius: 100px;
}
.work-types i { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.work-types span:nth-child(1) i { background: var(--ms-red); }
.work-types span:nth-child(2) i { background: var(--ms-blue); }
.work-types span:nth-child(3) i { background: var(--ms-green); }
.work-types span:nth-child(4) i { background: var(--ms-yellow); }

/* ─── STACK BAR ──────────────────────────────────────────────────── */

/* top padding clears the bench preview's -60px overhang */
.stack-bar {
  padding: 92px 0 40px;
  border-bottom: 1px solid var(--border);
}
.stack-label {
  text-align: center;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--ink-dim);
  margin-bottom: 18px;
}
.stack-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);
}
.stack-track {
  display: flex; gap: 14px; width: max-content;
  animation: marquee 48s linear infinite;
}
.stack-track:hover { animation-play-state: paused; }
.stack-track span {
  font-family: var(--mono); font-size: 12px; color: var(--ink-mid);
  background: #fff; border: 1px solid var(--border);
  padding: 9px 16px; border-radius: 100px; white-space: nowrap;
}
@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ─── SECTION SHELL ──────────────────────────────────────────────── */

.section {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 92px 24px;
}
.section-alt {
  max-width: none;
  background: var(--bg-2);
  border-block: 1px solid var(--border);
}
.section-alt > * { max-width: var(--maxw); margin-inline: auto; }

.section-head { max-width: 700px; margin-bottom: 52px; }
.section-head h2 { font-size: clamp(30px, 3.6vw, 44px); }
.section-sub {
  font-size: 15.5px; line-height: 1.65; color: var(--ink-mid);
  margin-top: 18px; max-width: 620px;
}

/* ─── PROBLEM ────────────────────────────────────────────────────── */

.problem-grid {
  display: grid; gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.problem-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 30px 28px;
}
.pc-num {
  font-family: var(--mono); font-size: 11px; letter-spacing: .12em;
  color: var(--accent); display: block; margin-bottom: 16px;
}
.problem-card h3 { font-size: 20px; margin-bottom: 10px; }
.problem-card p { font-size: 14px; line-height: 1.62; color: var(--ink-mid); }

/* ─── TWO-COLUMN COPY + VISUAL ───────────────────────────────────── */

.bench-layout {
  display: grid; gap: 56px; align-items: center;
  grid-template-columns: 1fr 1fr;
}
.bench-layout.reverse .bench-copy { order: 2; }
.bench-layout.reverse .bench-visual { order: 1; }

.bench-copy h2 { font-size: clamp(30px, 3.6vw, 44px); margin-bottom: 20px; }
.bench-copy > p {
  font-size: 15.5px; line-height: 1.68; color: var(--ink-mid);
  margin-bottom: 16px;
}
.bench-copy .btn-primary { margin-top: 28px; }

.tick-list { list-style: none; display: grid; gap: 12px; margin: 26px 0 0; }
.tick-list li {
  position: relative; padding-left: 30px;
  font-size: 14.5px; line-height: 1.5; color: var(--ink-mid);
  /* `pretty` only nudges the last line and often still leaves one word alone.
     These items are 1–3 lines, so `balance` is both deterministic and safe. */
  text-wrap: balance;
}
.tick-list li strong { color: var(--ink); font-weight: 600; }
.tick-list li::before {
  content: ''; position: absolute; left: 0; top: 1px;
  width: 19px; height: 19px; border-radius: 6px;
  background-color: var(--accent-soft);
  background-image: var(--check-mark);
  background-repeat: no-repeat; background-position: center; background-size: 10px 10px;
}

/* ─── STEPS ──────────────────────────────────────────────────────── */

.steps {
  display: grid; gap: 20px; margin-bottom: 64px;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
}
/* four steps must sit on one row — auto-fit only fits three at this width */
.steps.four { grid-template-columns: repeat(4, 1fr); gap: 18px; }
@media (max-width: 1040px) { .steps.four { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px)  { .steps.four { grid-template-columns: 1fr; } }
.step {
  position: relative; padding-top: 26px;
  border-top: 2px solid var(--border);
}
.step-n {
  position: absolute; top: -15px; left: 0;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent); color: #fff;
  font-family: var(--mono); font-size: 12px;
  display: grid; place-items: center;
  box-shadow: 0 4px 12px -4px rgba(242, 80, 34, .6);
}
.step h3 { font-size: 19px; margin-bottom: 10px; }
.step p { font-size: 14px; line-height: 1.62; color: var(--ink-mid); }

/* ─── FOOTER ─────────────────────────────────────────────────────── */

footer {
  border-top: 1px solid var(--border);
  background: var(--bg-2);
  padding: 60px 24px 28px;
}
.footer-top {
  max-width: var(--maxw); margin: 0 auto;
  display: grid; gap: 40px;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  padding-bottom: 44px;
  border-bottom: 1px solid var(--border);
}
/* footer wordmark matches the one in the main header exactly */
.footer-brand .brand-name { display: inline; }
.footer-brand p {
  font-size: 13.5px; line-height: 1.6; color: var(--ink-mid);
  margin-top: 16px; max-width: 280px; text-wrap: pretty;
}
.footer-col { display: flex; flex-direction: column; gap: 11px; }
.footer-col h5 {
  font-family: var(--mono); font-size: 10px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--ink-dim); font-weight: 500;
  margin-bottom: 4px;
}
.footer-col a {
  font-size: 13.5px; color: var(--ink-mid); text-decoration: none;
  transition: color .2s;
}
.footer-col a:hover { color: var(--accent); }

.footer-bottom {
  max-width: var(--maxw); margin: 0 auto;
  padding-top: 24px;
  display: flex; align-items: baseline; justify-content: space-between; gap: 32px;
}
.f-copy { font-family: var(--mono); font-size: 11px; color: var(--ink-dim); flex-shrink: 0; }
.f-note {
  font-size: 11px; line-height: 1.55; color: var(--ink-dim);
  max-width: 560px; text-align: left; text-wrap: pretty;
}

/* ─── RESPONSIVE ─────────────────────────────────────────────────── */

@media (max-width: 980px) {
  .bench-layout { grid-template-columns: 1fr; gap: 40px; }
  .bench-layout.reverse .bench-copy { order: 1; }
  .bench-layout.reverse .bench-visual { order: 2; }
  .footer-top { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 860px) {
  .nav-links, .nav-actions { display: none; }
  .nav-burger { display: flex; }

  .top-nav.open {
    height: auto; flex-wrap: wrap; padding-bottom: 20px;
    background: rgba(247, 244, 239, .97);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 1px 0 var(--border);
  }
  .top-nav.open .nav-links {
    display: flex; flex-direction: column; gap: 4px;
    width: 100%; margin: 8px 0 0;
  }
  .top-nav.open .nav-links a {
    padding: 12px 4px; font-size: 15px;
    border-bottom: 1px solid var(--border);
  }
  .top-nav.open .nav-actions { display: flex; width: 100%; margin-top: 14px; }
  .top-nav.open .btn-login, .top-nav.open .btn-nav-cta { flex: 1; justify-content: center; }
}

@media (max-width: 600px) {
  .top-nav { padding: 0 20px; }
  .brand-name { display: none; }
  .hero { padding-top: calc(var(--nav-h) + 44px); }
  .hero h1 { font-size: clamp(30px, 8.4vw, 44px); }
  .hero-sub { font-size: 14.5px; }
  .hero-cta { flex-direction: column; align-items: stretch; }
  .section { padding: 64px 20px; }
  .section-head { margin-bottom: 36px; }
  .footer-top { grid-template-columns: 1fr; gap: 30px; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .f-note { text-align: center; }
}
