/* =====================================================
   MOTIONSENSR — style.css
   Mobile-first. No frameworks. No build tools.
   ===================================================== */

/* TODO: Add Open Graph / Twitter card meta tags with product photo URL */

/* ─── Custom Properties ─────────────────────────────── */
:root {
  --bg:           #0d0d0d;
  --surface:      #161616;
  --accent:       #00e5ff;
  --accent-hover: #00b8cc;
  --text:         #f0f0f0;
  --muted:        #888888;
  --border:       #2a2a2a;

  --font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
          Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "Cascadia Code", "Source Code Pro", Menlo,
               Consolas, "DejaVu Sans Mono", monospace;

  --space-xs:  0.5rem;
  --space-sm:  1rem;
  --space-md:  2rem;
  --space-lg:  4rem;
  --space-xl:  6rem;

  --radius:    6px;
  --max-width: 1100px;

  --nav-height:        60px;
  --nav-height-shrunk: 48px;
  --nav-transition:    height 0.2s ease, padding 0.2s ease, box-shadow 0.2s ease;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

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

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

a:hover,
a:focus-visible {
  color: var(--accent-hover);
  text-decoration: underline;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

ul {
  list-style: none;
}

/* ─── Utility ───────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--space-sm);
}

.section-title {
  font-size: clamp(1.4rem, 4vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-xs);
  color: var(--text);
}

.section-sub {
  color: var(--muted);
  margin-bottom: var(--space-md);
  max-width: 60ch;
}

/* ─── Buttons ───────────────────────────────────────── */
.btn-primary {
  display: inline-block;
  background-color: var(--accent);
  color: #000;
  font-weight: 700;
  font-size: 1rem;
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.1s ease;
  text-decoration: none;
}

.btn-primary:hover,
.btn-primary:focus-visible {
  background-color: var(--accent-hover);
  color: #000;
  text-decoration: none;
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-large {
  font-size: 1.15rem;
  padding: 1rem 2.5rem;
}

/* ─── Nav ───────────────────────────────────────────── */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-height);
  background-color: rgba(13, 13, 13, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid transparent;
  transition: var(--nav-transition);
}

.site-nav nav {
  height: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--space-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--accent);
  text-decoration: none;
}

.nav-logo:hover {
  color: var(--accent-hover);
  text-decoration: none;
}

.nav-cta {
  font-size: 0.875rem;
  font-weight: 600;
  color: #000;
  background-color: var(--accent);
  padding: 0.4rem 1rem;
  border-radius: var(--radius);
  text-decoration: none;
  transition: background-color 0.15s ease;
}

.nav-cta:hover,
.nav-cta:focus-visible {
  background-color: var(--accent-hover);
  color: #000;
  text-decoration: none;
}

/* Shrunk state applied by JS on scroll */
.site-nav.shrunk {
  height: var(--nav-height-shrunk);
  border-bottom-color: var(--border);
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.5);
}

/* ─── Hero ──────────────────────────────────────────── */
.hero {
  padding-block: var(--space-xl) var(--space-lg);
  border-bottom: 1px solid var(--border);
}

.hero-inner {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
  align-items: center;
}

.hero-text {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  max-width: 580px;
}

.hero-title {
  font-size: clamp(2.5rem, 8vw, 4.5rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--accent);
}

.hero-tagline {
  font-size: clamp(1.1rem, 3vw, 1.5rem);
  font-weight: 600;
  color: var(--text);
}

.hero-sub {
  font-size: 1rem;
  color: var(--muted);
  max-width: 52ch;
}

.hero-shipping {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: calc(var(--space-xs) * -0.5);
}

.hero-media {
  width: 100%;
  max-width: 480px;
}

.hero-photo-placeholder {
  width: 100%;
  aspect-ratio: 4 / 3;
  background-color: var(--surface);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
}

.placeholder-label {
  font-size: 0.85rem;
  color: var(--muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

@media (min-width: 768px) {
  .hero-inner {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }

  .hero-media {
    flex-shrink: 0;
    width: 44%;
    max-width: 440px;
  }
}

/* ─── How It Works ──────────────────────────────────── */
.how-it-works {
  padding-block: var(--space-lg);
  border-bottom: 1px solid var(--border);
  background-color: var(--surface);
}

.steps {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  margin-top: var(--space-md);
}

.step {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  position: relative;
  overflow: hidden;
}

.step-icon {
  position: absolute;
  font-size: 8rem;
  line-height: 1;
  opacity: 0.07;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  user-select: none;
  z-index: 0;
}

.step-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  position: relative;
  z-index: 1;
}

.step p {
  color: var(--muted);
  font-size: 0.95rem;
  max-width: 38ch;
  position: relative;
  z-index: 1;
}

.step-divider {
  display: none;
}

@media (min-width: 640px) {
  .steps {
    flex-direction: row;
    align-items: flex-start;
    gap: 0;
  }

  .step {
    flex: 1;
    padding-inline: var(--space-sm);
  }

  .step:first-child {
    padding-left: 0;
  }

  .step:last-child {
    padding-right: 0;
  }

  .step-divider {
    display: block;
    width: 1px;
    align-self: stretch;
    background-color: var(--border);
    margin-top: 2.5rem; /* align with icon row */
    flex-shrink: 0;
  }

  .step p {
    max-width: none;
  }
}

/* ─── Features ──────────────────────────────────────── */
.features {
  padding-block: var(--space-lg);
  border-bottom: 1px solid var(--border);
}

.feature-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-sm);
  margin-top: var(--space-md);
}

.feature-card {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-sm) var(--space-md);
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.feature-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: 0 6px 24px rgba(0, 229, 255, 0.08);
}

.feature-card h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: var(--space-xs);
}

.feature-card p {
  font-size: 0.9rem;
  color: var(--muted);
}

@media (min-width: 640px) {
  .feature-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* ─── Use Cases ─────────────────────────────────────── */
.use-cases {
  padding-block: var(--space-lg);
  border-bottom: 1px solid var(--border);
  background-color: var(--surface);
}

.use-case-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-sm);
  margin-top: var(--space-md);
  /* Horizontal scroll on small screens */
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
  /* Let it overflow on mobile */
  grid-auto-flow: column;
  grid-auto-columns: min(85vw, 300px);
  padding-bottom: var(--space-xs); /* room for scrollbar */
}

.use-case-card {
  background-color: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-sm) var(--space-md);
  scroll-snap-align: start;
  min-width: 0;
}

.use-case-card h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: var(--space-xs);
}

.use-case-card p {
  font-size: 0.9rem;
  color: var(--muted);
}

@media (min-width: 768px) {
  .use-case-grid {
    grid-auto-flow: unset;
    grid-auto-columns: unset;
    grid-template-columns: repeat(3, 1fr);
    overflow-x: visible;
    scroll-snap-type: none;
  }

  /* 4th card spans partial — keep grid even */
  .use-case-card:last-child {
    grid-column: 1 / -1;
    max-width: calc((100% - var(--space-sm) * 2) / 3);
  }
}

/* ─── Config Example ────────────────────────────────── */
.config-example {
  padding-block: var(--space-lg);
  border-bottom: 1px solid var(--border);
}

.code-block {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: var(--space-md);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.7;
  color: var(--text);
  margin-block: var(--space-md);
  white-space: pre;
  -webkit-overflow-scrolling: touch;
}

.code-block code {
  font-family: inherit;
}

/* Style inline comments */
.code-block .comment {
  color: var(--muted);
}

.config-closer {
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent);
  margin-top: var(--space-sm);
}

/* ─── Backstory ─────────────────────────────────────── */
.backstory {
  padding-block: var(--space-lg);
  border-bottom: 1px solid var(--border);
  background-color: var(--surface);
}

.backstory-inner {
  max-width: 680px;
}

.backstory .section-title {
  margin-bottom: var(--space-md);
}

.backstory-text {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.backstory-text p {
  font-size: 0.975rem;
  color: var(--muted);
  line-height: 1.75;
}

/* ─── FAQ ───────────────────────────────────────────── */
.faq {
  padding-block: var(--space-lg);
  border-bottom: 1px solid var(--border);
}

.faq-list {
  margin-top: var(--space-md);
  max-width: 720px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.faq-item {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font);
  font-size: 0.975rem;
  font-weight: 600;
  color: var(--text);
  text-align: left;
  gap: var(--space-sm);
  transition: color 0.15s ease;
}

.faq-question:hover,
.faq-question:focus-visible {
  color: var(--accent);
  outline: none;
}

.faq-question:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.faq-icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  position: relative;
  display: inline-block;
}

/* Plus icon via pseudo-elements */
.faq-icon::before,
.faq-icon::after {
  content: '';
  position: absolute;
  background-color: var(--accent);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.faq-icon::before {
  width: 18px;
  height: 2px;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
}

.faq-icon::after {
  width: 2px;
  height: 18px;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
}

/* Minus icon when open */
.faq-item.open .faq-icon::after {
  transform: translateX(-50%) rotate(90deg);
  opacity: 0;
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease;
}

.faq-item.open .faq-answer {
  max-height: 400px;
}

.faq-answer p {
  padding: 0 var(--space-md) var(--space-sm);
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.7;
}

/* ─── Buy CTA ───────────────────────────────────────── */
.buy-cta {
  padding-block: var(--space-xl);
  border: 1px solid var(--accent);
  border-inline: none;
  background: radial-gradient(ellipse at 50% 0%, rgba(0,229,255,0.07) 0%, transparent 70%);
}

.buy-inner {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
}

.buy-inner h2 {
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
}

.buy-price {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--accent);
}

.buy-note {
  font-size: 0.85rem;
  color: var(--muted);
}

.buy-note a {
  color: var(--muted);
  text-decoration: underline;
}

.buy-note a:hover {
  color: var(--accent);
}

/* ─── Footer ────────────────────────────────────────── */
.site-footer {
  padding-block: var(--space-lg);
  border-top: 1px solid var(--border);
  background-color: var(--surface);
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  text-align: center;
}

.footer-tagline {
  font-size: 0.9rem;
  color: var(--muted);
}

.footer-links {
  display: flex;
  gap: var(--space-md);
}

.footer-links a {
  font-size: 0.85rem;
  color: var(--muted);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.footer-copy {
  font-size: 0.8rem;
  color: var(--border);
}

/* ─── Hero Eyebrow ──────────────────────────────────── */
.hero-eyebrow {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  background-color: rgba(0, 229, 255, 0.08);
  border: 1px solid rgba(0, 229, 255, 0.25);
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
}

/* ─── Niche Callout ─────────────────────────────────── */
.niche-callout {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: var(--space-sm) var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.niche-quote {
  font-size: 1rem;
  font-weight: 700;
  font-style: italic;
  color: var(--text);
}

.niche-desc {
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.65;
}

/* ─── Making Of ─────────────────────────────────────── */
.making-of {
  padding-block: var(--space-lg);
  border-bottom: 1px solid var(--border);
}

.making-gallery {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-sm);
  margin-top: var(--space-md);
}

.making-photo {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.photo-placeholder {
  width: 100%;
  aspect-ratio: 4 / 3;
  background-color: var(--surface);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-sm);
}

.making-photo--wide .photo-placeholder {
  aspect-ratio: 16 / 9;
}

.photo-placeholder .placeholder-label {
  font-size: 0.8rem;
  color: var(--muted);
  font-family: var(--font-mono);
  line-height: 1.6;
}

.making-photo figcaption {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.55;
  font-style: italic;
}

@media (min-width: 640px) {
  .making-gallery {
    grid-template-columns: 1fr 1fr 1fr;
  }

  .making-photo--wide {
    grid-column: 1 / -1;
  }

  .making-photo--wide .photo-placeholder {
    aspect-ratio: 21 / 9;
  }
}

/* ─── Batch Badge ───────────────────────────────────── */
.batch-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  background-color: rgba(0, 229, 255, 0.08);
  border: 1px solid rgba(0, 229, 255, 0.3);
  padding: 0.3rem 0.9rem;
  border-radius: 999px;
}

.buy-note--honest {
  max-width: 44ch;
  font-style: italic;
  border-top: 1px solid var(--border);
  padding-top: var(--space-sm);
  margin-top: var(--space-xs);
}

/* ─── Scrollbar (Webkit) ────────────────────────────── */
::-webkit-scrollbar {
  width: 8px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
}
