/* ============================================================
   Front Nine AI Consulting — styles (dark theme)
   Sections: tokens, reset, layout, header/nav, hero, sections,
             cards, steps, about, faq, contact, footer, motion
   ============================================================ */

/* ---------- Tokens ---------- */
:root {
  /* Surfaces, darkest to lightest */
  --header-bg:  #000000;   /* header + footer */
  --bg:         #0b0f0d;   /* page base */
  --bg-alt:     #131a17;   /* alternating sections (services, about) */
  --surface:    #161d1a;   /* cards, panels, FAQ rows */
  --surface-2:  #1d2521;   /* insets on top of --surface */

  /* Brand greens, brightened for legibility on dark */
  --fairway:      #2f7d5e;
  --fairway-lite: #4aa87e;
  --fairway-glow: rgba(74, 168, 126, .13);

  /* Text */
  --heading:   #eef4f0;
  --ink:       #dbe4df;
  --ink-soft:  #9aa8a1;

  /* Lines & accent */
  --line:      #232c28;
  --accent:    #d9a05a;

  --wrap:        1120px;
  --wrap-narrow: 760px;
  --radius:      14px;
  --header-h:    68px;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .5), 0 2px 8px rgba(0, 0, 0, .35);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, .55), 0 12px 34px rgba(0, 0, 0, .45);

  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
  --font-serif: ui-serif, Georgia, Cambria, "Times New Roman", serif;

  color-scheme: dark;
}

/* ---------- Reset-ish ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  /* keeps anchored sections clear of the sticky header */
  scroll-padding-top: calc(var(--header-h) + 16px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }
ul, ol { margin: 0; padding: 0; list-style: none; }
p { margin: 0 0 1rem; }

h1, h2, h3 {
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.015em;
  color: var(--heading);
  margin: 0 0 .6rem;
  text-wrap: balance;
}
h1 { font-size: clamp(2.1rem, 5.2vw, 3.5rem); }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); }
h3 { font-size: 1.15rem; letter-spacing: -0.005em; }

a { color: var(--fairway-lite); text-underline-offset: 3px; }
a:hover { color: #6ec49b; }

:where(a, button, summary, details):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

::selection { background: var(--fairway); color: #fff; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  clip-path: inset(50%); overflow: hidden; white-space: nowrap;
}

.skip-link {
  position: absolute; top: 0; left: 50%;
  transform: translate(-50%, -120%);
  z-index: 100;
  background: var(--fairway); color: #fff;
  padding: .7rem 1.1rem; border-radius: 0 0 8px 8px;
  text-decoration: none; font-weight: 600;
}
.skip-link:focus { transform: translate(-50%, 0); color: #fff; }

/* ---------- Layout ---------- */
.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: clamp(1.1rem, 4vw, 2rem);
}
.wrap-narrow { max-width: var(--wrap-narrow); }

.section { padding-block: clamp(3.5rem, 8vw, 6.5rem); }
.section-alt { background: var(--bg-alt); }

/* The step between --bg and --bg-alt is deliberately subtle, so every seam
   between two bands also gets a hairline. The hero and contact sections
   carry their own edges, hence the sibling selector. */
.section + .section { border-top: 1px solid var(--line); }

.section-head { max-width: 58ch; margin-bottom: clamp(2rem, 4vw, 3rem); }
.section-lede { color: var(--ink-soft); font-size: 1.08rem; margin-bottom: 0; }

.eyebrow {
  font-family: var(--font-sans);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 .7rem;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: .78rem 1.5rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: .98rem;
  text-decoration: none;
  border: 1.5px solid transparent;
  transition: background-color .18s ease, color .18s ease,
              border-color .18s ease, transform .18s ease;
}
.btn-primary { background: var(--fairway); color: #fff; }
.btn-primary:hover { background: #37936e; color: #fff; transform: translateY(-1px); }
.btn-ghost { border-color: var(--line); color: var(--heading); background: transparent; }
.btn-ghost:hover { border-color: var(--fairway-lite); background: var(--fairway-glow); color: var(--heading); }

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--header-bg);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.site-header.is-stuck {
  border-bottom-color: var(--line);
  box-shadow: 0 6px 20px rgba(0, 0, 0, .6);
}

.header-inner {
  min-height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: inline-flex; align-items: center; gap: .65rem;
  text-decoration: none; color: var(--heading);
}
.brand-mark { width: 34px; height: 34px; flex: none; }
.brand-text {
  font-family: var(--font-serif);
  font-size: 1.16rem; font-weight: 600; line-height: 1.05;
  display: flex; flex-direction: column;
}
.brand-sub {
  font-family: var(--font-sans);
  font-size: .64rem; font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-soft);
}

.primary-nav ul { display: flex; align-items: center; gap: .3rem; }
.primary-nav a {
  display: block;
  padding: .5rem .8rem;
  border-radius: 8px;
  font-size: .95rem; font-weight: 500;
  color: var(--ink-soft);
  text-decoration: none;
  transition: color .16s ease, background-color .16s ease;
}
.primary-nav a:hover { color: var(--heading); background: rgba(255, 255, 255, .07); }
.primary-nav a[aria-current="true"] { color: var(--heading); font-weight: 600; }

.primary-nav .nav-cta {
  margin-left: .5rem;
  background: var(--fairway); color: #fff;
  padding: .55rem 1.1rem; border-radius: 999px;
}
.primary-nav .nav-cta:hover { background: #37936e; color: #fff; }
.primary-nav .nav-cta[aria-current="true"] { color: #fff; }

.nav-toggle {
  display: none;
  width: 44px; height: 44px;
  padding: 0; border: 1px solid var(--line); border-radius: 10px;
  background: transparent; cursor: pointer;
  align-items: center; justify-content: center;
}
.nav-toggle-bars,
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  content: ""; display: block;
  width: 18px; height: 2px; border-radius: 2px;
  background: var(--heading);
  transition: transform .2s ease, opacity .2s ease;
}
.nav-toggle-bars { position: relative; }
.nav-toggle-bars::before { position: absolute; top: -6px; }
.nav-toggle-bars::after  { position: absolute; top: 6px; }

.nav-toggle[aria-expanded="true"] .nav-toggle-bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::before { top: 0; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::after  { top: 0; transform: rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  padding-block: clamp(3.5rem, 9vw, 7rem) clamp(3rem, 7vw, 5.5rem);
  background:
    radial-gradient(900px 420px at 12% -10%, rgba(74, 168, 126, .20), transparent 62%),
    radial-gradient(700px 380px at 92% 4%, rgba(217, 160, 90, .13), transparent 60%),
    linear-gradient(180deg, #121918 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--line);
}
.hero-inner { max-width: 900px; }
.hero .lede {
  font-size: clamp(1.05rem, 1.7vw, 1.25rem);
  color: var(--ink-soft);
  max-width: 62ch;
  margin-top: 1.2rem;
}
.hero-actions {
  display: flex; flex-wrap: wrap; gap: .8rem;
  margin-top: 1.9rem;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 1.2rem;
  margin: clamp(2.5rem, 5vw, 3.5rem) 0 0;
  padding-top: 1.8rem;
  border-top: 1px solid var(--line);
}
.hero-stats dt {
  font-size: .8rem; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink-soft);
}
.hero-stats dd {
  margin: .3rem 0 0;
  font-family: var(--font-serif);
  font-size: 1.3rem; font-weight: 600;
  color: var(--heading);
}

/* ---------- Cards (services) ---------- */
/* Exactly four cards: the first is the lead offer and spans the full row, the
   remaining three sit beneath it in equal thirds. A fixed track count beats
   auto-fit, which would reflow the three into two columns and strand one. */
.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.2rem;
}
/* 1 / -1 rather than span 3, so it still spans the row when the grid drops to
   fewer columns at narrow widths. */
.cards > .card:first-child { grid-column: 1 / -1; }
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.6rem 1.5rem 1.4rem;
  box-shadow: var(--shadow-sm);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--fairway-lite);
}
.card-num {
  font-family: var(--font-serif);
  font-size: .95rem; font-weight: 700;
  color: var(--accent);
  letter-spacing: .08em;
}
.card h3 { margin-top: .5rem; }
.card p { color: var(--ink-soft); font-size: .98rem; }

/* margin-top:auto pins the list to the card floor so the dashed rule lines up
   across a row even when the paragraphs above it differ in length. */
.card-list {
  margin-top: auto; padding-top: 1rem;
  border-top: 1px dashed var(--line);
  display: grid; gap: .4rem;
}
.card-list li {
  position: relative;
  padding-left: 1.15rem;
  font-size: .92rem;
  color: var(--ink-soft);
}
.card-list li::before {
  content: ""; position: absolute; left: 0; top: .62em;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--fairway-lite);
}

/* ---------- Steps (approach) ---------- */
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.6rem;
  counter-reset: step;
}
.step { position: relative; padding-top: 1.6rem; border-top: 2px solid var(--line); }
.step-marker {
  position: absolute; top: -19px; left: 0;
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--fairway); color: #fff;
  font-family: var(--font-serif); font-size: 1rem; font-weight: 700;
  /* ring blends the marker into the section background it sits on */
  box-shadow: 0 0 0 5px var(--bg);
}
.step h3 { margin-top: 1.2rem; }
.step p { color: var(--ink-soft); font-size: .97rem; margin-bottom: 0; }

/* ---------- About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 3.5rem);
  align-items: start;
}
/* The eyebrow is a <p> too, so both rules below have to step around it —
   otherwise :first-of-type lands on the eyebrow instead of the lede paragraph
   and repaints it in body-text size and color. */
.about-grid > div p:not(.eyebrow) { color: var(--ink-soft); }
.about-grid .eyebrow + h2 + p {
  font-size: 1.1rem;
  color: var(--ink);
}

.about-panel {
  /* Drop the panel by exactly the height of the eyebrow line above the h2, so
     its top edge sits level with "A small, trusted team, on purpose". */
  margin-top: calc(.78rem * 1.65 + .7rem);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.6rem 1.5rem;
}
.about-panel h3 { font-size: .82rem; font-family: var(--font-sans);
  letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft); }
.about-panel h3 + * { margin-top: .9rem; }
.about-panel > h3 ~ h3 { margin-top: 1.8rem; }

.check-list { display: grid; gap: .55rem; }
.check-list li {
  position: relative; padding-left: 1.7rem;
  font-size: .97rem; color: var(--ink);
}
.check-list li::before {
  content: ""; position: absolute; left: 0; top: .42em;
  width: 10px; height: 6px;
  border-left: 2px solid var(--fairway-lite); border-bottom: 2px solid var(--fairway-lite);
  transform: rotate(-45deg);
}

.tag-list { display: flex; flex-wrap: wrap; gap: .45rem; }
.tag-list li {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .3rem .8rem;
  font-size: .85rem;
  color: var(--ink-soft);
}

/* The qualifier applies to every tag above it, so it reads as a footnote to the
   list rather than as a sixth pill. */
.tag-note {
  margin: .9rem 0 0;
  font-size: .85rem;
  font-style: italic;
  color: var(--ink-soft);
}

/* ---------- FAQ ---------- */
.faq { display: grid; gap: .7rem; }
.faq details {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.faq details[open] { border-color: var(--fairway-lite); box-shadow: var(--shadow-sm); }

.faq summary {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1.05rem 1.25rem;
  cursor: pointer;
  font-weight: 600;
  color: var(--heading);
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; flex: none;
  width: 10px; height: 10px;
  border-right: 2px solid var(--fairway-lite);
  border-bottom: 2px solid var(--fairway-lite);
  transform: rotate(45deg) translateY(-2px);
  transition: transform .2s ease;
}
.faq details[open] summary::after { transform: rotate(225deg) translateY(-2px); }
.faq summary:hover { background: rgba(255, 255, 255, .04); }

.faq-body { padding: 0 1.25rem 1.15rem; }
.faq-body p { color: var(--ink-soft); margin: 0; font-size: .98rem; }

/* ---------- Contact ---------- */
.contact {
  background:
    radial-gradient(700px 320px at 50% 0%, rgba(74, 168, 126, .16), transparent 65%),
    var(--bg);
  border-top: 1px solid var(--line);
}
.contact-inner { text-align: center; }
.contact-inner .section-lede { margin-inline: auto; }
.contact-actions {
  display: flex; flex-wrap: wrap; justify-content: center; gap: .8rem;
  margin-top: 1.9rem;
}
.contact-note {
  margin-top: 1.8rem;
  font-size: .9rem;
  color: var(--ink-soft);
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--header-bg);
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  padding-block: 2.5rem;
}
.footer-inner {
  display: flex; flex-wrap: wrap; align-items: center;
  justify-content: space-between; gap: 1rem 2rem;
}
.footer-brand {
  font-family: var(--font-serif);
  font-size: 1.05rem; font-weight: 600; color: var(--heading);
  margin: 0;
}
.footer-nav { display: flex; flex-wrap: wrap; gap: .3rem 1.2rem; }
.footer-nav a {
  color: var(--ink-soft);
  text-decoration: none; font-size: .92rem;
}
.footer-nav a:hover { color: var(--heading); text-decoration: underline; }
.footer-legal {
  margin: 0; font-size: .85rem;
  color: #6d7a74;
  flex-basis: 100%;
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .about-grid { grid-template-columns: 1fr; }
  /* Single column — there's no heading beside it to line up with any more. */
  .about-panel { margin-top: 0; }
}

/* Three across gets too narrow to read well before the 700px breakpoint below,
   so the cards stack a step earlier than the rest of the layout. */
@media (max-width: 820px) {
  .cards { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .card-list { margin-top: 1.1rem; }
}

@media (max-width: 760px) {
  .nav-toggle { display: inline-flex; }

  .primary-nav {
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: var(--header-bg);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-md);
    padding: .6rem clamp(1.1rem, 4vw, 2rem) 1.2rem;
    display: none;
  }
  .primary-nav.is-open { display: block; }

  .primary-nav ul { flex-direction: column; align-items: stretch; gap: .1rem; }
  .primary-nav a { padding: .8rem .6rem; font-size: 1rem; }
  .primary-nav .nav-cta {
    margin: .6rem 0 0;
    text-align: center;
    padding: .8rem 1.1rem;
  }

  .footer-inner { flex-direction: column; align-items: flex-start; }
}

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* ---------- Print ----------
   The dark theme would flood a page with ink, so print flips to light. */
@media print {
  .site-header, .nav-toggle, .hero-actions, .contact-actions { display: none !important; }

  body, .hero, .section-alt, .contact, .site-footer {
    background: #fff !important;
    color: #000 !important;
  }
  h1, h2, h3, .footer-brand, .hero-stats dd, .faq summary { color: #000 !important; }
  p, li, .section-lede, .hero .lede { color: #222 !important; }
  .card, .about-panel, .faq details, .tag-list li {
    background: #fff !important;
    border-color: #bbb !important;
    box-shadow: none !important;
  }
  .eyebrow { color: #666 !important; }
  .faq details { break-inside: avoid; }
  .brand-mark { filter: invert(1); }
}
