/* Karvi Chem — public site
   Palette taken from the product world: pine-dark concentrate, clean water,
   citrus. Structure uses hairline rules and printed-panel blocks rather than
   floating cards, echoing the printed panel on a chemical drum. */

:root {
  --ink: #12211c;
  --teal: #0d5c4b;
  --teal-deep: #082a23;
  --citrus: #f5b301;
  --paper: #f4f6f1;
  --mist: #dde5de;
  --muted: #5a6b63;
  --line: #c9d5cc;

  --measure: 62ch;
  --shell: 1180px;
  --gap: clamp(1.25rem, 3vw, 2.5rem);

  --step-sm: 0.83rem;
  --step-0: 1rem;
  --step-1: 1.2rem;
  --step-2: clamp(1.4rem, 1.1rem + 1.2vw, 1.85rem);
  --step-3: clamp(1.9rem, 1.4rem + 2.2vw, 2.75rem);
  --step-4: clamp(2.4rem, 1.5rem + 4.4vw, 4.4rem);
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Karla, "Segoe UI", system-ui, sans-serif;
  font-size: var(--step-0);
  line-height: 1.6;
  font-feature-settings: "kern" 1;
}

h1, h2, h3, h4 {
  font-family: Archivo, "Segoe UI", system-ui, sans-serif;
  font-weight: 700;
  letter-spacing: -0.021em;
  line-height: 1.08;
  margin: 0 0 0.5em;
  text-wrap: balance;
}

h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-2); }
h4 { font-size: var(--step-1); letter-spacing: -0.01em; }

p { margin: 0 0 1rem; }
p:last-child { margin-bottom: 0; }

a { color: inherit; }

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

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

.shell {
  width: min(100% - 2.5rem, var(--shell));
  margin-inline: auto;
}

.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: 1rem; top: 1rem; z-index: 50;
  background: var(--citrus); color: var(--ink);
  padding: 0.6rem 1rem; border-radius: 2px;
}

/* ------------------------------------------------------------- header --- */

.topbar {
  background: var(--teal-deep);
  color: #cfe0d8;
  font-size: var(--step-sm);
}
.topbar .shell {
  display: flex; flex-wrap: wrap; gap: 0.35rem 1.5rem;
  align-items: center; justify-content: space-between;
  padding: 0.5rem 0;
}
.topbar a { color: #fff; text-decoration: none; }
.topbar a:hover { text-decoration: underline; }

.masthead {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 30;
}
.masthead .shell {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: 0.9rem 0;
}

.brand { display: flex; align-items: baseline; gap: 0.6rem; text-decoration: none; }
.brand b {
  font-family: Archivo, sans-serif; font-weight: 700;
  font-size: 1.45rem; letter-spacing: -0.03em; color: var(--teal);
}
.brand span { font-size: var(--step-sm); color: var(--muted); }
.brand-logo { max-height: 80px; width: auto; }
@media (max-width: 600px) { .brand-logo { max-height: 46px; } }

.nav { display: flex; align-items: center; gap: clamp(0.9rem, 2vw, 1.7rem); }
.nav a {
  text-decoration: none; font-size: 0.97rem;
  padding: 0.35rem 0; border-bottom: 2px solid transparent;
}
.nav a:hover { border-bottom-color: var(--citrus); }
.nav a[aria-current="page"] { border-bottom-color: var(--teal); font-weight: 700; }

.nav-toggle {
  display: none;
  background: none; border: 1px solid var(--line); border-radius: 2px;
  padding: 0.45rem 0.7rem; font: inherit; cursor: pointer;
}

@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .nav {
    display: none; position: absolute; inset: 100% 0 auto 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--paper); border-bottom: 1px solid var(--line);
    padding: 0.5rem 1.25rem 1rem;
  }
  .nav.is-open { display: flex; }
  .nav a { padding: 0.7rem 0; border-bottom: 1px solid var(--mist); }
  .masthead .shell { position: relative; }
}

/* --------------------------------------------------------------- hero --- */

.hero {
  background: var(--teal-deep);
  color: #eef4ef;
  padding: clamp(3rem, 8vw, 6.5rem) 0 0;
}
.hero h1 { color: #fff; max-width: 17ch; }
.hero p { max-width: 52ch; color: #bdd2c8; font-size: var(--step-1); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.75rem; }
.hero-note { margin-top: 1.1rem; font-size: var(--step-sm); color: #8fae9f; }

/* The panel strip: the printed spec block off the side of a drum. */
.specstrip {
  margin-top: clamp(2.5rem, 6vw, 4rem);
  border-top: 1px solid rgba(255,255,255,0.18);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}
.specstrip div {
  padding: 1.4rem 1.5rem 1.6rem 0;
  border-right: 1px solid rgba(255,255,255,0.18);
}
.specstrip div:last-child { border-right: 0; }
.specstrip dt {
  font-size: var(--step-sm); color: #8fae9f; margin-bottom: 0.3rem;
}
.specstrip dd {
  margin: 0; font-family: Archivo, sans-serif; font-weight: 600;
  font-size: 1.05rem; color: #fff;
}
@media (max-width: 700px) {
  .specstrip div { border-right: 0; border-bottom: 1px solid rgba(255,255,255,0.18); padding-right: 0; }
  .specstrip div:last-child { border-bottom: 0; }
}

/* ------------------------------------------------------------ buttons --- */

.btn {
  display: inline-block; text-decoration: none; cursor: pointer;
  font-family: Archivo, sans-serif; font-weight: 600; font-size: 0.97rem;
  padding: 0.75rem 1.35rem; border-radius: 2px; border: 2px solid transparent;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.btn-primary { background: var(--citrus); color: var(--ink); }
.btn-primary:hover { background: #ffc62e; }
.btn-ghost { border-color: rgba(255,255,255,0.45); color: #fff; }
.btn-ghost:hover { border-color: #fff; background: rgba(255,255,255,0.08); }
.btn-dark { background: var(--teal); color: #fff; }
.btn-dark:hover { background: #0a4a3d; }
.btn-line { border-color: var(--teal); color: var(--teal); }
.btn-line:hover { background: var(--teal); color: #fff; }

/* ------------------------------------------------------------ section --- */

.band { padding: clamp(3rem, 7vw, 5.5rem) 0; }
.band-mist { background: #eaefe9; }
.band-tight { padding-block: clamp(2.25rem, 5vw, 3.5rem); }

.lede { max-width: var(--measure); font-size: var(--step-1); color: var(--muted); }

.section-head {
  display: flex; flex-wrap: wrap; gap: 1rem;
  align-items: end; justify-content: space-between;
  border-bottom: 2px solid var(--ink); padding-bottom: 0.8rem; margin-bottom: 2rem;
}
.section-head h2 { margin: 0; }
.section-head a { font-size: 0.95rem; }

/* --------------------------------------------------------- categories --- */

.cat-grid {
  display: grid; gap: var(--gap);
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.cat {
  display: block; text-decoration: none;
  border-top: 3px solid var(--teal);
  padding-top: 1rem;
}
.cat .well { margin-bottom: 1rem; }
.cat h3 { margin-bottom: 0.35rem; }
.cat p { color: var(--muted); font-size: 0.95rem; }
.cat .more { color: var(--teal); font-weight: 700; font-size: 0.95rem; }
.cat:hover h3 { color: var(--teal); }
.cat:hover .well img { transform: scale(1.03); }

/* image wells — tinted, squared, no shadow */
.well {
  background: var(--mist);
  aspect-ratio: 4 / 3;
  overflow: hidden;
  position: relative;
}
.well img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.well-empty {
  display: grid; place-items: center;
  color: var(--teal); background: repeating-linear-gradient(
    135deg, var(--mist), var(--mist) 10px, #d3ddd5 10px, #d3ddd5 20px);
  font-family: Archivo, sans-serif; font-weight: 600; font-size: 0.9rem;
}

/* ----------------------------------------------------------- products --- */

.prod-grid {
  display: grid; gap: var(--gap);
  grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
}
.prod {
  display: flex; flex-direction: column;
  background: #fff; border: 1px solid var(--line); text-decoration: none;
}
.prod .well { aspect-ratio: 1 / 1; background: #f0f3ef; }
.prod-body { padding: 1.1rem 1.15rem 1.3rem; display: flex; flex-direction: column; flex: 1; }
.prod h3 { font-size: 1.12rem; margin-bottom: 0.4rem; }
.prod p { font-size: 0.93rem; color: var(--muted); margin-bottom: 0.9rem; }
.prod .meta {
  margin-top: auto; font-size: var(--step-sm); color: var(--teal);
  border-top: 1px solid var(--mist); padding-top: 0.7rem;
}
.prod:hover { border-color: var(--teal); }
.prod:hover h3 { color: var(--teal); }

.filters { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 2.25rem; }
.filters a {
  text-decoration: none; font-size: 0.93rem; padding: 0.45rem 0.95rem;
  border: 1px solid var(--line); border-radius: 2px; background: #fff;
}
.filters a:hover { border-color: var(--teal); }
.filters a.on { background: var(--teal); color: #fff; border-color: var(--teal); }

/* ------------------------------------------------------ product detail --- */

.crumbs { font-size: var(--step-sm); color: var(--muted); margin-bottom: 1.25rem; }
.crumbs a { color: var(--teal); }

.detail { display: grid; gap: clamp(1.75rem, 5vw, 3.5rem); grid-template-columns: 1fr; }
@media (min-width: 900px) { .detail { grid-template-columns: 5fr 6fr; align-items: start; } }
.detail .well { aspect-ratio: 1 / 1; border: 1px solid var(--line); background: #fff; }
.detail h1 { font-size: var(--step-3); }
.detail .summary { font-size: var(--step-1); color: var(--muted); max-width: var(--measure); }

.factbox { border: 1px solid var(--line); background: #fff; margin: 1.75rem 0; }
.factbox dl { display: grid; grid-template-columns: 1fr; margin: 0; }
.factbox > dl > div {
  display: flex; gap: 1rem; justify-content: space-between;
  padding: 0.8rem 1.1rem; border-bottom: 1px solid var(--mist);
}
.factbox > dl > div:last-child { border-bottom: 0; }
.factbox dt { color: var(--muted); font-size: 0.93rem; }
.factbox dd { margin: 0; font-weight: 700; text-align: right; }

.ticks { list-style: none; padding: 0; margin: 0 0 1.5rem; max-width: var(--measure); }
.ticks li {
  padding-left: 1.6rem; position: relative; margin-bottom: 0.5rem;
}
.ticks li::before {
  content: ""; position: absolute; left: 0; top: 0.62em;
  width: 0.7rem; height: 2px; background: var(--citrus);
}

.steps { padding-left: 1.25rem; margin: 0 0 1.5rem; max-width: var(--measure); }
.steps li { margin-bottom: 0.5rem; padding-left: 0.35rem; }
.steps li::marker { color: var(--teal); font-weight: 700; }

.subhead {
  font-family: Archivo, sans-serif; font-weight: 700; font-size: 1.05rem;
  margin: 1.75rem 0 0.7rem;
}

/* ---------------------------------------------------------------- misc --- */

.prose { max-width: var(--measure); }
.prose p + p { margin-top: 0.25rem; }

.split { display: grid; gap: var(--gap); grid-template-columns: 1fr; }
@media (min-width: 820px) { .split { grid-template-columns: 1fr 1fr; } }

.pillars { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.pillar { border-top: 3px solid var(--citrus); padding-top: 1rem; }
.pillar h3 { font-size: 1.2rem; }
.pillar p { color: var(--muted); font-size: 0.95rem; }

.reasons { list-style: none; padding: 0; margin: 0; display: grid; gap: 0;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.reasons li {
  padding: 1rem 0; border-bottom: 1px solid var(--line);
  font-family: Archivo, sans-serif; font-weight: 600; font-size: 1.05rem;
}

.quote {
  border-left: 4px solid var(--citrus); padding-left: 1.5rem; margin: 0;
  font-family: Archivo, sans-serif; font-weight: 600;
  font-size: var(--step-2); line-height: 1.25; max-width: 28ch;
}

.videos { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.videos figure { margin: 0; }
.videos video { width: 100%; background: #000; aspect-ratio: 9 / 16; object-fit: cover; }
.videos figcaption { padding-top: 0.7rem; font-size: 0.95rem; color: var(--muted); }

/* --------------------------------------------------------------- form --- */

.form { max-width: 34rem; }
.field { margin-bottom: 1.1rem; }
.field label { display: block; font-weight: 700; font-size: 0.95rem; margin-bottom: 0.35rem; }
.field input, .field textarea, .field select {
  width: 100%; font: inherit; color: var(--ink);
  padding: 0.7rem 0.8rem; background: #fff;
  border: 1px solid var(--line); border-radius: 2px;
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--teal); }
.field textarea { min-height: 8rem; resize: vertical; }
.hp { position: absolute; left: -9999px; }

.notice { padding: 0.9rem 1.1rem; border-radius: 2px; margin-bottom: 1.5rem; font-size: 0.95rem; }
.notice-ok { background: #e2f0e6; border-left: 4px solid var(--teal); }
.notice-bad { background: #fbe9e7; border-left: 4px solid #c0392b; }
.notice ul { margin: 0.4rem 0 0; padding-left: 1.1rem; }

.contact-grid { display: grid; gap: var(--gap); grid-template-columns: 1fr; }
@media (min-width: 900px) { .contact-grid { grid-template-columns: 1fr 1fr; } }
.contact-facts { list-style: none; padding: 0; margin: 0 0 2rem; }
.contact-facts li { padding: 0.9rem 0; border-bottom: 1px solid var(--line); }
.contact-facts strong { display: block; font-size: 0.9rem; color: var(--muted); font-weight: 400; }
.contact-facts a { color: var(--teal); font-weight: 700; }
.map { width: 100%; height: 340px; border: 1px solid var(--line); }

/* -------------------------------------------------------------- CTA/footer */

.cta { background: var(--teal); color: #fff; }
.cta h2 { color: #fff; max-width: 20ch; }
.cta p { color: #c6ded4; max-width: 46ch; }

.footer { background: var(--ink); color: #b6c4bd; padding: clamp(2.5rem, 6vw, 4rem) 0 2rem; font-size: 0.95rem; }
.footer a { color: #e7eee9; text-decoration: none; }
.footer a:hover { text-decoration: underline; }
.footer h4 { color: #fff; font-size: 0.95rem; margin-bottom: 0.9rem; }
.footer ul { list-style: none; padding: 0; margin: 0; }
.footer li { margin-bottom: 0.5rem; }
.footer-grid { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.footer-base {
  margin-top: 2.5rem; padding-top: 1.25rem; border-top: 1px solid #2b3c35;
  display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; justify-content: space-between;
  font-size: 0.87rem; color: #8b9c94;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
