/* ============================================================
   AVERLINE CORPORATION — design system
   Ink-navy base, warm copper accent. Cabinet Grotesk + Satoshi.
   ============================================================ */

:root {
  /* Type scale */
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1rem + 0.75vw, 1.5rem);
  --text-xl: clamp(1.5rem, 1.2rem + 1.25vw, 2.25rem);
  --text-2xl: clamp(2rem, 1.2rem + 2.5vw, 3.5rem);
  --text-3xl: clamp(2.5rem, 1.4rem + 3.4vw, 4.5rem);

  /* Spacing */
  --space-1: 0.25rem; --space-2: 0.5rem; --space-3: 0.75rem; --space-4: 1rem;
  --space-5: 1.25rem; --space-6: 1.5rem; --space-8: 2rem; --space-10: 2.5rem;
  --space-12: 3rem; --space-16: 4rem; --space-20: 5rem; --space-24: 6rem; --space-32: 8rem;

  --radius-sm: 3px;
  --radius-md: 6px;
  --radius-lg: 10px;

  --font-display: 'Cabinet Grotesk', 'Satoshi', 'Helvetica Neue', sans-serif;
  --font-body: 'Satoshi', 'Inter', system-ui, sans-serif;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --maxw: 1220px;
  --gutter: clamp(1.25rem, 5vw, 4rem);
  --section-pad: clamp(4rem, 9vw, 8rem);
}

/* ---------- Light (default) ---------- */
:root, [data-theme='light'] {
  --color-bg: #f6f4f0;
  --color-surface: #fbfaf8;
  --color-surface-2: #ecE8e1;
  --color-ink: #101822;
  --color-ink-soft: #1c2634;
  --color-text: #1b2430;
  --color-text-muted: #5c6675;
  --color-text-faint: #8d95a1;
  --color-text-inverse: #f6f4f0;
  --color-border: #d9d4cb;
  --color-divider: #e4dfd7;
  --color-accent: #b4601f;
  --color-accent-hover: #944c14;
  --color-accent-soft: rgba(180, 96, 31, 0.1);
  --color-on-accent: #fdf8f3;
  --shadow-sm: 0 1px 2px rgba(16, 24, 34, 0.06), 0 2px 8px rgba(16, 24, 34, 0.04);
  --shadow-md: 0 8px 30px rgba(16, 24, 34, 0.10);
}

/* ---------- Dark ---------- */
[data-theme='dark'] {
  --color-bg: #0d141d;
  --color-surface: #131c27;
  --color-surface-2: #1a2531;
  --color-ink: #080d14;
  --color-ink-soft: #101822;
  --color-text: #e6e9ee;
  --color-text-muted: #99a3b1;
  --color-text-faint: #6d7684;
  --color-text-inverse: #0d141d;
  --color-border: #2a3644;
  --color-divider: #212c39;
  --color-accent: #e0873c;
  --color-accent-hover: #f0a05b;
  --color-accent-soft: rgba(224, 135, 60, 0.14);
  --color-on-accent: #14181f;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 10px 34px rgba(0, 0, 0, 0.45);
}

body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.62;
  transition: background-color .3s var(--ease), color .3s var(--ease);
}

/* ---------- Type ---------- */
h1, h2, h3 { font-family: var(--font-display); line-height: 1.03; letter-spacing: -0.025em; font-weight: 800; color: var(--color-ink); }
[data-theme='dark'] h1, [data-theme='dark'] h2, [data-theme='dark'] h3 { color: var(--color-text); }
h1 { font-size: var(--text-2xl); }
h2 { font-size: var(--text-xl); }
h3 { font-family: var(--font-body); font-size: var(--text-lg); font-weight: 700; line-height: 1.25; letter-spacing: -0.01em; }
.display { font-size: var(--text-3xl); line-height: 0.98; }
.lede { font-size: var(--text-lg); line-height: 1.45; color: var(--color-text-muted); font-weight: 400; max-width: 46ch; }
.prose p { max-width: 68ch; margin-bottom: var(--space-5); color: var(--color-text-muted); }
.prose p strong { color: var(--color-text); font-weight: 600; }

.eyebrow {
  font-size: var(--text-xs); font-weight: 700; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--color-accent);
  display: flex; align-items: center; gap: var(--space-3); margin-bottom: var(--space-5);
}
.eyebrow::before { content: ''; width: 28px; height: 2px; background: var(--color-accent); flex: none; }
.eyebrow--plain::before { display: none; }

/* ---------- Layout ---------- */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: var(--section-pad); }
.section--tight { padding-block: clamp(2.5rem, 6vw, 5rem); }
.section--ink { background: var(--color-ink); color: #cdd4de; }
.section--ink h2, .section--ink h3 { color: #fff; }
.section--surface { background: var(--color-surface-2); }
.grid { display: grid; gap: var(--space-8); }
.split { display: grid; gap: clamp(2.5rem, 7vw, 3.5rem); }
@media (min-width: 860px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); gap: clamp(2rem, 5vw, 5rem); }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .split { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: clamp(2.5rem, 6vw, 6rem); align-items: start; }
  .split--rev > *:first-child { order: 2; }
}
@media (min-width: 620px) and (max-width: 859px) { .grid-3 { grid-template-columns: repeat(2, 1fr); } }
.stack-6 > * + * { margin-top: var(--space-6); }
.stack-4 > * + * { margin-top: var(--space-4); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  padding: 0.95rem var(--space-6); min-height: 48px;
  font-size: var(--text-sm); font-weight: 700; letter-spacing: 0.01em;
  border-radius: var(--radius-sm); border: 1.5px solid transparent;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color .22s var(--ease), color .22s var(--ease), border-color .22s var(--ease), transform .22s var(--ease);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn--primary { background: var(--color-accent); color: var(--color-on-accent); }
.btn--primary:hover { background: var(--color-accent-hover); }
.btn--ghost { border-color: var(--color-border); color: var(--color-text); background: transparent; }
.btn--ghost:hover { border-color: var(--color-accent); color: var(--color-accent); }
.btn--onink { border-color: rgba(255,255,255,0.28); color: #fff; }
.btn--onink:hover { border-color: var(--color-accent); color: var(--color-accent); }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--space-3); }

.textlink {
  display: inline-flex; align-items: center; gap: var(--space-2);
  font-weight: 700; font-size: var(--text-sm); color: var(--color-accent);
  text-decoration: none; border-bottom: 1.5px solid var(--color-accent-soft);
  padding-bottom: 2px; transition: border-color .2s var(--ease), gap .2s var(--ease);
}
.textlink:hover { border-color: var(--color-accent); gap: var(--space-3); }

/* ---------- Header ---------- */
.header {
  position: sticky; top: 0; z-index: 60;
  background: color-mix(in srgb, var(--color-bg) 88%, transparent);
  backdrop-filter: blur(14px) saturate(1.3);
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease), box-shadow .3s var(--ease), background-color .3s var(--ease);
}
.header--scrolled { border-bottom-color: var(--color-divider); box-shadow: var(--shadow-sm); }
.header__inner { display: flex; align-items: center; justify-content: space-between; gap: var(--space-6); min-height: 74px; }
.brand { display: inline-flex; align-items: center; gap: var(--space-3); text-decoration: none; flex: none; }
.brand__mark { width: 34px; height: 34px; color: var(--color-accent); flex: none; }
.brand__type { display: flex; flex-direction: column; line-height: 1; }
.brand__name { font-family: var(--font-display); font-weight: 800; font-size: 1.14rem; letter-spacing: 0.005em; color: var(--color-ink); }
[data-theme='dark'] .brand__name { color: var(--color-text); }
.brand__sub { font-size: 0.625rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--color-text-faint); margin-top: 4px; font-weight: 600; }

.nav { display: none; align-items: center; gap: clamp(0.9rem, 1.6vw, 1.6rem); }
.nav a {
  font-size: var(--text-sm); font-weight: 600; text-decoration: none; color: var(--color-text-muted);
  padding-block: var(--space-2); position: relative; white-space: nowrap;
  transition: color .2s var(--ease);
}
.nav a:hover { color: var(--color-text); }
.nav a[aria-current='page'] { color: var(--color-text); }
.nav a[aria-current='page']::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px; background: var(--color-accent);
}
.header__actions { display: flex; align-items: center; gap: var(--space-2); }
.header .btn { padding: 0.65rem var(--space-5); min-height: 44px; }
.header__cta { display: none; }

.icon-btn {
  width: 42px; height: 42px; display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 1px solid var(--color-border); border-radius: var(--radius-sm);
  cursor: pointer; color: var(--color-text-muted); transition: color .2s var(--ease), border-color .2s var(--ease);
}
.icon-btn:hover { color: var(--color-accent); border-color: var(--color-accent); }
.icon-btn svg { width: 18px; height: 18px; }
[data-theme='dark'] .icon-sun { display: none; }
:root:not([data-theme='dark']) .icon-moon { display: none; }

@media (max-width: 400px) {
  .header__inner { gap: var(--space-3); }
  .brand { gap: var(--space-2); }
  .brand__mark { width: 28px; height: 28px; }
  .brand__name { font-size: 1rem; }
  .brand__sub { font-size: 0.5625rem; letter-spacing: 0.14em; }
  .icon-btn { width: 38px; height: 38px; }
}

@media (min-width: 1024px) {
  .nav { display: flex; }
  .header__cta { display: inline-flex; }
  .menu-btn { display: none; }
}

/* Mobile menu */
.mobile-menu {
  display: block; border-top: 1px solid var(--color-divider); background: var(--color-surface);
  overflow: hidden; max-height: 0; transition: max-height .38s var(--ease);
}
.mobile-menu[data-open='true'] { max-height: 460px; }
.mobile-menu__inner { padding: var(--space-4) var(--gutter) var(--space-8); display: flex; flex-direction: column; }
.mobile-menu a {
  font-family: var(--font-display); font-size: 1.3rem; font-weight: 700; letter-spacing: -0.02em;
  text-decoration: none; padding: var(--space-3) 0; border-bottom: 1px solid var(--color-divider); color: var(--color-text);
}
.mobile-menu .btn { margin-top: var(--space-6); }
@media (min-width: 1024px) { .mobile-menu { display: none; } }

/* ---------- Hero ---------- */
.hero { position: relative; background: var(--color-ink); color: #dde2ea; overflow: hidden; }
.hero__media { position: absolute; inset: 0; }
.hero__media img { width: 100%; height: 100%; object-fit: cover; opacity: 0.42; }
.hero__media::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(100deg, var(--color-ink) 14%, rgba(16,24,34,0.86) 46%, rgba(16,24,34,0.45) 100%);
}
.hero__inner { position: relative; z-index: 2; padding-block: clamp(5rem, 13vw, 10rem); max-width: 44rem; }
.hero h1 { color: #fff; }
.hero .lede { color: #b9c2ce; max-width: 40ch; }
.hero__eyebrow { color: var(--color-accent); }
.hero--page .hero__inner { padding-block: clamp(4rem, 9vw, 7rem); }

/* ---------- Stat counters ---------- */
.stats { border-top: 1px solid rgba(255,255,255,0.1); position: relative; z-index: 2; }
.stats__grid { display: grid; gap: 0; grid-template-columns: 1fr; }
@media (min-width: 760px) { .stats__grid { grid-template-columns: repeat(3, 1fr); } }
.stat { padding: clamp(1.75rem, 4vw, 2.75rem) 0; }
@media (min-width: 760px) {
  .stat { padding-inline: clamp(1rem, 3vw, 2.5rem); border-left: 1px solid rgba(255,255,255,0.1); }
  .stat:first-child { padding-left: 0; border-left: 0; }
}
@media (max-width: 759px) { .stat + .stat { border-top: 1px solid rgba(255,255,255,0.1); } }
.stat__num {
  font-family: var(--font-display); font-weight: 800; font-size: clamp(2.75rem, 7vw, 4.25rem);
  line-height: 1; color: #fff; letter-spacing: -0.035em; font-variant-numeric: tabular-nums;
  display: flex; align-items: baseline;
}
.stat__suffix { color: var(--color-accent); }
.stat__label { margin-top: var(--space-3); font-size: var(--text-sm); font-weight: 600; color: #fff; }
.stat__note { margin-top: var(--space-1); font-size: var(--text-xs); color: #8d97a5; max-width: 30ch; }

/* ---------- Cards ---------- */
.card {
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-md); padding: clamp(1.5rem, 3vw, 2.25rem);
  transition: border-color .25s var(--ease), transform .25s var(--ease), box-shadow .25s var(--ease);
}
.card:hover { border-color: color-mix(in srgb, var(--color-accent) 55%, var(--color-border)); transform: translateY(-3px); box-shadow: var(--shadow-md); }
.card__num { font-family: var(--font-display); font-size: var(--text-xs); font-weight: 800; letter-spacing: 0.14em; color: var(--color-accent); margin-bottom: var(--space-4); }
.card h3 { margin-bottom: var(--space-3); }
.card p { color: var(--color-text-muted); font-size: var(--text-sm); }
.card--flat:hover { transform: none; box-shadow: none; }

.tile-list { display: grid; gap: var(--space-3); }
.tile {
  display: flex; align-items: flex-start; gap: var(--space-4);
  padding: var(--space-5); border: 1px solid var(--color-border); border-radius: var(--radius-md);
  background: var(--color-surface);
}
.tile__idx { font-family: var(--font-display); font-weight: 800; color: var(--color-accent); font-size: var(--text-sm); flex: none; min-width: 2ch; }
.tile h3 { font-size: var(--text-base); margin-bottom: var(--space-1); }
.tile p { font-size: var(--text-sm); color: var(--color-text-muted); }

/* Checklist */
.checks { display: grid; gap: var(--space-3); }
.checks li { position: relative; padding-left: var(--space-6); font-size: var(--text-sm); color: var(--color-text-muted); line-height: 1.6; }
.checks li::before {
  content: ''; position: absolute; left: 0; top: 0.62em; width: 8px; height: 8px;
  background: var(--color-accent); border-radius: 1px; transform: rotate(45deg);
}
.checks li strong { display: inline; }
.section--ink .checks li { color: #b6bfcb; }

/* Media blocks */
.media { border-radius: var(--radius-md); overflow: hidden; background: var(--color-surface-2); }
.media img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 4 / 3; }
.media--tall img { aspect-ratio: 3 / 4; }
.media--wide img { aspect-ratio: 16 / 9; }
.fullbleed { width: 100%; }
.fullbleed img { width: 100%; height: clamp(240px, 40vw, 460px); object-fit: cover; }
figcaption { font-size: var(--text-xs); color: var(--color-text-faint); margin-top: var(--space-3); }

/* Quote */
.quote { border-left: 3px solid var(--color-accent); padding-left: clamp(1.25rem, 3vw, 2rem); }
.quote p { font-family: var(--font-display); font-size: var(--text-lg); font-weight: 500; line-height: 1.35; letter-spacing: -0.015em; color: var(--color-text); }
.quote cite { display: block; margin-top: var(--space-4); font-style: normal; font-size: var(--text-xs); letter-spacing: 0.12em; text-transform: uppercase; color: var(--color-text-faint); }

/* CTA band */
.cta-band { background: var(--color-ink); color: #cdd4de; }
.cta-band h2 { color: #fff; max-width: 18ch; }
.cta-band p { color: #99a3b1; max-width: 48ch; }

/* ---------- Contact form ---------- */
.form { display: grid; gap: var(--space-5); }
.field { display: grid; gap: var(--space-2); }
.field label { font-size: var(--text-xs); font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--color-text-muted); }
.field input, .field select, .field textarea {
  width: 100%; padding: 0.85rem var(--space-4); font-size: var(--text-sm);
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-sm); color: var(--color-text);
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.field textarea { min-height: 130px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--color-accent); box-shadow: 0 0 0 3px var(--color-accent-soft);
}
@media (min-width: 640px) { .field-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-5); } }
.form__success {
  display: none; border: 1px solid var(--color-accent); background: var(--color-accent-soft);
  border-radius: var(--radius-md); padding: var(--space-6);
}
.form__success[data-show='true'] { display: block; }
.form__success h3 { color: var(--color-accent); margin-bottom: var(--space-2); }
.form__success p { font-size: var(--text-sm); color: var(--color-text-muted); }
.form[data-hidden='true'] { display: none; }

/* Info list (NAP) */
.nap { display: grid; gap: var(--space-6); }
.nap__item { display: grid; gap: var(--space-1); }
.nap__k { font-size: var(--text-xs); font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--color-text-faint); }
.nap__v { font-size: var(--text-base); font-weight: 500; color: var(--color-text); text-decoration: none; }
a.nap__v:hover { color: var(--color-accent); }

/* ---------- Footer ---------- */
.footer { background: var(--color-ink); color: #98a2b0; padding-block: var(--space-16) var(--space-8); }
.footer__grid { display: grid; gap: var(--space-10); }
@media (min-width: 820px) { .footer__grid { grid-template-columns: 1.4fr 1fr 1fr 1.1fr; gap: var(--space-8); } }
.footer h4 { font-size: var(--text-xs); font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: #fff; margin-bottom: var(--space-4); }
.footer a { color: #98a2b0; text-decoration: none; font-size: var(--text-sm); transition: color .2s var(--ease); }
.footer a:hover { color: var(--color-accent); }
.footer__links { display: grid; gap: var(--space-3); }
.footer .brand__name { color: #fff; }
.footer .brand__mark { color: var(--color-accent); }
.footer__blurb { font-size: var(--text-sm); margin-top: var(--space-5); max-width: 34ch; color: #8b95a3; }
.footer__bottom {
  margin-top: var(--space-12); padding-top: var(--space-6); border-top: 1px solid rgba(255,255,255,0.1);
  display: flex; flex-wrap: wrap; gap: var(--space-4); justify-content: space-between; font-size: var(--text-xs); color: #6f7987;
}
address.footer__addr { font-style: normal; font-size: var(--text-sm); line-height: 1.7; }

/* ---------- Scroll reveal (no layout shift) ---------- */
.reveal { opacity: 1; }
@media (prefers-reduced-motion: no-preference) {
  .reveal { opacity: 0; transition: opacity .7s var(--ease), filter .7s var(--ease); filter: blur(3px); }
  .reveal.is-in { opacity: 1; filter: blur(0); }
}

/* Divider rule */
.rule { height: 1px; background: var(--color-divider); border: 0; }
.section--ink .rule { background: rgba(255,255,255,0.1); }

/* Logo strip / pills */
.pills { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.pill {
  font-size: var(--text-xs); font-weight: 600; padding: var(--space-2) var(--space-4);
  border: 1px solid var(--color-border); border-radius: 100px; color: var(--color-text-muted);
}
.section--ink .pill { border-color: rgba(255,255,255,0.18); color: #b6bfcb; }
