/* ==========================================================================
   CraftTek — site.css
   Dark only. System fonts. No JavaScript.
   ========================================================================== */

/* 1. Tokens ------------------------------------------------------------- */

:root {
  --bg:          #0f0f0f;
  --bg-raised:   #171717;
  --bg-sunken:   #0a0a0a;
  --border:      #262626;
  --border-lit:  #333;

  --text:        #ededed;
  --text-dim:    #a1a1a1;
  --text-faint:  #6b6b6b;

  --accent:      #ff6000;
  --accent-hover:#ff7a2e;
  --accent-dim:  rgba(255, 96, 0, .12);

  --font: system-ui, -apple-system, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, sans-serif;

  --s1: .5rem;  --s2: 1rem;  --s3: 1.5rem; --s4: 2rem;
  --s5: 3rem;   --s6: 4rem;  --s7: 6rem;   --s8: 8rem;

  --max-w:   1100px;
  --measure: 68ch;
  --radius:  6px;
}

/* 2. Reset -------------------------------------------------------------- */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* clears the sticky header when landing on an anchor target */
  scroll-padding-top: calc(68px + var(--s3));
}

body, h1, h2, h3, h4, p, ul, ol, figure, blockquote {
  margin: 0;
}

ul, ol { padding: 0; list-style: none; }

img, svg { display: block; max-width: 100%; }

/* 3. Base --------------------------------------------------------------- */

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  line-height: 1.15;
  letter-spacing: -.02em;
  font-weight: 700;
  text-wrap: balance;
}

h1 { font-size: clamp(2.25rem, 5.5vw, 3.75rem); letter-spacing: -.035em; }
h2 { font-size: clamp(1.625rem, 3.2vw, 2.25rem); letter-spacing: -.025em; }
h3 { font-size: 1.1875rem; letter-spacing: -.015em; }
h4 { font-size: 1rem; }

p { text-wrap: pretty; }
p + p { margin-top: var(--s3); }

a {
  color: var(--accent);
  text-decoration-color: rgba(255, 96, 0, .35);
  text-underline-offset: .18em;
  transition: color .12s ease, text-decoration-color .12s ease;
}
a:hover { color: var(--accent-hover); text-decoration-color: currentColor; }

strong { font-weight: 650; color: #fff; }

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

::selection { background: var(--accent); color: #fff; }

/* 4. Layout ------------------------------------------------------------- */

.container {
  width: 100%;
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: var(--s4);
}

.section { padding-block: var(--s7); }
.section + .section { padding-top: 0; }
.band + .section { padding-top: 0; }   /* band already provides the gap */
.section--tight { padding-block: var(--s6); }

.prose { max-width: var(--measure); }

.rule {
  border: 0;
  border-top: 1px solid var(--border);
  margin-block: var(--s6);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--accent);
  color: #fff;
  padding: var(--s2) var(--s3);
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus {
  left: var(--s2);
  top: var(--s2);
  color: #fff;
}

/* 5. Header / nav ------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(15, 15, 15, .88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s4);
  min-height: 68px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: .55em;
  text-decoration: none;
  color: var(--text);
  flex: none;
}
.logo svg {
  width: 1.5em;
  height: 1.515em;
  color: var(--accent);
  flex: none;
}
.logo span {
  font-size: 1.1875rem;
  font-weight: 800;
  letter-spacing: -.025em;
}
.logo:hover { color: var(--text); }
.logo:hover svg { color: var(--accent-hover); }

/* the landmark wrapper is transparent to layout — .nav stays the flex child
   of .site-header .container, so every rule below is unaffected */
.site-nav { display: contents; }

.nav ul {
  display: flex;
  align-items: center;
  gap: var(--s4);
}

.nav a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: .9375rem;
  font-weight: 500;
  padding-block: var(--s1);
  transition: color .12s ease;
}
.nav a:hover { color: var(--text); }
.nav a[aria-current="page"] { color: var(--text); }

/* mobile disclosure — no JS */
.nav-toggle { display: none; }

/* 6. Hero --------------------------------------------------------------- */

.hero {
  padding-block: clamp(var(--s6), 11vw, var(--s8));
  border-bottom: 1px solid var(--border);
}

.hero h1 { max-width: 18ch; }
.hero .label { margin-bottom: var(--s2); }

.accent { color: var(--accent); }

.hero-lede {
  margin-top: var(--s4);
  max-width: 56ch;
  font-size: clamp(1.0625rem, 1.6vw, 1.1875rem);
  color: var(--text-dim);
}

.hero-actions {
  margin-top: var(--s5);
  display: flex;
  flex-wrap: wrap;
  gap: var(--s3);
  align-items: center;
}

/* 7. Buttons ------------------------------------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: .5em;
  padding: .7em 1.35em;
  border-radius: var(--radius);
  font-size: .9375rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background .12s ease, border-color .12s ease, color .12s ease;
}
.btn--primary {
  background: var(--accent);
  color: #fff;
}
.btn--primary:hover { background: var(--accent-hover); color: #fff; }

.btn--ghost {
  border-color: var(--border-lit);
  color: var(--text);
}
.btn--ghost:hover {
  border-color: var(--text-faint);
  color: var(--text);
  background: var(--bg-raised);
}

/* 8. Labels & headings -------------------------------------------------- */

.label {
  display: block;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: var(--s3);
}

.section-head { margin-bottom: var(--s5); }
.section-head p {
  margin-top: var(--s2);
  color: var(--text-dim);
  max-width: 60ch;
}

.more-link { margin-top: var(--s4); }

/* 9. Capability cards --------------------------------------------------- */

.grid {
  display: grid;
  gap: var(--s3);
  grid-template-columns: repeat(4, 1fr);
}

.card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--s3);
  display: flex;
  flex-direction: column;
  transition: border-color .15s ease;
}
.card:hover { border-color: var(--border-lit); }

.card h3 {
  padding-top: var(--s2);
  border-top: 2px solid var(--accent);
  margin-bottom: var(--s2);
  font-size: 1.0625rem;
  text-wrap: balance;
}

/* heading links stay headings — accent is punctuation, not body text */
.card h3 a {
  color: inherit;
  text-decoration: none;
}
.card:hover h3 a,
.card h3 a:hover { color: var(--accent); }

.card ul {
  margin-top: auto;
  padding-top: var(--s1);
  color: var(--text-dim);
  font-size: .875rem;
  line-height: 1.45;
}
.card li { padding-block: .34em; }
.card li + li { border-top: 1px solid var(--border); }

/* 9b. Domains (capabilities page) ---------------------------------------
   Two columns: a framing paragraph on the left, the specifics on the right.
   The specifics are the credibility, so they get the visual weight.        */

.domains {
  display: grid;
  gap: var(--s5);
}

.domain {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: var(--s5);
  padding-top: var(--s4);
  border-top: 1px solid var(--border);
}
.domains .domain:first-child { padding-top: 0; border-top: 0; }

.domain-head h3 {
  padding-left: var(--s2);
  border-left: 3px solid var(--accent);
  margin-bottom: var(--s2);
  font-size: 1.3125rem;
}
.domain-head p { color: var(--text-dim); font-size: .9375rem; }

.domain-list { font-size: .9375rem; }
.domain-list li {
  padding: .55em 0 .55em var(--s3);
  border-bottom: 1px solid var(--border);
  position: relative;
  color: var(--text);
}
.domain-list li:first-child { padding-top: 0; }
.domain-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.domain-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 1.05em;
  width: 8px;
  height: 1px;
  background: var(--accent);
}
.domain-list li:first-child::before { top: .55em; }

/* breadth statement — the honest catch-all */
.breadth {
  margin-top: var(--s6);
  padding: var(--s4);
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  max-width: var(--measure);
}
.breadth h3 { margin-bottom: var(--s1); font-size: 1.125rem; }
.breadth p { color: var(--text-dim); font-size: .9375rem; }
.breadth p + p { margin-top: var(--s2); }

/* 9c. Engagement models -------------------------------------------------- */

.engage {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--border);
}
.engage-item {
  display: grid;
  grid-template-columns: 13rem 1fr;
  gap: var(--s4);
  padding-block: var(--s3);
  border-bottom: 1px solid var(--border);
  align-items: baseline;
}
.engage-item h3 { font-size: 1.125rem; }
.engage-item p { color: var(--text-dim); font-size: .9375rem; max-width: 58ch; }

/* 9d. Contact cards ------------------------------------------------------
   Two wide cards; the address is the point, so it gets its own line.       */

.contact-cards {
  display: grid;
  gap: var(--s3);
  grid-template-columns: repeat(2, 1fr);
  max-width: 860px;
}

.contact-card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: var(--s4);
}
.contact-card h3 { margin-bottom: var(--s1); font-size: 1.125rem; }
.contact-card p { color: var(--text-dim); font-size: .9375rem; }

.contact-email {
  display: inline-block;
  margin-top: var(--s3);
  font-size: 1.0625rem;
  font-weight: 600;
  text-decoration: none;
  word-break: break-word;
}
.contact-email:hover { text-decoration: underline; }

/* 10. Feature list (why us) --------------------------------------------- */

.features {
  display: grid;
  gap: var(--s5) var(--s5);
  grid-template-columns: repeat(4, 1fr);
}
.features h3 {
  margin-bottom: var(--s1);
  font-size: 1.0625rem;
  text-wrap: balance;
}
.features p { color: var(--text-dim); font-size: .9375rem; }

.team .role {
  margin-top: 0;
  color: var(--accent);
  font-size: .8125rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.team .role + p { margin-top: var(--s2); }

/* 11. Steps ------------------------------------------------------------- */

.steps { counter-reset: step; }
.step {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--s3);
  padding-block: var(--s3);
}
.step + .step { border-top: 1px solid var(--border); }
.step::before {
  counter-increment: step;
  content: counter(step, decimal-leading-zero);
  font-variant-numeric: tabular-nums;
  font-size: .8125rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: .05em;
  padding-top: .35em;
}
.step h3 { margin-bottom: .25em; }
.step p { color: var(--text-dim); font-size: .9375rem; }

/* 11b. Texture band -----------------------------------------------------
   One sepia photograph per page, heavily darkened. Carries the "old school
   work ethic" half of the tagline without competing with the type.         */

.band {
  position: relative;
  height: clamp(140px, 18vw, 220px);
  margin-block: var(--s7);
  border-block: 1px solid var(--border);
  background: var(--bg-sunken);
  overflow: hidden;
  isolation: isolate;
}

/* directly under the hero: no double rule, no gap above */
.hero + .band {
  margin-top: 0;
  border-top: 0;
}

/* image layer: desaturated and dimmed, so it never fights the type */
.band::before {
  content: "";
  position: absolute;
  inset: 0;
  background: inherit;
  background-image: var(--tex);
  background-size: cover;
  background-position: center;
  filter: grayscale(1) contrast(1.08) brightness(.5);
}

/* fade the edges into the page so it reads as texture, not a photo slot */
.band::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg,  var(--bg) 0%, transparent 28%,
                            transparent 72%, var(--bg) 100%),
    linear-gradient(180deg, var(--bg) 0%, transparent 40%,
                            rgba(15,15,15,.5) 100%);
}

.band--tracks  { --tex: url("/assets/img/tex/tracks.jpg"); }
.band--tractor { --tex: url("/assets/img/tex/tractor.jpg"); }
.band--valves  { --tex: url("/assets/img/tex/valves.jpg"); }
.band--rows    { --tex: url("/assets/img/tex/rows.jpg"); }
.band--tower   { --tex: url("/assets/img/tex/tower.jpg"); }

/* 12. CTA band ---------------------------------------------------------- */

.cta {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--s6) var(--s5);
  text-align: center;
}
.cta p {
  margin: var(--s2) auto 0;
  max-width: 48ch;
  color: var(--text-dim);
}
.cta .hero-actions { justify-content: center; }

/* 13. Footer ------------------------------------------------------------ */

.site-footer {
  border-top: 1px solid var(--border);
  margin-top: var(--s7);
  padding-block: var(--s5);
  color: var(--text-dim);
  font-size: .9375rem;
}

.footer-grid {
  display: grid;
  gap: var(--s4);
  grid-template-columns: 1.4fr 1.4fr .8fr;
  align-items: start;
}

.site-footer h2 {
  font-size: .75rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: var(--s2);
  font-weight: 600;
}
.site-footer li + li { margin-top: .4em; }

/* Company links: two rows (3 + 2), filled left-to-right */
.footer-links {
  display: grid;
  grid-template-columns: repeat(3, auto);
  gap: .45em var(--s4);
  justify-content: start;
}
.footer-links li + li { margin-top: 0; }
.site-footer a { color: var(--text-dim); text-decoration: none; }
.site-footer a:hover { color: var(--accent); }

.footer-tag { color: var(--text-faint); margin-top: var(--s2); max-width: 34ch; }

.footer-bottom {
  margin-top: var(--s5);
  padding-top: var(--s3);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  gap: var(--s3);
  flex-wrap: wrap;
  color: var(--text-faint);
  font-size: .875rem;
}

.social { display: flex; gap: var(--s3); }

/* 14. Responsive -------------------------------------------------------- */

@media (max-width: 980px) {
  /* 4 across gets cramped — drop to 2 x 2 */
  .grid,
  .features { grid-template-columns: repeat(2, 1fr); }

  .domain { grid-template-columns: 1fr; gap: var(--s3); }
  .engage-item { grid-template-columns: 10rem 1fr; gap: var(--s3); }
}

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

@media (max-width: 640px) {
  :root { --s7: 4rem; --s8: 5rem; }

  .container { padding-inline: var(--s3); }

  /* nav collapses into a CSS-only disclosure */
  .site-header .container { flex-wrap: wrap; min-height: 60px; }
  html { scroll-padding-top: calc(60px + var(--s2)); }

  .nav-toggle {
    display: block;
    cursor: pointer;
    list-style: none;
    color: var(--text-dim);
    font-size: .9375rem;
    font-weight: 500;
    padding: var(--s1) 0;
  }
  .nav-toggle::-webkit-details-marker { display: none; }
  .nav[open] .nav-toggle { color: var(--text); }

  .nav ul {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    width: 100%;
    padding-bottom: var(--s2);
  }
  .nav li { border-top: 1px solid var(--border); }
  .nav li a { display: block; padding: .7em 0; }

  .grid,
  .features { grid-template-columns: 1fr; }
  .features { gap: var(--s4); }

  .engage-item { grid-template-columns: 1fr; gap: var(--s1); }
  .breadth { padding: var(--s3); }
  .contact-cards { grid-template-columns: 1fr; }
  .contact-card { padding: var(--s3); }

  .footer-grid { grid-template-columns: 1fr; gap: var(--s4); }
  .footer-links { grid-template-columns: repeat(2, auto); }
  .cta { padding: var(--s5) var(--s3); }
  .step { grid-template-columns: 1fr; gap: var(--s1); }
}

/* nav is always visible on wider screens */
@media (min-width: 641px) {
  .nav { display: block !important; }
  .nav ul { display: flex !important; }
}

/* 15. Motion ------------------------------------------------------------ */

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

/* 16. Print -------------------------------------------------------------
   Dark-only screens print as black rectangles otherwise.                  */

@media print {
  :root {
    --bg: #fff; --bg-raised: #fff; --border: #ccc;
    --text: #000; --text-dim: #333; --text-faint: #555;
    --accent: #c44a00;
  }
  body { background: #fff; color: #000; font-size: 11pt; }
  .accent { color: #000; font-weight: 600; }
  .site-header { position: static; border-bottom: 1px solid #ccc; }
  .nav, .skip-link, .hero-actions, .cta, .band { display: none; }
  .card,
  .domain,
  .engage-item,
  .breadth { break-inside: avoid; border-color: #ccc; }
  .card { border: 1px solid #ccc; }
  .domain-head h3,
  .breadth { border-left: 2px solid #999; }
  a { color: #000; text-decoration: underline; }
  a[href^="http"]::after,
  a[href^="mailto"]::after {
    content: " (" attr(href) ")";
    font-size: 9pt;
    color: #555;
  }
  .section { padding-block: 1.5rem; }
}
