/* Imperial Fence Supply — shared design system
   DNA hash: ebcf70ef2e73
   Typography: slab-industrial (Roboto Slab / Roboto)
   Color: monochrome-plus-one — galvanized graphite neutrals + imperial crimson
   Components: industrial-utilitarian (0 radius, 1px borders, underline hover)
   Buttons: chamfered-corners (cut-steel bevels)
   Texture: diamond-lattice (chain-link mesh)  |  Nav: dual-row-header */

:root {
  --ink: #15181c;
  --graphite: #1f2328;
  --graphite-2: #24292f;
  --steel: #4b5058;        /* secondary text on light (AA) */
  --steel-light: #b9bdc2;  /* secondary text on dark */
  --paper: #f2f3f4;
  --zinc: #e7e9eb;
  --white: #ffffff;
  --line: #d2d6da;         /* hairline on light */
  --line-dark: rgba(255,255,255,0.14);
  --crimson: #9d1c2e;
  --crimson-bright: #b81f30;
  --oxblood: #6d1420;

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --wrap: 1240px;
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Roboto", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 {
  font-family: "Roboto Slab", Georgia, serif;
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.015em;
  margin: 0;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: clamp(20px, 5vw, 56px); }
.section { padding-block: clamp(64px, 9vw, 128px); }

/* display type — oversized-heading mutation */
.display {
  font-size: clamp(2.6rem, 7vw, 5.6rem);
  line-height: 0.98;
  letter-spacing: -0.028em;
  font-weight: 800;
}
.display-xl {
  font-size: clamp(3rem, 9vw, 7rem);
  line-height: 0.94;
  letter-spacing: -0.03em;
  font-weight: 900;
}
.overline {
  font-family: "Roboto Slab", serif;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  color: var(--crimson);
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}
.lede { font-size: clamp(1.05rem, 1.6vw, 1.35rem); line-height: 1.55; color: var(--steel); max-width: 60ch; }
.on-dark { color: var(--paper); }
.on-dark .lede { color: var(--steel-light); }
.on-dark .overline { color: #e79aa6; }

/* crimson diamond marker — brand device that replaces the AI "eyebrow" */
.mark { width: 11px; height: 11px; background: var(--crimson); transform: rotate(45deg); display: inline-block; flex: none; }

/* ---------- chain-link diamond lattice (signature texture) ---------- */
.mesh {
  background-image:
    linear-gradient(45deg, var(--line) 1px, transparent 1px),
    linear-gradient(-45deg, var(--line) 1px, transparent 1px);
  background-size: 24px 24px;
}
.mesh-dark {
  background-image:
    linear-gradient(45deg, rgba(255,255,255,0.07) 1px, transparent 1px),
    linear-gradient(-45deg, rgba(255,255,255,0.07) 1px, transparent 1px);
  background-size: 26px 26px;
}
/* custom-divider mutation: chain-link seam between sections */
.seam { position: relative; height: 30px; background: var(--ink); overflow: hidden; }
.seam::before {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(45deg, rgba(255,255,255,0.16) 1px, transparent 1px),
    linear-gradient(-45deg, rgba(255,255,255,0.16) 1px, transparent 1px);
  background-size: 15px 15px;
}
.seam::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 3px; transform: translateY(-50%); background: var(--crimson); }

/* ---------- buttons: chamfered "cut-steel" corners ---------- */
.btn {
  --chamfer: 9px;
  display: inline-flex; align-items: center; gap: 0.6rem;
  font-family: "Roboto", sans-serif;
  font-weight: 700; font-size: 0.82rem; letter-spacing: 0.11em; text-transform: uppercase;
  padding: 15px 30px; cursor: pointer; border: 0;
  clip-path: polygon(var(--chamfer) 0%, calc(100% - var(--chamfer)) 0%, 100% var(--chamfer), 100% calc(100% - var(--chamfer)), calc(100% - var(--chamfer)) 100%, var(--chamfer) 100%, 0% calc(100% - var(--chamfer)), 0% var(--chamfer));
  transition: background-color 160ms var(--ease-out), color 160ms var(--ease-out);
}
.btn-primary { background: var(--crimson); color: #fff; }
.btn-outline { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }
.on-dark .btn-outline { color: var(--paper); box-shadow: inset 0 0 0 1.5px rgba(255,255,255,0.45); }
.btn-ghost-dark { background: transparent; color: var(--paper); box-shadow: inset 0 0 0 1.5px rgba(255,255,255,0.35); }
@media (hover: hover) and (pointer: fine) {
  .btn-primary:hover { background: var(--crimson-bright); }
  .btn-outline:hover { background: var(--ink); color: #fff; }
  .on-dark .btn-outline:hover { background: var(--paper); color: var(--ink); }
  .btn-ghost-dark:hover { background: var(--paper); color: var(--ink); }
}
.btn:active { transform: scale(0.975); }

/* text link with underline-on-hover (industrial-utilitarian) */
.tlink { display: inline-flex; align-items: center; gap: 0.4rem; font-weight: 500; border-bottom: 1.5px solid transparent; transition: border-color 120ms linear, color 120ms linear; }
.tlink:hover { border-bottom-color: var(--crimson); color: var(--crimson); }

/* ---------- cards / plates ---------- */
.card { background: var(--white); border: 1px solid var(--line); padding: clamp(22px, 3vw, 34px); }
.card-dark { background: var(--graphite); border: 1px solid var(--line-dark); padding: clamp(22px, 3vw, 34px); color: var(--paper); }

/* styled product "plate" (photography placeholder — client images drop in) */
.plate { position: relative; overflow: hidden; background: var(--graphite); color: var(--paper); }
.plate::before {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(160deg, rgba(157,28,46,0.16), transparent 55%),
    linear-gradient(45deg, rgba(255,255,255,0.06) 1px, transparent 1px),
    linear-gradient(-45deg, rgba(255,255,255,0.06) 1px, transparent 1px);
  background-size: 100% 100%, 26px 26px, 26px 26px;
}
.plate > * { position: relative; }
.plate-ico { position: absolute; right: -6px; bottom: -14px; font-size: 12rem; color: rgba(255,255,255,0.05); }
.plate-label { position: absolute; left: 0; bottom: 0; background: var(--crimson); color: #fff; font-weight: 700; font-size: 0.72rem; letter-spacing: 0.09em; text-transform: uppercase; padding: 8px 16px; clip-path: polygon(0 0, 100% 0, calc(100% - 10px) 100%, 0 100%); }
.plate-tag { position: absolute; top: 20px; left: 20px; font-family: "Roboto Slab", serif; font-weight: 700; color: rgba(255,255,255,0.85); font-size: 0.9rem; }

/* stat numerals */
.stat-num { font-family: "Roboto Slab", serif; font-weight: 900; font-size: clamp(2.6rem, 5vw, 4rem); line-height: 1; letter-spacing: -0.02em; }
.stat-num .accent { color: var(--crimson); }
.on-dark .stat-num { color: #fff; }

/* ---------- header: dual-row ---------- */
.site-header { position: sticky; top: 0; z-index: 50; }
.util-bar { background: var(--ink); color: var(--steel-light); font-size: 0.82rem; transition: margin-top 220ms var(--ease-out); }
.util-bar .wrap { display: flex; align-items: center; justify-content: space-between; min-height: 40px; gap: 1rem; }
.util-branches { display: flex; gap: 1.4rem; flex-wrap: wrap; }
.util-branches a { display: inline-flex; align-items: center; gap: 0.4rem; white-space: nowrap; transition: color 120ms linear; }
.util-branches a:hover { color: #fff; }
.util-note { display: inline-flex; align-items: center; gap: 0.5rem; color: #fff; font-weight: 500; white-space: nowrap; }
.util-note .mark { width: 8px; height: 8px; }
.site-header.scrolled .util-bar { margin-top: -44px; }

.mainbar { background: var(--white); border-bottom: 1px solid var(--line); }
.mainbar .wrap { display: flex; align-items: center; justify-content: space-between; min-height: 74px; gap: 1rem; }
.brand { display: inline-flex; align-items: center; gap: 0.7rem; }
.brand svg { width: 40px; height: auto; color: var(--ink); }
.brand-logo { height: 52px; width: auto; display: block; }
/* real logo is black art on white; invert + screen drops the white box and shows white art on dark surfaces */
.brand-logo--light { filter: invert(1); mix-blend-mode: screen; }
.brand .wm { line-height: 1; }
.brand .wm b { font-family: "Roboto Slab", serif; font-weight: 800; font-size: 1.18rem; letter-spacing: 0.02em; display: block; }
.brand .wm span { font-size: 0.62rem; letter-spacing: 0.34em; text-transform: uppercase; color: var(--steel); }
.nav-links { display: none; align-items: center; gap: 2rem; }
.nav-links a { font-weight: 500; font-size: 0.98rem; padding-block: 4px; border-bottom: 2px solid transparent; transition: border-color 120ms linear, color 120ms linear; }
.nav-links a:hover { border-bottom-color: var(--crimson); }
.nav-links a[aria-current="page"] { border-bottom-color: var(--crimson); color: var(--crimson); }
.mainbar-cta { display: none; align-items: center; gap: 1.2rem; }
.mainbar-cta .phone { font-family: "Roboto Slab", serif; font-weight: 700; font-size: 1.02rem; }
.hamburger { display: inline-flex; flex-direction: column; gap: 5px; background: none; border: 0; padding: 10px; cursor: pointer; }
.hamburger span { width: 26px; height: 2px; background: var(--ink); display: block; }

@media (min-width: 1024px) {
  .nav-links { display: flex; }
  .mainbar-cta { display: flex; }
  .hamburger { display: none; }
}

/* mobile menu — full-viewport overlay (HARD RULE) */
.mobile-menu {
  position: fixed; top: 0; left: 0;
  width: 100vw; height: 100vh; height: 100dvh;
  z-index: 100; display: none; flex-direction: column;
  background: var(--ink); color: var(--paper);
  overflow-y: auto; padding: 24px;
  padding-top: max(24px, env(safe-area-inset-top));
  padding-bottom: max(24px, env(safe-area-inset-bottom));
}
.mobile-menu.is-open { display: flex; }
.mobile-menu .mm-top { display: flex; align-items: center; justify-content: space-between; }
.mm-close { width: 46px; height: 46px; display: inline-flex; align-items: center; justify-content: center; background: none; border: 1px solid var(--line-dark); color: var(--paper); font-size: 1.5rem; cursor: pointer; }
.mm-links { display: flex; flex-direction: column; margin-top: 8vh; }
.mm-links a { font-family: "Roboto Slab", serif; font-weight: 700; font-size: 2rem; padding: 18px 0; border-bottom: 1px solid var(--line-dark); }
.mm-links a:hover { color: #e79aa6; }
.mm-foot { margin-top: auto; display: flex; flex-direction: column; gap: 14px; padding-top: 32px; }

/* ---------- footer ---------- */
.site-footer { background: var(--graphite); color: var(--steel-light); }
.footer-grid { display: grid; grid-template-columns: 1fr; gap: 40px; padding-block: clamp(56px, 7vw, 84px); }
.footer-grid h4 { font-family: "Roboto Slab", serif; font-size: 0.82rem; letter-spacing: 0.18em; text-transform: uppercase; color: #fff; margin-bottom: 18px; }
.footer-grid a { display: block; padding: 5px 0; transition: color 120ms linear; }
.footer-grid a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid var(--line-dark); }
.footer-bottom .wrap { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; padding-block: 22px; font-size: 0.82rem; }
@media (min-width: 720px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr; } }
@media (min-width: 1024px) { .footer-grid { grid-template-columns: 2.4fr 1fr 1fr 1.3fr; } }

/* ---------- scroll reveal (confident-decisive) ---------- */
[data-animate] { opacity: 0; transform: translateY(18px); transition: opacity 520ms var(--ease-out), transform 520ms var(--ease-out); }
[data-animate].is-in { opacity: 1; transform: none; }

/* ---------- utilities ---------- */
.eq-grid { display: grid; gap: clamp(16px, 2.4vw, 26px); }
.g-2 { grid-template-columns: 1fr; }
.g-3 { grid-template-columns: 1fr; }
.g-4 { grid-template-columns: 1fr; }
@media (min-width: 640px) { .g-2 { grid-template-columns: 1fr 1fr; } .g-3 { grid-template-columns: 1fr 1fr; } .g-4 { grid-template-columns: 1fr 1fr; } }
@media (min-width: 980px) { .g-3 { grid-template-columns: repeat(3,1fr); } .g-4 { grid-template-columns: repeat(4,1fr); } }

/* ---------- page-specific layout blocks ---------- */
.hero-grid { display: grid; grid-template-columns: 1fr; max-width: var(--wrap); margin-inline: auto; }
.hero-copy { padding: clamp(48px, 7vw, 104px) clamp(20px, 5vw, 56px); }
.hero-plate { min-height: 320px; }
.offset-head { display: grid; gap: clamp(28px, 4vw, 60px); grid-template-columns: 1fr; }
.conv-grid { display: grid; gap: 32px; grid-template-columns: 1fr; align-items: center; }
@media (min-width: 900px) {
  .hero-grid { grid-template-columns: 1.05fr 0.95fr; }
  .hero-plate { min-height: 560px; }
  .conv-grid { grid-template-columns: 1.2fr 1fr; }
}
@media (min-width: 1000px) {
  .offset-head { grid-template-columns: 0.85fr 1.15fr; align-items: start; }
}

/* ---------- product detail rows ---------- */
.prod { display: grid; gap: clamp(24px, 4vw, 56px); grid-template-columns: 1fr; align-items: center; }
.prod + .prod { margin-top: clamp(48px, 7vw, 96px); }
.prod .plate { min-height: 300px; }
.prod-spec { list-style: none; margin: 22px 0 0; padding: 0; display: grid; gap: 10px; }
.prod-spec li { display: flex; gap: 12px; align-items: flex-start; color: var(--steel); }
.prod-spec i { color: var(--crimson); margin-top: 4px; }
@media (min-width: 900px) {
  .prod { grid-template-columns: 1fr 1fr; }
  .prod.rev .prod-text { order: 2; }
}

/* ---------- why-rows (dark editorial list) ---------- */
.why-rows { display: grid; }
.why-row { display: grid; grid-template-columns: auto 1fr; gap: 20px; padding: 24px 0; border-top: 1px solid var(--line-dark); }
.why-row:first-child { border-top: 0; padding-top: 0; }
.why-row > i { color: #e79aa6; font-size: 1.5rem; margin-top: 4px; }
.why-row h3 { font-size: 1.2rem; color: #fff; }
.why-row p { color: var(--steel-light); margin-top: 8px; }

/* ---------- real photos inside plates ---------- */
.plate img.plate-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; }
.plate::before { z-index: 1; }
.plate .plate-tag, .plate .plate-label { z-index: 2; }
.plate.has-img .plate-ico { display: none; }
.plate.has-img::before {
  background:
    linear-gradient(180deg, rgba(21,24,28,0.12) 0%, rgba(21,24,28,0.20) 55%, rgba(21,24,28,0.55) 100%),
    linear-gradient(45deg, rgba(255,255,255,0.05) 1px, transparent 1px),
    linear-gradient(-45deg, rgba(255,255,255,0.05) 1px, transparent 1px);
  background-size: 100% 100%, 26px 26px, 26px 26px;
}

/* ---------- FAQ (answer-first) ---------- */
.faq { border-top: 1px solid var(--line); }
.faq-item { border-bottom: 1px solid var(--line); padding: clamp(22px, 3vw, 32px) 0; display: grid; gap: 10px; grid-template-columns: 1fr; }
.faq-item h3 { font-size: clamp(1.15rem, 2vw, 1.4rem); }
.faq-item p { margin: 0; color: var(--steel); max-width: 68ch; }
@media (min-width: 820px) { .faq-item { grid-template-columns: 0.9fr 1.1fr; gap: 32px; } }

/* ---------- contact form ---------- */
.form-grid { display: grid; gap: 18px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .form-grid .col-2 { grid-column: span 2; } .form-grid { grid-template-columns: 1fr 1fr; } }
.field label { display: block; font-weight: 500; font-size: 0.9rem; margin-bottom: 7px; }
.field input, .field select, .field textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--white);
  border: 1px solid var(--line); border-radius: 0; padding: 13px 14px;
  transition: border-color 120ms linear;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--ink); }
.form-ok { background: var(--ink); color: var(--paper); padding: 16px 18px; border-left: 4px solid var(--crimson); }

/* reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  [data-animate] { opacity: 1 !important; transform: none !important; }
}
