:root {
  --bg: #000000;
  --bg-subtle: #09090b;
  --surface: #111114;
  --surface-hover: #17171c;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #f5f5f7;
  --text-muted: #86868b;
  --text-light: #6e6e73;
  --accent: #f59e0b;
  --accent-hover: #fbbf24;
  --accent-soft: rgba(245, 158, 11, 0.14);
  --radius: 20px;
  --radius-sm: 12px;
  --max-w: 1120px;
}

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

html {
  scroll-behavior: smooth;
  background: var(--bg);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Inter', 'Segoe UI', sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

.mono {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;
  font-size: 0.78rem;
}

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

/* =========================================================
   Meng To Skill: Gradient Border Flashlight
   ========================================================= */
.flashlight-card {
  position: relative;
  isolation: isolate;
}

.flashlight-overlay {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
  z-index: 2;
  background: radial-gradient(
    280px circle at var(--fx, -999px) var(--fy, -999px),
    rgba(245, 158, 11, 0.085),
    transparent 70%
  );
}

.flashlight-overlay::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: radial-gradient(
    240px circle at var(--fx, -999px) var(--fy, -999px),
    rgba(245, 158, 11, 0.75),
    rgba(255, 255, 255, 0.18) 45%,
    transparent 75%
  );
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
}

.flashlight-card.is-lit > .flashlight-overlay {
  opacity: 1;
}

@media (hover: none), (prefers-reduced-motion: reduce), (forced-colors: active) {
  .flashlight-overlay { display: none; }
}

/* =========================================================
   Apple-style Ultra-thin Glass Navbar
   ========================================================= */
.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
}

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

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.brand-wordmark {
  font-size: 1.05rem;
  letter-spacing: -0.03em;
  color: #ffffff;
}

.brand-wordmark strong { font-weight: 600; }
.brand-wordmark span { font-weight: 300; color: var(--text-muted); }

.nav-links {
  display: flex;
  gap: 32px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.nav-links a { transition: color 0.15s; }
.nav-links a:hover { color: #ffffff; }

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-buy-pill {
  background: #ffffff;
  color: #000000;
  font-size: 0.76rem;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: 999px;
  transition: background 0.15s;
}

.nav-buy-pill:hover { background: #e5e5ea; }

.cart-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 10px;
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s;
}

.cart-trigger:hover { border-color: var(--border-strong); }

.cart-count {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

/* =========================================================
   Buttons
   ========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: 999px;
  font-size: 0.94rem;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-primary {
  background: #ffffff;
  color: #000000;
  font-weight: 600;
}

.btn-primary:hover { background: #e5e5ea; }

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
  border-color: var(--border-strong);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.32);
}

.btn-accent {
  background: var(--accent);
  color: #000000;
  font-weight: 600;
}

.btn-accent:hover { background: var(--accent-hover); }

.btn-link {
  color: var(--accent);
  padding: 13px 12px;
}

.btn-link:hover { color: var(--accent-hover); }

.btn-full { width: 100%; border-radius: var(--radius-sm); }

/* =========================================================
   Viewport 1: Apple-grade Full-Bleed Hero
   ========================================================= */
.hero {
  padding: 96px 0 64px;
  background: radial-gradient(ellipse 70% 45% at 50% 0%, rgba(245, 158, 11, 0.11), transparent 70%);
}

.hero-center {
  text-align: center;
  max-width: 780px;
}

.hero-overline {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: -0.01em;
  margin-bottom: 12px;
}

.hero-title {
  font-size: clamp(2.8rem, 6.2vw, 4.8rem);
  font-weight: 600;
  line-height: 1.04;
  letter-spacing: -0.045em;
  color: #ffffff;
  margin-bottom: 22px;
}

.text-gradient {
  background: linear-gradient(180deg, #ffffff 10%, #a1a1aa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: clamp(1.05rem, 1.8vw, 1.25rem);
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 32px;
  line-height: 1.5;
}

.hero-actions {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 56px;
}

.hero-stage {
  background: radial-gradient(circle at 50% 42%, #1a1a20 0%, #0b0b0e 72%);
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: 40px 32px 28px;
  overflow: hidden;
}

.hero-hardware-img,
.hero-hardware-video {
  width: 100%;
  max-height: 520px;
  border-radius: 16px;
  object-fit: cover;
  background: #000;
  margin: 0 auto 28px;
  display: block;
}

.hero-spec-strip {
  display: flex;
  justify-content: space-around;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.strip-item { text-align: center; }

.strip-val {
  display: block;
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #ffffff;
  font-variant-numeric: tabular-nums;
}

.strip-key {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.strip-divider {
  width: 1px;
  height: 28px;
  background: var(--border);
}

/* =========================================================
   Sections & Scroll Reveal
   ========================================================= */
.section { padding: 112px 0; }

.section-intro {
  max-width: 640px;
  margin-bottom: 52px;
}

.section-intro h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.08;
  color: #ffffff;
  margin-bottom: 14px;
}

.section-intro p {
  font-size: 1.08rem;
  color: var(--text-muted);
}

.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.65s cubic-bezier(0.22, 1, 0.36, 1), transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* =========================================================
   Viewport 2: Bento Grid
   ========================================================= */
.bento-section { border-top: 1px solid var(--border); }

.bento-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.bento-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 20px;
}

.bento-span-2 {
  grid-column: span 2;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  align-items: center;
  gap: 28px;
}

.bento-tag {
  display: inline-block;
  font-size: 0.76rem;
  font-weight: 500;
  color: var(--accent);
  margin-bottom: 10px;
}

.bento-card h3 {
  font-size: 1.45rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: #ffffff;
  margin-bottom: 10px;
}

.bento-card p {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.bento-media img {
  width: 100%;
  max-height: 220px;
  object-fit: contain;
}

.bento-metric {
  font-size: 4.2rem;
  font-weight: 600;
  letter-spacing: -0.05em;
  line-height: 1;
  color: #ffffff;
  font-variant-numeric: tabular-nums;
}

.bento-metric .unit {
  font-size: 1.8rem;
  color: var(--accent);
  margin-left: 4px;
}

/* =========================================================
   Viewport 3: Apple Store Configurator
   ========================================================= */
.buy-section {
  background: var(--bg-subtle);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.buy-grid {
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: 56px;
  align-items: start;
}

.buy-visual-col {
  position: sticky;
  top: 76px;
}

.gallery-stage {
  background: radial-gradient(circle at 50% 45%, #1b1b22, #101014);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  margin-bottom: 14px;
}

.gallery-stage img {
  width: 100%;
  height: 410px;
  object-fit: contain;
}

.gallery-thumbs {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}

.thumb {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 6px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  color: var(--text-muted);
  transition: border-color 0.18s, color 0.18s;
}

.thumb img { height: 42px; object-fit: contain; }
.thumb.active, .thumb:hover { border-color: var(--accent); color: #ffffff; }

.status-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--accent);
  margin-bottom: 10px;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

.buy-config-col h2 {
  font-size: 2.5rem;
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.1;
  color: #ffffff;
}

.buy-lead {
  color: var(--text-muted);
  font-size: 1rem;
  margin-top: 6px;
  margin-bottom: 22px;
}

.config-price-block {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 28px;
}

.config-price {
  font-size: 1.85rem;
  font-weight: 600;
  color: #ffffff;
  font-variant-numeric: tabular-nums;
}

.config-note {
  font-size: 0.84rem;
  color: var(--text-muted);
}

.config-step { margin-bottom: 24px; }

.step-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 12px;
}

.variant-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.variant-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-align: left;
  padding: 16px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  color: var(--text);
  transition: border-color 0.15s, background 0.15s;
}

.variant-row:hover { background: var(--surface-hover); }

.variant-row.active {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
  background: var(--surface-hover);
}

.v-name {
  display: block;
  font-size: 0.94rem;
  font-weight: 600;
  color: #ffffff;
}

.v-desc {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.v-price {
  font-size: 0.94rem;
  font-weight: 600;
  color: #ffffff;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  margin-left: 16px;
}

.purchase-bar {
  display: flex;
  gap: 12px;
}

.qty-control {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.qty-control button {
  width: 40px;
  height: 46px;
  background: transparent;
  color: #ffffff;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
}

.qty-control input {
  width: 42px;
  text-align: center;
  border: none;
  background: transparent;
  color: #ffffff;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  outline: none;
}

.trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.8rem;
  color: var(--text-muted);
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* =========================================================
   Viewport 4: Store Catalog
   ========================================================= */
.store-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.store-header h2 {
  font-size: clamp(1.9rem, 3.5vw, 2.6rem);
  font-weight: 600;
  letter-spacing: -0.04em;
  color: #ffffff;
}

.store-header p { color: var(--text-muted); margin-top: 6px; }

.filter-tabs { display: flex; gap: 8px; flex-wrap: wrap; }

.filter-btn {
  padding: 7px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.82rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
}

.filter-btn.active, .filter-btn:hover {
  background: #ffffff;
  color: #000000;
  border-color: #ffffff;
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.product-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.card-img {
  background: radial-gradient(circle at 50% 45%, #1c1c23, #111114);
  height: 210px;
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--border);
}

.card-img img { max-height: 165px; object-fit: contain; }

.card-body {
  padding: 22px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.card-cat {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
}

.card-price {
  font-weight: 600;
  font-size: 0.94rem;
  color: #ffffff;
  font-variant-numeric: tabular-nums;
}

.card-body h3 { font-size: 1.05rem; color: #ffffff; margin-bottom: 6px; }
.card-body p { font-size: 0.86rem; color: var(--text-muted); margin-bottom: 18px; flex: 1; }

/* =========================================================
   Specs & Open Source CLI
   ========================================================= */
.specs-section {
  background: var(--bg-subtle);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.specs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.spec-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
}

.spec-card h3 {
  font-size: 1.15rem;
  color: #ffffff;
  margin-bottom: 18px;
}

.spec-list div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
  font-size: 0.88rem;
}

.spec-list dt { color: var(--text-muted); }
.spec-list dd { font-weight: 500; text-align: right; color: #ffffff; }

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

.cli-copy h2 {
  font-size: clamp(2rem, 3.8vw, 2.8rem);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.1;
  color: #ffffff;
  margin-bottom: 16px;
}

.cli-copy p { color: var(--text-muted); margin-bottom: 28px; font-size: 1.02rem; }
.cli-actions { display: flex; flex-wrap: wrap; gap: 12px; }

.terminal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.t-dot { width: 10px; height: 10px; border-radius: 50%; background: #27272a; }
.t-title { margin-left: 8px; color: var(--text-muted); }

.terminal-body {
  padding: 24px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  line-height: 1.85;
  overflow-x: auto;
  color: #e4e4e7;
}

.c-muted { color: #71717a; }
.c-amber { color: var(--accent); }

/* FAQ & Footer */
.faq-section { border-top: 1px solid var(--border); }
.faq-container { max-width: 760px; }

.faq-list details { border-top: 1px solid var(--border); padding: 20px 0; }
.faq-list details:last-child { border-bottom: 1px solid var(--border); }

.faq-list summary {
  font-weight: 500;
  font-size: 1rem;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #ffffff;
}

.faq-list summary::after { content: '+'; font-size: 1.25rem; color: var(--text-muted); }
.faq-list details[open] summary::after { content: '−'; color: var(--accent); }
.faq-list p { margin-top: 12px; font-size: 0.94rem; color: var(--text-muted); }

.footer {
  border-top: 1px solid var(--border);
  padding: 64px 0 36px;
  background: var(--bg-subtle);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.4fr;
  gap: 36px;
  margin-bottom: 48px;
}

.footer-desc { margin-top: 12px; font-size: 0.86rem; color: var(--text-muted); max-width: 240px; }
.footer-col h4 { font-size: 0.82rem; margin-bottom: 14px; color: #ffffff; }
.footer-col a { display: block; font-size: 0.86rem; color: var(--text-muted); margin-bottom: 8px; }
.footer-col a:hover { color: #ffffff; }

.newsletter-form { display: flex; gap: 8px; }
.newsletter-form input {
  flex: 1;
  padding: 10px 14px;
  background: var(--bg);
  color: #ffffff;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  font-size: 0.84rem;
  outline: none;
}

.newsletter-form input:focus { border-color: var(--accent); }

.footer-bottom {
  padding-top: 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-light);
}

/* Cart Drawer & Toast */
.cart-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 90;
}

.cart-backdrop.open { opacity: 1; pointer-events: auto; }

.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 400px;
  max-width: 100%;
  height: 100vh;
  background: #0d0d10;
  border-left: 1px solid var(--border);
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 100;
  display: flex;
  flex-direction: column;
}

.cart-drawer.open { transform: translateX(0); }

.cart-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.icon-btn { background: none; border: none; font-size: 1.1rem; cursor: pointer; color: var(--text-muted); }
.icon-btn:hover { color: #ffffff; }

.cart-items { flex: 1; overflow-y: auto; padding: 20px 24px; display: flex; flex-direction: column; gap: 16px; }
.cart-empty { text-align: center; color: var(--text-muted); margin-top: 48px; font-size: 0.92rem; }

.cart-item { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.cart-item h4 { font-size: 0.9rem; margin-bottom: 4px; color: #ffffff; }
.cart-item-meta { font-size: 0.82rem; color: var(--text-muted); }
.cart-item-actions { display: flex; align-items: center; gap: 8px; }

.mini-btn {
  width: 28px;
  height: 28px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: #ffffff;
  border-radius: 6px;
  cursor: pointer;
}

.cart-footer { padding: 20px 24px; border-top: 1px solid var(--border); background: #000000; }
.cart-subtotal { display: flex; justify-content: space-between; font-size: 1.05rem; margin-bottom: 6px; font-variant-numeric: tabular-nums; }
.cart-shipping-note { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 16px; }

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #ffffff;
  color: #000000;
  font-weight: 600;
  padding: 12px 22px;
  border-radius: 999px;
  font-size: 0.86rem;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s;
  z-index: 120;
}

.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Responsive */
@media (max-width: 960px) {
  .bento-grid, .buy-grid, .specs-grid, .cli-grid { grid-template-columns: 1fr; }
  .bento-span-2 { grid-column: span 1; grid-template-columns: 1fr; }
  .buy-visual-col { position: static; }
  .catalog-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .nav-links { display: none; }
  .strip-divider { display: none; }
}

@media (max-width: 600px) {
  .catalog-grid, .footer-grid { grid-template-columns: 1fr; }
}
