/* ==========================================================================
   ForAI — Financial Accounting
   Light, warm, pricing-forward. Keeps the product-grade typographic craft:
   Inter variable at 510/590, negative tracking at every size, hairline rules.
   ========================================================================== */

/* --- Tokens ------------------------------------------------------------- */

:root {
  /* Canvas & surfaces */
  --bg: #fdfcfa;
  --bg-warm: #f5f2ec;
  --surface: #ffffff;
  --surface-sunk: #f7f5f1;

  /* Hairlines */
  --line: rgba(25, 24, 21, 0.1);
  --line-strong: rgba(25, 24, 21, 0.18);

  /* Text — all verified >= 4.5:1 on --bg */
  --text: #191815;
  --text-mid: #4d4a44; /* 8.6:1 */
  --text-dim: #6e6a62; /* 5.3:1 */

  /* Accent — ledger green, carried across every variant */
  --accent: #14684a; /* 6.6:1 on --bg, safe for text */
  --accent-deep: #0d5039;
  --accent-soft: #e9f2ee;
  --accent-line: rgba(20, 104, 74, 0.24);

  --warn-soft: #fdf3e7;
  --warn-ink: #8a5a1a;

  /* Type */
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Display",
    "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --track-display: -0.022em;
  --track-heading: -0.015em;
  --track-body: -0.011em;

  /* Shape */
  --r-sm: 6px;
  --r: 8px;
  --r-lg: 12px;
  --r-xl: 18px;
  --pill: 9999px;

  /* Elevation — soft and warm, never grey */
  --shadow-sm: 0 1px 2px rgba(25, 24, 21, 0.04),
    0 1px 3px rgba(25, 24, 21, 0.03);
  --shadow: 0 4px 12px -2px rgba(25, 24, 21, 0.07),
    0 2px 4px -1px rgba(25, 24, 21, 0.04);
  --shadow-lg: 0 18px 40px -12px rgba(25, 24, 21, 0.14),
    0 4px 10px -3px rgba(25, 24, 21, 0.05);

  /* Rhythm */
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --measure: 1140px;
  --section-y: clamp(4rem, 8vw, 7rem);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* --- Reset -------------------------------------------------------------- */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 0.9375rem;
  line-height: 1.6;
  letter-spacing: var(--track-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
}

button,
input,
textarea,
select {
  font: inherit;
  letter-spacing: inherit;
  color: inherit;
}

h1,
h2,
h3,
h4,
p,
figure,
fieldset {
  margin: 0;
}

fieldset {
  border: 0;
  padding: 0;
  min-width: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

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

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 999;
  background: var(--text);
  color: var(--bg);
  padding: 0.7rem 1.2rem;
  border-radius: var(--r);
  text-decoration: none;
  font-weight: 510;
}

.skip-link:focus {
  left: 0.5rem;
  top: 0.5rem;
}

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

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

.wrap {
  width: 100%;
  max-width: var(--measure);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  padding-block: var(--section-y);
}

.section--tight {
  padding-block: clamp(3rem, 5.5vw, 4.5rem);
}

.section--warm {
  background: var(--bg-warm);
  border-block: 1px solid var(--line);
}

/* --- Type ---------------------------------------------------------------- */

.display {
  font-weight: 510;
  letter-spacing: var(--track-display);
  line-height: 1.04;
  text-wrap: balance;
}

.display--xl {
  font-size: clamp(2.4rem, 5.4vw, 3.85rem);
}

.display--lg {
  font-size: clamp(1.9rem, 3.6vw, 2.85rem);
  line-height: 1.07;
}

.display--md {
  font-size: clamp(1.45rem, 2.3vw, 1.9rem);
  line-height: 1.14;
  letter-spacing: var(--track-heading);
}

.display .muted {
  color: var(--text-dim);
}

.display .accent {
  color: var(--accent);
}

.lede {
  font-size: clamp(1rem, 1.2vw, 1.125rem);
  line-height: 1.6;
  color: var(--text-mid);
  max-width: 54ch;
  text-wrap: pretty;
}

.body-copy {
  color: var(--text-mid);
  max-width: 62ch;
  text-wrap: pretty;
}

.body-copy + .body-copy {
  margin-top: 1rem;
}

.body-copy strong {
  color: var(--text);
  font-weight: 590;
}

.label {
  font-size: 0.75rem;
  font-weight: 590;
  letter-spacing: 0.02em;
  color: var(--accent);
  text-transform: uppercase;
}

/* --- Chip ---------------------------------------------------------------- */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.8rem 0.35rem 0.6rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--pill);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  font-size: 0.75rem;
  font-weight: 510;
  color: var(--text-mid);
  letter-spacing: 0;
  text-decoration: none;
}

.chip__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  flex: none;
  box-shadow: 0 0 0 3px var(--accent-soft);
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  height: 2.875rem;
  padding-inline: 1.25rem;
  border-radius: var(--pill);
  border: 1px solid transparent;
  font-size: 0.9375rem;
  font-weight: 510;
  letter-spacing: 0;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.22s var(--ease), border-color 0.22s var(--ease),
    color 0.22s var(--ease), box-shadow 0.22s var(--ease),
    transform 0.22s var(--ease);
}

.btn--primary {
  background: var(--text);
  color: #fff;
  border-color: var(--text);
  box-shadow: var(--shadow-sm);
}

.btn--primary:hover {
  background: #000;
  border-color: #000;
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.btn--accent {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: var(--shadow-sm);
}

.btn--accent:hover {
  background: var(--accent-deep);
  border-color: var(--accent-deep);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.btn--ghost {
  background: var(--surface);
  color: var(--text);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-sm);
}

.btn--ghost:hover {
  border-color: var(--text-dim);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.btn--sm {
  height: 2.25rem;
  padding-inline: 0.95rem;
  font-size: 0.875rem;
}

.btn--block {
  width: 100%;
}

.btn .arrow {
  transition: transform 0.22s var(--ease);
}

.btn:hover .arrow {
  transform: translateX(3px);
}

.btn[disabled] {
  opacity: 0.5;
  cursor: default;
  transform: none;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.link-quiet {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--accent);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 510;
  letter-spacing: 0;
}

.link-quiet:hover {
  color: var(--accent-deep);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* --- Header -------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(253, 252, 250, 0.8);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease);
}

.site-header.is-stuck {
  border-bottom-color: var(--line);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: 4rem;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 590;
  letter-spacing: var(--track-heading);
  color: var(--text);
}

.wordmark__mark {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: var(--r-sm);
  background: linear-gradient(140deg, var(--accent), var(--accent-deep));
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  flex: none;
}

.wordmark__sub {
  color: var(--text-dim);
  font-weight: 400;
  border-left: 1px solid var(--line-strong);
  padding-left: 0.6rem;
}

.nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav a {
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--text-mid);
  padding: 0.45rem 0.7rem;
  border-radius: var(--r-sm);
  transition: color 0.2s var(--ease), background 0.2s var(--ease);
}

.nav a:hover {
  color: var(--text);
  background: var(--surface-sunk);
}

.nav a[aria-current="page"] {
  color: var(--text);
}

/* `.nav a` out-specifies `.btn`; restate button colours in nav context. */
.nav a.btn--primary,
.nav a.btn--primary:hover {
  color: #fff;
  background: var(--text);
}

.nav a.btn--primary:hover {
  background: #000;
}

.nav-toggle {
  display: none;
  align-items: center;
  height: 2.75rem;
  padding-inline: 0.95rem;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--pill);
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 510;
  cursor: pointer;
}

/* --- Hero ---------------------------------------------------------------- */

.hero {
  position: relative;
  padding-top: clamp(3rem, 7vw, 5.5rem);
  padding-bottom: clamp(2.5rem, 5vw, 4rem);
  overflow: hidden;
  isolation: isolate;
}

.hero::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: -35%;
  left: 50%;
  width: min(1000px, 125%);
  aspect-ratio: 1.7 / 1;
  transform: translateX(-50%);
  background: radial-gradient(
    ellipse at 50% 50%,
    rgba(20, 104, 74, 0.07),
    rgba(20, 104, 74, 0.02) 45%,
    transparent 70%
  );
  pointer-events: none;
}

.hero__title {
  margin-top: 1.5rem;
  max-width: 17ch;
}

.hero__lede {
  margin-top: 1.25rem;
}

.hero__actions {
  margin-top: 1.85rem;
}

.hero__reassure {
  margin-top: 1rem;
  font-size: 0.8125rem;
  color: var(--text-dim);
}

/* --- Section head -------------------------------------------------------- */

.section-head {
  max-width: 42rem;
  margin-bottom: clamp(2rem, 4vw, 3rem);
}

.section-head .display,
.section-head .lede {
  margin-top: 0.9rem;
}

.section-head--center {
  margin-inline: auto;
  text-align: center;
}

.section-head--center .lede {
  margin-inline: auto;
}

/* --- Services tiles ------------------------------------------------------ */

.svc-block + .svc-block {
  margin-top: clamp(2.25rem, 4.5vw, 3.25rem);
}

.svc-block__label {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  font-size: 0.75rem;
  font-weight: 590;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 1rem;
}

/* Rule fills the space to the right of the group name. */
.svc-block__label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.svc-tiles {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.svc-tile {
  padding: clamp(1.1rem, 2vw, 1.4rem);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.25s var(--ease), transform 0.25s var(--ease),
    border-color 0.25s var(--ease);
}

.svc-tile:hover {
  box-shadow: var(--shadow);
  border-color: var(--line-strong);
  transform: translateY(-2px);
}

.svc-tile h4 {
  font-size: 1rem;
  font-weight: 590;
  letter-spacing: var(--track-heading);
  line-height: 1.25;
  color: var(--text);
  text-wrap: balance;
}

/* The problem the service solves, in the client's words. */
.svc-tile p {
  margin-top: 0.6rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--line);
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--text-mid);
  text-wrap: pretty;
}

/* Rule spans the full column width; the text stays at a readable measure. */
.svc-note {
  margin-top: clamp(2rem, 4vw, 3rem);
  padding-top: 1.35rem;
  border-top: 1px solid var(--line);
}

.svc-note p {
  font-size: 0.9375rem;
  color: var(--text-mid);
  max-width: 68ch;
  text-wrap: pretty;
}

/* --- Pricing ------------------------------------------------------------- */

.pricing {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  align-items: start;
}

.tier {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: clamp(1.4rem, 2.6vw, 1.9rem);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  height: 100%;
}

.tier--featured {
  border-color: var(--accent-line);
  box-shadow: var(--shadow-lg);
}

.tier__flag {
  position: absolute;
  top: -0.7rem;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.2rem 0.7rem;
  border-radius: var(--pill);
  background: var(--accent);
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 590;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.tier__name {
  font-size: 1rem;
  font-weight: 590;
  letter-spacing: var(--track-heading);
}

.tier__for {
  margin-top: 0.3rem;
  font-size: 0.875rem;
  color: var(--text-dim);
}

.tier__price {
  margin-top: 1.1rem;
  font-size: 2.35rem;
  font-weight: 510;
  letter-spacing: var(--track-display);
  line-height: 1;
}

.tier__price span {
  font-size: 0.9375rem;
  font-weight: 400;
  color: var(--text-dim);
  letter-spacing: var(--track-body);
}

.tier__list {
  margin-top: 1.35rem;
  padding-top: 1.35rem;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 0.65rem;
  font-size: 0.9375rem;
  color: var(--text-mid);
  flex: 1;
}

.tier__list li {
  display: grid;
  grid-template-columns: 1rem minmax(0, 1fr);
  gap: 0.6rem;
  align-items: start;
}

.tier__tick {
  color: var(--accent);
  font-size: 0.8125rem;
  line-height: 1.5;
}

.tier .btn {
  margin-top: 1.5rem;
}

.pricing-note {
  margin-top: 1.25rem;
  font-size: 0.875rem;
  color: var(--text-dim);
  text-align: center;
}

/* --- Split --------------------------------------------------------------- */

.split {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}

/* --- CTA panel ----------------------------------------------------------- */

.cta-panel {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  padding: clamp(2rem, 4.5vw, 3.5rem);
  text-align: center;
  overflow: hidden;
  isolation: isolate;
}

.cta-panel::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: auto 0 -60% 0;
  height: 140%;
  background: radial-gradient(
    ellipse at 50% 100%,
    rgba(20, 104, 74, 0.09),
    transparent 65%
  );
  pointer-events: none;
}

.cta-panel .lede {
  margin: 1rem auto 0;
}

.cta-panel .actions {
  margin-top: 1.85rem;
  justify-content: center;
}

.cta-fine {
  margin-top: 1.5rem;
  font-size: 0.875rem;
  color: var(--text-mid);
  text-wrap: pretty;
}

.cta-fine a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 510;
}

.cta-fine a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

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

.site-footer {
  border-top: 1px solid var(--line);
  padding-block: clamp(2.5rem, 5vw, 3.5rem) 1.75rem;
  font-size: 0.9375rem;
}

.footer__top {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) repeat(2, minmax(0, 1fr));
  gap: 2rem;
  padding-bottom: clamp(2rem, 4vw, 2.75rem);
}

.footer__blurb {
  color: var(--text-mid);
  max-width: 34ch;
  margin-top: 0.9rem;
}

.footer h4 {
  font-size: 0.8125rem;
  font-weight: 590;
  letter-spacing: var(--track-heading);
  margin: 0 0 0.9rem;
}

.footer-list li + li {
  margin-top: 0.55rem;
}

.footer-list a {
  text-decoration: none;
  color: var(--text-mid);
  transition: color 0.2s var(--ease);
}

.footer-list a:hover {
  color: var(--accent);
}

.footer__bottom {
  border-top: 1px solid var(--line);
  padding-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
  color: var(--text-dim);
  font-size: 0.8125rem;
}

/* --- Reveal -------------------------------------------------------------- */

.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

.reveal.is-in {
  opacity: 1;
  transform: none;
}

.reveal[data-delay="1"] {
  transition-delay: 0.06s;
}
.reveal[data-delay="2"] {
  transition-delay: 0.12s;
}
.reveal[data-delay="3"] {
  transition-delay: 0.18s;
}

/* --- Responsive ---------------------------------------------------------- */

@media (max-width: 940px) {
  .pricing {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tier--featured {
    grid-column: span 2;
  }

  .split {
    grid-template-columns: 1fr;
  }

  .svc-tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .footer__top {
    grid-template-columns: 1fr 1fr;
  }

  .footer__brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 720px) {
  .pricing,
  .svc-tiles {
    grid-template-columns: 1fr;
  }

  .tier--featured {
    grid-column: span 1;
  }

  .wordmark__sub {
    display: none;
  }

  .nav {
    position: fixed;
    inset: 4rem 0 auto;
    flex-direction: column;
    align-items: stretch;
    gap: 0.15rem;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-lg);
    padding: 0.75rem var(--gutter) 1.25rem;
    transform: translateY(-130%);
    transition: transform 0.4s var(--ease);
  }

  .nav.is-open {
    transform: none;
  }

  .nav a {
    padding: 0.75rem 0.5rem;
    font-size: 1rem;
    color: var(--text);
  }

  .nav a.btn {
    margin-top: 0.75rem;
    height: 2.75rem; /* override .btn--sm so the tap target stays 44px */
  }

  .nav-toggle {
    display: inline-flex;
  }

  .actions .btn {
    width: 100%;
  }
}

/* --- Motion preferences -------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
