:root {
  --ink: #edf4f7;
  --muted: #97a8b1;
  --faint: #6f818b;
  --line: rgba(182, 207, 218, 0.16);
  --line-strong: rgba(182, 207, 218, 0.28);
  --bg: #080d10;
  --bg-soft: #0d1418;
  --panel: rgba(16, 24, 29, 0.92);
  --panel-2: #121d23;
  --steel: #b9c7ce;
  --accent: #ff9f1c;
  --accent-2: #f2780c;
  --blue: #56b4df;
  --ok: #48cf91;
  --warn: #ffc55c;
  --danger: #ff6b66;
  --radius: 18px;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.42);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 84% 6%, rgba(64, 139, 170, 0.13), transparent 31rem),
    radial-gradient(circle at 8% 42%, rgba(242, 120, 12, 0.07), transparent 27rem),
    linear-gradient(180deg, #0a1014 0%, var(--bg) 68%);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.44;
  background-image:
    linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px);
  background-size: 38px 38px;
  mask-image: linear-gradient(to bottom, #000, transparent 76%);
}

a { color: inherit; }

button, input, select { font: inherit; }

button, a { -webkit-tap-highlight-color: transparent; }

.shell {
  position: relative;
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: rgba(8, 13, 16, 0.82);
  backdrop-filter: blur(18px);
}

.header-inner {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  letter-spacing: 0.08em;
  font-weight: 850;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  color: var(--accent);
  filter: drop-shadow(0 0 14px rgba(255,159,28,.2));
}

.brand-mark svg { width: 100%; height: 100%; }

.brand-copy { display: flex; flex-direction: column; line-height: 1; }
.brand-copy strong { font-size: 21px; }
.brand-copy small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 650;
  letter-spacing: 0.2em;
  white-space: nowrap;
}

.nav-links { display: flex; align-items: center; gap: 8px; }

.nav-links a {
  padding: 10px 13px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--muted);
  font-size: 14px;
  text-decoration: none;
  transition: .2s ease;
}

.nav-links a:hover, .nav-links a[aria-current="page"] {
  color: var(--ink);
  border-color: var(--line);
  background: rgba(255,255,255,.035);
}

.nav-links .nav-cta {
  color: #15100a;
  background: var(--accent);
  border-color: var(--accent);
  font-weight: 760;
}

.nav-links .nav-cta:hover { color: #15100a; background: #ffad3d; }

.hero {
  padding: 90px 0 68px;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(340px, .75fr);
  gap: 70px;
  align-items: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .17em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 30px;
  height: 2px;
  background: currentColor;
  box-shadow: 0 0 12px currentColor;
}

h1, h2, h3, p { margin-top: 0; }

h1 {
  max-width: 780px;
  margin: 22px 0 23px;
  font-size: clamp(44px, 6vw, 78px);
  line-height: .98;
  letter-spacing: -0.055em;
}

h1 .steel-text {
  color: transparent;
  background: linear-gradient(160deg, #fff 10%, #9cadb5 48%, #f2f6f7 78%);
  background-clip: text;
  -webkit-background-clip: text;
}

.hero-lead {
  max-width: 680px;
  margin-bottom: 30px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.7;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

.button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 18px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  color: var(--ink);
  background: rgba(255,255,255,.035);
  font-weight: 720;
  text-decoration: none;
  cursor: pointer;
  transition: transform .2s ease, border-color .2s ease, background .2s ease;
}

.button:hover { transform: translateY(-2px); border-color: rgba(255,255,255,.42); }
.button.primary { border-color: var(--accent); color: #171109; background: var(--accent); }
.button.primary:hover { background: #ffad3d; }
.button svg { width: 18px; height: 18px; }

.hero-machine {
  position: relative;
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
}

.hero-machine::before, .hero-machine::after {
  content: "";
  position: absolute;
  border-radius: 50%;
}

.hero-machine::before {
  inset: 6%;
  border: 1px solid var(--line-strong);
  background: repeating-conic-gradient(from 0deg, rgba(255,255,255,.1) 0 1deg, transparent 1deg 15deg);
  mask-image: radial-gradient(circle, transparent 50%, #000 51% 56%, transparent 57%);
  animation: turn 28s linear infinite;
}

.hero-machine::after {
  inset: 20%;
  border: 1px solid rgba(86,180,223,.35);
  box-shadow: inset 0 0 45px rgba(86,180,223,.08), 0 0 45px rgba(86,180,223,.07);
}

.machine-core {
  position: relative;
  z-index: 2;
  width: 54%;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.23);
  border-radius: 50%;
  color: var(--steel);
  background:
    radial-gradient(circle at 40% 35%, #33424a 0, #151e23 38%, #090e11 72%),
    #111;
  box-shadow: inset 0 0 0 13px rgba(0,0,0,.22), var(--shadow);
}

.machine-core strong { font-size: clamp(32px, 5vw, 60px); letter-spacing: .05em; }
.machine-core span { position: absolute; bottom: 23%; color: var(--accent); font-size: 9px; letter-spacing: .22em; }

.machine-core .machine-name {
  position: static;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.machine-core .machine-name strong { color: var(--accent); }
.machine-core .machine-name small { color: var(--steel); font-size: 8px; font-weight: 800; letter-spacing: .18em; white-space: nowrap; }

@keyframes turn { to { transform: rotate(360deg); } }

.stat-rail {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.stat {
  padding: 22px 25px;
  border-right: 1px solid var(--line);
}

.stat:last-child { border-right: 0; }
.stat strong { display: block; margin-bottom: 5px; color: var(--ink); font-size: 17px; }
.stat span { color: var(--muted); font-size: 13px; }

.section { padding: 88px 0; }
.section.compact { padding-top: 56px; }

.section-head {
  margin-bottom: 32px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 30px;
}

.section-head h2 {
  margin: 12px 0 0;
  font-size: clamp(30px, 4vw, 46px);
  letter-spacing: -.035em;
}

.section-head p { max-width: 480px; margin-bottom: 3px; color: var(--muted); line-height: 1.6; }

.tool-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.tool-card {
  position: relative;
  min-height: 290px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 27px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(255,255,255,.04), rgba(255,255,255,.014));
  text-decoration: none;
  box-shadow: inset 0 1px rgba(255,255,255,.035);
  transition: transform .25s ease, border-color .25s ease, background .25s ease;
}

.tool-card::after {
  content: "";
  position: absolute;
  width: 170px;
  height: 170px;
  right: -75px;
  bottom: -95px;
  border-radius: 50%;
  border: 25px solid rgba(255,255,255,.022);
}

.tool-card:hover {
  transform: translateY(-5px);
  border-color: rgba(255,159,28,.5);
  background: linear-gradient(145deg, rgba(255,159,28,.065), rgba(255,255,255,.015));
}

.tool-card.placeholder { cursor: default; }
.tool-card.placeholder:hover { transform: none; border-color: var(--line); }

.card-top { display: flex; align-items: center; justify-content: space-between; gap: 14px; }

.card-icon {
  width: 47px;
  height: 47px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 13px;
  color: var(--accent);
  background: rgba(0,0,0,.18);
}

.card-icon svg { width: 24px; height: 24px; }

.status {
  padding: 6px 9px;
  border: 1px solid rgba(72,207,145,.25);
  border-radius: 999px;
  color: var(--ok);
  background: rgba(72,207,145,.06);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.status.soon { color: var(--faint); border-color: var(--line); background: rgba(255,255,255,.02); }

.tool-card h3 { margin: 35px 0 11px; font-size: 23px; letter-spacing: -.02em; }
.tool-card p { margin-bottom: 25px; color: var(--muted); line-height: 1.55; }
.card-link { margin-top: auto; color: var(--accent); font-size: 13px; font-weight: 750; }

.future-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.future-card { min-height: 205px; }
.future-card h3 { margin-top: 28px; font-size: 19px; }

.process-panel {
  display: grid;
  grid-template-columns: .8fr 1.2fr;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.process-title { padding: 44px; border-right: 1px solid var(--line); }
.process-title h2 { margin: 14px 0 15px; font-size: 36px; }
.process-title p { color: var(--muted); line-height: 1.65; }

.process-list { display: grid; grid-template-columns: repeat(2, 1fr); }
.process-item { padding: 34px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.process-item:nth-child(2n) { border-right: 0; }
.process-item:nth-last-child(-n+2) { border-bottom: 0; }
.process-item strong { display: block; margin-bottom: 8px; color: var(--accent); font-size: 13px; }
.process-item h3 { margin-bottom: 8px; font-size: 18px; }
.process-item p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.55; }

.site-footer { padding: 32px 0 42px; border-top: 1px solid var(--line); color: var(--faint); font-size: 13px; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 18px; }
.footer-links a { text-decoration: none; }
.footer-links a:hover { color: var(--ink); }

/* Calculator */
.tool-hero { padding: 62px 0 38px; }
.tool-hero h1 { margin: 18px 0 16px; font-size: clamp(38px, 5vw, 61px); }
.tool-hero p { max-width: 760px; color: var(--muted); font-size: 17px; line-height: 1.65; }

.calculator-layout {
  padding-bottom: 80px;
  display: grid;
  grid-template-columns: minmax(330px, .82fr) minmax(420px, 1.18fr);
  gap: 18px;
  align-items: start;
}

.calc-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 16px 45px rgba(0,0,0,.22), inset 0 1px rgba(255,255,255,.03);
}

.panel-head {
  padding: 22px 24px;
  border-bottom: 1px solid var(--line);
}

.panel-head h2 { margin: 0; font-size: 20px; }
.panel-head p { margin: 7px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.panel-body { padding: 24px; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 17px 14px; }
.field.full { grid-column: 1 / -1; }
.field label { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 8px; color: #d9e4e9; font-size: 13px; font-weight: 650; }
.field label small { color: var(--faint); font-weight: 500; }

.field input, .field select {
  width: 100%;
  height: 46px;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  outline: none;
  color: var(--ink);
  background: #0c1419;
  transition: border-color .2s ease, box-shadow .2s ease;
}

.field input:focus, .field select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(86,180,223,.12);
}

.field input:invalid { border-color: rgba(255,107,102,.5); }

.form-actions { margin-top: 22px; display: flex; gap: 10px; }
.form-actions .button { flex: 1; }

.result-summary {
  padding: 24px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 12px;
}

.result-summary.thread-results { grid-template-columns: 1fr; }
.result-summary.thread-results .metric { min-height: 105px; }

.metric {
  min-height: 112px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(255,255,255,.035), transparent);
}

.metric.featured { border-color: rgba(255,159,28,.42); background: linear-gradient(145deg, rgba(255,159,28,.09), transparent); }
.metric span { display: block; margin-bottom: 13px; color: var(--muted); font-size: 12px; }
.metric strong { display: block; font-size: clamp(23px, 3vw, 31px); letter-spacing: -.035em; }
.metric small { margin-left: 5px; color: var(--faint); font-size: 12px; font-weight: 600; letter-spacing: 0; }

.result-note {
  margin: 0 24px 24px;
  padding: 14px 15px;
  border: 1px solid rgba(86,180,223,.22);
  border-radius: 11px;
  color: #b9d6e3;
  background: rgba(86,180,223,.055);
  font-size: 13px;
  line-height: 1.55;
}

.result-note.warning { border-color: rgba(255,197,92,.28); color: #ebd4a8; background: rgba(255,197,92,.055); }
.result-note.error { border-color: rgba(255,107,102,.32); color: #ffc1be; background: rgba(255,107,102,.07); }

.details-panel { grid-column: 1 / -1; }
.table-wrap { overflow-x: auto; }
.calc-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.calc-table th, .calc-table td { padding: 13px 16px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
.calc-table th:first-child, .calc-table td:first-child { text-align: left; }
.calc-table th { color: var(--muted); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.calc-table tbody tr:last-child td { border-bottom: 0; }
.calc-table tbody tr:hover { background: rgba(255,255,255,.022); }

.formula-grid { padding: 22px 24px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 13px; }
.formula {
  padding: 15px;
  border-left: 2px solid var(--accent);
  color: var(--muted);
  background: rgba(255,255,255,.025);
  font-size: 12px;
  line-height: 1.5;
}
.formula code { display: block; margin-bottom: 5px; color: var(--ink); font: 700 14px/1.4 "Cascadia Code", Consolas, monospace; }

.safety-strip {
  margin-bottom: 72px;
  padding: 18px 21px;
  display: flex;
  gap: 15px;
  align-items: flex-start;
  border: 1px solid rgba(255,197,92,.25);
  border-radius: 14px;
  color: #dbcba8;
  background: rgba(255,197,92,.045);
  font-size: 13px;
  line-height: 1.6;
}
.safety-strip svg { flex: 0 0 21px; width: 21px; height: 21px; color: var(--warn); }

@media (max-width: 940px) {
  .nav-links a:not(.nav-cta) { display: none; }
  .hero { grid-template-columns: 1fr; padding-top: 70px; gap: 30px; }
  .hero-machine { width: min(420px, 86vw); margin: 0 auto; }
  .tool-grid, .future-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .process-panel { grid-template-columns: 1fr; }
  .process-title { border-right: 0; border-bottom: 1px solid var(--line); }
  .calculator-layout { grid-template-columns: minmax(0, 1fr); }
  .calculator-layout > * { min-width: 0; }
}

@media (max-width: 1100px) and (min-width: 941px) {
  .hero { grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; }
  .hero h1 { font-size: clamp(44px, 5.6vw, 64px); }
}

@media (max-width: 640px) {
  .shell {
    width: auto;
    max-width: none;
    margin-left: 12px;
    margin-right: 12px;
  }
  .header-inner { min-height: 66px; }
  .brand-copy small { display: none; }
  .nav-links .nav-cta { padding-inline: 11px; font-size: 12px; }
  .hero { padding: 54px 0 46px; }
  h1 { font-size: clamp(40px, 13vw, 58px); }
  .hero-lead { font-size: 16px; }
  .hero-actions .button { flex: 1; }
  .stat-rail { grid-template-columns: 1fr; }
  .stat { border-right: 0; border-bottom: 1px solid var(--line); }
  .stat:last-child { border-bottom: 0; }
  .section { padding: 62px 0; }
  .section-head { align-items: start; flex-direction: column; gap: 12px; }
  .tool-grid, .future-grid { grid-template-columns: 1fr; }
  .tool-card { min-height: 250px; }
  .process-list { grid-template-columns: 1fr; }
  .process-item { border-right: 0; }
  .process-item:nth-last-child(2) { border-bottom: 1px solid var(--line); }
  .process-title { padding: 31px 25px; }
  .footer-inner { align-items: flex-start; flex-direction: column; }
  .tool-hero { padding-top: 44px; }
  .tool-hero h1 { font-size: 39px; }
  .tool-hero p { overflow-wrap: anywhere; }
  .form-grid, .result-summary, .formula-grid { grid-template-columns: 1fr; }
  .calculator-layout { width: 100%; min-width: 0; }
  .calc-panel { min-width: 0; max-width: 100%; overflow: hidden; }
  .panel-head, .panel-body, .field, .form-grid { min-width: 0; }
  .field input, .field select { min-width: 0; max-width: 100%; }
  .panel-head p, .result-note { overflow-wrap: anywhere; }
  .metric { min-height: 96px; }
  .panel-body, .result-summary { padding: 18px; }
  .panel-head { padding: 19px 18px; }
  .result-note { margin: 0 18px 18px; }
  .formula-grid { padding: 18px; }
}

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