/* =========================================================
   SurfX — Shared Styles (v1.0)
   Used across every page (homepage, category pages, blog).
   Cascade order: tokens.css -> shared.css -> per-page inline <style>
   ========================================================= */

/* ============== FONT SHORTHAND ============== */
/* General Sans fallback to Space Grotesk locally — closer to the system spec */
:root{
  --display: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --body: "Inter", ui-sans-serif, system-ui, sans-serif;
  --serif: "Instrument Serif", "Times New Roman", serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}

/* ============== GLOBAL RESETS ============== */
*{ box-sizing: border-box; }
html, body{ margin:0; padding:0; }
html{ scroll-behavior: smooth; }
body{
  background: var(--sx-ink-50);
  color: var(--sx-ink-900);
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
::selection{ background: var(--sx-cobalt-500); color:#fff; }
a{ color: inherit; text-decoration: none; }
img{ max-width: 100%; display: block; }

/* ============== NAV ============== */
.nav{
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 36px;
  transition: background var(--sx-d-2) var(--sx-ease-soft),
              backdrop-filter var(--sx-d-2) var(--sx-ease-soft),
              box-shadow var(--sx-d-2) var(--sx-ease-soft);
}
.nav.scrolled{
  background: rgba(248, 247, 243, 0.82);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  box-shadow: 0 1px 0 rgba(20,37,122,.06);
}
.nav-brand{
  display:flex; align-items:center; gap: 10px;
  font-family: var(--display); font-weight: 600; letter-spacing: -0.02em;
  font-size: 18px;
}
.nav-brand .mark{
  width: 30px; height: 30px; border-radius: 8px;
  background: var(--sx-cobalt-500);
  display: grid; place-items: center;
  box-shadow: var(--sx-shadow-1);
}
.nav-brand .mark img{ width: 22px; height: 22px; }
.nav-brand .x{ font-family: var(--serif); font-style: italic; color: var(--sx-coral-500); font-weight: 400; padding-left: 1px; }
.nav-links{ display:flex; gap: 32px; font-size: 14px; font-weight: 500; color: var(--sx-ink-700); }
.nav-links a{ position: relative; transition: color var(--sx-d-1); }
.nav-links a:hover{ color: var(--sx-cobalt-600); }
.nav-cta{ display:flex; gap: 10px; align-items: center; }

/* ============== MOBILE HAMBURGER + DRAWER ============== */
/* Hidden on desktop, shown on mobile via media query below.
   Animates the three lines into an X when open. */
.nav-burger{
  display: none;
  background: transparent; border: 0; cursor: pointer;
  width: 40px; height: 40px;
  padding: 0; margin: 0;
  position: relative;
}
.nav-burger span{
  display: block; width: 22px; height: 2px;
  background: var(--sx-ink-900);
  border-radius: 2px;
  margin: 5px auto;
  transition: transform var(--sx-d-2) var(--sx-ease-glide),
              opacity var(--sx-d-1) var(--sx-ease-soft);
  transform-origin: center;
}
.nav-burger[aria-expanded="true"] span:nth-child(1){
  transform: translateY(7px) rotate(45deg);
}
.nav-burger[aria-expanded="true"] span:nth-child(2){
  opacity: 0;
}
.nav-burger[aria-expanded="true"] span:nth-child(3){
  transform: translateY(-7px) rotate(-45deg);
}

/* ============== BUTTONS ============== */
.btn{
  font-family: var(--display); font-weight: 500; letter-spacing: -.01em;
  padding: 10px 18px; border-radius: var(--sx-r-pill);
  font-size: 14px; cursor: pointer; border: 1px solid transparent;
  transition: all var(--sx-d-1) var(--sx-ease-soft);
  display: inline-flex; align-items: center; gap: 8px;
}
.btn-primary{ background: var(--sx-cobalt-500); color: #fff; box-shadow: var(--sx-shadow-1); }
.btn-primary:hover{ background: var(--sx-cobalt-600); transform: translateY(-1px); box-shadow: var(--sx-shadow-2); }
.btn-ink{ background: var(--sx-ink-900); color: #fff; }
.btn-ink:hover{ background: var(--sx-ink-800); transform: translateY(-1px); }
.btn-ghost{ background: transparent; color: var(--sx-ink-900); border-color: var(--sx-line); }
.btn-ghost:hover{ background: rgba(255,255,255,.6); border-color: var(--sx-ink-400); }
.btn-lg{ padding: 14px 26px; font-size: 15px; }

/* ============== SECTION SHELL ============== */
section{ padding: 120px 36px; position: relative; }
.container{ max-width: 1240px; margin: 0 auto; }
.sec-head{
  display: grid; grid-template-columns: auto 1fr; gap: 40px;
  align-items: end;
  margin-bottom: 64px;
}
.sec-eyebrow{
  font-family: var(--mono); font-size: 11px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--sx-ink-500);
  display: flex; align-items: center; gap: 10px;
}
.sec-eyebrow::before{
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--sx-cobalt-500);
}
.sec-num{
  font-family: var(--mono); font-size: 11px; letter-spacing: .14em;
  color: var(--sx-ink-400); text-transform: uppercase;
}
.sec-title{
  font-family: var(--display); font-weight: 500;
  font-size: clamp(40px, 5vw, 64px);
  letter-spacing: -.03em; line-height: 1.02;
  margin: 0; max-width: 16ch;
}
.sec-title em{ font-family: var(--serif); font-style: italic; font-weight: 400; color: var(--sx-cobalt-500); }
.sec-title .x-it{ font-family: var(--serif); font-style: italic; color: var(--sx-coral-500); font-weight: 400; }
.sec-lede{
  font-size: 17px; line-height: 1.6; color: var(--sx-ink-600); max-width: 460px;
  justify-self: end;
}

/* ============== REVEAL-ON-SCROLL UTILITIES ============== */
.reveal{ opacity: 0; transform: translateY(24px); transition: opacity .8s var(--sx-ease-soft), transform .8s var(--sx-ease-glide); }
.reveal.in{ opacity: 1; transform: translateY(0); }
.reveal-d-1{ transition-delay: .08s; }
.reveal-d-2{ transition-delay: .16s; }
.reveal-d-3{ transition-delay: .24s; }

/* ============== FOOTER SOCIAL ICONS ============== */
/* Social row sits inside .cta-foot .meta, above the copyright line.
   On desktop (.cta-foot is right-aligned) icons sit right; on mobile,
   icons left-align since meta itself flips to left-align. */
.cta-social{
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-bottom: 14px;
}
.cta-social a{
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: rgba(255,255,255,.08);
  color: var(--sx-ink-200);
  border: 1px solid rgba(255,255,255,.10);
  transition: background var(--sx-d-1) var(--sx-ease-soft),
              color var(--sx-d-1) var(--sx-ease-soft),
              transform var(--sx-d-1) var(--sx-ease-soft),
              border-color var(--sx-d-1);
}
.cta-social a:hover{
  background: var(--sx-cobalt-500);
  color: #fff;
  border-color: var(--sx-cobalt-500);
  transform: translateY(-2px);
}
.cta-social svg{
  width: 16px; height: 16px;
  fill: currentColor;
  display: block;
}

/* ============== FOOTER COLUMNS ============== */
/* Reusable across every page. The .cta wrapper, headline, eyebrow, and email-signup form
   stay inline on index.html since they're homepage-specific (large CTA with email capture).
   New pages will compose their own simpler footer wrapper around .cta-foot. */
.cta-foot{
  margin-top: 100px;
  display: grid; grid-template-columns: 1fr auto;
  gap: 40px; align-items: end;
  padding-top: 40px;
  border-top: 1px solid rgba(255,255,255,.1);
}
.cta-foot .cols{
  display: grid; grid-template-columns: repeat(4, auto);
  gap: 60px;
}
.cta-foot .cols .col{ display: flex; flex-direction: column; gap: 12px; }
.cta-foot .cols .col .h{ font-family: var(--mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--sx-ink-400); margin-bottom: 4px; }
.cta-foot .cols .col a{ font-size: 14px; color: var(--sx-ink-200); transition: color var(--sx-d-1); }
.cta-foot .cols .col a:hover{ color: #fff; }
.cta-foot .meta{ font-family: var(--mono); font-size: 11px; letter-spacing: .08em; color: var(--sx-ink-400); text-align: right; }
.cta-foot .meta .tag{ display: block; margin-top: 6px; color: var(--sx-ink-300); }
.cta-foot .meta .tag em{ font-family: var(--serif); font-style: italic; color: var(--sx-coral-500); }

/* ============== RESPONSIVE — SHARED OVERRIDES ============== */
/* Page-specific responsive overrides (.hero, .cat-orbit, .atlas-grid, .app-grid, etc.)
   stay in each page's inline <style>. */
@media (max-width: 980px){
  /* Mobile nav: hamburger drawer pattern.
     Single-row nav (logo left, Download CTA + burger right).
     Tap burger -> drawer slides down with all nav links. */
  .nav{ padding: 14px 20px; }

  /* Show the hamburger button only on mobile */
  .nav-burger{ display: block; }

  /* Tighter Download CTA so it sits comfortably alongside the burger */
  .nav-cta .btn{ padding: 8px 14px; font-size: 13px; }

  /* Drawer: hidden by default; .open class (toggled by JS) reveals it.
     Positioned fixed below the nav so it doesn't push content down. */
  .nav-links{
    display: none;
    position: fixed;
    top: 64px; left: 0; right: 0;
    flex-direction: column;
    background: rgba(248, 247, 243, 0.96);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    padding: 18px 22px 28px;
    gap: 0;
    font-size: 17px;
    border-top: 1px solid var(--sx-line);
    box-shadow: 0 12px 28px rgba(20,37,122,.10);
    max-height: calc(100vh - 64px);
    overflow-y: auto;
  }
  .nav-links.open{ display: flex; }
  .nav-links a{
    padding: 14px 4px;
    border-bottom: 1px solid var(--sx-ink-100);
    color: var(--sx-ink-800);
    font-weight: 500;
    letter-spacing: -.01em;
  }
  .nav-links a:last-child{ border-bottom: 0; }
  .nav-links a:hover{ color: var(--sx-cobalt-600); }

  section{ padding: 80px 20px; }
  .sec-head{ grid-template-columns: 1fr; gap: 16px; }
  .sec-lede{ justify-self: start; }
  .cta-foot{ grid-template-columns: 1fr; }
  .cta-foot .meta{ text-align: left; }
  .cta-foot .cols{ grid-template-columns: repeat(2, 1fr); gap: 32px; }
}
