/* Legion Brothers — powder-coat graphite, steel plates, butterfly yellow. */
:root {
  --graphite: #171B21;
  --panel: #222832;
  --panel-2: #2B323D;
  --line: #343C48;
  --steel: #E6E9ED;
  --steel-shadow: #C9CED6;
  --text: #EDEFF2;
  --muted: #A2ABB7;
  --yellow: #FFE01B;
  --yellow-deep: #F5C400;
  --red: #E3141B;
  --ink: #171B21;

  --font: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Source Serif 4", Georgia, serif;
  --wrap: 1200px;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --radius-plate: 6px;
  --step--1: 0.875rem;
  --step-0: 1rem;
  --step-1: 1.25rem;
  --step-2: 1.563rem;
  --step-3: clamp(1.75rem, 1.2rem + 2vw, 2.441rem);
  --step-4: clamp(2.1rem, 1.2rem + 3.6vw, 3.6rem);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 6rem; }
body {
  margin: 0; background: var(--graphite); color: var(--text);
  font-family: var(--font); font-size: var(--step-0); line-height: 1.6;
  font-variation-settings: "wdth" 100;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration-color: var(--yellow); text-underline-offset: 3px; }
a:hover { color: var(--yellow); }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; border-radius: 2px; }
h1, h2, h3 {
  font-family: var(--font); font-variation-settings: "wdth" 118; font-weight: 700;
  line-height: 1.12; letter-spacing: -0.01em; 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-1); }
p { margin: 0 0 1em; max-width: 68ch; }
.lede { font-size: var(--step-1); color: var(--muted); line-height: 1.5; max-width: 60ch; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: var(--yellow); color: var(--ink); padding: .5rem 1rem; z-index: 100; }
.skip:focus { left: 1rem; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 48px; padding: .75rem 1.4rem; border-radius: 3px; border: 2px solid transparent;
  font: 600 var(--step-0)/1.2 var(--font); font-variation-settings: "wdth" 105;
  text-decoration: none; cursor: pointer; transition: background-color .15s, color .15s, border-color .15s;
}
.btn-primary { background: var(--yellow); color: var(--ink); }
.btn-primary:hover { background: var(--yellow-deep); color: var(--ink); }
.btn-ghost { border-color: var(--line); color: var(--text); background: transparent; }
.btn-ghost:hover { border-color: var(--yellow); color: var(--yellow); }
.actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }
.text-link { font-weight: 600; text-decoration: underline; text-decoration-color: var(--yellow); text-decoration-thickness: 2px; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50; background: rgba(23, 27, 33, .92);
  backdrop-filter: blur(10px); border-bottom: 1px solid transparent; transition: border-color .2s, padding .2s;
}
.site-header.is-scrolled { border-bottom-color: var(--line); }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; min-height: 76px; transition: min-height .2s; }
.site-header.is-scrolled .header-row { min-height: 62px; }
.brand { display: flex; align-items: center; gap: .7rem; text-decoration: none; }
.brand:hover { color: inherit; }
.brand-mark { width: 44px; height: auto; }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-name { font-family: var(--serif); font-weight: 500; font-size: 1.45rem; color: #fff; letter-spacing: .005em; }
.brand-tag { font-family: var(--serif); font-style: italic; font-weight: 600; font-size: .82rem; color: var(--yellow); }
.site-nav { display: flex; align-items: center; gap: 1.75rem; }
.site-nav > ul { display: flex; gap: 1.5rem; list-style: none; margin: 0; padding: 0; }
.site-nav a { text-decoration: none; font-weight: 500; }
.site-nav > ul > li > a { padding: .5rem 0; display: inline-block; border-bottom: 2px solid transparent; }
.site-nav > ul > li > a[aria-current="page"] { border-bottom-color: var(--yellow); }
.has-menu { position: relative; }
.menu {
  position: absolute; top: 100%; left: -1rem; min-width: 280px; list-style: none; margin: 0; padding: .5rem 0;
  background: var(--panel); border: 1px solid var(--line); border-radius: 4px;
  opacity: 0; visibility: hidden; transform: translateY(4px); transition: opacity .15s, transform .15s, visibility .15s;
}
.has-menu:hover .menu, .has-menu:focus-within .menu, .has-menu.is-open .menu { opacity: 1; visibility: visible; transform: none; }
.menu a { display: block; padding: .55rem 1rem; }
.menu a:hover { background: var(--panel-2); }
.nav-cta { min-height: 42px; padding: .55rem 1.1rem; }
.nav-toggle { display: none; }

@media (max-width: 960px) {
  .nav-toggle {
    display: inline-flex; width: 48px; height: 48px; align-items: center; justify-content: center;
    background: none; border: 1px solid var(--line); border-radius: 3px; color: var(--text); cursor: pointer;
  }
  .bars, .bars::before, .bars::after { display: block; width: 20px; height: 2px; background: currentColor; position: relative; }
  .bars::before, .bars::after { content: ""; position: absolute; left: 0; }
  .bars::before { top: -6px; } .bars::after { top: 6px; }
  .site-nav {
    position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 1rem;
    padding: 1rem var(--gutter) 1.5rem; background: var(--graphite); border-bottom: 1px solid var(--line);
    display: none;
  }
  .site-nav.is-open { display: flex; }
  html:not(.js) .site-nav { display: flex; position: static; }
  .site-nav > ul { flex-direction: column; gap: 0; }
  .site-nav > ul > li > a { padding: .75rem 0; display: block; }
  .menu { position: static; opacity: 1; visibility: visible; transform: none; border: 0; background: none; padding: 0 0 .5rem 1rem; min-width: 0; }
  .menu a { padding: .4rem 0; color: var(--muted); }
  .brand-name { font-size: 1.2rem; }
}

/* Hero: the scope trace is the signature moment */
.hero { position: relative; overflow: hidden; padding: clamp(3rem, 8vw, 6.5rem) 0 clamp(3rem, 7vw, 5.5rem); border-bottom: 1px solid var(--line); }
.hero-watermark { position: absolute; right: -8%; top: -10%; width: min(70vw, 780px); opacity: .05; pointer-events: none; transform: rotate(-8deg); }
.hero-grid { position: relative; display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
.hero h1 { font-size: clamp(2.3rem, 1.3rem + 3.6vw, 4.1rem); font-variation-settings: "wdth" 122; max-width: 15ch; }
.hero-kicker { color: var(--yellow); font-weight: 600; margin-bottom: 1.25rem; font-variation-settings: "wdth" 110; }
.scope { margin: 0; background: #0F1216; border: 1px solid var(--line); border-radius: 6px; padding: 1rem 1.1rem .9rem; box-shadow: inset 0 0 60px rgba(255, 224, 27, .03); }
.scope-head { display: flex; justify-content: space-between; gap: 1rem; color: var(--muted); font-size: var(--step--1); margin-bottom: .5rem; font-variant-numeric: tabular-nums; }
.scope svg { width: 100%; height: auto; display: block; overflow: visible; }
.scope .grid line { stroke: #232A33; stroke-width: 1; }
.scope .tdc { stroke: #3A4350; stroke-dasharray: 4 5; }
.scope .axis { fill: var(--muted); font: 500 13px var(--font); }
.trace-motored { fill: none; stroke: #59636F; stroke-width: 2; stroke-dasharray: 6 6; }
.trace-fired { fill: none; stroke: var(--yellow); stroke-width: 3; stroke-linejoin: round; filter: drop-shadow(0 0 6px rgba(255, 224, 27, .45)); }
.trace-peak { fill: var(--red); }
.scope figcaption { color: var(--muted); font-size: var(--step--1); margin-top: .6rem; }
html.js .trace-fired { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 2.4s cubic-bezier(.45, .05, .25, 1) .35s forwards; }
html.js .trace-peak { opacity: 0; animation: blip .5s ease-out 2.5s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes blip { 0% { opacity: 0; r: 1; } 60% { opacity: 1; r: 9; } 100% { opacity: 1; r: 5; } }
@media (max-width: 860px) { .hero-grid { grid-template-columns: 1fr; } }

/* Sections */
.section { padding: clamp(3.5rem, 8vw, 6rem) 0; }
.section-tight { padding: clamp(2rem, 5vw, 3.5rem) 0; }
.section + .section:not(.cta-band):not(.capability) { padding-top: 0; }
.section-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: .5rem 2rem; margin-bottom: 2rem; }
.section-head h2 { margin: 0; }
.section-head h2 a { text-decoration: none; }
.section-head p { color: var(--muted); margin: 0; max-width: 56ch; }
.sub-h { font-size: var(--step-1); margin: 2.5rem 0 1rem; font-variation-settings: "wdth" 110; }
.sub-h:first-child { margin-top: 0; }
.sub-h a { text-decoration: none; }

/* Steel plates hold the white-background rig photos */
.plate {
  background: linear-gradient(180deg, #F1F3F5 0%, var(--steel) 100%);
  border-radius: var(--radius-plate); aspect-ratio: 650 / 560; display: grid; place-items: center; overflow: hidden;
  box-shadow: inset 0 -1px 0 var(--steel-shadow);
}
.plate img { width: 92%; height: 92%; object-fit: contain; mix-blend-mode: multiply; transition: transform .35s ease; }
.plate-empty { color: #7A838F; font-size: var(--step--1); display: grid; justify-items: center; gap: .6rem; }
.plate-empty::before { content: ""; width: 34%; max-width: 160px; aspect-ratio: 700 / 590; background: url(/static/brand/butterfly.svg) center / contain no-repeat; opacity: .18; filter: grayscale(1); }
.plate-large:has(.plate-empty) { aspect-ratio: 650 / 380; }

/* Families on home */
.families { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, 1fr); gap: 1.25rem; }
.family { grid-column: span 2; }
.family-lead { grid-column: span 4; grid-row: span 2; }
.family:nth-child(2) { grid-column: span 2; }
.family:nth-child(4), .family:nth-child(5) { grid-column: span 3; }
.family a { display: flex; flex-direction: column; height: 100%; text-decoration: none; background: var(--panel); border-radius: 8px; padding: .75rem; border: 1px solid transparent; transition: border-color .2s; }
.family a:hover { border-color: var(--yellow); color: inherit; }
.family a:hover .plate img { transform: scale(1.03); }
.family-lead .plate { flex: 1; aspect-ratio: auto; min-height: 320px; }
.family-text { padding: 1rem .5rem .5rem; }
.family-text h3 { margin-bottom: .35rem; }
.family-text p { color: var(--muted); font-size: var(--step--1); margin-bottom: .75rem; }
.count { font-size: var(--step--1); font-weight: 600; color: var(--yellow); }
@media (max-width: 860px) {
  .families { grid-template-columns: 1fr 1fr; }
  .family, .family-lead, .family:nth-child(n) { grid-column: span 1; grid-row: auto; }
  .family-lead { grid-column: span 2; }
  .family-lead .plate { min-height: 220px; }
}
@media (max-width: 520px) { .families { grid-template-columns: 1fr; } .family-lead { grid-column: span 1; } }

/* Capability */
.capability { background: var(--panel); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.capability-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 6vw, 5rem); align-items: start; }
.points { margin: 0; display: grid; gap: 0; }
.points > div { padding: 1.1rem 0; border-top: 1px solid var(--line); }
.points > div:last-child { border-bottom: 1px solid var(--line); }
.points dt { font-weight: 700; font-variation-settings: "wdth" 112; font-size: var(--step-1); margin-bottom: .2rem; }
.points dd { margin: 0; color: var(--muted); }
@media (max-width: 860px) { .capability-grid { grid-template-columns: 1fr; } }

/* Product grid */
.plate-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1.75rem 1.25rem; }
.plate-card a { display: block; text-decoration: none; }
.plate-card a:hover { color: inherit; }
.plate-card a:hover .plate img { transform: scale(1.04); }
.plate-card a:hover .card-name { text-decoration: underline; text-decoration-color: var(--yellow); }
.code { display: block; color: var(--yellow); font-weight: 600; font-size: var(--step--1); font-variant-numeric: tabular-nums; font-variation-settings: "wdth" 90; margin: .85rem 0 .2rem; letter-spacing: .02em; }
.card-name { display: block; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }

/* Page heads & breadcrumbs */
.page-head { padding: clamp(2.5rem, 6vw, 4rem) 0 clamp(1.5rem, 4vw, 2.5rem); border-bottom: 1px solid var(--line); }
.page-head h1 { max-width: 22ch; overflow-wrap: break-word; }
.crumbs { display: flex; flex-wrap: wrap; gap: .4rem; color: var(--muted); font-size: var(--step--1); margin-bottom: 1.25rem; }
.crumbs a { text-decoration: none; display: inline-flex; align-items: center; min-height: 24px; }
.crumbs a:hover { text-decoration: underline; }
.subnav { list-style: none; padding: 0; margin: 1.5rem 0 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.subnav a { display: inline-block; padding: .5rem .9rem; border: 1px solid var(--line); border-radius: 3px; text-decoration: none; font-size: var(--step--1); font-weight: 500; }
.subnav a[aria-current="page"] { background: var(--yellow); color: var(--ink); border-color: var(--yellow); }

/* Product page */
.product-head { border-bottom: 0; padding-bottom: 0; }
.product-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.plate-large { aspect-ratio: 650 / 600; }
.product-info h1 { font-size: clamp(1.7rem, 1.1rem + 2.2vw, 2.6rem); max-width: none; }
.product-info .code { margin-top: 0; font-size: var(--step-0); }
.contact-line { color: var(--muted); font-size: var(--step--1); margin-top: 1.25rem; }
.detail-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: clamp(2rem, 5vw, 4rem); align-items: start; }
.prose h2 { font-size: var(--step-2); margin-top: 1.5em; }
.prose h2:first-child { margin-top: 0; }
.prose ul { padding-left: 1.2rem; }
.prose li { margin-bottom: .35rem; }
.prose li::marker { color: var(--yellow); }
.spec-table { width: 100%; border-collapse: collapse; font-size: var(--step--1); margin-bottom: .75rem; }
.spec-table th, .spec-table td { text-align: left; vertical-align: top; padding: .55rem .75rem .55rem 0; border-top: 1px solid var(--line); }
.spec-table th { font-weight: 600; width: 34%; color: var(--text); font-variation-settings: "wdth" 105; }
.spec-table tr:not(.group-start) td { border-top-color: transparent; }
.spec-table .spec-label { color: var(--muted); width: 26%; }
.spec-note { color: var(--muted); font-size: var(--step--1); }
@media (max-width: 520px) {
  .spec-table, .spec-table tbody, .spec-table tr { display: block; }
  .spec-table tr { display: grid; grid-template-columns: 40% 1fr; }
  .spec-table th { display: block; width: auto; grid-column: 1 / -1; padding-top: .9rem; }
  .spec-table td[colspan] { grid-column: 1 / -1; }
  .spec-table tr:not(.group-start) td { border-top: 0; }
  .spec-table td, .spec-table .spec-label { width: auto; }
}
.quote-box { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: clamp(1.25rem, 3vw, 2rem); position: sticky; top: 90px; }
.quote-box h2 { font-size: var(--step-2); }
.quote-box > p { color: var(--muted); }
.related { border-top: 1px solid var(--line); padding-top: clamp(2.5rem, 5vw, 3.5rem) !important; }
@media (max-width: 860px) {
  .product-grid, .detail-grid { grid-template-columns: 1fr; }
  .quote-box { position: static; }
}

/* Forms */
.quote-form { display: grid; gap: 1rem; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.quote-form label { display: grid; gap: .35rem; font-size: var(--step--1); font-weight: 600; }
.quote-form input, .quote-form textarea {
  width: 100%; font: 400 var(--step-0)/1.4 var(--font); color: var(--text); background: var(--graphite);
  border: 1px solid var(--line); border-radius: 3px; padding: .75rem .85rem; min-height: 48px;
}
.quote-form input:focus, .quote-form textarea:focus { outline: 2px solid var(--yellow); outline-offset: 0; border-color: var(--yellow); }
.quote-form .btn { justify-self: start; }
.hp { position: absolute; left: -9999px; }
.form-status { margin: 0; font-weight: 600; min-height: 1.5em; }
.form-status.is-ok { color: var(--yellow); }
.form-status.is-error { color: #FF8A8E; }
@media (max-width: 520px) { .field-row { grid-template-columns: 1fr; } }

/* CTA band */
.cta-band { background: var(--yellow); color: var(--ink); }
.cta-band a:hover { color: var(--ink); }
.cta-grid { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.5rem 3rem; }
.cta-band h2 { margin-bottom: .3em; }
.cta-band p { margin: 0; }
.cta-band .actions { margin-top: 0; }
.cta-band .btn-primary { background: var(--ink); color: var(--yellow); }
.cta-band .btn-primary:hover { background: #000; color: var(--yellow); }
.cta-band .btn-ghost { border-color: var(--ink); color: var(--ink); }
.cta-band .btn-ghost:hover { background: var(--ink); color: var(--yellow); }

/* Downloads table */
.sheet-table { width: 100%; border-collapse: collapse; margin-bottom: 1rem; }
.sheet-table th { text-align: left; font-size: var(--step--1); color: var(--muted); font-weight: 500; padding: .5rem .75rem; border-bottom: 1px solid var(--line); }
.sheet-table td { padding: .8rem .75rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.sheet-table td.code { margin: 0; display: table-cell; white-space: nowrap; }
.sheet-table td a { text-decoration: none; }
.sheet-table td a:hover { text-decoration: underline; }
.sheet-table .dl { text-align: right; white-space: nowrap; }
.sheet-table .dl a { color: var(--yellow); font-weight: 600; }
@media (max-width: 600px) {
  .sheet-table thead { display: none; }
  .sheet-table tr { display: grid; grid-template-columns: auto 1fr; gap: .2rem .75rem; padding: .8rem 0; border-bottom: 1px solid var(--line); }
  .sheet-table td { border: 0; padding: 0; }
  .sheet-table .dl { grid-column: 2; text-align: left; }
}

/* Contact, clients, empty states */
.contact-info h2 { font-size: var(--step-1); margin-top: 1.75rem; }
.contact-info h2:first-child { margin-top: 0; }
.contact-info address { font-style: normal; color: var(--muted); max-width: 40ch; }
.plain { list-style: none; padding: 0; margin: 0; }
.plain li { margin-bottom: .35rem; }
.empty { color: var(--muted); font-size: var(--step-1); }
.client-list { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; }
.client-list li { background: var(--panel); border-radius: 6px; padding: 1.25rem; display: grid; gap: .25rem; }
.client-list img { max-height: 56px; width: auto; margin-bottom: .5rem; }
.client-name { font-weight: 600; }
.client-loc { color: var(--muted); font-size: var(--step--1); }

/* Footer */
.site-footer { background: #12151A; border-top: 1px solid var(--line); padding: clamp(3rem, 6vw, 4.5rem) 0 1.5rem; color: var(--muted); font-size: var(--step--1); }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1.3fr; gap: 2rem; }
.footer-logo { margin-bottom: 1.25rem; }
.footer-logo .brand-mark { width: 64px; }
.footer-logo .brand-name { font-size: 1.75rem; }
.footer-logo .brand-tag { font-size: .95rem; }
.site-footer .footer-logo:hover { text-decoration: none; }
.footer-h { font-size: var(--step-0); color: var(--text); font-variation-settings: "wdth" 105; margin-bottom: .75rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: .4rem; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.site-footer address { font-style: normal; line-height: 1.7; }
.footer-base { margin-top: 2.5rem; padding-top: 1.25rem; border-top: 1px solid var(--line); }
.footer-base p { margin: 0; }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .footer-grid { grid-template-columns: 1fr; } }

/* Scroll reveal: content is visible unless JS is running (html.js) */
html.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; }
html.js .reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html.js .reveal { opacity: 1; transform: none; }
  html.js .trace-fired { stroke-dashoffset: 0; }
  html.js .trace-peak { opacity: 1; }
}
