/* N4 Studio clone — tokens extracted from live computed styles
   bg #0a0f12 · text #fafafa · muted #758696/#5d6c7b · accent #0082f3
   font: Favoritpro (Book/Regular local woff2) · base 15.6px
   h1 39.09px/46.9px/-0.78px ls · transitions .2s–.6s */

@font-face {
  font-family: 'Favoritpro';
  src: url('fonts/FavoritPro-Book.woff2') format('woff2');
  font-weight: 300 400;
  font-display: swap;
}
@font-face {
  font-family: 'Favoritpro';
  src: url('fonts/FavoritPro-Regular.woff2') format('woff2');
  font-weight: 400 500;
  font-display: swap;
}

:root {
  --bg: #0a0f12;
  --ink: #fafafa;
  --muted: #758696;
  --muted-2: #5d6c7b;
  --accent: #0082f3;
  --line: rgba(250, 250, 250, .09);
  --font: 'Favoritpro', Arial, sans-serif;
  --ease: cubic-bezier(.4, 0, .2, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15.6px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }
ul { list-style: none; }

/* ---------- nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 40px;
  transition: background .3s var(--ease), backdrop-filter .3s var(--ease);
}
.nav.scrolled { background: rgba(10,15,18,.82); backdrop-filter: blur(14px); }
.nav-logo { font-weight: 500; font-size: 17px; letter-spacing: .02em; }
.reg { font-size: .6em; vertical-align: super; }
.nav-links { display: flex; gap: 26px; align-items: center; }
.nav-item { font-size: 14px; color: var(--muted); transition: color .2s; position: relative; }
.nav-item:hover, .nav-item.has-menu:hover > a { color: var(--ink); }
.nav-item.has-menu { position: relative; }
.nav-menu {
  position: absolute; top: calc(100% + 14px); left: -20px;
  background: #0d1418; border: 1px solid var(--line); border-radius: 10px;
  padding: 10px; min-width: 210px;
  opacity: 0; visibility: hidden; transform: translateY(6px);
  transition: opacity .25s var(--ease), transform .25s var(--ease), visibility .25s;
}
.nav-item.has-menu:hover .nav-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.nav-menu a { display: block; padding: 9px 12px; border-radius: 6px; font-size: 13.5px; color: var(--muted); transition: background .2s, color .2s; }
.nav-menu a:hover { background: rgba(255,255,255,.05); color: var(--ink); }
.lab-count, .btn-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 16px; height: 16px; padding: 0 4px; margin-left: 6px;
  border-radius: 99px; background: var(--accent); color: #fff;
  font-size: 10px; font-weight: 600;
}
.btn-contact {
  font-size: 14px; padding: 9px 18px; border: 1px solid var(--line);
  border-radius: 99px; transition: background .25s, color .25s, border-color .25s;
}
.btn-contact:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.nav-burger { display: none; background: none; border: 0; color: var(--muted); cursor: pointer; }

/* ---------- hero ---------- */
.hero {
  padding: 160px 40px 0; overflow: hidden;
}
.hero-inner { max-width: 1280px; margin: 0 auto 64px; }
.hero-h1 {
  /* tokens: --font-size--h2 clamp, line-height 1.2, ls -0.02em */
  font-size: clamp(1.75rem, 1.443rem + 1.25vw, 2.9438rem);
  line-height: 1.2; letter-spacing: -0.02em; font-weight: 400;
  max-width: 880px;
}
/* ---------- page-load animation (gap 6) ---------- */
@media (prefers-reduced-motion: no-preference) {
  .hero-h1  { animation: rise .7s var(--ease) both; }
  .hero-sub { animation: rise .7s .15s var(--ease) both; }
  @keyframes rise {
    from { opacity: 0; transform: translateY(26px); }
    to   { opacity: 1; transform: none; }
  }
}
.rotator { display: inline-block; position: relative; }
.rot-word { display: inline-block; opacity: 0; transform: translateY(12px); transition: opacity .45s var(--ease), transform .45s var(--ease); position: absolute; left: 0; white-space: nowrap; }
.rot-word.is-on { opacity: 1; transform: translateY(0); position: relative; }
.hero-sub { color: var(--muted); margin-top: 20px; font-size: 17px; max-width: 460px; }
.hero-marquee { overflow: hidden; }
.marquee-track { display: flex; gap: 20px; width: max-content; animation: marquee var(--dur, 40s) linear infinite; }
@keyframes marquee { to { transform: translateX(-50%); } }
.hero-marquee:hover .marquee-track,
.res-marquee:hover .marquee-track,
.quote-marquee:hover .marquee-track { animation-play-state: paused; }
/* original: .hero_projects_card width 388px @1280 container, visual ratio 388x593 */
.hcard { width: 388px; flex: 0 0 auto; display: flex; flex-direction: column; }
.hcard-imgs { position: relative; aspect-ratio: 388/593; overflow: hidden; border-radius: 2px; }
.hcard-imgs img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .45s var(--ease); }
.hcard-imgs img.is-on { opacity: 1; }
.hcard:hover .hcard-imgs img { animation: hcycle 6s infinite; }
.hcard:hover .hcard-imgs img.is-on { animation: none; opacity: 1; }
@keyframes hcycle { 0%, 25% { opacity: 1; } 33%, 100% { opacity: 0; } }
.hcard-meta { display: flex; gap: 12px; align-items: flex-start; padding: 14px 2px 0; }
.hcard-logo { width: 26px; height: 26px; margin-top: 2px; }
.hcard-meta b { display: block; font-weight: 500; }
.hcard-meta span { color: var(--muted); font-size: 13px; }
.hcard-meta em { font-style: normal; color: var(--muted-2); font-size: 12px; margin-left: auto; white-space: nowrap; }
.hcard:hover .hcard-imgs img.is-on { opacity: 1; }

/* stagger hero hover image cycling per-card */
.hcard:nth-child(2):hover .hcard-imgs img { animation-delay: -1.5s; }
.hcard:nth-child(3):hover .hcard-imgs img { animation-delay: -3s; }

/* ---------- section chrome ---------- */
section { padding: 110px 40px; }
.eyebrow {
  font-size: 12px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 26px;
}
.sec-h { font-size: clamp(24px, 3vw, 34px); line-height: 1.25; font-weight: 400; max-width: 900px; margin-bottom: 60px; letter-spacing: -0.4px; }

/* ---------- principles ---------- */
.prin-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; max-width: 1280px; margin: 0 auto; }
.prin { border-top: 1px solid var(--line); padding-top: 22px; }
.prin-num { color: var(--muted-2); font-size: 13px; }
.prin h3 { font-size: 22px; font-weight: 400; margin: 14px 0 12px; line-height: 1.2; }
.prin p { color: var(--muted); font-size: 14.5px; }

/* ---------- services ---------- */
.serv-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 56px 70px; max-width: 1280px; margin: 0 auto; }
.serv h3 { font-size: 24px; font-weight: 400; margin-bottom: 12px; }
.serv p { color: var(--muted); font-size: 14.5px; margin-bottom: 18px; }
.serv ul { border-top: 1px solid var(--line); }
.serv li { padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; color: #c8c8c8; transition: padding-left .25s var(--ease), color .25s; }
.serv li:hover { padding-left: 10px; color: var(--ink); }
.serv-more { display: inline-block; margin-top: 16px; color: var(--muted); font-size: 13.5px; transition: color .2s; }
.serv-more:hover { color: var(--ink); }

/* ---------- work ---------- */
.work { padding-left: 0; padding-right: 0; }
.work .eyebrow { padding-left: 40px; }
.work-rail {
  display: flex; gap: 24px; overflow-x: auto; scroll-snap-type: x mandatory;
  padding: 0 40px 24px; scrollbar-width: none;
  cursor: grab; user-select: none; -webkit-user-select: none;
}
.work-rail::-webkit-scrollbar { display: none; }
.work-rail.is-dragging { cursor: grabbing; scroll-snap-type: none; }
.work-rail.dragging a { pointer-events: none; } /* prevent click after drag */
.wcard { width: min(560px, 78vw); flex: 0 0 auto; scroll-snap-align: start; }
.wcard-img { position: relative; aspect-ratio: 16/10.6; overflow: hidden; border-radius: 2px; }
.wcard-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity .5s var(--ease); }
.wcard-hover { opacity: 0; }
.wcard:hover .wcard-hover { opacity: 1; }
.wcard-front { transition: transform .6s var(--ease); }
.wcard:hover .wcard-front { transform: scale(1.04); }
.wcard-meta { padding: 16px 2px 0; }
.wcard-meta b { font-weight: 500; font-size: 17px; }
.wcard-meta span { display: block; color: var(--muted); font-size: 14px; margin: 4px 0 10px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tags i { font-style: normal; font-size: 11.5px; color: var(--muted); border: 1px solid var(--line); padding: 4px 10px; border-radius: 99px; }

/* ---------- results ---------- */
.results { padding-top: 20px; }
.res-marquee, .quote-marquee { overflow: hidden; }
.rcard {
  width: 340px; flex: 0 0 auto; border: 1px solid var(--line); border-radius: 12px;
  padding: 26px; display: flex; flex-direction: column; gap: 8px;
  background: rgba(255,255,255,.015);
}
.rcard b { font-size: 44px; font-weight: 400; letter-spacing: -1px; }
.rcard span { color: var(--muted); font-size: 13.5px; flex: 1; }
.rcard a { color: var(--muted-2); font-size: 12.5px; transition: color .2s; }
.rcard a:hover { color: var(--ink); }
.quote { width: 420px; flex: 0 0 auto; }
.quote blockquote { font-size: 19px; line-height: 1.4; font-weight: 300; }
.quote figcaption { color: var(--muted-2); font-size: 13px; margin-top: 12px; }
.quote-marquee { margin-top: 64px; }

/* ---------- feed ---------- */
.feed-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; max-width: 1280px; margin: 0 auto; }
.fcard-img { aspect-ratio: 1/1; overflow: hidden; border-radius: 2px; margin-bottom: 14px; }
.fcard-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.fcard:hover .fcard-img img { transform: scale(1.05); }
.fcard-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.pill { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; border: 1px solid var(--line); border-radius: 99px; padding: 4px 10px; color: var(--muted); }
.fdate { color: var(--muted-2); font-size: 12.5px; }
.fcard h3 { font-size: 16.5px; font-weight: 400; line-height: 1.35; }
.feed-all { display: inline-block; margin-top: 34px; color: var(--muted); font-size: 14px; transition: color .2s; }
.feed-all:hover { color: var(--ink); }
.feed { max-width: 1280px; margin: 0 auto; padding-left: 40px; padding-right: 40px; }

/* ---------- cta ---------- */
.cta { text-align: center; padding: 150px 40px; border-top: 1px solid var(--line); }
.cta h2 { font-size: clamp(30px, 4.4vw, 54px); font-weight: 400; letter-spacing: -1px; line-height: 1.15; max-width: 900px; margin: 0 auto 44px; }
.cta-btn {
  display: inline-block; padding: 16px 34px; border-radius: 99px;
  background: var(--ink); color: var(--bg); font-size: 15px; font-weight: 500;
  transition: transform .3s var(--ease), background .3s;
}
.cta-btn:hover { transform: translateY(-2px); background: #fff; }

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--line); padding: 70px 40px 30px; }
.foot-top { display: flex; gap: 60px; max-width: 1280px; margin: 0 auto 60px; }
.foot-brand { flex: 1; }
.foot-logo { font-size: 44px; font-weight: 500; letter-spacing: -1px; margin-bottom: 18px; }
.foot-logo span { font-size: .5em; vertical-align: super; }
.foot-tag { color: var(--muted); font-size: 15px; margin-bottom: 22px; max-width: 300px; }
.foot-cta { color: var(--ink); font-size: 14.5px; border-bottom: 1px solid var(--muted); padding-bottom: 2px; }
.foot-cols { display: grid; grid-template-columns: repeat(4, 1fr); gap: 40px; flex: 2; }
.fcol { display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
.fcol h4 { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted-2); margin-bottom: 6px; font-weight: 500; }
.fcol h4.mt { margin-top: 26px; }
.fcol a, .fcol span { color: var(--muted); transition: color .2s; }
.fcol a:hover { color: var(--ink); }
.foot-news { max-width: 1280px; margin: 0 auto 50px; border-top: 1px solid var(--line); padding-top: 40px; }
.news-row { display: flex; gap: 12px; max-width: 480px; }
.news-row input {
  flex: 1; background: none; border: 1px solid var(--line); border-radius: 99px;
  padding: 12px 20px; outline: none; transition: border-color .25s;
}
.news-row input:focus { border-color: var(--muted); }
.news-row button {
  background: var(--ink); color: var(--bg); border: 0; border-radius: 99px;
  padding: 12px 24px; cursor: pointer; font-weight: 500; transition: opacity .25s;
}
.news-row button:hover { opacity: .85; }
.news-fine { color: var(--muted-2); font-size: 12px; margin-top: 14px; max-width: 480px; }
.news-fine a { text-decoration: underline; }
.foot-legal { display: flex; justify-content: space-between; max-width: 1280px; margin: 0 auto; border-top: 1px strip var(--line); border-top: 1px solid var(--line); padding-top: 24px; color: var(--muted-2); font-size: 12.5px; }
.foot-legal a:hover { color: var(--ink); }

/* ---------- reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.reveal.is-in { opacity: 1; transform: translateY(0); }

/* ---------- mobile overlay menu (gap 4) ---------- */
.mnav {
  position: fixed; inset: 0; z-index: 90;
  background: #0a0f12;
  display: flex; flex-direction: column; justify-content: center;
  padding: 90px 28px 40px;
  opacity: 0; visibility: hidden; transition: opacity .35s var(--ease), visibility .35s;
}
body[data-nav="open"] .mnav { opacity: 1; visibility: visible; }
body[data-nav="open"] { overflow: hidden; }
.mnav-link {
  font-size: clamp(2rem, 8vw, 3rem); font-weight: 400; letter-spacing: -0.02em;
  padding: 10px 0; color: var(--ink);
  opacity: 0; transform: translateY(22px);
  transition: opacity .5s var(--ease), transform .5s var(--ease), color .2s;
}
body[data-nav="open"] .mnav-link { opacity: 1; transform: translateY(0); }
/* staggered reveal */
body[data-nav="open"] .mnav-link:nth-child(1) { transition-delay: .08s; }
body[data-nav="open"] .mnav-link:nth-child(2) { transition-delay: .16s; }
body[data-nav="open"] .mnav-link:nth-child(3) { transition-delay: .24s; }
body[data-nav="open"] .mnav-link:nth-child(4) { transition-delay: .32s; }
body[data-nav="open"] .mnav-link:nth-child(5) { transition-delay: .4s; }
.mnav-link:hover, .mnav-link:active { color: var(--accent); }
.mnav-sub {
  margin: 6px 0 26px; padding-left: 4px; border-left: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 8px;
  max-height: 0; overflow: hidden;
  transition: max-height .4s var(--ease), margin .4s var(--ease);
}
.mnav-item.open .mnav-sub { max-height: 300px; }
.mnav-sub a { color: var(--muted); font-size: 15px; transition: color .2s; }
.mnav-sub a:hover { color: var(--ink); }
.mnav-foot {
  position: absolute; bottom: 36px; left: 28px; right: 28px;
  display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center;
  color: var(--muted-2); font-size: 13px;
}
.mnav-foot a {
  font-size: 14px; padding: 10px 22px; border: 1px solid var(--line); border-radius: 99px;
  color: var(--ink); transition: background .25s, color .25s;
}
.mnav-foot a:hover { background: var(--ink); color: var(--bg); }

/* nav dropdown open on tap (mobile-friendly, gap 7) */
.nav-menu.is-open {
  opacity: 1; visibility: visible; transform: translateY(0);
}
@media (hover: none) {
  /* touch devices: show a chevron hint on dropdown triggers */
  .nav-item.has-menu > a::after { content: ' ↓'; font-size: .8em; color: var(--muted-2); }
}

/* ---------- responsive ---------- */
@media (max-width: 1024px) {
  .prin-grid { grid-template-columns: 1fr; gap: 30px; }
  .serv-grid { grid-template-columns: 1fr; }
  .feed-grid { grid-template-columns: 1fr 1fr; }
  .foot-cols { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .nav { padding: 16px 20px; }
  .nav-links, .btn-contact { display: none; }
  .nav-burger { display: block; font-size: 15px; }
  section { padding: 70px 20px; }
  /* hero: original .hero_section padding-top 10rem minus fixed nav ~76px */
  .hero { padding-top: 140px; padding-left: 20px; padding-right: 20px; }
  .hero-inner { margin-bottom: 44px; }
  .hero-h1 { font-size: 1.75rem; line-height: 1.2; letter-spacing: -0.02em; max-width: 100%; }
  .hero-sub { font-size: 15.5px; margin-top: 16px; }
  /* original mobile hero card = 80vw */
  .hcard { width: 80vw; }
  .hcard-meta span { font-size: 12px; }
  .hcard-logo { width: 22px; height: 22px; }
  .feed-grid { grid-template-columns: 1fr; }
  .foot-top { flex-direction: column; gap: 40px; }
  .cta { padding: 90px 20px; }
  .rcard { width: 280px; }
  .quote { width: 320px; }
  .quote blockquote { font-size: 16.5px; }
  .work .eyebrow { padding-left: 0; }
  .work-rail { padding: 0 20px 24px; }
  .work-rail.dragging a { pointer-events: auto; } /* keep taps clickable on touch */
}
@media (max-width: 400px) {
  .hcard-meta b { font-size: 14px; }
  .hcard-meta em { display: none; } /* "Case study" tag drops off tiny screens */
}
