:root {
  --bg: #0a0908;
  --bg-raised: #141210;
  --bg-raised-2: #1b1713;
  --ink: #f4ede1;
  --ink-dim: #948772;
  --ink-faint: #5c5243;
  --accent: #ff5a1f;
  --accent-2: #ffb24d;
  --line: rgba(244, 237, 225, 0.1);
  --line-bright: rgba(244, 237, 225, 0.2);
  --serif: "Fraunces", "Iowan Old Style", serif;
  --mono: "JetBrains Mono", "SF Mono", Menlo, monospace;
  --sans: "Archivo", "Helvetica Neue", sans-serif;
  --max: 1080px;
}

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

html { scroll-behavior: smooth; }

html, body { background: var(--bg); }

body {
  color: var(--ink);
  font-family: var(--sans);
  position: relative;
}

a { color: inherit; text-decoration: none; }

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 32px;
  position: relative;
  z-index: 2;
}

/* ---------- shared backdrop ---------- */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.backdrop .glow {
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(40% 30% at 24% 28%, rgba(255, 90, 31, 0.15), transparent 60%),
    radial-gradient(34% 28% at 76% 70%, rgba(255, 178, 77, 0.07), transparent 60%);
  filter: blur(40px);
  animation: drift 28s ease-in-out infinite alternate;
}

@keyframes drift {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(3%, -4%) scale(1.07); }
  100% { transform: translate(-4%, 3%) scale(1); }
}

.backdrop .contours {
  position: absolute;
  inset: -10% -50%;
  width: 200%;
  height: 120%;
  opacity: 0.35;
  animation: contour-drift 90s linear infinite;
}

@keyframes contour-drift {
  from { transform: translateX(0); }
  to   { transform: translateX(-25%); }
}

.backdrop .grain {
  position: absolute;
  inset: 0;
  opacity: 0.4;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.3'/></svg>");
}

@media (prefers-reduced-motion: reduce) {
  .backdrop .glow, .backdrop .contours { animation: none; }
}

/* ---------- nav ---------- */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 32px;
  backdrop-filter: blur(10px);
  background: linear-gradient(to bottom, rgba(10,9,8,0.9), rgba(10,9,8,0));
}

.mark {
  width: 15px;
  height: 15px;
  border: 1.3px solid var(--ink-dim);
  transform: rotate(45deg);
  position: relative;
}
.mark::after {
  content: "";
  position: absolute;
  inset: 4px;
  background: var(--accent);
  border-radius: 1px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

.nav-links a { transition: color 0.25s ease; }
.nav-links a:hover, .nav-links a.current { color: var(--accent); }

/* ---------- reveal ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.in { opacity: 1; transform: translateY(0); }

/* ---------- home hero ---------- */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 140px 24px 80px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 32px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.badge .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
  animation: pulse 2.6s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }

.hero h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-style: italic;
  font-size: clamp(32px, 6vw, 58px);
  line-height: 1.22;
  letter-spacing: -0.01em;
  max-width: 17ch;
}

.hero .sub {
  margin-top: 22px;
  max-width: 48ch;
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--ink-dim);
}

.hero .contact {
  margin-top: 34px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--ink-dim);
  border-bottom: 1px solid var(--line);
  padding-bottom: 4px;
  transition: color 0.3s ease, border-color 0.3s ease;
}
.hero .contact:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- pillars strip ---------- */
.pillars {
  border-top: 1px solid var(--line);
  padding: 64px 0;
}

.pillars .wrap {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.pillar {
  background: var(--bg);
  padding: 30px 26px;
  text-align: left;
}

.pillar .tag {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  display: block;
  margin-bottom: 12px;
}

.pillar p {
  font-size: 14px;
  color: var(--ink-dim);
  line-height: 1.6;
}

/* ---------- see-hardware link ---------- */
.more-link-wrap {
  text-align: center;
  padding: 90px 0;
  border-top: 1px solid var(--line);
}

.more-link {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(20px, 2.6vw, 28px);
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 12px;
  position: relative;
}

.more-link .arrow {
  color: var(--accent);
  transition: transform 0.3s ease;
}
.more-link:hover .arrow { transform: translateX(6px); }

/* ---------- footer ---------- */
footer {
  border-top: 1px solid var(--line);
  padding: 30px 0 46px;
}
footer .wrap {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
footer span {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* ===================================================== */
/* ---------- hardware page ---------- */
/* ===================================================== */

.page-hero {
  padding: 150px 0 70px;
  border-top: none;
}

.page-hero .label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-faint);
  display: block;
  margin-bottom: 22px;
}

.page-hero h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(34px, 5.6vw, 54px);
  line-height: 1.15;
  max-width: 18ch;
  margin-bottom: 20px;
}

.page-hero .sub {
  max-width: 50ch;
  color: var(--ink-dim);
  font-size: 16px;
  line-height: 1.7;
}

.device-section {
  border-top: 1px solid var(--line);
  padding: 110px 0;
}

.device-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.device-grid.flip .diagram { order: 2; }

.fig-tag {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  display: block;
  margin-bottom: 18px;
}

.device-copy h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(26px, 3.4vw, 36px);
  margin-bottom: 16px;
  line-height: 1.2;
}

.device-copy > p {
  color: var(--ink-dim);
  font-size: 15px;
  line-height: 1.7;
  margin-bottom: 30px;
  max-width: 42ch;
}

.callouts {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.callout {
  display: flex;
  gap: 16px;
  align-items: baseline;
}

.callout .idx {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-faint);
  min-width: 20px;
}

.callout .ctext strong {
  display: block;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 3px;
}

.callout .ctext span {
  font-size: 13.5px;
  color: var(--ink-dim);
  line-height: 1.5;
}

.diagram {
  position: relative;
  display: flex;
  justify-content: center;
}

.diagram svg { width: 100%; max-width: 380px; height: auto; }

.diagram .diagram-ring {
  position: absolute;
  inset: 0;
  border: 1px dashed var(--line-bright);
  border-radius: 50%;
  width: 92%;
  height: 92%;
  margin: auto;
}

.schem-line { stroke: var(--ink-dim); stroke-width: 1.1; fill: none; }
.schem-line-dim { stroke: var(--line-bright); stroke-width: 1; fill: none; }
.schem-fill { fill: var(--bg-raised); stroke: var(--ink-dim); stroke-width: 1.1; }
.schem-dot { fill: var(--accent); animation: pulse 2.6s ease-in-out infinite; }
.schem-dot:nth-of-type(2n) { animation-delay: 0.4s; }
.schem-dot:nth-of-type(3n) { animation-delay: 0.8s; }
.schem-leader { stroke: var(--line-bright); stroke-width: 1; stroke-dasharray: 2 3; }
.schem-label { font-family: "JetBrains Mono"; font-size: 8.5px; fill: var(--ink-faint); letter-spacing: 0.5px; }

/* ---------- pipeline ---------- */
.pipeline-section {
  border-top: 1px solid var(--line);
  padding: 120px 0 130px;
}

.pipeline-head {
  text-align: center;
  margin-bottom: 76px;
}

.pipeline-head h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(26px, 3.6vw, 38px);
  max-width: 26ch;
  margin: 0 auto 14px;
  line-height: 1.25;
}

.pipeline-head p {
  color: var(--ink-dim);
  font-size: 14.5px;
  max-width: 42ch;
  margin: 0 auto;
}

.pipeline {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  position: relative;
}

.p-connector {
  position: absolute;
  top: 29px;
  height: 1px;
  background: var(--line-bright);
  z-index: 0;
  overflow: hidden;
}

.p-connector .bit {
  position: absolute;
  top: -1.5px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent);
  animation: flow 2.6s linear infinite;
}

@keyframes flow {
  from { left: -4px; opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: 1; }
  to   { left: 100%; opacity: 0; }
}

.p-node {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0 10px;
}

.p-node .ring {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 1px solid var(--line-bright);
  background: var(--bg-raised);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  position: relative;
}

.p-node .ring svg { width: 22px; height: 22px; }

.p-node .ring::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1px solid var(--accent);
  opacity: 0;
  animation: ringpulse 2.6s ease-in-out infinite;
}
.p-node:nth-child(2) .ring::after { animation-delay: 0s; }
.p-node:nth-child(4) .ring::after { animation-delay: 0.5s; }
.p-node:nth-child(6) .ring::after { animation-delay: 1s; }
.p-node:nth-child(8) .ring::after { animation-delay: 1.5s; }
.p-node:nth-child(10) .ring::after { animation-delay: 2s; }

@keyframes ringpulse {
  0% { opacity: 0.5; transform: scale(0.9); }
  70% { opacity: 0; transform: scale(1.25); }
  100% { opacity: 0; transform: scale(1.25); }
}

.p-node .step-label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: 8px;
}

.p-node .step-status {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink-faint);
  min-height: 14px;
}

.p-node .step-status .cursor {
  display: inline-block;
  width: 5px;
  background: var(--accent);
  animation: pulse 1.1s step-end infinite;
}

.pipeline-note {
  text-align: center;
  margin-top: 56px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
}

/* ---------- cta ---------- */
.cta-section {
  border-top: 1px solid var(--line);
  padding: 130px 0 70px;
  text-align: center;
}

.cta-section h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-style: italic;
  font-size: clamp(26px, 4.4vw, 44px);
  max-width: 20ch;
  margin: 0 auto 32px;
  line-height: 1.2;
}

.cta-section .contact {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--ink-dim);
  border-bottom: 1px solid var(--line);
  padding-bottom: 5px;
  transition: color 0.3s ease, border-color 0.3s ease;
}
.cta-section .contact:hover { color: var(--accent); border-color: var(--accent); }

@media (max-width: 900px) {
  .device-grid { grid-template-columns: 1fr; gap: 40px; }
  .device-grid.flip .diagram { order: 0; }
  .pillars .wrap { grid-template-columns: 1fr; }
  .pipeline { grid-template-columns: repeat(5, 1fr); gap: 6px; }
  .p-node .step-label { font-size: 9px; }
  .p-node .ring { width: 44px; height: 44px; }
  .p-connector { display: none; }
  .device-section, .pipeline-section, .cta-section { padding: 80px 0; }
  nav { padding: 20px 22px; }
  .wrap { padding: 0 22px; }
}
