/* ======================================================
   style.css
   Mobile-first, thumb-friendly, polished + accessible
   Uses tokens from tokens.css (+ transparent / color-mix)
   ====================================================== */

/* =========================
   1. Modern Reset
   ========================= */

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

body,
h1,
h2,
h3,
h4,
h5,
h6,
p,
figure,
blockquote {
  margin: 0;
}

ul[role="list"],
ol[role="list"] {
  padding: 0;
  list-style: none;
}

html:focus-within {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  text-rendering: optimizeSpeed;
}

img,
picture {
  max-width: 100%;
  display: block;
}

input,
button,
textarea,
select {
  font: inherit;
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* =========================
   2. Global Base Styles
   ========================= */

body {
  font-family: var(--font-family-base);
  font-size: var(--text-sm);
  line-height: var(--line-normal);
  color: var(--color-text-main);
  background: var(--color-page-bg);
}

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  cursor: pointer;
}

/* Keyboard focus (visible, consistent) */
:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
  border-radius: var(--radius-soft);
}

/* Skip link */
.skip-link {
  position: absolute;
  left: 0;
  top: 0;
  transform: translateY(-200%);
  background: var(--color-surface);
  color: var(--color-text-main);
  border: 1px solid var(--color-border-strong);
  padding: var(--space-tight) var(--space-cozy);
  border-radius: var(--radius-soft);
  box-shadow: var(--shadow-card);
  z-index: 100;
}

.skip-link:focus-visible {
  transform: translateY(var(--space-tight));
}

/* Optional backup offset for hash targets */
:target {
  scroll-margin-top: var(--space-roomy);
}

/* =========================
   3. Layout: Container & Sections
   ========================= */

.container {
  width: 100%;
  max-width: var(--layout-page-max);
  margin-inline: auto;
  padding-inline: var(--layout-page-padding-x);
}

.container-cta {
  text-align: center;
  justify-items: center;
}

.container-cta .section-title {
  text-align: center;
  justify-items: center;
}

.section {
  padding-block: var(--space-section);
  background: var(--color-section-bg);
}

.section--full {
  min-height: 100vh;
  display: flex;
  align-items: center;
}

.section--muted {
  background: var(--color-surface-muted);
}

.section--accent {
  background: var(--section-accent-bg);
  color: var(--color-text-on-accent);
}

.section+.section {
  border-top: 1px solid var(--color-border-subtle);
}

.section-overline {
  font-size: var(--text-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  font-weight: var(--weight-medium);
  margin-bottom: var(--space-tight);
}

.section-title {
  font-size: var(--text-lg);
  line-height: var(--line-tight);
  font-weight: var(--weight-bold);
  margin: 0 0 var(--space-cozy);
  position: relative;
}

.section-title::after {
  content: "";
  display: block;
  width: 3rem;
  height: 0.25rem;
  border-radius: var(--radius-pill);
  background: var(--color-accent-main);
  margin-top: var(--space-cozy);
}

.section-description {
  max-width: 40rem;
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  margin: 0;
}

.stack-tight>*+* {
  margin-top: var(--space-tight);
}

.stack-cozy>*+* {
  margin-top: var(--space-cozy);
}

.stack-comfy>*+* {
  margin-top: var(--space-comfy);
}

/* simple inline link style for body copy */
.text-link {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.text-link:hover {
  text-decoration-thickness: 2px;
}

/* =========================
   4. Header & Navigation
   ========================= */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--color-section-bg);
  border-bottom: 1px solid var(--color-border-subtle);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(12px);
}

.site-header::after {
  content: "";
  display: block;
  height: 2px;
  background: var(--color-accent-main);
  opacity: 0.9;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: var(--space-cozy);
  gap: var(--gap-comfy);
  position: relative;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: var(--gap-tight);
  min-height: var(--tap-target-min);
}

.brand-logo {
  height: 2.75rem;
  /* ~44px */
  width: auto;
  display: block;
}

.logo-mark {
  display: none;
}

/* legacy placeholder */

.brand-text {
  font-weight: var(--weight-bold);
  font-size: var(--text-sm);
}

.brand-sub {
  display: block;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

/* Mobile call icon (uses your tokens) */
.nav-utils {
  display: inline-flex;
  gap: var(--space-tight); /* tighter spacing between call & menu */
  align-items: center;
}
.nav-call {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--tap-target-min);
  height: var(--tap-target-min);
  border-radius: var(--radius-pill);
  border: 1px solid var(--color-border-subtle);
  background: var(--color-surface);
  color: var(--color-text-main);
  box-shadow: var(--shadow-card);
}

.nav-call svg {
  width: 1.1rem;
  height: 1.1rem;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.nav-call:hover svg {
  transform: translateY(-1px);
  opacity: 0.85;
}

/* Mobile nav toggle */
.nav-toggle {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: var(--tap-target-min);
  height: var(--tap-target-min);
  border-radius: var(--radius-pill);
  border: 1px solid var(--color-border-subtle);
  background: var(--color-surface);
  gap: var(--space-tight);
  padding: 0;
}

.nav-toggle-line {
  width: 1.5rem;
  height: 0.15rem;
  border-radius: var(--radius-pill);
  background: var(--color-text-main);
  transition: transform 0.25s ease, opacity 0.25s ease, background 0.25s ease;
}

body.nav-open .nav-toggle-line:nth-child(1) {
  transform: translateY(0.65rem) rotate(45deg);
}

body.nav-open .nav-toggle-line:nth-child(2) {
  opacity: 0;
}

body.nav-open .nav-toggle-line:nth-child(3) {
  transform: translateY(-0.65rem) rotate(-45deg);
}

/* Mobile dropdown */
.nav-links {
  position: absolute;
  inset-inline: 0;
  top: 100%;
  margin-top: var(--space-tight);
  background: var(--color-surface);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: var(--space-cozy);
  display: flex;
  flex-direction: column;
  gap: var(--gap-tight);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-0.5rem);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.nav-links a {
  display: flex;
  align-items: center;
  min-height: var(--tap-target-min);
  font-size: var(--text-md);
  padding-inline: var(--space-cozy);
  border-radius: var(--radius-soft);
}

/* Mobile: simple background darken on hover (no underline) */
.nav-links a:hover {
  background: color-mix(in srgb, var(--color-surface-muted) 70%, var(--color-surface));
}

/* Open state */
body.nav-open .nav-links {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

/* aria-current styling (works mobile + desktop) */
.nav-links a[aria-current="page"] {
  font-weight: var(--weight-bold);
  background: color-mix(in srgb, var(--color-accent-soft) 35%, var(--color-surface));
}

/* Optional nav CTA */
.nav-cta {
  background: var(--color-accent-main);
  color: var(--color-text-on-accent);
}

.nav-cta:hover {
  background: var(--color-accent-strong);
  color: var(--color-text-main)
}

/* =========================
   5. Hero
   ========================= */

.hero {
  position: relative;
  color: var(--color-text-main);
}

.hero--image {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  z-index: 1;
}

.hero--image::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom,
      color-mix(in srgb, var(--color-text-main) 70%, transparent),
      color-mix(in srgb, var(--color-text-main) 88%, transparent));
}

.hero .container {
  position: relative;
  z-index: 1;
}

.hero-inner {
  width: 100%;
  max-width: 40rem;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-tight);
  padding-inline: var(--space-cozy);
  padding-block: calc(var(--space-tight) / 2);
  border-radius: var(--radius-pill);
  background: var(--color-accent-main);
  color: var(--color-text-on-accent);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
}

.hero-title {
  margin-top: var(--space-comfy);
  margin-bottom: var(--space-cozy);
  font-size: var(--text-xl);
  line-height: var(--line-tight);
  font-weight: var(--weight-bold);
  color: var(--color-text-on-accent);
}

.hero-title-highlight {
  display: inline-block;
  color: var(--color-accent-soft);
}

.hero-subtitle {
  margin: 0 0 var(--space-comfy);
  color: var(--color-text-on-accent);
  font-size: var(--text-sm);
  max-width: 32rem;
}

.hero-actions {
  display: flex;
  flex-direction: column;
  gap: var(--gap-comfy);
}

/* =========================
   6. Buttons
   ========================= */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-tight);
  padding: var(--button-padding-y) var(--button-padding-x);
  min-height: var(--tap-target-min);
  border-radius: var(--button-radius);
  border: 1px solid transparent;
  font-size: var(--button-font-size);
  font-weight: var(--weight-medium);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}

.button--primary {
  background: var(--color-accent-main);
  color: var(--color-text-on-accent);
}

.button--primary:hover {
  background: var(--color-accent-strong);
  transform: translateY(-2px);
  box-shadow: var(--shadow-soft);
}

.button--ghost {
  background: var(--color-surface);
  color: var(--color-text-main);
  border-color: var(--color-border-subtle);
}

.button--ghost:hover {
  border-color: var(--color-border-strong);
  transform: translateY(-2px);
  box-shadow: var(--shadow-soft);
}

.button:active {
  transform: translateY(0);
  box-shadow: var(--shadow-card);
}

/* =========================
   7. Grids & Cards
   ========================= */

.grid {
  display: grid;
  gap: var(--gap-comfy);
}

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

.card {
  background: var(--color-surface);
  border-radius: var(--radius-card);
  padding: var(--space-comfy);
  border: 1px solid var(--color-border-subtle);
  box-shadow: var(--shadow-card);
  transition: box-shadow 0.25s ease, transform 0.25s ease, border-color 0.25s ease;
}

.card:hover {
  border-color: var(--color-border-strong);
  box-shadow: var(--shadow-soft);
  transform: translateY(-4px);
}

.card-title {
  font-size: var(--text-md);
  font-weight: var(--weight-bold);
  margin: 0 0 var(--space-tight);
}

.card-body {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin: 0;
}

.card-meta {
  margin-top: var(--space-cozy);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

/* =========================
   8. Forms
   ========================= */

.field {
  display: flex;
  flex-direction: column;
  gap: var(--space-tight);
}

.field-label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.field-input,
.field-textarea {
  padding: var(--field-padding-y) var(--field-padding-x);
  border-radius: var(--field-radius);
  border: 1px solid var(--color-border-subtle);
  background: var(--color-surface);
  font-size: var(--field-font-size);
}

form .button {
  width: 100%;
}

.field-input:focus,
.field-textarea:focus {
  outline: none;
  box-shadow: var(--shadow-focus);
}

/* =========================
   9. Accent Section Contrast Fixes
   ========================= */

.section--accent .section-overline,
.section--accent .section-title,
.section--accent .section-description {
  color: var(--color-text-on-accent);
}

.section--accent .card {
  background: var(--color-surface);
  color: var(--color-text-main);
  box-shadow: var(--shadow-card);
  border-color: var(--color-border-strong);
}

.section--accent .card-title,
.section--accent .card-body,
.section--accent .card-meta {
  color: var(--color-text-main);
}

.section--accent .card-meta {
  color: var(--color-text-muted);
}

.section-cta {
  margin-top: var(--space-comfy);
  display: flex;
  justify-content: center;
}

.site-footer {
  background: var(--color-section-bg);
  border-top: 1px solid var(--color-border-subtle);
  padding-block: var(--space-comfy);
  color: var(--color-text-muted);
  font-size: var(--text-xs);
}

/* MOBILE-FIRST: 2 columns using grid areas */
.site-footer .footer-inner {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: var(--space-comfy);
  align-items: start;

  grid-template-areas:
    "brand   links"
    "contact links"
    "bottom  bottom";
}

/* Place each block */
.site-footer .footer-brand {
  grid-area: brand;
  display: flex;
  align-items: center;
  gap: var(--gap-tight);
}

.site-footer .footer-links {
  grid-area: links;
  display: grid;
  gap: var(--space-tight);
  justify-items: end;
  text-align: right;
}

.site-footer .footer-contact {
  grid-area: contact;
  line-height: 1.6;
}

.site-footer .footer-bottom {
  grid-area: bottom;
  text-align: center;
  margin-top: var(--space-section-lg);
}

/* Typography */
.site-footer .footer-name {
  font-weight: var(--weight-bold);
  color: var(--color-text-main);
}

.site-footer .footer-sub {
  color: var(--color-text-muted);
  font-size: var(--text-xs);
}

.site-footer .footer-links a {
  color: var(--color-text-main);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.site-footer .footer-links a[aria-current="page"] {
  font-weight: var(--weight-bold);
}

.site-footer .footer-contact strong {
  font-weight: var(--weight-medium);
}

.site-footer .footer-contact .text-link {
  color: var(--color-text-main);
}

.site-footer .footer-meta {
  opacity: 0.75;
  margin-top: var(--space-tight);
}

/* =========================
   11. Responsive Enhancements
   ========================= */

@media (min-width: 48rem) {
  .section {
    padding-block: var(--space-section-lg);
  }

  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }

  .section-title {
    font-size: calc(var(--text-lg) + 0.125rem);
  }

  .section-description {
    font-size: var(--text-md);
    line-height: var(--line-relaxed);
  }

  .hero-title {
    font-size: var(--text-hero);
  }

  .hero-actions {
    flex-direction: row;
  }

  /* Desktop nav */
  .nav-call {
    display: none;
  }

  .nav-toggle {
    display: none;
  }

  .nav-links {
    position: static;
    margin-top: 0;
    padding: 0;
    border: none;
    border-radius: 0;
    box-shadow: none;
    display: flex;
    flex-direction: row;
    gap: var(--gap-comfy);
    opacity: 1;
    pointer-events: auto;
    transform: none;
    align-items: center;
    background: transparent;
  }

  .nav-links a {
    min-height: auto;
    font-size: var(--text-sm);
    padding-inline: 0;
    border-radius: 0;
    background: transparent;
    position: relative;
  }

  /* Desktop hover underline accent */
  .nav-links a::after {
    content: "";
    position: absolute;
    bottom: -0.15rem;
    left: 0;
    height: 2px;
    width: 0%;
    background: var(--color-accent-main);
    border-radius: var(--radius-pill);
    transition: width 0.25s ease;
  }

  .nav-links a:hover::after {
    width: 100%;
  }

  /* Desktop current-page underline */
  .nav-links a[aria-current="page"]::after {
    width: 100%;
  }

  /* Nav CTA on desktop should look like a button */
  .nav-links .nav-cta {
    padding-inline: var(--space-cozy);
    border-radius: var(--radius-soft);
    min-height: var(--tap-target-min);
  }

  .nav-links .nav-cta::after {
    display: none;
  }

  /* Footer: clean 3-column desktop layout */
  .site-footer .footer-inner {
    grid-template-columns: 1.5fr 1fr 1.5fr;
    column-gap: var(--space-section);
    grid-template-areas:
      "brand links contact"
      "bottom bottom bottom";
  }

  .site-footer .footer-links {
    justify-items: center;
    justify-content: center;
    text-align: left;
    display: flex;
    flex-wrap: wrap;
    gap: var(--gap-tight);
  }

  .site-footer .footer-contact {
    text-align: right;
    justify-self: end;
  }

  .site-footer .footer-bottom {
    margin-top: var(--space-section-lg);
  }
}