/* ==========================================================================
   Jarpet & Japes — tokens, reset, typography, and shared chrome.
   Palette: raw indigo, unbleached cotton, copper rivet.
   Loaded by every page.
   ========================================================================== */

:root {
  --indigo-900: #12203a;
  --indigo-700: #1e3462;
  --indigo-500: #35558c;
  --cotton-50:  #f6f3ee;
  --cotton-100: #efeae1;
  --cotton-200: #e2dbcf;
  --ink:        #191919;
  --ink-soft:   #3a3833;
  --ink-muted:  #6d6a64;
  --copper:     #b06432;

  --shell: 1240px;
  --gutter: clamp(1.25rem, 4vw, 3.5rem);

  --font-display: "Hoefler Text", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --font-body: ui-sans-serif, -apple-system, "Helvetica Neue", Helvetica, Arial, sans-serif;

  --step: clamp(4.5rem, 9vw, 8.5rem);
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

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

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

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

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

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; font-weight: 400; letter-spacing: -0.01em; }
p { margin: 0 0 1.1em; }
ul, ol, dl { margin: 0; padding: 0; list-style: none; }

:focus-visible {
  outline: 2px solid var(--copper);
  outline-offset: 3px;
}

.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: 50%; top: 0;
  transform: translate(-50%, -110%);
  z-index: 100; padding: 0.75rem 1.25rem;
  background: var(--indigo-900); color: var(--cotton-50);
  font-size: 0.8125rem;
}
.skip-link:focus { transform: translate(-50%, 0); }

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

/* --- Typography ----------------------------------------------------------- */

.display {
  font-family: var(--font-display);
  font-size: clamp(2.75rem, 7.2vw, 5.5rem);
  line-height: 0.98;
  letter-spacing: -0.025em;
  margin: 0 0 1.5rem;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 3.6vw, 3rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.eyebrow {
  margin: 0 0 1rem;
  font-size: 0.6875rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.lede {
  max-width: 46ch;
  font-size: clamp(1.0625rem, 1.4vw, 1.1875rem);
  line-height: 1.7;
  color: var(--ink-soft);
}
.lede--wide { max-width: 62ch; }

.section-note {
  max-width: 52ch;
  color: var(--ink-muted);
}

.section-head { margin-bottom: clamp(2.5rem, 5vw, 4rem); }

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

.btn {
  display: inline-block;
  padding: 0.95rem 2rem;
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  border: 1px solid var(--indigo-900);
  cursor: pointer;
  transition: background-color 0.35s var(--ease), color 0.35s var(--ease);
}

.btn--primary { background: var(--indigo-900); color: var(--cotton-50); }
.btn--primary:hover { background: var(--indigo-700); border-color: var(--indigo-700); }

.btn--ghost { background: transparent; color: var(--indigo-900); }
.btn--ghost:hover { background: var(--indigo-900); color: var(--cotton-50); }

/* --- Announcement + masthead --------------------------------------------- */

.announce {
  background: var(--indigo-900);
  color: var(--cotton-100);
  text-align: center;
}
.announce p {
  margin: 0;
  padding: 0.7rem var(--gutter);
  font-size: 0.6875rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.masthead {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--cotton-50) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease), background-color 0.3s var(--ease);
}
.masthead.is-stuck {
  border-bottom-color: var(--cotton-200);
  background: color-mix(in srgb, var(--cotton-50) 96%, transparent);
}

.masthead__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  min-height: 76px;
}

.wordmark {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  font-family: var(--font-display);
  font-size: 1.25rem;
  letter-spacing: 0.02em;
}
.wordmark__amp { color: var(--copper); font-style: italic; }
.wordmark--footer { font-size: 1.6rem; margin-bottom: 0.75rem; }

.nav {
  display: flex;
  gap: clamp(1.25rem, 2.6vw, 2.5rem);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.nav a { padding-block: 0.25rem; border-bottom: 1px solid transparent; }
.nav a:hover { border-bottom-color: var(--copper); }

.masthead__utility {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.utility-link:hover { color: var(--copper); }

.nav-toggle {
  display: none;
  width: 34px; height: 34px;
  padding: 0;
  background: none;
  border: 0;
  cursor: pointer;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
}
.nav-toggle__bar {
  display: block;
  height: 1px;
  background: var(--ink);
  transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
}
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:first-child { transform: translateY(3.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:last-child  { transform: translateY(-3.5px) rotate(-45deg); }

/* --- Product cards (home grid and PDP cross-sell) ------------------------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: clamp(1.75rem, 3vw, 3rem) clamp(1.5rem, 2.4vw, 2.25rem);
}

.card__media {
  display: block;
  overflow: hidden;
  background: var(--cotton-100);
  aspect-ratio: 4 / 3;
}
.card__media img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.9s var(--ease);
}
.card:hover .card__media img { transform: scale(1.035); }

.card__body { padding-top: 1.1rem; }

.card__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.card__name {
  font-family: var(--font-display);
  font-size: 1.375rem;
}
.card__name a:hover { color: var(--copper); }

.card__price { margin: 0; font-size: 0.9375rem; color: var(--ink-muted); }

.card__spec {
  margin: 0.35rem 0 0;
  font-size: 0.8125rem;
  color: var(--ink-muted);
}

/* --- Specification list --------------------------------------------------- */

.specs {
  margin: 2rem 0 2.25rem;
  border-top: 1px solid var(--cotton-200);
}
.specs > div {
  display: grid;
  grid-template-columns: 9rem 1fr;
  gap: 1rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--cotton-200);
  font-size: 0.875rem;
}
.specs dt {
  align-self: center;
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.specs dd { margin: 0; color: var(--ink); }

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

.footer {
  padding-top: clamp(3.5rem, 6vw, 5.5rem);
  background: var(--indigo-900);
  color: var(--cotton-100);
}

.footer__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  gap: clamp(2.5rem, 5vw, 4rem);
  padding-bottom: clamp(3rem, 5vw, 4.5rem);
}

.footer__tag { max-width: 30ch; color: rgba(246, 243, 238, 0.6); font-size: 0.875rem; }

.footer__cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 2rem;
}
.footer__cols h3 {
  margin-bottom: 1rem;
  font-size: 0.6875rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(246, 243, 238, 0.5);
}
.footer__cols a {
  display: block;
  padding: 0.28rem 0;
  font-size: 0.875rem;
  color: rgba(246, 243, 238, 0.85);
}
.footer__cols a:hover { color: var(--cotton-50); }

.footer__base {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1.5rem;
  border-top: 1px solid rgba(246, 243, 238, 0.15);
  font-size: 0.75rem;
  color: rgba(246, 243, 238, 0.55);
}
.footer__base p { margin: 0; }

/* --- Scroll reveal -------------------------------------------------------- */

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.85s var(--ease), transform 0.85s var(--ease);
}
.reveal.is-visible { opacity: 1; transform: none; }

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

@media (max-width: 900px) {
  .footer__inner { grid-template-columns: 1fr; }
}

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

  .nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    padding: 0 var(--gutter);
    max-height: 0;
    overflow: hidden;
    background: var(--cotton-50);
    border-bottom: 1px solid transparent;
    transition: max-height 0.4s var(--ease), border-color 0.4s var(--ease);
  }
  .nav.is-open {
    max-height: 20rem;
    border-bottom-color: var(--cotton-200);
  }
  .nav a {
    padding: 1rem 0;
    border-bottom: 1px solid var(--cotton-200);
  }
  .nav a:last-child { border-bottom: 0; }

  .masthead__utility .utility-link { display: none; }

  .specs > div { grid-template-columns: 1fr; gap: 0.2rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}

/* Legal links in the footer base. */
.footer__legal { display: flex; gap: 1.25rem; }
.footer__legal a { text-decoration: underline; text-underline-offset: 0.15em; }
.footer__legal a:hover { color: var(--cotton-50); }
