/* ============================================================================
   AFTON SOLUTIONS — SITE.CSS  (single source of truth)
   ----------------------------------------------------------------------------
   This file owns every GLOBAL, cross-page style: tokens, the type scale,
   nav + mobile drawer, footer, buttons, and the CTA band. Every page links
   this file. Change a global here once and it changes everywhere.

   RULES (do not break these — see CLAUDE.md "Source of Truth Rules"):
   1. Global components (nav, footer, buttons, CTA, type scale, gutters) live
      ONLY here. Never redefine them inside a page's <style> block.
   2. A page's inline <style> may ONLY contain layout that is unique to that
      page (its hero, its bespoke sections). It must reuse the tokens below.
   3. Body text is ALWAYS 100% opacity. Use the --ink* color tokens, never
      rgba() with an alpha < 1 on readable text.
   4. Horizontal page padding is controlled by --gutter (flips to 10% on
      mobile automatically). Never hard-code section side padding or add
      per-page !important padding overrides.
   5. No arrows inside buttons or links. Ever.
   6. On mobile, Permanent Marker is swapped to Inter 700 globally (below) —
      never add per-page mobile font swaps.
   ========================================================================== */

/* ── Fonts ─────────────────────────────────────────────────────────────── */
@font-face {
  font-family: 'Permanent Marker';
  src: url('/fonts/PermanentMarker-Regular.ttf') format('truetype');
  font-display: swap;
}
@font-face {
  font-family: 'Aurelia Emiko';
  src: url('/fonts/Aurelia Emiko.otf') format('opentype');
  font-display: swap;
}

/* ── Reset ─────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

/* ── Tokens ────────────────────────────────────────────────────────────── */
:root {
  /* Brand palette — LOCKED. Do not add alternatives. */
  --navy:       #0D1B2A;
  --icy:        #BDE0FE;
  --sky:        #A2D2FF;
  --warm:       #F8F6F1;
  --slate:      #64748B;
  --icy-dark:   #2A5A80;

  /* Text colors — all solid, all 100% opacity (rule #3) */
  --ink:         var(--navy);   /* body text on light backgrounds         */
  --ink-muted:   #4F6075;       /* secondary text on light (solid)        */
  --ink-light:   #FFFFFF;       /* headings/strong text on navy           */
  --ink-light-2: #CFD4D7;       /* body/secondary text on navy (solid)    */
  --muted-dark:  #CFD4D7;       /* legacy alias of --ink-light-2          */

  /* Layout */
  --max-w: 1200px;

  /* Horizontal gutter — the ONE knob for side padding everywhere.
     Flips to 10% on mobile (rule #4). */
  --gutter: 5%;

  /* Vertical spacing scale */
  --sp-section: clamp(4rem, 8vw, 8rem);
  --sp-lg:      clamp(2rem, 4vw, 4rem);
  --sp-md:      clamp(1rem, 2vw, 2rem);

  /* Type scale — the ONLY font sizes for shared text roles (rule #2).
     Page-unique sections may use these tokens; do not invent new literals. */
  --fs-display: clamp(2.25rem, 5vw, 3.75rem);     /* Permanent Marker display */
  --fs-h1:      clamp(1.875rem, 4vw, 3.125rem);   /* page hero headline       */
  --fs-h2:      clamp(1.875rem, 3.8vw, 3.125rem); /* section headline (30→50px)*/
  --fs-h3:      clamp(1.1rem, 1.8vw, 1.5rem);     /* sub-headline / card title*/
  --fs-body:    clamp(0.9375rem, 1.05vw, 1rem);   /* body copy ~15–16px       */
  --fs-sm:      0.875rem;                          /* 14px                     */
  --fs-xs:      0.75rem;                           /* 12px                     */
  --lh-body:    1.7;
}

/* Mobile gutter flip — every section/nav/footer that uses var(--gutter)
   moves to 10% side padding at once. No overrides, no specificity wars. */
@media (max-width: 768px) {
  :root { --gutter: 10%; }
}

/* ── Base ──────────────────────────────────────────────────────────────── */
body {
  font-family: 'Montserrat', sans-serif;
  background: var(--warm);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

/* ── Permanent Marker is applied ONLY through these shared roles ──────────────
   Never hardcode font-family:'Permanent Marker' in a page. Anything that
   should be marker either uses class="display" or is one of the shared
   component roles listed here (case-study accent).
   On mobile, ALL of them swap to Inter 700 / -0.02em in one place (rule #6).
   Case-study card titles use Inter (.case-card-title) — not Permanent Marker.
   --------------------------------------------------------------------------- */
.display,
.csd-accent {
  font-family: 'Permanent Marker', sans-serif;
  font-weight: 400;
}
.display { letter-spacing: 0.01em; line-height: 1.15; }

@media (max-width: 768px) {
  .display,
  .csd-accent {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    letter-spacing: -0.02em;
  }
}

.heading {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.eyebrow {
  font-family: 'Montserrat', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  display: block;
  margin-bottom: 16px;
}

/* Section background helpers — set color ONCE at the section level so child
   text inherits the correct readable color (rule #3). Use these on new pages. */
.bg-navy  { background: var(--navy); color: var(--ink-light-2);
            /* dark surface → ghost buttons go sky automatically (same as .on-dark) */
            --btn-ghost-fg: var(--sky); --btn-ghost-fg-hover: #ffffff; --btn-ghost-hover-bg: transparent; }
.bg-navy  .eyebrow { color: var(--sky); }
.bg-navy  h1, .bg-navy h2, .bg-navy h3 { color: var(--ink-light); }
.bg-icy   { background: var(--icy);  color: var(--navy); }
.bg-icy   .eyebrow { color: var(--icy-dark); }
.bg-warm  { background: var(--warm); color: var(--navy); }
.bg-warm  .eyebrow { color: var(--icy-dark); }

.section-inner { max-width: var(--max-w); margin: 0 auto; }

/* ── Buttons ───────────────────────────────────────────────────────────────
   One button system. NO arrows inside buttons (rule #5).
   - .btn-dark  : solid sky pill, navy text — the primary action; reads on any bg.
   - .btn-ghost : outlined pill whose color ADAPTS TO ITS SURFACE automatically:
                    • Default = navy  → correct on warm/cream/icy content sections.
                    • On a navy/dark surface, add class `on-dark` to the SECTION;
                      the ghost flips to sky (→ white on hover) with no fill.
                  There is no `.on-light` and nothing to remember on light
                  sections — navy is the safe default, so a forgotten flag on a
                  dark section fails LOUDLY (navy-on-navy), never silently wrong.
   ------------------------------------------------------------------------- */

/* Surface-driven ghost-button colors. Light surfaces use the defaults below;
   dark surfaces override the three vars via `.on-dark`. */
:root {
  --btn-ghost-fg:       var(--navy);
  --btn-ghost-fg-hover: var(--navy);
  --btn-ghost-hover-bg: rgba(13,27,42,.08);
}
.on-dark {
  --btn-ghost-fg:       var(--sky);
  --btn-ghost-fg-hover: #ffffff;
  --btn-ghost-hover-bg: transparent;
}

.btn-dark,
.btn-ghost,
.nav-cta {
  font-family: 'Montserrat', sans-serif;
  font-size: 12px;
  font-weight: 600;
  padding: 9px 18px;
  border-radius: 999px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  display: inline-block;
  white-space: nowrap;
  transition: opacity .2s, background .2s, color .2s, border-color .2s;
}

.btn-dark  { background: var(--sky); color: var(--navy); }
.btn-dark:hover { opacity: .85; }

.btn-ghost {
  background: transparent;
  color: var(--btn-ghost-fg);
  font-weight: 500;
  border: 1.5px solid var(--btn-ghost-fg);
}
.btn-ghost:hover { color: var(--btn-ghost-fg-hover); border-color: var(--btn-ghost-fg-hover); background: var(--btn-ghost-hover-bg); }

.nav-cta { background: var(--sky); color: var(--navy); font-size: 13px; padding: 10px 22px; }
.nav-cta:hover { opacity: .85; }

/* ── Nav ───────────────────────────────────────────────────────────────────
   Identical markup on every page (rule #1). Default: solid navy, sticky.
   Home opts into the transparent-over-hero behavior with .site-nav--overlay.
   ------------------------------------------------------------------------- */
.site-nav {
  background: var(--navy);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 0 var(--gutter);
  transition: background .3s ease, box-shadow .3s ease;
}
.site-nav--overlay {
  position: fixed;
  top: 0; left: 0; right: 0;
  background: transparent;
}
.site-nav--overlay.nav-solid {
  background: var(--navy);
  box-shadow: 0 1px 0 rgba(255,255,255,.06);
}

.nav-inner { max-width: var(--max-w); margin: 0 auto; height: 68px; display: flex; align-items: center; justify-content: space-between; }
.nav-logo { display: inline-flex; align-items: center; text-decoration: none; }
.nav-logo img { height: 26px; width: auto; display: block; }
.nav-right { display: flex; align-items: center; gap: 36px; }
.nav-links { list-style: none; display: flex; gap: 4px; align-items: center; }
.nav-links > li { position: relative; }
.nav-links > li > a { font-size: 13px; font-weight: 500; color: var(--sky); text-decoration: none; transition: color .2s, background .2s; padding: 6px 14px; border-radius: 999px; display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.nav-links > li > a:hover,
.nav-links > li > a.active { color: var(--navy); background: var(--sky); }
.nav-links > li > a .chev { width: 10px; height: 10px; flex-shrink: 0; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s; }
.nav-links > li:hover > a .chev { transform: rotate(180deg); }

.nav-dropdown-panel { position: absolute; top: calc(100% + 12px); right: 0; left: auto; transform: translateY(-8px); background: var(--navy); border: 1px solid rgba(162,210,255,.18); border-radius: 14px; padding: 8px; min-width: 260px; opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease; box-shadow: 0 28px 60px rgba(0,0,0,.55), 0 0 0 1px rgba(255,255,255,.04); }
.nav-dropdown-panel::before { content: ''; position: absolute; top: -14px; left: 0; right: 0; height: 14px; }
.nav-links > li:hover .nav-dropdown-panel { opacity: 1; pointer-events: auto; transform: translateY(0); }
.nav-dropdown-panel a { display: flex; align-items: center; justify-content: flex-end; padding: 10px 14px; border-radius: 9px; font-size: 13px; font-weight: 500; color: var(--sky); text-decoration: none; transition: background .18s, color .18s; border-right: 2px solid transparent; }
.nav-dropdown-panel a:hover,
.nav-dropdown-panel a.active { background: rgba(162,210,255,.09); color: var(--sky); border-right-color: var(--sky); }

/* Hamburger */
.nav-hamburger { display: none; flex-direction: column; justify-content: center; gap: 5px; cursor: pointer; padding: 4px; background: none; border: none; }
.nav-hamburger span { display: block; width: 22px; height: 2px; background: var(--sky); border-radius: 2px; transition: transform .3s ease, opacity .2s ease; }
.nav-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile overlay + slide-in drawer */
.mobile-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 98; opacity: 0; transition: opacity .3s ease; }
.mobile-overlay.open { display: block; opacity: 1; }

.mobile-menu { display: flex; flex-direction: column; background: var(--navy); border-left: 1px solid rgba(255,255,255,.08); position: fixed; top: 0; right: 0; bottom: 0; width: 75vw; max-width: 300px; z-index: 99; padding: 96px 32px 40px; transform: translateX(100%); transition: transform .3s ease; overflow-y: auto; }
.mobile-menu.open { transform: translateX(0); }
.mobile-menu a { font-size: 16px; font-weight: 500; color: var(--sky); text-decoration: none; padding: 14px 0; text-align: right; border-bottom: 1px solid rgba(255,255,255,.06); transition: color .2s; }
.mobile-menu a:last-of-type { border-bottom: none; }
.mobile-menu a:hover { color: #fff; }
.mobile-menu .mobile-services-label { font-size: 16px; font-weight: 500; color: var(--sky); text-decoration: none; padding: 14px 0 6px; text-align: right; border-bottom: none; }
.mobile-menu .mobile-service-links { display: flex; flex-direction: column; border-bottom: 1px solid rgba(255,255,255,.06); }
.mobile-menu .mobile-service-links a { font-size: 13px; font-weight: 500; color: #9CC4E8; padding: 9px 0; border-bottom: none; padding-left: 12px; }
.mobile-menu .mobile-service-links a:hover { color: #fff; }

/* ── Footer ─────────────────────────────────────────────────────────────────
   One footer. Home's footer is canonical. Same markup on every page (rule #1).
   ------------------------------------------------------------------------- */
footer { background: var(--navy); padding: clamp(40px, 5.3vw, 64px) var(--gutter) clamp(24px, 3vw, 36px); }
.footer-inner { max-width: var(--max-w); margin: 0 auto; }
.footer-top { display: flex; flex-wrap: wrap; align-items: flex-start; gap: clamp(24px, 4vw, 48px); padding-bottom: clamp(28px, 4vw, 48px); border-bottom: 1px solid rgba(255,255,255,.07); margin-bottom: clamp(16px, 2.3vw, 28px); }
.footer-brand { flex: 1 1 min(220px, 100%); }
.footer-cols { display: flex; flex-wrap: wrap; gap: clamp(24px, 4vw, 48px); margin-left: auto; }
.footer-col { flex: 0 0 auto; }
.footer-logo { margin-bottom: 12px; }
.footer-logo img { height: clamp(22px, 2.3vw, 28px); width: auto; display: block; }
.footer-col h4 { font-family: 'Montserrat', sans-serif; font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: #8C9298; margin-bottom: 18px; }
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.footer-col a { font-size: 14px; color: var(--ink-light-2); text-decoration: none; transition: color .2s; }
.footer-col a:hover { color: #fff; }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; }
.footer-copy { font-size: 13px; color: #8C9298; }

/* ── Case study card ──────────────────────────────────────────────────────────
   Single source of truth for the case-study card used in six places: the
   /case-studies/ index grid AND the case-study sections on home + the four
   service pages. White card, image with tags overlaid, eyebrow (client +
   industry), Inter title, description, ghost CTA pill.

   Two top-decoration variants live here so all pages share one structure:
     • default (.case-card)             → blue tape ribbon (case-studies index)
     • .case-card.case-card--pinned     → pushpin SVG (main + service pages)
   Pinned cards must include a <div class="case-pin-wrap"><img class="case-pin">
   …</div> as the first child.

   The corkboard context (.case-board + crooked rotations) is the layout that
   makes the pushpin variant feel natural — it sits below this rule and is
   used ONLY on the home + service pages, not the case-studies index.
   ------------------------------------------------------------------------- */
.case-card {
  background: #fff;
  border-radius: 4px;
  box-shadow: 0 4px 18px rgba(13,27,42,.12), 0 1px 4px rgba(13,27,42,.07);
  padding: 14px 14px 22px;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  position: relative;
  transition: transform .25s ease, box-shadow .25s ease;
}
.case-card:hover { transform: translateY(-6px); box-shadow: 0 22px 52px rgba(13,27,42,.18), 0 4px 12px rgba(13,27,42,.1); }
/* Default top decoration: blue tape ribbon. Suppressed on the pinned variant. */
.case-card:not(.case-card--pinned)::before {
  content: ""; position: absolute; top: -12px; left: 50%;
  transform: translateX(-50%) rotate(-2deg);
  width: 96px; height: 22px;
  background: rgba(189,224,254,.78);
  border: 1px solid rgba(13,27,42,.08);
}
.case-card-image { aspect-ratio: 4/3; background-color: var(--navy); background-size: cover; background-position: center; position: relative; margin-bottom: 18px; }
.case-card-tags { display: flex; gap: 6px; flex-wrap: wrap; position: absolute; top: 10px; right: 10px; max-width: calc(100% - 20px); justify-content: flex-end; }
.case-tag { font-size: 10.5px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--icy); color: var(--navy); font-family: 'Montserrat', sans-serif; letter-spacing: .03em; text-transform: uppercase; }
.case-card-body { display: flex; flex-direction: column; flex: 1; padding: 0 4px; }
.case-card-eyebrow { margin: 0 0 14px; }
.case-card-company { display: block; font-family: 'Montserrat', sans-serif; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--navy); line-height: 1.2; margin-bottom: 2px; }
.case-card-industry { display: block; font-family: 'Montserrat', sans-serif; font-size: 10px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--icy-dark); line-height: 1.2; }
.case-card-title { font-family: 'Inter', sans-serif; font-size: 19px; font-weight: 800; color: var(--navy); margin: 0 0 10px; letter-spacing: -0.02em; line-height: 1.22; }
.case-card-desc { font-size: 14px; color: var(--slate); line-height: 1.6; flex: 1; margin: 0 0 18px; }
.case-card-cta { display: inline-flex; align-items: center; align-self: flex-start; font-size: 12px; font-weight: 600; color: var(--navy); font-family: 'Montserrat', sans-serif; padding: 9px 18px; border-radius: 999px; border: 1.5px solid var(--navy); transition: background .2s, color .2s, border-color .2s; }
.case-card:hover .case-card-cta { background: var(--icy); color: var(--navy); border-color: var(--icy); }

/* Pinned variant — pushpin SVG instead of the tape ribbon. */
.case-pin-wrap { position: absolute; top: -20px; left: 50%; transform: translateX(-50%); z-index: 2; pointer-events: none; }
.case-pin { width: 24px; height: 32px; display: block; filter: drop-shadow(0 2px 4px rgba(0,0,0,.3)); }

/* ── Case board (pinned-card corkboard) ───────────────────────────────────────
   Linen-textured board that holds the pinned case cards on the home + service
   pages. Cards are crooked by default (nth-child rotations) and straighten on
   hover. On mobile, rotations flatten and cards stack centered.
   ------------------------------------------------------------------------- */
.case-board { max-width: var(--max-w); margin: 0 auto; background: url('/images/home/desktop/LinenTexture.png') repeat; border-radius: 20px; box-shadow: 0 0 0 10px #ebdfd2, 0 3px 10px rgba(0,0,0,.15), inset 2px 2px 8px rgba(0,0,0,.28), inset -1px -1px 5px rgba(0,0,0,.12); padding: clamp(24px, 3vw, 40px); }
.case-grid { display: flex; flex-wrap: wrap; gap: clamp(24px, 3vw, 40px); align-items: flex-end; justify-content: center; }
.case-board .case-card { flex: 1 1 min(280px, 100%); max-width: 380px; }
.case-board .case-card:nth-child(1) { transform: rotate(-2deg); }
.case-board .case-card:nth-child(2) { transform: rotate(0.5deg); margin-bottom: 28px; }
.case-board .case-card:nth-child(3) { transform: rotate(1.5deg); }
@media (hover: hover) {
  .case-board .case-card:hover { transform: rotate(0deg) translateY(-10px); box-shadow: 0 22px 52px rgba(13,27,42,.18), 0 4px 12px rgba(13,27,42,.1); }
}
@media (max-width: 768px) {
  .case-board .case-card,
  .case-board .case-card:nth-child(1),
  .case-board .case-card:nth-child(2),
  .case-board .case-card:nth-child(3) { transform: none; margin-bottom: 0; max-width: 340px; }
}

/* ── CTA band ───────────────────────────────────────────────────────────────
   Finalized style. Same on every page; only the headline/subcopy text change.
   Lives on icy-blue, with reversed (navy) buttons. (rule: CTA is universal.)
   ------------------------------------------------------------------------- */
.cta-band { background: var(--icy); padding: var(--sp-section) var(--gutter); text-align: center; }
.cta-inner { max-width: 660px; margin: 0 auto; }
.cta-band .eyebrow { color: var(--icy-dark); display: flex; justify-content: center; }
.cta-headline { font-size: var(--fs-display); color: var(--navy); margin-bottom: 14px; }
.cta-sub { font-size: 18px; color: var(--icy-dark); line-height: 1.6; margin-bottom: 10px; }
.cta-support { font-size: 15px; color: var(--icy-dark); margin-bottom: 40px; font-style: italic; }
.cta-actions { display: flex; gap: 14px; justify-content: center; align-items: center; flex-wrap: wrap; }
/* Reversed primary button on the icy band (ghost is already navy by default). */
.cta-band .btn-dark { background: var(--navy); color: var(--sky); }
.cta-band .btn-dark:hover { opacity: .85; }

/* ── Responsive: nav collapse + CTA stacking ───────────────────────────────
   Single hamburger breakpoint at 1024px. Mobile gutter handled by --gutter.
   ------------------------------------------------------------------------- */
@media (max-width: 1024px) {
  .nav-links { display: none; }
  .nav-right { gap: 16px; }
  .nav-hamburger { display: flex; margin-left: 12px; }
  .nav-inner { justify-content: flex-start; }
  .nav-logo { margin-right: auto; }
  .nav-cta { background: transparent; color: var(--sky); border: 1.5px solid var(--sky); font-size: 12px; padding: 9px 18px; }
  .nav-cta:hover { background: rgba(162,210,255,.1); opacity: 1; }
  .footer-top { gap: 32px; }
}

@media (max-width: 768px) {
  .nav-right { display: none; }
  .nav-hamburger { display: flex; }

  .cta-headline { font-size: 22px; }
  .cta-sub { line-height: 1.5; }
  .cta-actions { flex-direction: column; align-items: center; }
  .cta-actions .btn-dark,
  .cta-actions .btn-ghost { width: 100%; max-width: 300px; text-align: center; }

  .footer-bottom { flex-direction: column; gap: 10px; text-align: center; }
  .footer-col h4 { font-size: 10px; }
  .footer-col a { font-size: 12px; }
}

@media (max-width: 600px) {
  .footer-cols { margin-left: 0; }
}

@media (max-width: 480px) {
  .nav-logo img { height: 20px; }
}
