/* American Fence Kits — kit.css */

:root {
  --ground: #f6f6f3;
  --card: #ffffff;
  --ink: #17191c;
  --muted: #5f646b;
  --line: #dfe0dc;
  --steel: #1d4e6b;
  --steel-dark: #163d54;
  --flame: #c2410c;
  --flame-dark: #9a330a;
  --good: #2f6b46;
  --good-soft: #e6f0ea;

  --display: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
  --body: "IBM Plex Sans", system-ui, -apple-system, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;

  --maxw: 1100px;
  --radius: 6px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ground: #131417;
    --card: #1b1d21;
    --ink: #ecedea;
    --muted: #a0a5ac;
    --line: #2e3137;
    --steel: #6fa8c9;
    --steel-dark: #8bbcd8;
    --flame: #e2703c;
    --flame-dark: #f08a58;
    --good: #7fb894;
    --good-soft: #1c2721;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 1.25rem; }

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin: 0 0 0.6rem;
  text-wrap: balance;
}
h1 { font-size: clamp(2.4rem, 6vw, 4rem); text-transform: uppercase; }
h2 { font-size: clamp(1.7rem, 3.6vw, 2.4rem); text-transform: uppercase; }
h3 { font-size: 1.15rem; }

p { margin: 0 0 1rem; }
a { color: var(--steel); }

.eyebrow {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--flame);
  font-weight: 600;
  margin: 0 0 0.5rem;
}

/* ---------- Header ---------- */
.hdr {
  background: var(--ink);
  color: var(--ground);
  position: sticky;
  top: 0;
  z-index: 40;
}
.hdr .wrap { display: flex; align-items: center; gap: 1rem; padding-block: 0.8rem; }
.logo {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.35rem;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  color: var(--ground);
  text-decoration: none;
  line-height: 1;
}
.logo span { color: var(--flame); }
.hdr .spacer { flex: 1; }
.hdr .ph {
  font-family: var(--mono);
  font-size: 0.92rem;
  color: var(--ground);
  text-decoration: none;
  white-space: nowrap;
}
.hdr .ph:hover { color: var(--flame); }

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(180deg, var(--ink) 0%, #1f2228 100%);
  color: var(--ground);
  padding: clamp(3rem, 7vw, 5rem) 0 clamp(3.5rem, 8vw, 6rem);
}
.hero h1 { color: #fff; max-width: 16ch; }
.hero .sub { font-size: 1.12rem; max-width: 46ch; color: #c9ccd1; margin-bottom: 1.6rem; }
.hero .sub strong { color: #fff; }

.badges { display: flex; flex-wrap: wrap; gap: 0.55rem; }
.badge {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 99px;
  padding: 0.3rem 0.75rem;
  color: #e6e8ea;
}
.badge.hot { border-color: var(--flame); color: var(--flame); }

/* ---------- Section ---------- */
.section { padding: clamp(2.5rem, 6vw, 4.5rem) 0; }
.section.alt { background: var(--card); border-block: 1px solid var(--line); }

/* ---------- Configurator ---------- */
.cfg { display: grid; grid-template-columns: 1fr 22rem; gap: 2rem; align-items: start; }
@media (max-width: 900px) { .cfg { grid-template-columns: 1fr; } }

.step { margin-bottom: 1.9rem; }
.step-h {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  margin-bottom: 0.65rem;
}
.step-n {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 700;
  color: #fff;
  background: var(--steel);
  border-radius: 3px;
  padding: 0.1rem 0.4rem;
}
.step-t { font-family: var(--display); font-size: 1.3rem; font-weight: 700; text-transform: uppercase; }
.step-hint { font-size: 0.85rem; color: var(--muted); margin: -0.35rem 0 0.65rem; }

.opts { display: flex; flex-wrap: wrap; gap: 0.6rem; }

.opt {
  position: relative;
  flex: 1 1 auto;
  min-width: 7.5rem;
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  cursor: pointer;
  text-align: left;
  font-family: var(--body);
  color: var(--ink);
  transition: border-color 0.15s, background 0.15s, transform 0.12s;
}
.opt:hover { border-color: var(--steel); transform: translateY(-1px); }
.opt:focus-visible { outline: 3px solid var(--flame); outline-offset: 2px; }
.opt .big {
  display: block;
  font-family: var(--display);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
  text-transform: uppercase;
}
.opt .small { display: block; font-size: 0.78rem; color: var(--muted); margin-top: 0.2rem; line-height: 1.35; }
.opt .delta {
  display: block;
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--steel);
  margin-top: 0.3rem;
  font-variant-numeric: tabular-nums;
}
.opt[aria-pressed="true"] {
  border-color: var(--flame);
  background: color-mix(in srgb, var(--flame) 8%, var(--card));
}
.opt[aria-pressed="true"] .delta { color: var(--flame); }
.opt[aria-pressed="true"]::after {
  content: "✓";
  position: absolute;
  top: 0.45rem;
  right: 0.6rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--flame);
}

.swatch { width: 1.1rem; height: 1.1rem; border-radius: 3px; border: 1px solid rgba(0,0,0,.25); display: inline-block; vertical-align: -2px; margin-right: 0.45rem; }

/* ---------- Price panel ---------- */
.panel {
  position: sticky;
  top: 5rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-top: 4px solid var(--flame);
  border-radius: var(--radius);
  padding: 1.3rem 1.4rem 1.5rem;
}
.panel h3 { font-size: 1rem; text-transform: uppercase; letter-spacing: 0.03em; margin-bottom: 0.9rem; }
.price-big {
  font-family: var(--display);
  font-size: 3.1rem;
  font-weight: 700;
  line-height: 1;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.price-sub { font-family: var(--mono); font-size: 0.82rem; color: var(--muted); margin-bottom: 0.2rem; }
.price-strike { font-family: var(--mono); font-size: 0.85rem; color: var(--muted); }
.price-strike s { opacity: 0.75; }
.price-save {
  display: inline-block;
  background: var(--good-soft);
  color: var(--good);
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.18rem 0.55rem;
  border-radius: 99px;
  margin-top: 0.5rem;
}

.bom { list-style: none; margin: 1.1rem 0 0; padding: 0.9rem 0 0; border-top: 1px solid var(--line); font-size: 0.88rem; }
.bom li { display: flex; justify-content: space-between; gap: 0.8rem; padding: 0.22rem 0; }
.bom li span:last-child { font-family: var(--mono); color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.bom li.tot { border-top: 1px solid var(--line); margin-top: 0.5rem; padding-top: 0.55rem; font-weight: 600; }

.freight-note {
  margin-top: 0.9rem;
  padding: 0.7rem 0.85rem;
  background: var(--ground);
  border-left: 3px solid var(--steel);
  border-radius: 0 4px 4px 0;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.5;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  font-family: var(--body);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.95rem 1.6rem;
  border-radius: var(--radius);
  border: 2px solid transparent;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: background 0.15s, border-color 0.15s, transform 0.12s;
}
.btn-primary { background: var(--flame); color: #fff; width: 100%; }
.btn-primary:hover { background: var(--flame-dark); transform: translateY(-1px); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--steel); }

/* ---------- Includes grid ---------- */
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; }
@media (max-width: 800px) { .grid3 { grid-template-columns: 1fr; } }
.feat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.3rem; }
.feat h3 { color: var(--steel); }
.feat p { margin: 0; font-size: 0.92rem; color: var(--muted); }

/* ---------- Compare table ---------- */
.tblwrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { text-align: left; padding: 0.7rem 0.9rem; border-bottom: 1px solid var(--line); }
th { font-family: var(--mono); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
tr:last-child td { border-bottom: none; }
td.num { font-family: var(--mono); text-align: right; font-variant-numeric: tabular-nums; }
.yes { color: var(--good); font-weight: 700; }
.no { color: var(--muted); }

/* ---------- Form ---------- */
.form { max-width: 40rem; }
.f2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0.9rem; }
@media (max-width: 640px) { .f2 { grid-template-columns: 1fr; } }
.field { margin-bottom: 0.9rem; }
.field label {
  display: block;
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 0.3rem;
}
.field input, .field textarea, .field select {
  width: 100%;
  padding: 0.8rem 0.9rem;
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 4px;
  font-family: var(--body);
  font-size: 1rem;
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none;
  border-color: var(--flame);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--flame) 20%, transparent);
}
.field textarea { resize: vertical; min-height: 5rem; }
.hp { position: absolute; left: -9999px; }
.formnote { font-size: 0.84rem; color: var(--muted); margin-top: 0.7rem; }

.spec-recap {
  background: var(--ground);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 0.9rem 1.1rem;
  font-family: var(--mono);
  font-size: 0.84rem;
  line-height: 1.6;
  margin-bottom: 1.2rem;
}

/* ---------- Footer ---------- */
.ftr { background: var(--ink); color: #b9bdc2; padding: 2.2rem 0; font-size: 0.86rem; margin-top: 3rem; }
.ftr .wrap { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; }
.ftr a { color: #dfe2e5; }

@media (prefers-reduced-motion: reduce) {
  .opt, .btn { transition: none; }
  .opt:hover, .btn:hover { transform: none; }
}


/* ---------- Inline submission confirmation ---------- */

.confirmed {
  background: var(--card);
  border: 1px solid var(--line);
  border-top: 4px solid var(--good);
  border-radius: var(--radius);
  padding: 2rem 1.9rem 1.9rem;
  max-width: 40rem;
}
.confirmed-tick {
  width: 2.6rem; height: 2.6rem;
  border-radius: 50%;
  background: var(--good-soft);
  color: var(--good);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; font-weight: 700;
  margin-bottom: 1rem;
}
.confirmed h3 {
  font-family: var(--display);
  font-size: 1.9rem;
  text-transform: uppercase;
  margin-bottom: .5rem;
}
.confirmed-lede { font-size: 1.03rem; color: var(--muted); margin-bottom: 1.4rem; }
.confirmed-lede strong { color: var(--ink); }

.confirmed-card {
  background: var(--ground);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: .3rem 1rem;
  margin-bottom: 1.6rem;
}
.confirmed-row {
  display: flex; justify-content: space-between; gap: 1.2rem;
  padding: .6rem 0;
  border-bottom: 1px solid var(--line);
  font-size: .89rem;
}
.confirmed-row:last-child { border-bottom: none; }
.confirmed-row span:first-child {
  color: var(--muted);
  font-family: var(--mono);
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  flex: 0 0 5.5rem;
  padding-top: .15rem;
}
.confirmed-row span:last-child { text-align: right; }
.confirmed-row .mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

.confirmed-h4 {
  font-family: var(--mono);
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--flame);
  margin: 0 0 .7rem;
}
.confirmed-steps {
  margin: 0 0 1.5rem;
  padding-left: 1.15rem;
  display: grid;
  gap: .55rem;
  font-size: .92rem;
  color: var(--muted);
}
.confirmed-steps strong { color: var(--ink); }
.confirmed-foot {
  margin: 0;
  padding-top: 1.1rem;
  border-top: 1px solid var(--line);
  font-size: .92rem;
  color: var(--muted);
}

@media (max-width: 560px) {
  .confirmed { padding: 1.5rem 1.2rem; }
  .confirmed-row { flex-direction: column; gap: .2rem; }
  .confirmed-row span:last-child { text-align: left; }
}
