/* manufacturing.diy — Design System
   Based on factory.talk Cyber-Industrial aesthetic
   Fonts: Space Grotesk (headings/body) + IBM Plex Mono (code/labels)
   Palette: Dark industrial with amber accent
*/

:root {
  --bg: #0b0e11;
  --bg2: #11151a;
  --panel: #151a21;
  --line: #232b35;
  --ink: #e8edf2;
  --dim: #8b98a5;
  --amber: #ffb020;
  --amber-dim: rgba(255, 176, 32, .12);
  --green: #3ddc84;
  --red: #ff5c5c;
  --cyan: #4cc3ff;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  --sans: 'Space Grotesk', system-ui, sans-serif;
}

/* === RESET === */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.6;
  overflow-x: hidden;
}
::selection { background: var(--amber); color: #111; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
.mono { font-family: var(--mono); }

/* === GRAIN OVERLAY === */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .04;
  z-index: 1000;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
}

/* === LAYOUT === */
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 28px; }
.wrap-narrow { max-width: 800px; margin: 0 auto; padding: 0 24px; }

/* === NAVIGATION === */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(11, 14, 17, .85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}
.nav-in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 28px;
}
.logo {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 17px;
  letter-spacing: -.5px;
}
.logo b { color: var(--amber); }
.nav-links {
  display: flex;
  gap: 28px;
  font-size: 14px;
  color: var(--dim);
}
.nav-links a { transition: color .2s; }
.nav-links a:hover { color: var(--amber); }
.nav-cta {
  font-family: var(--mono);
  font-size: 13px;
  padding: 8px 16px;
  border: 1px solid var(--amber);
  color: var(--amber);
  border-radius: 3px;
  transition: background .2s, color .2s;
}
.nav-cta:hover { background: var(--amber); color: #111; }

/* === DISCLAIMER STRIP === */
.strip {
  background: var(--amber-dim);
  border-bottom: 1px solid rgba(255, 176, 32, .2);
  text-align: center;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .08em;
  color: var(--amber);
  padding: 7px 12px;
  text-transform: uppercase;
}

/* === HERO === */
.hero {
  padding: 96px 0 72px;
  position: relative;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(600px 300px at 80% 10%, rgba(255, 176, 32, .06), transparent),
    radial-gradient(500px 400px at 10% 90%, rgba(76, 195, 255, .05), transparent);
  pointer-events: none;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 64px;
  align-items: center;
}
.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: "";
  width: 28px;
  height: 1px;
  background: var(--amber);
}
h1 {
  font-size: clamp(38px, 5.2vw, 64px);
  line-height: 1.04;
  font-weight: 700;
  letter-spacing: -.03em;
}
h1 .amber { color: var(--amber); }
.hero p.sub {
  margin-top: 24px;
  font-size: 18px;
  color: var(--dim);
  max-width: 520px;
}
.hero-ctas {
  margin-top: 36px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

/* === BUTTONS === */
.btn {
  font-family: var(--mono);
  font-size: 14px;
  padding: 14px 26px;
  border-radius: 3px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: transform .15s, box-shadow .2s, background .2s;
  cursor: pointer;
  border: none;
}
.btn:hover { transform: translateY(-2px); }
.btn-amber {
  background: var(--amber);
  color: #111;
  font-weight: 600;
  box-shadow: 0 0 0 rgba(255, 176, 32, 0);
}
.btn-amber:hover { box-shadow: 0 8px 28px rgba(255, 176, 32, .25); }
.btn-ghost {
  border: 1px solid var(--line);
  color: var(--ink);
  background: transparent;
}
.btn-ghost:hover { border-color: var(--amber); color: var(--amber); }

/* === SECTIONS === */
section {
  padding: 88px 0;
  position: relative;
}
.sec-head {
  margin-bottom: 48px;
  max-width: 640px;
}
.sec-head h2 {
  font-size: clamp(26px, 3.4vw, 40px);
  letter-spacing: -.02em;
  line-height: 1.15;
}
.sec-head p {
  margin-top: 14px;
  color: var(--dim);
  font-size: 16px;
}
.kicker {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 14px;
}

/* === TUTORIAL CARDS === */
.tut-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 18px;
}
.tut {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 24px;
  position: relative;
  transition: transform .2s, border-color .2s;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.tut:hover { transform: translateY(-4px); border-color: var(--amber); }
.tut .tag {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--cyan);
}
.tut h3 { font-size: 17px; line-height: 1.35; font-weight: 600; }
.tut p { font-size: 13.5px; color: var(--dim); flex: 1; }
.tut .meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--dim);
}
.tut .difficulty {
  padding: 2px 8px;
  border-radius: 3px;
  border: 1px solid;
}
.tut .difficulty.beginner { color: var(--green); border-color: rgba(61, 220, 132, .35); }
.tut .difficulty.intermediate { color: var(--amber); border-color: rgba(255, 176, 32, .35); }
.tut .difficulty.advanced { color: var(--red); border-color: rgba(255, 92, 92, .35); }

/* === PRODUCT CARDS (affiliate links) === */
.product-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 18px;
  display: grid;
  grid-template-columns: 80px 1fr auto;
  gap: 16px;
  align-items: center;
  transition: border-color .2s;
}
.product-card:hover { border-color: var(--amber); }
.product-card .product-img {
  width: 80px;
  height: 80px;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
}
.product-card .product-info h4 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
}
.product-card .product-info .specs {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--dim);
}
.product-card .product-action .price {
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 600;
  color: var(--green);
  margin-bottom: 6px;
}
.product-card .product-action .buy-link {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--amber);
  display: flex;
  align-items: center;
  gap: 4px;
}
.product-card .product-action .buy-link:hover { text-decoration: underline; }

/* === PARTS LIST (BOM-style) === */
.parts-list {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  margin: 24px 0;
}
.parts-list-header {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 100px;
  padding: 12px 18px;
  background: var(--bg2);
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--dim);
}
.parts-list-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 100px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
  align-items: center;
  transition: background .15s;
}
.parts-list-row:last-child { border-bottom: none; }
.parts-list-row:hover { background: rgba(255, 176, 32, .04); }
.parts-list-row .part-name { font-weight: 500; }
.parts-list-row .part-spec { font-family: var(--mono); font-size: 12px; color: var(--dim); }
.parts-list-row .part-qty { font-family: var(--mono); font-size: 12px; }
.parts-list-row .part-link a {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--amber);
}
.parts-list-row .part-link a:hover { text-decoration: underline; }

/* === CTA HOOK (io.codes funnel) === */
.hook {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 36px;
  margin-top: 56px;
  position: relative;
  overflow: hidden;
}
.hook::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--amber), transparent);
}
.hook h3 { font-size: 20px; margin-bottom: 10px; }
.hook p { font-size: 14.5px; color: var(--dim); margin-bottom: 16px; }

/* === EMAIL CAPTURE === */
.capture {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 48px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 40px;
  align-items: center;
}
.capture h2 {
  font-size: clamp(22px, 2.8vw, 32px);
  letter-spacing: -.02em;
}
.capture p {
  margin-top: 10px;
  color: var(--dim);
  font-size: 15px;
  max-width: 480px;
}
.capture form { display: flex; gap: 10px; }
.capture input {
  font-family: var(--mono);
  font-size: 14px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 14px 18px;
  color: var(--ink);
  width: 280px;
  outline: none;
  transition: border-color .2s;
}
.capture input:focus { border-color: var(--amber); }
.capture-ok {
  display: none;
  font-family: var(--mono);
  color: var(--green);
  font-size: 14px;
}

/* === ARTICLE STYLES (tutorials) === */
article {
  max-width: 800px;
  margin: 0 auto;
  padding: 56px 24px 80px;
}
article .tag {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--cyan);
}
article h1 {
  font-size: clamp(28px, 4.5vw, 44px);
  line-height: 1.12;
  letter-spacing: -.02em;
  margin: 14px 0 10px;
}
article .byline {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--dim);
  margin-bottom: 36px;
}
article h2 {
  font-size: 22px;
  margin: 44px 0 14px;
  letter-spacing: -.01em;
}
article h2 .n {
  color: var(--amber);
  font-family: var(--mono);
  font-size: 18px;
  margin-right: 10px;
}
article h3 {
  font-size: 18px;
  margin: 32px 0 10px;
}
article p {
  color: #c3ccd5;
  margin: 14px 0;
  font-size: 16px;
  line-height: 1.75;
}
article strong { color: var(--ink); }
article ul, article ol {
  margin: 14px 0 14px 22px;
  color: #c3ccd5;
}
article li { margin: 8px 0; }
article code {
  font-family: var(--mono);
  font-size: .88em;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 2px 7px;
  color: var(--cyan);
}
article pre {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 18px 22px;
  overflow-x: auto;
  margin: 20px 0;
}
article pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 13px;
  line-height: 1.7;
  color: #c3ccd5;
}
article img {
  border-radius: 6px;
  border: 1px solid var(--line);
  margin: 24px 0;
}

/* === CALLOUTS === */
.callout {
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 3px solid var(--amber);
  border-radius: 4px;
  padding: 18px 22px;
  margin: 24px 0;
}
.callout.tip { border-left-color: var(--green); }
.callout.warning { border-left-color: var(--red); }
.callout .callout-label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--amber);
  display: block;
  margin-bottom: 6px;
}
.callout.tip .callout-label { color: var(--green); }
.callout.warning .callout-label { color: var(--red); }
.callout p { margin: 6px 0; font-size: 14.5px; }

/* === FOOTER === */
footer {
  border-top: 1px solid var(--line);
  padding: 56px 0 40px;
  background: var(--bg2);
}
.foot-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 48px;
}
.foot-links {
  display: flex;
  gap: 36px;
  font-size: 13.5px;
  color: var(--dim);
}
.foot-links a:hover { color: var(--amber); }
.legal {
  margin-top: 36px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: #5f6b78;
  line-height: 1.7;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .tut-grid { grid-template-columns: 1fr; }
  .capture { grid-template-columns: 1fr; padding: 32px; }
  .capture form { flex-direction: column; }
  .capture input { width: 100%; }
  .foot-grid { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  .product-card { grid-template-columns: 1fr; gap: 12px; }
  .product-card .product-img { display: none; }
  .parts-list-header,
  .parts-list-row { grid-template-columns: 1.5fr 1fr 80px; }
  .parts-list-row .part-spec { display: none; }
}
