/* ═══════════════════════════════════════════════════════════
   Smelt.works — main.css
   Industrial precision. Near-black + molten orange.
   ═══════════════════════════════════════════════════════════ */

/* ── Design tokens ──────────────────────────────────────── */

:root {
  --color-bg:        #0F0F0F;
  --color-surface:   #1A1A1A;
  --color-text:      #F0F0F0;
  --color-accent:    #E8720C;
  --color-muted:     #888888;
  --color-border:    #2A2A2A;
  --color-white:     #FFFFFF;

  --font-display:    'Bebas Neue', sans-serif;
  --font-body:       'DM Sans', sans-serif;
  --font-mono:       'IBM Plex Mono', monospace;

  --size-hero:       clamp(3rem, 8vw, 7rem);
  --size-heading:    clamp(1.75rem, 4vw, 3rem);
  --size-subhead:    1.25rem;
  --size-body:       1rem;
  --size-caption:    0.875rem;

  --line-body:       1.75;
  --line-heading:    1.1;

  --max-width:       1200px;
  --grid-gap:        24px;

  --section-pad:     6rem;
  --section-pad-m:   3rem;
}

/* ── Reset ──────────────────────────────────────────────── */

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: var(--size-body);
  line-height: var(--line-body);
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a {
  color: var(--color-text);
  text-decoration: none;
}

ul, ol {
  list-style: none;
}

/* ── Typography ─────────────────────────────────────────── */

h1, h2, h3 {
  font-family: var(--font-display);
  line-height: var(--line-heading);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--color-white);
}

h1 {
  font-size: var(--size-hero);
}

h2 {
  font-size: var(--size-heading);
}

h3 {
  font-size: clamp(1.25rem, 2.5vw, 1.75rem);
}

.subheadline {
  font-size: var(--size-subhead);
  color: var(--color-muted);
  font-weight: 400;
  max-width: 600px;
}

.mono {
  font-family: var(--font-mono);
  font-size: var(--size-caption);
}

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

.caption {
  font-size: var(--size-caption);
  color: var(--color-muted);
}

/* ── Layout ─────────────────────────────────────────────── */

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--grid-gap);
}

section {
  padding: var(--section-pad) 0;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--grid-gap);
}

.border-top {
  border-top: 1px solid var(--color-border);
}

/* ── Navigation ─────────────────────────────────────────── */

.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(15, 15, 15, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
}

.site-nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.site-nav__logo {
  font-family: var(--font-display);
  font-size: 1.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-white);
}

.site-nav__links {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.site-nav__links a {
  font-size: var(--size-caption);
  color: var(--color-muted);
  transition: color 0.2s;
  position: relative;
}

.site-nav__links a:hover {
  color: var(--color-text);
}

.site-nav__links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--color-accent);
  transition: width 0.3s;
}

.site-nav__links a:hover::after {
  width: 100%;
}

.site-nav__links a.nav-cta {
  color: var(--color-accent);
  font-weight: 500;
}

.site-nav__links a.nav-cta:hover {
  color: var(--color-accent);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-text);
  margin: 5px 0;
  transition: transform 0.3s, opacity 0.3s;
}

/* ── Hero ───────────────────────────────────────────────── */

.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 64px;
  position: relative;
  overflow: hidden;
}

.hero--compact {
  min-height: auto;
  padding-top: calc(64px + var(--section-pad));
  padding-bottom: var(--section-pad);
}

/* Grain overlay */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 256px 256px;
  pointer-events: none;
}

.hero__content {
  position: relative;
  z-index: 1;
}

.hero h1 {
  margin-bottom: 1.5rem;
}

.hero .subheadline {
  margin-bottom: 2.5rem;
}

/* Staggered entrance */
.hero__content > * {
  opacity: 0;
  transform: translateY(20px);
  animation: fade-up 0.6s ease forwards;
}

.hero__content > *:nth-child(1) { animation-delay: 0s; }
.hero__content > *:nth-child(2) { animation-delay: 0.1s; }
.hero__content > *:nth-child(3) { animation-delay: 0.2s; }
.hero__content > *:nth-child(4) { animation-delay: 0.3s; }

@keyframes fade-up {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Buttons ────────────────────────────────────────────── */

.btn {
  display: inline-block;
  padding: 14px 32px;
  font-family: var(--font-body);
  font-size: var(--size-body);
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: transform 0.2s;
}

.btn:hover {
  transform: translate(-2px, -2px);
}

.btn-primary {
  background: var(--color-accent);
  color: var(--color-bg);
}

.btn-text {
  background: none;
  color: var(--color-muted);
  padding: 14px 0;
}

.btn-text:hover {
  color: var(--color-text);
}

.cta-group {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

/* ── Cards ──────────────────────────────────────────────── */

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: 2.5rem;
}

.card h3 {
  margin-bottom: 1rem;
}

.card p {
  color: var(--color-muted);
  margin-bottom: 1.5rem;
}

.card p:last-child {
  margin-bottom: 0;
}

.card__link {
  font-size: var(--size-caption);
  color: var(--color-accent);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.card__link:hover {
  text-decoration: underline;
}

/* ── Pipeline diagram ───────────────────────────────────── */

.pipeline {
  display: flex;
  align-items: flex-start;
  gap: 0;
  overflow-x: auto;
  padding: 2rem 0;
  -webkit-overflow-scrolling: touch;
}

.pipeline__step {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 120px;
  flex-shrink: 0;
  position: relative;
}

.pipeline__step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 12px;
  left: calc(50% + 16px);
  width: calc(100% - 32px);
  height: 2px;
  background: var(--color-accent);
}

.pipeline__dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--color-accent);
  margin-bottom: 0.75rem;
  flex-shrink: 0;
}

.pipeline__label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--color-text);
  text-align: center;
  margin-bottom: 0.25rem;
}

.pipeline__desc {
  font-size: 0.7rem;
  color: var(--color-muted);
  text-align: center;
  max-width: 100px;
  line-height: 1.4;
}

/* ── Numbered steps ─────────────────────────────────────── */

.steps {
  counter-reset: step;
}

.step {
  counter-increment: step;
  padding-left: 3.5rem;
  position: relative;
  margin-bottom: 2.5rem;
}

.step::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--color-accent);
  line-height: 1;
}

.step h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.step p {
  color: var(--color-muted);
}

/* ── Tech stack list ────────────────────────────────────── */

.tech-stack {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.5rem 2rem;
  font-family: var(--font-mono);
  font-size: var(--size-caption);
}

.tech-stack dt {
  color: var(--color-text);
}

.tech-stack dd {
  color: var(--color-muted);
}

/* ── CTA section ────────────────────────────────────────── */

.cta-section {
  text-align: left;
}

.cta-section h2 {
  margin-bottom: 1rem;
}

.cta-section p {
  color: var(--color-muted);
  margin-bottom: 2rem;
  max-width: 500px;
}

/* ── Blueprint form ─────────────────────────────────────── */

.blueprint-form {
  max-width: 420px;
}

.blueprint-form input {
  display: block;
  width: 100%;
  padding: 14px 16px;
  margin-bottom: 12px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--size-body);
  border-radius: 0;
  outline: none;
  transition: border-color 0.2s;
}

.blueprint-form input::placeholder {
  color: var(--color-muted);
}

.blueprint-form input:focus {
  border-color: var(--color-accent);
}

.blueprint-form button {
  width: 100%;
}

.blueprint-form .form-note {
  margin-top: 1rem;
  font-size: 0.8rem;
  color: var(--color-muted);
  line-height: 1.5;
}

.thank-you {
  display: none;
}

.thank-you.is-visible {
  display: block;
}

.form-wrapper.is-hidden {
  display: none;
}

/* ── What you get list ──────────────────────────────────── */

.check-list {
  margin: 2rem 0;
}

.check-list li {
  padding: 0.5rem 0;
  padding-left: 1.5rem;
  position: relative;
  color: var(--color-muted);
}

.check-list li::before {
  content: '\2192';
  position: absolute;
  left: 0;
  color: var(--color-accent);
}

/* ── Approval modes ─────────────────────────────────────── */

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

.mode {
  padding: 2rem;
  border: 1px solid var(--color-border);
  border-radius: 4px;
}

.mode h3 {
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
}

.mode p {
  color: var(--color-muted);
  font-size: var(--size-caption);
}

/* ── Content types (Cast) ───────────────────────────────── */

.content-type {
  margin-bottom: 2.5rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--color-border);
}

.content-type:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.content-type h3 {
  font-size: 1rem;
  letter-spacing: 0.1em;
  margin-bottom: 0.75rem;
}

.content-type p {
  color: var(--color-muted);
}

/* ── Article listing ────────────────────────────────────── */

.article-list {
  margin-top: 2rem;
}

.article-item {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--color-border);
}

.article-item:first-child {
  border-top: 1px solid var(--color-border);
}

.article-item a {
  display: block;
}

.article-item__title {
  font-size: 1.125rem;
  font-weight: 500;
  color: var(--color-text);
  margin-bottom: 0.25rem;
  transition: color 0.2s;
}

.article-item a:hover .article-item__title {
  color: var(--color-accent);
}

.article-item__meta {
  font-size: var(--size-caption);
  color: var(--color-muted);
  margin-bottom: 0.25rem;
}

.article-item__desc {
  font-size: var(--size-caption);
  color: var(--color-muted);
}

/* ── Article page ───────────────────────────────────────── */

.article-header {
  padding-top: calc(64px + var(--section-pad));
  padding-bottom: var(--section-pad-m);
}

.article-header h1 {
  font-size: var(--size-heading);
  margin-bottom: 1rem;
}

.article-body {
  max-width: 760px;
  padding-bottom: var(--section-pad);
}

.article-body p {
  margin-bottom: 1.5rem;
  color: var(--color-muted);
}

.article-body h2 {
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  margin-top: 3rem;
  margin-bottom: 1rem;
}

.article-body h3 {
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.article-body ul, .article-body ol {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
}

.article-body li {
  margin-bottom: 0.5rem;
  color: var(--color-muted);
  list-style: disc;
}

.article-body ol li {
  list-style: decimal;
}

.article-body a {
  color: var(--color-accent);
  text-decoration: underline;
}

.article-body blockquote {
  border-left: 2px solid var(--color-accent);
  padding-left: 1.5rem;
  margin: 2rem 0;
  color: var(--color-muted);
  font-style: italic;
}

.article-body code {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  background: var(--color-surface);
  padding: 2px 6px;
  border-radius: 2px;
}

.article-end-cta {
  border-top: 1px solid var(--color-border);
  padding: var(--section-pad-m) 0;
  max-width: 760px;
}

.article-end-cta h2 {
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
}

.article-end-cta p {
  color: var(--color-muted);
  margin-bottom: 1.5rem;
}

.related-articles {
  border-top: 1px solid var(--color-border);
  padding: var(--section-pad-m) 0 var(--section-pad);
}

.related-articles h3 {
  font-size: 1rem;
  letter-spacing: 0.1em;
  margin-bottom: 1.5rem;
  color: var(--color-muted);
}

/* ── About page ─────────────────────────────────────────── */

.about-section {
  max-width: 760px;
  margin-bottom: var(--section-pad-m);
}

.about-section p {
  color: var(--color-muted);
  margin-bottom: 1rem;
}

/* ── Footer ─────────────────────────────────────────────── */

.site-footer {
  border-top: 1px solid var(--color-border);
  padding: 2.5rem 0;
}

.site-footer .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-footer__copy {
  font-size: var(--size-caption);
  color: var(--color-muted);
}

.site-footer__links {
  display: flex;
  gap: 1.5rem;
}

.site-footer__links a {
  font-size: var(--size-caption);
  color: var(--color-muted);
  transition: color 0.2s;
}

.site-footer__links a:hover {
  color: var(--color-text);
}

/* ── Responsive ─────────────────────────────────────────── */

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

@media (max-width: 640px) {
  section {
    padding: var(--section-pad-m) 0;
  }

  .hero {
    min-height: auto;
    padding-top: calc(64px + var(--section-pad-m));
    padding-bottom: var(--section-pad-m);
  }

  .hero--compact {
    padding-top: calc(64px + var(--section-pad-m));
  }

  .grid-2 {
    grid-template-columns: 1fr;
  }

  .site-nav__links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    background: rgba(15, 15, 15, 0.98);
    padding: 1.5rem var(--grid-gap);
    gap: 1.25rem;
    border-bottom: 1px solid var(--color-border);
  }

  .site-nav__links.is-open {
    display: flex;
  }

  .nav-toggle {
    display: block;
  }

  .pipeline {
    padding-bottom: 1rem;
  }

  .pipeline__step {
    min-width: 90px;
  }

  .site-footer .container {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  .site-footer__links {
    flex-wrap: wrap;
    justify-content: center;
  }

  .step {
    padding-left: 2.5rem;
  }

  .modes {
    grid-template-columns: 1fr;
  }
}
