/* ============================================================
   Samoforge Labs: design tokens
   Palette rationale: food-safe blue is the one color almost never
   found in food, which is exactly why the industry paints its
   gloves, plasters, hairnets and conveyor belts with it: a stray
   one shows up immediately. That's the accent here, not a generic
   SaaS vermilion. Steel is a cooled, blue-leaning dark rather than
   a flat near-black. Ember (the "forge" in Samoforge) survives only
   as a rare, deliberate spark, not the primary action color.
   ============================================================ */
:root {
  --steel-950: #0e171c;
  --steel-900: #142128;
  --steel-800: #1c2d35;
  --steel-700: #2a4049;
  --steel-200: #c7d4d8;
  --steel-100: #e4ebec;

  --blue: #0c87b8;
  --blue-bright: #3bb6e8;
  --blue-dark: #09658a;
  --blue-wash: #e4f3f9;

  --ember: #d9641e;

  --paper: #f2eee4;
  --paper-dim: #e8e2d3;
  --ink: #16202a;
  --ink-muted: #51606a;

  --radius: 3px;
  --maxw: 1280px;
  --edge: clamp(20px, 5vw, 64px);
  --font: "Satoshi", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; min-width: 0; }
html { scroll-behavior: smooth; overflow-x: hidden; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  max-width: 100vw;
}

h1, h2, h3, p { overflow-wrap: break-word; word-break: break-word; }
h1, h2, h3 { line-height: 1.1; margin: 0 0 0.5em; letter-spacing: -0.015em; }
h1, h2 { font-weight: 900; }
h1 { font-size: clamp(1.9rem, 5.2vw, 4rem); }
h2 { font-size: clamp(1.4rem, 3.4vw, 2.6rem); }
h3 { font-size: 1.15rem; font-weight: 700; letter-spacing: -0.005em; }
p { margin: 0 0 1em; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

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

:focus-visible {
  outline: 2px solid var(--blue-bright);
  outline-offset: 2px;
}

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

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--edge); }
.narrow { max-width: 42rem; }
.lead { font-size: clamp(1.12rem, 1.8vw, 1.35rem); line-height: 1.55; color: var(--ink-muted); max-width: 46rem; }
.section-dark .lead { color: var(--steel-200); }

.skip-link { position: absolute; left: -9999px; top: 0; }
.skip-link:focus { left: 8px; top: 8px; background: var(--blue); color: #fff; padding: 8px 12px; z-index: 999; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 0.8em 1.5em;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 0.95rem;
  border: 2px solid transparent;
  transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-dark); }
.btn-ghost { border-color: currentColor; }
.btn-large { font-size: 1.1rem; padding: 0.95em 1.9em; }
.btn-small { padding: 0.55em 1.1em; font-size: 0.88rem; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(14,23,28,0.93);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--steel-700);
}
.header-inner {
  display: flex; align-items: center; gap: 28px;
  height: 72px; color: var(--paper);
}
.logo {
  display: flex; align-items: center; gap: 10px;
  font-weight: 800; letter-spacing: 0.02em; font-size: 0.98rem;
  color: var(--paper); margin-right: auto;
}
.logo-mark { color: var(--blue-bright); flex-shrink: 0; }
.logo-spark { fill: var(--ember); }
.main-nav { display: flex; gap: 24px; }
.main-nav a { font-size: 0.92rem; color: var(--steel-200); }
.main-nav a:hover { color: var(--blue-bright); }

.nav-toggle {
  display: none; background: none; border: 0; cursor: pointer;
  width: 32px; height: 32px; flex-direction: column; justify-content: center; gap: 5px;
}
.nav-toggle span { display: block; width: 100%; height: 2px; background: var(--paper); }
.mobile-nav {
  display: none; flex-direction: column;
  background: var(--steel-950); border-top: 1px solid var(--steel-700);
  padding: 8px var(--edge) 16px;
}
.mobile-nav a { color: var(--steel-200); padding: 10px 0; border-bottom: 1px solid var(--steel-700); }
.mobile-nav.open { display: flex; }

@media (max-width: 860px) {
  .main-nav, .header-inner > .btn { display: none; }
  .nav-toggle { display: flex; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  background: var(--steel-950);
  color: var(--paper);
  min-height: min(92vh, 820px);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}
.hero-media {
  position: absolute; inset: 0; z-index: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.hero-scrim {
  position: absolute; inset: 0; z-index: 1;
  background:
    linear-gradient(0deg, rgba(14,23,28,0.97) 0%, rgba(14,23,28,0.75) 38%, rgba(14,23,28,0.35) 68%, rgba(14,23,28,0.55) 100%);
}
.hero-inner {
  position: relative; z-index: 2;
  width: 100%;
  padding: 0 var(--edge) 64px;
  max-width: 980px;
}
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.92rem; font-weight: 600; color: var(--blue-bright);
  margin: 0 0 1em;
}
.hero-eyebrow::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: var(--blue-bright); flex-shrink: 0;
}
.hero-sub { font-size: clamp(1.15rem, 2.4vw, 1.45rem); color: var(--steel-200); max-width: 620px; }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 1.6em; }
.hero-cta .btn-ghost { color: var(--paper); }

/* ---------- Sections ---------- */
.section { padding: clamp(64px, 11vw, 120px) 0; position: relative; }
.section-dark { background: var(--steel-950); color: var(--paper); }

.section-index {
  font-size: clamp(3.5rem, 13vw, 9rem);
  font-weight: 900;
  line-height: 1;
  color: var(--ink);
  opacity: 0.06;
  position: absolute;
  top: 0.1em; left: var(--edge);
  z-index: 0;
  pointer-events: none;
  user-select: none;
}
.section-dark .section-index { color: var(--paper); opacity: 0.07; }
.section-head { position: relative; z-index: 1; }

/* ---------- Full-bleed showcase panels ---------- */
.panel-section { position: relative; }
.panel {
  display: grid;
  grid-template-columns: minmax(320px, 560px) 1fr;
  min-height: 640px;
}
.panel-text {
  display: flex; flex-direction: column; justify-content: center;
  padding: 72px var(--edge);
  position: relative;
  z-index: 1;
}
.panel-media { position: relative; overflow: hidden; background: var(--steel-800); }
.panel-media img {
  width: 100%; height: 100%; object-fit: cover;
}
.panel.reverse { grid-template-columns: 1fr minmax(320px, 560px); }
.panel.reverse .panel-media { order: -1; }

@media (max-width: 960px) {
  .panel, .panel.reverse { grid-template-columns: 1fr; min-height: 0; }
  .panel-media { order: -1 !important; aspect-ratio: 4 / 3; }
  .panel-text { padding: 56px var(--edge); }
}

/* ---------- Cards ---------- */
.card-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px;
  background: var(--steel-700);
  margin-top: 40px;
  border: 1px solid var(--steel-700);
}
.card {
  background: var(--paper);
  color: var(--ink);
  padding: 32px 28px;
}
.card-icon { color: var(--blue); margin-bottom: 18px; }
.card p { color: var(--ink-muted); margin-bottom: 0; font-size: 1.08rem; }

.services-layout {
  display: grid; grid-template-columns: 1.6fr 1fr; gap: 0; margin-top: 40px;
  border: 1px solid var(--steel-700);
}
.services-layout .card-grid { margin-top: 0; grid-template-columns: 1fr; border: 0; border-right: 1px solid var(--steel-700); }
.services-layout .card-grid .card { border-bottom: 1px solid var(--steel-700); }
.services-layout .card-grid .card:last-child { border-bottom: 0; }
.services-media { position: relative; min-height: 320px; }
.services-media img { width: 100%; height: 100%; object-fit: cover; }

@media (max-width: 860px) {
  .card-grid { grid-template-columns: 1fr; }
  .services-layout { grid-template-columns: 1fr; }
  .services-layout .card-grid { border-right: 0; border-bottom: 1px solid var(--steel-700); }
  .services-media { min-height: 260px; }
}

/* ---------- Process section ---------- */
.process-section { position: relative; overflow: hidden; }
.process-bg {
  position: absolute; inset: 0; z-index: 0;
  background-size: cover; background-position: center;
}
.process-scrim {
  position: absolute; inset: 0; z-index: 0;
  background: linear-gradient(180deg, rgba(14,23,28,0.95) 0%, rgba(14,23,28,0.92) 100%);
}

.process-list {
  list-style: none; margin: 40px 0 0; padding: 0;
  display: grid; gap: 28px;
  position: relative; z-index: 1;
}
.process-list li { display: flex; gap: 22px; align-items: flex-start; }
.process-step {
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  width: 56px; height: 56px;
  border: 2px solid var(--blue-bright);
  border-radius: 50%;
  font-weight: 800; font-size: 1.1rem; color: var(--blue-bright);
  background: rgba(59,182,232,0.08);
}
.process-list h3 { margin-bottom: 0.3em; font-size: clamp(1.2rem, 2vw, 1.4rem); }
.process-list p { color: var(--steel-200); margin-bottom: 0; font-size: clamp(1.05rem, 1.6vw, 1.2rem); }

/* ---------- Industries (photo grid) ---------- */
.industry-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px;
  margin-top: 40px;
  background: var(--steel-700);
  border: 1px solid var(--steel-700);
}
.industry {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--steel-800);
}
.industry img {
  width: 100%; height: 100%; object-fit: cover;
}
.industry-label {
  position: absolute; inset: auto 0 0 0;
  padding: 14px 16px;
  background: linear-gradient(0deg, rgba(14,23,28,0.92) 0%, rgba(14,23,28,0) 100%);
  color: #fff;
  font-weight: 700; font-size: 0.98rem;
}
.industry--lead .industry-label { font-size: 1.1rem; }
.industry--lead {
  grid-column: span 2; grid-row: span 2;
}

@media (max-width: 860px) {
  .industry-grid { grid-template-columns: repeat(2, 1fr); }
  .industry--lead { grid-column: span 2; grid-row: span 1; aspect-ratio: 16 / 9; }
}
@media (max-width: 560px) {
  .industry-grid { grid-template-columns: 1fr; }
  .industry--lead { grid-column: span 1; aspect-ratio: 4 / 3; }
}

/* ---------- Contact ---------- */
.contact-section { background: var(--blue); color: #fff; }
.contact-section .lead { color: rgba(255,255,255,0.85); }
.contact-section .section-index { color: #fff; }
.contact-inner { text-align: center; max-width: 640px; margin: 0 auto; position: relative; z-index: 1; }
.contact-section .btn-primary { background: var(--ink); }
.contact-section .btn-primary:hover { background: #000; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--steel-950); color: var(--steel-200);
  padding: 28px 0;
  font-size: 0.85rem;
}
.footer-inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.footer-inner a:hover { color: var(--blue-bright); }
