/* ============================================================
   Tycho — custom operational software for warehouses
   Industrial / utilitarian. Spec-sheet structure: numbered index
   column + content, mono accents, hairline rules, blueprint grid.
   Inter (text) + IBM Plex Mono (codes/labels).
   ============================================================ */

/* ---------- Design tokens ---------- */
:root {
  /* Neutrals — cooler, harder than before */
  --ink:        #14181c;  /* primary text / near-black */
  --ink-soft:   #525a62;  /* secondary text */
  --ink-faint:  #828b93;  /* mono labels, captions */
  --line:       #d9dde1;  /* hairline borders */
  --line-soft:  #e8eaed;  /* faintest rules */
  --bg:         #fbfbfa;  /* warm off-white base */
  --bg-alt:     #f3f4f2;  /* alternating band */
  --bg-deep:    #14181c;  /* dark band (proof) */

  /* Accent — industrial amber/safety, not SaaS blue */
  --accent:     #c4622d;  /* burnt orange / safety amber */
  --accent-ink: #a64f20;
  --accent-dim: rgba(196, 98, 45, 0.12);

  /* Type */
  --font:  "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono:  "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* Rhythm */
  --maxw: 920px;
  --band-y: 6rem;
  --idx-col: 150px; /* width of the numbered index column */
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 18px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding-inline: 1.75rem;
}

/* Shared mono treatment for codes/labels */
.mono,
.idx-num, .idx-label, .pain-code, .cap-num, .step-num,
.field-code, .hero-tag, .wordmark-meta, .header-link,
.metric-label, .footer-mark, .footer-meta {
  font-family: var(--mono);
  font-feature-settings: "tnum" 1;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(251, 251, 250, 0.88);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.wordmark { display: flex; align-items: baseline; gap: 0.6rem; color: var(--ink); }
.wordmark:hover { text-decoration: none; }
.wordmark-name {
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: 0.14em;
}
.wordmark-meta {
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  color: var(--ink-faint);
}
.header-link {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.header-link-arrow { color: var(--accent); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--mono);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 500;
  line-height: 1;
  padding: 0.95rem 1.5rem;
  border: 1px solid transparent;
  border-radius: 2px;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.05s ease;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-ink); text-decoration: none; }
.btn-primary:active { transform: translateY(1px); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding-top: calc(var(--band-y) + 1.5rem);
  padding-bottom: var(--band-y);
  overflow: hidden;
}
/* Blueprint grid texture, fading out downward */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, var(--line-soft) 1px, transparent 1px),
    linear-gradient(to bottom, var(--line-soft) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, transparent 78%);
  mask-image: linear-gradient(to bottom, #000 0%, transparent 78%);
  pointer-events: none;
}
.hero .container { position: relative; }

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  color: var(--ink-faint);
  margin-bottom: 1.75rem;
}
.tag-dot {
  width: 7px; height: 7px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 0 3px var(--accent-dim);
}
.hero-headline {
  font-size: clamp(2.1rem, 5.2vw, 3.25rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  font-weight: 800;
  margin: 0 0 1.5rem;
  max-width: 18ch;
}
.hero-subhead {
  font-size: clamp(1.15rem, 2.4vw, 1.4rem);
  color: var(--ink-soft);
  font-weight: 500;
  margin: 0 0 1.5rem;
  max-width: 52ch;
}
.hero-body {
  color: var(--ink-soft);
  margin: 0 0 2.25rem;
  max-width: 58ch;
}

/* ---------- Spec-sheet band layout ---------- */
.band {
  padding-block: var(--band-y);
  border-top: 1px solid var(--line);
}
.band-alt { background: var(--bg-alt); }

.section-grid {
  display: grid;
  grid-template-columns: var(--idx-col) 1fr;
  gap: 2.5rem;
  align-items: start;
}

/* The numbered index column */
.section-index {
  position: sticky;
  top: 90px;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.idx-num {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.05em;
}
.idx-rule {
  width: 32px;
  height: 1px;
  background: var(--ink);
  opacity: 0.35;
}
.idx-label {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.section-body { min-width: 0; }

.band-title {
  font-size: clamp(1.5rem, 3.2vw, 2.05rem);
  line-height: 1.18;
  letter-spacing: -0.02em;
  font-weight: 700;
  margin: 0 0 2rem;
  max-width: 24ch;
}
.band-close {
  margin: 2rem 0 0;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-weight: 500;
}

/* ---------- Problem: pain list ---------- */
.pain-list { list-style: none; margin: 0; padding: 0; }
.pain-list li {
  display: grid;
  grid-template-columns: 3.25rem 1fr;
  gap: 1rem;
  align-items: baseline;
  padding: 1rem 0;
  border-top: 1px solid var(--line-soft);
  color: var(--ink-soft);
}
.pain-list li:first-child { border-top: none; }
.pain-code {
  font-size: 0.78rem;
  color: var(--accent);
  letter-spacing: 0.04em;
}

/* ---------- Capabilities: card grid ---------- */
.capability-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.cap-card {
  background: var(--bg-alt);
  padding: 1.5rem;
}
.band:not(.band-alt) .cap-card { background: var(--bg); }
.cap-num {
  font-size: 0.74rem;
  color: var(--accent);
  letter-spacing: 0.06em;
}
.cap-card h3 {
  margin: 0.6rem 0 0.5rem;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.cap-card p { margin: 0; font-size: 0.95rem; color: var(--ink-soft); }

/* ---------- Proof (dark band) ---------- */
.proof {
  background: var(--bg-deep);
  color: #c7cdd2;
  border-top: 1px solid var(--bg-deep);
}
.proof .idx-num { color: var(--accent); }
.proof .idx-rule { background: #fff; opacity: 0.25; }
.proof .idx-label { color: #8a939b; }

.proof-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-bottom: 2.25rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}
.metric { display: flex; flex-direction: column; gap: 0.4rem; }
.metric-num {
  font-family: var(--font);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #fff;
  line-height: 1;
}
.metric-label {
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #8a939b;
}
.proof-body {
  font-size: 1.18rem;
  line-height: 1.6;
  color: #e3e7ea;
  margin: 0 0 1.5rem;
  max-width: 60ch;
}
.proof-close {
  font-size: 1.18rem;
  font-weight: 600;
  color: #fff;
  margin: 0;
}

/* ---------- Steps ---------- */
.steps { list-style: none; margin: 0; padding: 0; }
.steps li {
  display: grid;
  grid-template-columns: 3.5rem 1fr;
  gap: 1.25rem;
  align-items: start;
  padding: 1.5rem 0;
  border-top: 1px solid var(--line-soft);
}
.steps li:first-child { border-top: none; padding-top: 0; }
.step-num {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--accent);
  padding-top: 0.15rem;
}
.steps h3 {
  margin: 0 0 0.4rem;
  font-size: 1.12rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.steps p { margin: 0; color: var(--ink-soft); }

/* ---------- Contact form ---------- */
.contact-form { margin-top: 0.5rem; max-width: 560px; }
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}
.field { margin-bottom: 1.25rem; }
.field label {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 0.5rem;
}
.field-code {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--accent);
}
.field input,
.field textarea {
  width: 100%;
  font-family: inherit;
  font-size: 1rem;
  color: var(--ink);
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--bg);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
.field textarea { resize: vertical; }
.form-fallback { margin-top: 1.25rem; font-size: 0.95rem; color: var(--ink-soft); }

/* Honeypot — off-screen, not display:none (naive bots still fill it). */
.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px; height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

/* Form status (set by JS) */
.form-status { margin-top: 1rem; font-weight: 500; display: none; }
.form-status.is-visible { display: block; }
.form-status.is-ok { color: #2f7d52; }
.form-status.is-error { color: #b03a3a; }
.proof .form-status.is-ok { color: #6cd39a; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--ink);
  background: var(--bg);
  padding-block: 2rem;
}
.footer-inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.footer-mark {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--ink);
}
.footer-text { font-size: 0.9rem; color: var(--ink-soft); flex: 1; min-width: 200px; }
.footer-meta { font-size: 0.78rem; color: var(--ink-faint); }

/* ---------- Mobile ---------- */
@media (max-width: 760px) {
  body { font-size: 17px; }
  :root { --band-y: 4rem; }

  /* Collapse the spec-sheet two-column into stacked, index as a horizontal header */
  .section-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .section-index {
    position: static;
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
  }
  .idx-rule { flex: 1; max-width: 60px; }

  .capability-grid { grid-template-columns: 1fr; }
  .proof-metrics { grid-template-columns: 1fr; gap: 1.25rem; }
  .field-row { grid-template-columns: 1fr; gap: 0; }
  .wordmark-meta { display: none; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
