/* TETROFIT site styles. Shared by index.html and products.html.
   Look: clean and minimal, full-width dark hero, light product section, pill buttons. */
:root {
  --bg: #0b0c0e;
  --bg-soft: #f4f4f4;
  --ink: #171a20;
  --ink-soft: #5c5e62;
  --ink-on-dark: #f4f4f4;
  --muted-on-dark: #a3a6ab;
  --line: #d0d1d2;
  --accent: #3e6ae1;
  --display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --body: "Barlow", system-ui, -apple-system, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink-on-dark);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
img { max-width: 100%; display: block; }

/* ---------- Top nav ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: calc(env(safe-area-inset-top, 0px) + 14px) 20px 14px;
  background: rgba(11, 12, 14, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.nav-logo { width: 150px; height: auto; }
.nav-links { display: flex; align-items: center; gap: 22px; font-size: 14px; font-weight: 500; }
.nav-links a { text-decoration: none; opacity: 0.9; }
.nav-links a:hover { opacity: 1; text-decoration: underline; text-underline-offset: 4px; }
.nav-links a[aria-current="page"] { text-decoration: underline; text-underline-offset: 4px; }

/* ---------- Pill buttons ---------- */
.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 22px;
  border-radius: 999px;
  font: 500 14px/1 var(--body);
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
}
.pill-light { background: #fff; color: #171a20; }
.pill-light:hover { background: #e8e8e8; }
.pill-dark { background: #171a20; color: #fff; }
.pill-dark:hover { background: #393c41; }
.pill-outline-light { background: transparent; color: #fff; border-color: #fff; }
.pill-outline-light:hover { background: rgba(255, 255, 255, 0.08); }
.pill-outline { background: transparent; color: var(--ink); border-color: var(--ink); }
.pill-outline:hover { background: rgba(23, 26, 32, 0.06); }
.pill:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ---------- Hero (home) ---------- */
.hero {
  position: relative;
  min-height: 62vh;
  min-height: 62svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 120px 20px 72px;
  background: radial-gradient(ellipse at 50% 30%, #1d2026 0%, var(--bg) 70%);
}
.hero-logo { width: min(520px, 80vw); height: auto; }
.hero-copy { display: flex; flex-direction: column; align-items: center; gap: 14px; margin-top: 28px; }
.hero-eyebrow {
  margin: 0;
  font: 500 13px/1 var(--mono);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted-on-dark);
}
.hero-headline {
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(34px, 6vw, 56px);
  line-height: 1;
  text-wrap: balance;
}
.hero-sub { margin: 0; color: var(--muted-on-dark); font-size: 17px; max-width: 44ch; }
.hero-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 8px; }

/* ---------- Page header (products page) ---------- */
.page-head {
  padding: 140px 20px 48px;
  background: radial-gradient(ellipse at 50% 0%, #1d2026 0%, var(--bg) 75%);
}

/* ---------- Sections ---------- */
section.block { padding: 88px 20px; }
.inner { max-width: 1100px; margin: 0 auto; }
.light { background: var(--bg-soft); color: var(--ink); }
.light .eyebrow { color: var(--ink-soft); }
.eyebrow {
  margin: 0 0 12px;
  font: 500 12px/1.2 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted-on-dark);
}
.section-title {
  margin: 0;
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(34px, 5vw, 52px);
  line-height: 1.02;
  text-wrap: balance;
}
.section-lede { margin: 16px 0 0; max-width: 56ch; color: var(--ink-soft); font-size: 17px; }

/* ---------- Product cards ---------- */
.cards {
  margin-top: 48px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 330px), 1fr));
  gap: 20px;
}
.card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: #fff;
  padding: 32px;
  min-width: 0;
}
.card-thumb {
  aspect-ratio: 16 / 10;
  background: linear-gradient(160deg, #e9eaec, #d5d7da);
  display: grid;
  place-items: center;
  color: #6b6e74;
  font: 500 12px/1 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.card h3 {
  margin: 0;
  font-family: var(--display);
  font-weight: 600;
  font-size: 30px;
  line-height: 1.05;
  text-wrap: balance;
}
.card p { margin: 0; color: var(--ink-soft); }
.card-foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 8px;
}
.status-tag {
  font: 500 12px/1 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
}

/* Option rows inside the PCB card */
.options { list-style: none; margin: 4px 0 0; padding: 0; border-top: 1px solid var(--line); }
.options li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.options .opt-name { font-weight: 600; color: var(--ink); }
.options .opt-desc { display: block; font-size: 14px; color: var(--ink-soft); font-weight: 400; }
.options .pill { min-height: 36px; padding: 0 16px; font-size: 13px; flex: 0 0 auto; }

/* ---------- Signup ---------- */
.signup { background: #111317; }
.signup .eyebrow { color: var(--muted-on-dark); }
.signup .section-lede { color: var(--muted-on-dark); }
form.signup-form { margin-top: 32px; display: flex; flex-wrap: wrap; gap: 12px; max-width: 620px; }
.signup-form label.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.signup-form input[type="email"] {
  flex: 1 1 260px;
  min-width: 0;
  min-height: 48px;
  font: inherit;
  color: var(--ink-on-dark);
  background: #1c1f25;
  border: 1px solid #2c3038;
  border-radius: 999px;
  padding: 0 20px;
}
.signup-form input[type="email"]::placeholder { color: #7d8189; }
.signup-form input[type="email"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.signup-form button { min-height: 48px; padding: 0 28px; }
.signup-form button:disabled { opacity: 0.6; cursor: default; }
.form-msg { margin: 14px 0 0; min-height: 1.5em; font-size: 14px; color: var(--muted-on-dark); }
.form-msg.ok { color: #8fd19e; }
.form-msg.err { color: #ff8a8a; }
.fine { margin: 16px 0 0; font-size: 12px; color: #7d8189; max-width: 60ch; }

footer { background: var(--bg); padding: 32px 20px 40px; color: var(--muted-on-dark); font-size: 12px; }
footer .inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid #22252b;
  padding-top: 20px;
}

@media (max-width: 640px) {
  .nav-links a.hide-sm { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* ---------- Product extras (build output) ---------- */
.price { margin: 0; font-family: var(--display); font-weight: 800; font-size: 26px; color: var(--ink); }
.opt-price { margin-left: 8px; font-family: var(--display); font-weight: 600; font-size: 18px; color: var(--ink); }
.card-photo { aspect-ratio: 16 / 10; width: 100%; object-fit: cover; background: #e9eaec; }
.muted { color: var(--ink-soft); }

/* ---------- Progress page ---------- */
.updated-note { margin: 12px 0 0; font: 500 12px/1.4 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted-on-dark); }
.progress-list { display: grid; gap: 20px; }
.progress-card { background: #fff; padding: 32px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.progress-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.progress-head h2 { margin: 0; font-family: var(--display); font-weight: 600; font-size: 30px; line-height: 1.05; text-wrap: balance; }
.progress-pct { font-family: var(--display); font-weight: 800; font-size: 34px; color: var(--ink); }
.progress-bar { height: 12px; background: #e3e4e6; border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--accent); border-radius: 999px; }
.milestones { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.milestones li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); color: var(--ink); }
.ms-status { flex: 0 0 auto; min-width: 96px; font: 500 11px/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; padding: 6px 8px; border-radius: 999px; text-align: center; border: 1px solid var(--line); color: var(--ink-soft); }
.ms-done { background: var(--ink); color: #fff; border-color: var(--ink); }
.ms-in_progress { color: var(--accent); border-color: var(--accent); }

/* ---------- Firmware (filled in by progress.html from the public Tetrofit repo) ---------- */
.firmware { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; background: var(--bg-soft); border-left: 3px solid var(--accent); }
.firmware-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 14px; }
.firmware-badge { font: 600 14px/1.2 var(--body); color: var(--ink); }
.firmware-date, .firmware-status { font: 400 13px/1.4 var(--mono); color: var(--ink-soft); }
.changelog summary { cursor: pointer; font: 500 13px/1.4 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink); }
.changelog-release { margin-top: 12px; }
.changelog-version { margin: 0; font: 600 13px/1.4 var(--mono); color: var(--ink-soft); }
.changelog-notes { margin: 6px 0 0; padding-left: 20px; color: var(--ink); font-size: 15px; }
.changelog-notes li { margin: 4px 0; }

/* ---------- Kit contents, ship dates, and progress sections ---------- */
.block-title { margin: 0 0 8px; font: 500 12px/1.2 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-soft); }
.includes { border-top: 1px solid var(--line); padding-top: 12px; }
.includes ul { margin: 0; padding-left: 18px; color: var(--ink); }
.includes li { margin: 2px 0; }
.ship-date { margin: 0; font: 500 13px/1.4 var(--mono); color: var(--ink); }
.progress-section { display: flex; flex-direction: column; gap: 4px; }
.progress-section ul { margin: 0; padding-left: 18px; color: var(--ink); }
.progress-section li { margin: 4px 0; }
.progress-section.waiting { background: #fff7ee; border-left: 3px solid var(--accent); padding: 12px 14px; }
.progress-section.waiting ul { color: var(--ink); }

/* ---------- Two-photo product cards ---------- */
.card-photos { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.card-photos .card-photo { aspect-ratio: 4 / 3; }

/* ---------- Photo carousel (cards with two or more photos) ---------- */
.carousel { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.carousel-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  border-radius: 2px;
  overscroll-behavior-x: contain;
}
.carousel-track::-webkit-scrollbar { display: none; }
.carousel-track:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.carousel .slide { flex: 0 0 100%; scroll-snap-align: start; min-width: 0; }
.carousel .slide .card-photo { aspect-ratio: 4 / 3; width: 100%; object-fit: cover; }
.carousel-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.carousel-count { font: 500 12px/1 var(--mono); letter-spacing: 0.08em; color: var(--ink-soft); }
.carousel-dots { display: flex; gap: 8px; }
.carousel .dot {
  width: 9px; height: 9px; padding: 0; border: 0; border-radius: 50%;
  background: #c4c7cc; cursor: pointer;
}
.carousel .dot.active { background: var(--ink); }
.carousel .dot:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* Gentle nudge once per card when it first comes into view */
.carousel.nudge .dot { animation: dot-pulse 1.2s ease-in-out 3; }
.carousel.nudge .carousel-count { animation: count-bob 1.2s ease-in-out 3; color: var(--ink); }
.carousel.nudge .carousel-dots { animation: none; }
@keyframes dot-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.6); }
}
@keyframes count-bob {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(6px); }
}
@media (prefers-reduced-motion: reduce) {
  .carousel.nudge .dot, .carousel.nudge .carousel-count { animation: none; }
}

/* ---------- FAQ ---------- */
.faq-list { max-width: 760px; display: flex; flex-direction: column; gap: 12px; }
.faq-item { background: #fff; padding: 0; }
.faq-item summary {
  cursor: pointer; list-style: none; padding: 20px 24px;
  font-family: var(--display); font-weight: 600; font-size: 24px; line-height: 1.15;
  color: var(--ink); display: flex; justify-content: space-between; gap: 16px; align-items: center;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; font: 500 22px/1 var(--mono); color: var(--ink-soft); transition: transform 0.2s; }
.faq-item[open] summary::after { content: "–"; }
.faq-item summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.faq-answer { padding: 0 24px 22px; color: var(--ink); font-size: 16px; }
.faq-answer p { margin: 0 0 12px; max-width: 62ch; }
.faq-answer p:last-child { margin-bottom: 0; }

/* ---------- Progress bar shimmer (progress page) ---------- */
.progress-fill { position: relative; overflow: hidden; }
.progress-fill::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  transform: translateX(-100%);
  animation: shimmer 2.4s ease-in-out infinite;
}
@keyframes shimmer {
  0% { transform: translateX(-100%); }
  60%, 100% { transform: translateX(100%); }
}
@media (prefers-reduced-motion: reduce) {
  .progress-fill::after { animation: none; }
}

/* ---------- Progress page: full motion ---------- */
.page-head h1 { perspective: 600px; }
.page-head h1 .char { display: inline-block; will-change: transform; }

.progress-card { position: relative; overflow: hidden; }
.progress-card::before {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(360px circle at var(--mx, 50%) var(--my, 50%), rgba(62, 106, 225, 0.12), transparent 65%);
  opacity: 0; transition: opacity 0.35s ease; pointer-events: none; z-index: 0;
}
.progress-card:hover::before { opacity: 1; }
.progress-card > * { position: relative; z-index: 1; }
.progress-card:hover { box-shadow: 0 18px 40px -22px rgba(23, 26, 32, 0.35); }

/* Segmented bar: one segment per milestone */
.progress-bar.segmented { display: flex; gap: 4px; height: 14px; background: none; border-radius: 0; overflow: visible; }
.seg { flex: 1 1 0; position: relative; background: #e3e4e6; border-radius: 999px; overflow: hidden; }
.seg-fill { position: absolute; inset: 0 auto 0 0; background: var(--accent); border-radius: 999px; }
.seg-in_progress .seg-fill {
  background: repeating-linear-gradient(-45deg, var(--accent) 0 6px, #5a7fe8 6px 12px);
  animation: stripes 1s linear infinite;
}
.seg-done .seg-fill { background: var(--ink); }
@keyframes stripes {
  from { background-position: 0 0; }
  to { background-position: 17px 0; }
}
.progress-bar.segmented .seg-fill { background-size: 17px 17px; }

/* Milestone rows with icons */
.milestones li, .progress-section li { display: flex; align-items: center; gap: 12px; }
.milestones li .ms-text, .progress-section li .ms-text { flex: 1 1 auto; min-width: 0; }
.ms-row-icon { flex: 0 0 22px; width: 22px; height: 22px; }
.ms-icon { width: 22px; height: 22px; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ms-icon-done { stroke: var(--ink); }
.ms-icon-done path { stroke: var(--ink); }
.ms-icon-done circle { stroke: var(--ink); fill: var(--ink); fill-opacity: 0.08; }
.ms-icon-progress { stroke: #e3e4e6; }
.ms-icon-progress .track { stroke: #d6d9de; }
.ms-icon-progress .arc { stroke: var(--accent); }
.ms-icon-todo { stroke: #b8bcc3; }
.milestones li .ms-status, .progress-section li .ms-status { flex: 0 0 auto; }

/* Firmware box */
.firmware { border-radius: 2px; }

/* Pulsing dot on in-progress status tags */
.progress-head .progress-pct { font-variant-numeric: tabular-nums; }

/* ---------- Bubbly progress segments (overrides the earlier striped design) ---------- */
.progress-bar.segmented { gap: 6px; height: 18px; }
.seg { background: transparent; border-radius: 999px; overflow: hidden; }
.seg-todo { border: 1.5px dashed #c4c7cc; }
.seg-in_progress { background: #eef1ff; }
.seg-fill { position: absolute; inset: 0 auto 0 0; border-radius: 999px; background: none; }
.seg-done .seg-fill {
  background: linear-gradient(180deg, #3a3f48 0%, #0d0e10 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.seg-in_progress .seg-fill {
  background: linear-gradient(180deg, #9db3ff 0%, var(--accent) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
  animation: none;
}
.bubble {
  position: absolute; bottom: 3px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.75);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5);
  pointer-events: none;
}

/* Signup success */
.signup-form { position: relative; }
.burst-dot {
  position: absolute; left: 50%; top: 50%; width: 8px; height: 8px; margin: -4px 0 0 -4px;
  border-radius: 50%; background: var(--accent); pointer-events: none;
}
.success-check {
  display: inline-block; width: 22px; height: 22px; margin-right: 8px; vertical-align: middle;
  fill: none; stroke: #8fd19e; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round;
}

/* Home headline word reveal */
.hero-headline .word { display: inline-block; will-change: transform; }

/* Carousel: dot morph and grab cursor */
.carousel .dot { transition: width 0.35s ease, border-radius 0.35s ease, background 0.35s ease; }
.carousel .dot.active { width: 22px; border-radius: 6px; }
.carousel-track { cursor: grab; }
.carousel-track.is-dragging { scroll-snap-type: none; cursor: grabbing; user-select: none; }

/* FAQ answers animate in height */
.faq-answer { overflow: hidden; }

/* Cards get room for the 3D tilt */
.cards .card { will-change: transform; }
