/* ==========================================================================
   AWAKE — style.css
   Design tokens, base styles and shared components (header, footer, buttons,
   cards, forms, reveal states). Mobile-first. Desktop overrides live in
   responsive.css; page-specific layout lives in pages.css.
   ========================================================================== */

/* ---------- 1. Design tokens ---------- */
:root {
  /* Palette — AWAKE brand colours (from the final logo) */
  --blue: #2055A4;          /* primary brand blue */
  --yellow: #F9C928;        /* sunshine yellow accent (use charcoal text on it) */
  --white: #FFFFFF;         /* main background */
  --ice: #F4F7FB;           /* ice blue secondary background / cards */
  --charcoal: #202936;      /* text */
  --soft-blue: #DCE9F8;     /* subtle backgrounds, borders, hover states */
  --charcoal-soft: rgba(32, 41, 54, 0.86);   /* secondary text (tint of charcoal) */
  --line: rgba(32, 85, 164, 0.18);           /* hairline borders (tint of blue) */
  --line-light: rgba(255, 255, 255, 0.28);   /* hairlines on blue */
  --error: #A3392B;         /* validation errors only (functional state colour) */

  /* Typography */
  --font-body: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "DM Serif Display", Georgia, "Times New Roman", serif;

  --fs-xs: 0.8125rem;
  --fs-sm: 0.95rem;
  --fs-base: 1rem;
  --fs-md: 1.15rem;
  --fs-lg: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem);
  --fs-h3: clamp(1.4rem, 1.15rem + 1vw, 1.9rem);
  --fs-h2: clamp(1.9rem, 1.2rem + 2.4vw, 3rem);
  --fs-h1: clamp(2.1rem, 1.2rem + 3.4vw, 3.8rem);
  --fs-hero: clamp(2.6rem, 1.3rem + 5.4vw, 5.6rem);

  /* Spacing */
  --sp-1: 0.5rem;
  --sp-2: 1rem;
  --sp-3: 1.5rem;
  --sp-4: 2rem;
  --sp-5: 3rem;
  --sp-6: 4.5rem;
  --section-y: clamp(3.5rem, 2.5rem + 5vw, 7rem);

  --container: 1240px;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --header-h: 76px;

  --radius: 4px;
  --shadow-sm: 0 1px 2px rgba(32, 85, 164, 0.08);
  --shadow-md: 0 14px 34px -16px rgba(32, 85, 164, 0.35);
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ---------- 2. Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1rem);
}
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: 1.7;
  color: var(--charcoal);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg, picture { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
p { margin: 0 0 1.1em; text-wrap: pretty; }
ul, ol { margin: 0; padding: 0; }
h1, h2, h3, h4 { margin: 0 0 0.5em; font-weight: 400; line-height: 1.1; overflow-wrap: break-word; text-wrap: balance; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

h1, h2, h3, .display { font-family: var(--font-display); letter-spacing: -0.01em; }
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); line-height: 1.2; }

:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
  border-radius: 2px;
}
.on-dark :focus-visible, .section--blue :focus-visible, .section--charcoal :focus-visible { outline-color: var(--yellow); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: var(--gutter); top: -4rem; z-index: 200;
  background: var(--blue); color: var(--white); padding: 0.75rem 1.25rem;
  font-weight: 700; text-decoration: none; transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 0.75rem; }

/* ---------- 3. Layout primitives ---------- */
.container { width: 100%; max-width: calc(var(--container) + var(--gutter) * 2); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: var(--section-y); position: relative; }
.section--white { background: var(--white); }
.section--ice { background: var(--ice); }
.section--soft { background: var(--soft-blue); }
.section--blue { background: var(--blue); color: var(--white); }
.section--charcoal { background: var(--charcoal); color: var(--white); }
.section--blue .lead, .section--charcoal .lead { color: rgba(255, 255, 255, 0.86); }
.section--blue .eyebrow, .section--charcoal .eyebrow { color: var(--yellow); }

.eyebrow {
  display: inline-block; margin-bottom: 1.1rem;
  font-size: var(--fs-xs); font-weight: 800; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--blue);
}
.lead { font-size: var(--fs-md); color: var(--charcoal-soft); max-width: 58ch; }
.display-sub { font-family: var(--font-display); font-size: var(--fs-lg); line-height: 1.3; margin-bottom: 1rem; }
.text-accent { color: var(--blue); }
.section--blue .text-accent, .section--charcoal .text-accent { color: var(--yellow); }
.stack > * + * { margin-top: var(--sp-2); }
.measure { max-width: 62ch; }

/* ---------- 4. Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.6em;
  min-height: 3.25rem; padding: 0.9rem 1.8rem;
  font-family: var(--font-body); font-size: 0.875rem; font-weight: 800;
  letter-spacing: 0.12em; text-transform: uppercase; text-align: center; text-decoration: none; line-height: 1.25;
  border: 1.5px solid transparent; border-radius: 999px;
  transition: background-color 0.25s var(--ease), color 0.25s var(--ease), border-color 0.25s var(--ease), transform 0.25s var(--ease);
}
.btn::after { content: "\2192"; font-size: 1.15em; transition: transform 0.25s var(--ease); }
.btn:hover::after { transform: translateX(4px); }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--blue); color: var(--white); border-color: var(--blue); }
.btn--primary:hover { background: var(--soft-blue); border-color: var(--blue); color: var(--blue); }
.btn--outline { background: transparent; color: var(--blue); border-color: var(--blue); }
.btn--outline:hover { background: var(--blue); color: var(--white); }
.btn--light { background: var(--white); color: var(--blue); border-color: var(--white); }
.btn--light:hover { background: var(--soft-blue); border-color: var(--soft-blue); }
.btn--outline-light { background: transparent; color: var(--white); border-color: rgba(255, 255, 255, 0.7); }
.btn--outline-light:hover { background: var(--white); color: var(--blue); border-color: var(--white); }
.btn--yellow { background: var(--yellow); color: var(--charcoal); border-color: var(--yellow); }
.btn--yellow:hover { background: var(--ice); border-color: var(--ice); }
.btn--sm { min-height: 2.75rem; padding: 0.6rem 1.3rem; font-size: 0.8rem; }
.btn--lg { min-height: 3.6rem; padding: 1rem 2.2rem; font-size: 0.9rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.85rem; margin-top: var(--sp-4); }

.link-arrow {
  display: inline-flex; align-items: center; gap: 0.5em; font-weight: 800; font-size: 0.875rem;
  letter-spacing: 0.12em; text-transform: uppercase; text-decoration: none;
  border-bottom: 1.5px solid currentColor; padding-bottom: 0.2em;
}
.link-arrow::after { content: "\2192"; transition: transform 0.25s var(--ease); }
.link-arrow:hover::after { transform: translateX(4px); }

/* ---------- 5. Header & navigation ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--white);
  border-bottom: 1px solid var(--line);
  transition: background-color 0.3s var(--ease), box-shadow 0.3s var(--ease), border-color 0.3s var(--ease);
}
.header-inner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 0.5rem 1.5rem; min-height: var(--header-h);
}
.brand { display: inline-flex; align-items: center; text-decoration: none; line-height: 0; padding-block: 0.4rem; }
.brand img { height: 56px; width: auto; max-width: none; }

.primary-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1.75rem; width: 100%; padding-bottom: 0.75rem; }
.primary-nav ul { display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; list-style: none; }
.nav-link {
  position: relative; display: inline-block; padding: 0.6rem 0;
  font-size: 0.875rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; text-decoration: none; color: var(--blue);
}
.nav-link::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0.2rem; height: 2px; background: var(--blue);
  transform: scaleX(0); transform-origin: left; transition: transform 0.3s var(--ease);
}
.nav-link:hover::after, .nav-link[aria-current="page"]::after { transform: scaleX(1); }
.nav-toggle { display: none; }

/* Progressive enhancement: collapsed menu only when JS is running */
.js .site-header--overlay { position: fixed; left: 0; right: 0; }
.js .site-header--overlay:not(.is-scrolled):not(.menu-open) { background: transparent; border-bottom-color: transparent; }
.site-header.is-scrolled { box-shadow: 0 6px 24px -14px rgba(32, 85, 164, 0.35); }
.js .nav-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 3rem; height: 3rem; margin-right: -0.5rem;
  background: transparent; border: 0; color: var(--blue);
}
.nav-toggle__bars, .nav-toggle__bars::before, .nav-toggle__bars::after {
  display: block; width: 24px; height: 2px; background: currentColor; border-radius: 2px;
  transition: transform 0.3s var(--ease), background-color 0.2s;
}
.nav-toggle__bars { position: relative; }
.nav-toggle__bars::before, .nav-toggle__bars::after { content: ""; position: absolute; left: 0; }
.nav-toggle__bars::before { top: -7px; }
.nav-toggle__bars::after { top: 7px; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::before { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::after { transform: translateY(-7px) rotate(-45deg); }

.js .primary-nav {
  display: none; flex-direction: column; align-items: stretch; gap: 1.25rem;
  position: absolute; top: 100%; left: 0; right: 0; width: auto;
  padding: 1.25rem var(--gutter) 1.75rem; background: var(--white);
  border-bottom: 1px solid var(--line); box-shadow: 0 24px 40px -24px rgba(32, 85, 164, 0.35);
}
.js .primary-nav.is-open { display: flex; }
.js .primary-nav ul { flex-direction: column; gap: 0; }
.js .primary-nav .nav-link { display: block; padding: 0.95rem 0; font-size: 1rem; border-bottom: 1px solid var(--line); }
.js .primary-nav .nav-link::after { display: none; }
.js .primary-nav .nav-link[aria-current="page"] { color: var(--blue); }

/* ---------- 6. Footer ---------- */
.site-footer { background: var(--blue); color: var(--white); padding-top: var(--sp-6); border-top: 5px solid var(--yellow); }
.footer-grid { display: grid; gap: var(--sp-5); padding-bottom: var(--sp-5); }
.footer-brand .brand { background: var(--white); padding: 0.6rem 0.9rem; border-radius: var(--radius); }
.footer-brand .brand img { height: 64px; }
.footer-brand p { margin-top: 1.25rem; max-width: 34ch; font-size: var(--fs-md); color: rgba(255, 255, 255, 0.92); }
.footer-tag { font-family: var(--font-display); font-size: 1.4rem !important; color: var(--yellow) !important; }
.footer-col h2 {
  font-family: var(--font-body); font-size: var(--fs-xs); font-weight: 800; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--yellow); margin-bottom: 1rem; padding-bottom: 0.75rem; border-bottom: 1px solid var(--line-light);
}
.footer-col ul { list-style: none; }
.footer-col li + li { margin-top: 0.1rem; }
.footer-col a { display: inline-block; padding: 0.5rem 0; font-size: 1rem; text-decoration: none; color: var(--white); }
.footer-col a:hover { color: var(--yellow); text-decoration: underline; text-underline-offset: 0.25em; }
.footer-bottom { border-top: 1px solid var(--line-light); padding-block: 1.5rem; font-size: var(--fs-sm); color: rgba(255, 255, 255, 0.9); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 1.5rem; }
.footer-contact { margin-top: 1.25rem; font-size: var(--fs-sm); }
.footer-contact a { text-decoration: none; }

/* ---------- 7. Cards ---------- */
.product-card { position: relative; display: flex; flex-direction: column; background: var(--ice); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease); }
.product-card__media { overflow: hidden; background: var(--soft-blue); aspect-ratio: 10 / 11; }
.product-card__media img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 55%; transition: transform 0.8s var(--ease); }
.product-card__body { padding: 1.5rem 1.6rem 1.7rem; display: flex; flex-direction: column; gap: 0.4rem; flex: 1; }
.product-card__body > .product-card__link { margin-top: auto; }
.product-card__kicker { font-size: var(--fs-xs); font-weight: 800; letter-spacing: 0.2em; text-transform: uppercase; color: var(--blue); }
.product-card__title { font-family: var(--font-display); font-size: clamp(1.6rem, 1.3rem + 0.8vw, 2rem); letter-spacing: 0.03em; margin: 0; line-height: 1.1; }
.product-card__text { margin: 0; font-size: var(--fs-md); color: var(--charcoal); }
.product-card__link {
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
  padding-top: 1.1rem; border-top: 1px solid var(--line); margin-top: 1.1rem;
  font-size: 0.875rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; text-decoration: none;
  color: var(--blue);
}
.product-card__link::after { content: ""; position: absolute; inset: 0; }  /* whole card clickable */
.product-card__link .arrow { display: inline-block; font-size: 1.2em; transition: transform 0.3s var(--ease); }
.product-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); }
.product-card:hover .product-card__media img { transform: scale(1.05); }
.product-card:hover .product-card__link .arrow { transform: translateX(5px); }
.product-card:focus-within { box-shadow: var(--shadow-md); }

/* ---------- 8. Forms ---------- */
.form-grid { display: grid; gap: 1.25rem; }
.field { display: flex; flex-direction: column; gap: 0.4rem; }
.field label, .field .label { font-size: var(--fs-sm); font-weight: 700; color: var(--blue); }
.field .req { color: var(--error); margin-left: 0.15em; }
.field input, .field select, .field textarea {
  width: 100%; min-height: 3.1rem; padding: 0.8rem 1rem;
  background: var(--white); border: 1.5px solid rgba(32, 85, 164, 0.35); border-radius: var(--radius);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.field textarea { min-height: 9rem; resize: vertical; }
.field select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--blue) 50%), linear-gradient(135deg, var(--blue) 50%, transparent 50%); background-position: calc(100% - 20px) 52%, calc(100% - 14px) 52%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 2.6rem; }
.field input:hover, .field select:hover, .field textarea:hover { border-color: var(--blue); }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible { outline: 3px solid var(--blue); outline-offset: 1px; border-color: var(--blue); }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--error); background: #FFF8F6; }
.field-error { display: none; font-size: var(--fs-sm); font-weight: 600; color: var(--error); }
.field.has-error .field-error { display: block; }
.field-hint { font-size: var(--fs-xs); color: var(--charcoal-soft); }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form-status { margin-top: 1.5rem; padding: 1.25rem 1.4rem; border-radius: var(--radius); border-left: 5px solid; font-size: var(--fs-sm); }
.form-status h3 { font-family: var(--font-body); font-size: 1rem; font-weight: 800; margin-bottom: 0.4rem; letter-spacing: 0; }
.form-status p:last-child { margin-bottom: 0; }
.form-status--success { background: var(--soft-blue); border-color: var(--blue); color: var(--charcoal); }
.form-status--error { background: #FBEAE6; border-color: var(--error); color: #5B1D14; }
.form-status--notice { background: var(--ice); border-color: var(--yellow); color: var(--charcoal); }
.form-status .btn { margin-top: 0.5rem; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.65; cursor: progress; }
.btn.is-loading::after { content: ""; width: 1em; height: 1em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 9. Reveal animations (only when JS is running) ---------- */
.js [data-reveal] {
  opacity: 0; transform: translateY(26px);
  transition: opacity 0.9s var(--ease) var(--d, 0ms), transform 0.9s var(--ease) var(--d, 0ms);
}
.js [data-reveal="image"] { transform: scale(0.97); opacity: 0; transition: opacity 1s var(--ease) var(--d, 0ms), transform 1.2s var(--ease) var(--d, 0ms); }
.js [data-reveal="fade"] { transform: none; }
.js [data-reveal].is-visible { opacity: 1; transform: none; }
.js [data-reveal="image"].is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .js [data-reveal], .js [data-reveal].is-visible, .js [data-reveal="image"], .js [data-reveal="image"].is-visible { opacity: 1; transform: none; clip-path: none; }
  .product-card:hover, .product-card:hover .product-card__media img { transform: none; }
}

@media print {
  .site-header, .nav-toggle { position: static; }
  .js [data-reveal] { opacity: 1 !important; transform: none !important; clip-path: none !important; }
}

/* Failsafe: if animations.js fails to run, the inline head script adds
   .reveal-all after a few seconds so no content stays hidden. */
.reveal-all [data-reveal], .reveal-all [data-reveal="image"] { opacity: 1 !important; transform: none !important; clip-path: none !important; }
