/* ============================================================
   Gromex marketing site — shared styles
   Palette taken from brand.pdf:
     Gromex / Deep Cove (deep blue)
     Track  / Muted Blue
     Tender / Green Leaf
   Theme is selected via [data-theme] on <body>.
   ============================================================ */

:root {
  /* ---- Gromex (Deep Cove) — DEFAULT ---- */
  --gx-900: #080b3f;   /* deep cove */
  --gx-800: #10165c;
  --gx-700: #182079;
  --gx-600: #202b97;
  --gx-500: #2835b4;
  --gx-400: #3040d1;
  --gx-300: #8a92e5;
  --gx-200: #c8cbf1;
  --gx-100: #e5e7fa;
  --gx-50:  #f3f4fc;

  /* ---- Track (Muted Blue) ---- */
  --tk-900: #1f4a72;
  --tk-800: #316d9d;
  --tk-700: #4584af;
  --tk-500: #77afe3;
  --tk-300: #bad7f2;
  --tk-200: #e0edf9;
  --tk-100: #f1f7fd;

  /* ---- Tender (Green Leaf) ---- */
  --td-900: #2c5012;
  --td-800: #407018;
  --td-700: #60b929;
  --td-500: #80d447;
  --td-300: #c6f0a6;
  --td-200: #def6ca;
  --td-100: #f2fce9;

  /* ---- Active brand vars — overridden per page via [data-theme] ---- */
  --brand-900: var(--gx-900);
  --brand-800: var(--gx-800);
  --brand-700: var(--gx-700);
  --brand-500: var(--gx-500);
  --brand-400: var(--gx-400);
  --brand-300: var(--gx-300);
  --brand-200: var(--gx-200);
  --brand-100: var(--gx-100);
  --brand-50:  var(--gx-50);

  /* Neutrals */
  --ink-900: #0d1019;
  --ink-800: #1a2030;
  --ink-700: #3b4253;
  --ink-500: #6b7280;
  --ink-300: #d1d5db;
  --ink-200: #e7eaec;
  --ink-100: #f3f4f6;
  --ink-50:  #f9fafb;
  --paper:   #fbfbf8;     /* warm off-white, default */
  --paper-2: #f5f6f0;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --shadow-sm: 0 1px 2px rgba(13,16,25,.04), 0 1px 3px rgba(13,16,25,.06);
  --shadow-md: 0 2px 6px rgba(13,16,25,.05), 0 8px 24px rgba(13,16,25,.06);
  --shadow-lg: 0 8px 16px rgba(13,16,25,.06), 0 24px 48px rgba(13,16,25,.08);

  /* Onest is the brand typeface. */
  --font-heading: 'Onest', ui-sans-serif, system-ui, sans-serif;
  --font-body: 'Onest', ui-sans-serif, system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  --max-w: 1240px;
}

/* Per-page brand themes */
body[data-theme="track"] {
  --brand-900: var(--td-900);
  --brand-800: var(--td-800);
  --brand-700: var(--td-700);
  --brand-500: var(--td-500);
  --brand-400: var(--td-500);
  --brand-300: var(--td-300);
  --brand-200: var(--td-200);
  --brand-100: var(--td-100);
  --brand-50:  var(--td-100);
  --paper:    #fbfdf8;
  --paper-2:  #f0f7ea;
}
body[data-theme="tender"] {
  --brand-900: var(--tk-900);
  --brand-800: var(--tk-800);
  --brand-700: var(--tk-700);
  --brand-500: var(--tk-500);
  --brand-400: var(--tk-500);
  --brand-300: var(--tk-300);
  --brand-200: var(--tk-200);
  --brand-100: var(--tk-100);
  --brand-50:  var(--tk-100);
  --paper:    #fbfdff;
  --paper-2:  #eef5fc;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font-body);
  font-weight: 400;
  color: var(--ink-900);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* Belt-and-braces guard against decorative SVGs / hero transforms
     bleeding past the viewport on tablet sizes. `clip` instead of
     `hidden` so it doesn't break position:sticky on the nav. */
  overflow-x: clip;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: -0.025em;
  margin: 0;
  text-wrap: balance;
}

p { text-wrap: pretty; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

.mono { font-family: var(--font-mono); font-feature-settings: "tnum" 1; }

/* ---------- Layout ---------- */

.shell {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 32px;
}

@media (max-width: 720px) {
  .shell { padding: 0 28px; }
}
@media (max-width: 480px) {
  .shell { padding: 0 24px; }
}

/* iOS notched devices in landscape — respect the safe-area inset, but
   keep the same minimum we'd give any phone otherwise. */
@supports (padding: max(0px)) {
  .shell {
    padding-left:  max(24px, env(safe-area-inset-left));
    padding-right: max(24px, env(safe-area-inset-right));
  }
}

/* ---------- Nav ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(251,251,248,.85);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--ink-200);
  transition: background .25s ease, border-color .25s ease;
}
body[data-theme="track"]  .nav { background: rgba(251,253,255,.85); }
body[data-theme="tender"] .nav { background: rgba(251,253,248,.85); }

/* Dark-overlay variant: floats transparent over the hero panel, then
   fades to the paper-bg style above once the user scrolls past the hero
   (Nav drops `is-on-dark` based on scrollY > 80). */
.nav.nav-dark.is-on-dark {
  background: transparent;
  backdrop-filter: none;
  border-bottom-color: transparent;
}
.nav.nav-dark.is-on-dark .nav-link { color: rgba(255,255,255,0.85); }
.nav.nav-dark.is-on-dark .nav-link.is-active { color: white; }
.nav.nav-dark.is-on-dark .nav-link:hover { color: white; }
.nav.nav-dark.is-on-dark .nav-toggle { color: white; }
/* Outline buttons in the nav (e.g. Tender "Coming soon" chip) need to
   read against the dark hero too. */
.nav.nav-dark.is-on-dark .btn-disabled {
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.7);
  border-color: rgba(255,255,255,0.25);
}

/* When the mobile hamburger expands, the nav grows in height — but the
   hero only overlaps the original 64px (margin-top: -64px), so the upper
   portion of the open menu sits over the body's paper background and
   white-text-on-transparent becomes white-on-paper. Force a solid
   hero-coloured backdrop on the nav whenever the mobile menu is open
   AND the nav is in its dark-overlay state. Per-theme so the colour
   matches the variant's hero. */
.nav.nav-dark.is-on-dark.is-mobile-open {
  background: #080b3f; /* default = home (Deep Cove) */
  border-bottom-color: rgba(255,255,255,0.10);
}
body[data-theme="track"]  .nav.nav-dark.is-on-dark.is-mobile-open { background: #1a3a17; }
body[data-theme="tender"] .nav.nav-dark.is-on-dark.is-mobile-open { background: #0f2740; }

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 24px;
}
.nav-left { display: flex; align-items: center; gap: 36px; }
.nav-logo { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--ink-900); font-size: 18px; }
.nav-links { display: flex; gap: 28px; }
.nav-link { font-size: 14px; color: var(--ink-700); font-weight: 500; transition: color .15s; }
.nav-link:hover { color: var(--brand-700); }
.nav-link.is-active { color: var(--brand-800); font-weight: 600; }
.nav-right { display: flex; align-items: center; gap: 12px; }
.nav-toggle { display: none; background: none; border: none; padding: 8px; color: var(--ink-700); }

@media (max-width: 720px) {
  /* `.shell .nav-inner` shares the element with .shell, so use the
     long-form padding-top/bottom here — the shorthand `padding: 14px 0`
     wipes out .shell's horizontal padding and the brand + hamburger end
     up flush against the viewport edges on phones. */
  .nav-inner { flex-wrap: wrap; height: auto; padding-top: 14px; padding-bottom: 14px; gap: 0; }
  .nav-left { width: 100%; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
  .nav-toggle { display: flex; align-items: center; justify-content: center; }
  .nav-links {
    display: none;
    width: 100%;
    flex-direction: column;
    gap: 0;
    padding: 12px 0 4px;
    margin-top: 12px;
    border-top: 1px solid var(--ink-200);
    order: 99;
  }
  .nav-links.is-open { display: flex; }
  .nav-link { padding: 12px 4px; font-size: 16px; border-bottom: 1px solid var(--ink-100); }
  .nav-link:last-child { border-bottom: none; }
  .nav-right {
    display: none;
    width: 100%;
    padding: 12px 0 0;
    border-top: 1px solid var(--ink-200);
    order: 100;
    flex-direction: column;
    gap: 8px;
  }
  .nav-right.is-open { display: flex; }
  .nav-right .btn { width: 100%; justify-content: center; }
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font-heading);
  border: 1px solid transparent;
  transition: all .15s;
  white-space: nowrap;
}
.btn-primary {
  background: var(--brand-700);
  color: white;
  border-color: var(--brand-700);
}
.btn-primary:hover { background: var(--brand-800); border-color: var(--brand-800); }
/* Track-green CTA — locked to the Track palette regardless of page theme. */
.btn-track {
  background: var(--td-700);
  color: white;
  border-color: var(--td-700);
}
.btn-track:hover { background: var(--td-800); border-color: var(--td-800); }
.btn-ghost { background: transparent; color: var(--ink-900); }
.btn-ghost:hover { background: var(--ink-100); }
.btn-outline {
  background: transparent;
  color: var(--ink-900);
  border-color: var(--ink-300);
}
.btn-outline:hover { border-color: var(--brand-800); color: var(--brand-800); }
.btn-lg { padding: 14px 24px; font-size: 15px; }

/* Dark-hero CTAs — used inside `.hero-dark`. The primary fills with the
   page's hero CTA colour from the brand handoff (white on the home page,
   brand-700 on Track / Tender); the outline is transparent with a faint
   white border. Both are designed to read against the dark hero panel. */
.btn-hero-primary,
.btn-hero-outline {
  border: 1px solid transparent;
  font-weight: 600;
  transition: opacity .15s, background .15s, border-color .15s;
}
.btn-hero-primary {
  background: white;
  color: #080b3f;            /* default = home (Deep Cove) */
  border-color: white;
}
.btn-hero-primary:hover { opacity: .92; }
body[data-theme="track"]  .btn-hero-primary { background: #60b929; color: white; border-color: #60b929; }
body[data-theme="tender"] .btn-hero-primary { background: #316d9d; color: white; border-color: #316d9d; }

.btn-hero-outline {
  background: transparent;
  color: white;
  border-color: rgba(255,255,255,0.5);
}
.btn-hero-outline:hover { border-color: white; background: rgba(255,255,255,0.06); }
.btn-disabled {
  background: var(--ink-100);
  color: var(--ink-500);
  border-color: var(--ink-200);
  cursor: not-allowed;
  pointer-events: none;
}

/* ---------- Eyebrow / pill labels ---------- */

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--brand-100);
  border: 1px solid var(--brand-300);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--brand-800);
  font-weight: 500;
}
.eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--brand-700); }

/* ---------- Footer ---------- */

footer.site-footer {
  border-top: 1px solid var(--ink-200);
  background: var(--paper-2);
  padding: 64px 0 32px;
  margin-top: 96px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 48px;
}
.footer-col h4 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-500);
  margin-bottom: 16px;
  font-weight: 600;
}
.footer-col a {
  display: block;
  font-size: 14px;
  color: var(--ink-700);
  padding: 4px 0;
}
.footer-col a:hover { color: var(--brand-800); }
.footer-bottom {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--ink-200);
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--ink-500);
}

/* Tablet portrait (e.g. iPad ≤960) — drop to 3 columns so "Sydney HQ"
   isn't squashed into a 155px gutter at 768. */
@media (max-width: 960px) {
  .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; }
}
@media (max-width: 720px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  footer.site-footer { padding: 40px 0 24px; margin-top: 48px; }
  .footer-bottom { flex-direction: column; gap: 8px; align-items: flex-start; }
}
@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
}
@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
}

/* ---------- Mock UI chrome ---------- */

.mock-window {
  background: white;
  border-radius: var(--radius-lg);
  border: 1px solid var(--ink-200);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.mock-titlebar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--ink-50);
  border-bottom: 1px solid var(--ink-200);
}
.mock-dot { width: 12px; height: 12px; border-radius: 50%; }
.mock-dot.r { background: #ff5f57; }
.mock-dot.y { background: #ffbd2e; }
.mock-dot.g { background: #28c941; }
.mock-url {
  flex: 1;
  background: white;
  border: 1px solid var(--ink-200);
  border-radius: 6px;
  padding: 4px 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-500);
  margin-left: 8px;
  text-align: center;
  max-width: 320px;
  margin-inline: auto;
}

/* ---------- Section utilities ---------- */

section.block { padding: 96px 0; }
section.block-sm { padding: 64px 0; }
@media (max-width: 720px) {
  section.block { padding: 64px 0; }
  section.block-sm { padding: 48px 0; }
}
@media (max-width: 480px) {
  section.block { padding: 48px 0; }
  section.block-sm { padding: 32px 0; }
}

.lead {
  font-size: 19px;
  line-height: 1.55;
  color: var(--ink-700);
  max-width: 60ch;
  font-weight: 400;
}

.h-display {
  font-size: clamp(40px, 6vw, 76px);
  line-height: 1.02;
  letter-spacing: -0.04em;
  font-weight: 700;
}
.h-section {
  font-size: clamp(32px, 4vw, 48px);
  line-height: 1.05;
  letter-spacing: -0.03em;
  font-weight: 700;
}
.h-card {
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-weight: 600;
}

@media (max-width: 480px) {
  .h-display { font-size: 32px; }
  .h-section { font-size: 24px; }
  .lead { font-size: 16px; max-width: 100%; }
  .card, .card-flat { padding: 16px; }
}

/* ---------- Background utilities ---------- */
/* The repeating grid motif that previously lived on `body` and as a
   `.bg-grid` utility has been removed site-wide per the hero redesign. */

.bg-dots {
  background-image: radial-gradient(rgba(14,20,19,.12) 1px, transparent 1px);
  background-size: 16px 16px;
}

/* ---------- Cards ---------- */

.card {
  background: white;
  border: 1px solid var(--ink-200);
  border-radius: var(--radius-lg);
  padding: 28px;
}
.card-flat {
  background: var(--paper-2);
  border: 1px solid var(--ink-200);
  border-radius: var(--radius-lg);
  padding: 28px;
}

/* ---------- Responsive grid utilities ---------- */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-hero { display: grid; grid-template-columns: 1.1fr 1fr; gap: 64px; align-items: center; }
.grid-about { display: grid; grid-template-columns: 1fr 1.4fr; gap: 80px; align-items: start; }
.grid-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
/* `--steps-count` is set inline by the HowItWorks component (pages.jsx)
   so each consumer (Track has 4, future pages may differ) gets the right
   column count without an inline `grid-template-columns` that would
   defeat the responsive media queries below. Default to 4 if unset. */
.grid-steps { display: grid; gap: 24px; position: relative;
              grid-template-columns: repeat(var(--steps-count, 4), 1fr); }

/* Collapse the hero grid earlier than the rest of the layout — iPad
   portrait (768) misses the ≤720 breakpoint, and the 2-col hero pushes
   the mock screenshot past the viewport edge. Stack at ≤900 so iPad
   portrait gets the same layout phones do; tablet landscape (1024)
   keeps the side-by-side view. The 3D perspective transform also goes
   when stacked — it has nothing to add when content is full-width. */
@media (max-width: 900px) {
  /* `minmax(0, 1fr)` (not bare `1fr`) so the column can actually
     shrink below the min-content size of its widest descendant —
     otherwise the rigid-pixel grid inside the mock surface forces
     the column wider than the viewport even with max-width:100%
     declared on the card. */
  .grid-hero { grid-template-columns: minmax(0, 1fr); gap: 48px; }
  .grid-hero > * { min-width: 0; }
  .hero-card-3d { transform: none !important; }
  /* The mock surfaces inside the hero card use rigid pixel-width
     grid columns (Track: 60+130+1fr+110+100+110 = ~510px min,
     Tender: explicit min-width: 560). On stacked layouts the card
     would otherwise force the page wider than the viewport — body's
     overflow-x:clip silently swallows the right portion. Scope an
     internal scroll instead so users can swipe through the mock
     without the page itself scrolling. */
  .hero-card-3d {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

@media (max-width: 720px) {
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-hero { gap: 32px; }
  .grid-about { grid-template-columns: 1fr; gap: 32px; }
  .grid-stats { grid-template-columns: 1fr; gap: 16px; }
  .grid-steps { grid-template-columns: repeat(2, 1fr); }
  .hero-home { padding: 64px 0 48px !important; }
  .cta-band-inner { padding: 32px !important; }
  .product-card { min-height: auto !important; padding: 24px !important; }
  .product-card h3 { font-size: 22px !important; }
  .pricing-amount { font-size: 48px !important; }
  .pricing-card { padding: 24px !important; }
  .step-circle { width: 48px !important; height: 48px !important; font-size: 18px !important; border-radius: 12px !important; }
  .step-connector { display: none !important; }
}
@media (max-width: 480px) {
  .grid-3 { grid-template-columns: 1fr; }
  .grid-steps { grid-template-columns: 1fr; }
  .grid-stats { grid-template-columns: 1fr; }
}

/* ---------- Decorative hero mark (home page, legacy) ---------- */
/* Retained for any non-hero blocks that still reference it; the new dark
   heroes draw their watermark via .hero-bg-mark below. */
.hero-deco-mark { position: absolute; top: 40px; right: -100px; opacity: 0.06; }
@media (max-width: 720px) {
  .hero-deco-mark { display: none; }
}

/* ---------- Dark hero (home / Track / Tender) ---------- */
/* The hero panel sits flush under the (transparent) Nav and provides its
   own full-bleed brand-colour background. `min-height` is sized so the
   composition matches the 1920×1080 references at desktop widths; phones
   collapse via the @media block at the bottom of the rule. */
.hero-dark {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  color: white;
  /* Pull the section up under the dark-overlay nav so the nav floats over
     the hero rather than sitting on a separate paper strip. */
  margin-top: -64px;
  padding-top: 64px;
  min-height: 720px;
  display: flex;
  align-items: center;
}
.hero-dark .hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}
.hero-dark .hero-bg-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.hero-dark .hero-bg-mark {
  position: absolute;
  right: -180px;
  bottom: -180px;
  width: 920px;
  height: 920px;
  opacity: 0.10;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero-dark-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  padding-top: 96px;
  padding-bottom: 96px;
}
.hero-dark-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.7);
  margin-bottom: 20px;
}
.hero-dark-title {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: clamp(40px, 7vw, 92px);
  line-height: 1.02;
  letter-spacing: -0.035em;
  color: white;
  max-width: 18ch;
  margin: 0;
  text-wrap: balance;
}
.hero-dark-accent { opacity: 0.6; font-weight: 800; }
.hero-dark-lead {
  font-size: 21px;
  line-height: 1.55;
  color: rgba(255,255,255,0.8);
  margin-top: 28px;
  max-width: 60ch;
}
.hero-dark-ctas {
  display: flex;
  gap: 12px;
  margin-top: 36px;
  flex-wrap: wrap;
}

@media (max-width: 720px) {
  .hero-dark { min-height: 560px; }
  .hero-dark-inner { padding-top: 64px; padding-bottom: 64px; }
  .hero-dark-lead { font-size: 17px; margin-top: 20px; }
  .hero-dark-ctas { margin-top: 24px; }
  .hero-dark .hero-bg-mark { width: 540px; height: 540px; right: -120px; bottom: -120px; }
}

/* ---------- Animation ---------- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-up { animation: fadeUp .6s ease-out both; }
