/* ═══════════════════════════════════════════
   DJML LABS — "Apple way" layer
   Loaded last on every page. Light is the default theme.
   ═══════════════════════════════════════════ */

/* ── Light (default) ── */
html[data-theme="light"] {
  --bg: #f5f5f7;
  --bg2: #ffffff;
  --panel: #ffffff;
  --panel-b: #f5f5f7;
  --panel-hov: #fbfbfd;
  --stroke: rgba(0,0,0,0.08);
  --stroke-b: rgba(0,0,0,0.14);
  --text: #1d1d1f;
  --text2: #6e6e73;
  --text3: #86868b;
  --c1: #0071e3;
  --c2: #8a3ffc;
  --c3: #e3337a;
  --link: #0066cc;
  --grad: linear-gradient(135deg, #0071e3 0%, #8a3ffc 55%, #e3337a 100%);
  --grad-text: linear-gradient(90deg, #0071e3 0%, #8a3ffc 50%, #e3337a 100%);
  --shadow-card: 0 4px 24px rgba(0,0,0,0.06);
  --shadow-lift: 0 18px 50px -12px rgba(0,0,0,0.18);
  --shadow-glow: none;
  --nav-bg: rgba(251,251,253,0.8);
  --nav-bg-s: rgba(251,251,253,0.88);
  --overlay: rgba(255,255,255,0.8);
  --cfg-on: rgba(0,113,227,0.05);
  --cfg-on-b: #0071e3;
  --cfg-ok: #1a8f4a;
  --cfg-ok-soft: rgba(26,143,74,0.08);
  --btn: #0071e3; --btn-hov: #0077ed; --btn-fg: #ffffff;
  --gold: #ff9f0a;
  color-scheme: light;
}

/* ── Dark (Apple dark) ── */
html[data-theme="dark"] {
  --bg: #000000;
  --bg2: #161617;
  --panel: #1d1d1f;
  --panel-b: #2a2a2d;
  --panel-hov: #242426;
  --stroke: rgba(255,255,255,0.1);
  --stroke-b: rgba(255,255,255,0.18);
  --text: #f5f5f7;
  --text2: #a1a1a6;
  --text3: #86868b;
  --c1: #2997ff;
  --link: #2997ff;
  --shadow-card: none;
  --shadow-lift: 0 18px 50px -12px rgba(0,0,0,0.7);
  --shadow-glow: none;
  --nav-bg: rgba(22,22,23,0.8);
  --nav-bg-s: rgba(22,22,23,0.9);
  --cfg-on: rgba(41,151,255,0.08);
  --cfg-on-b: #2997ff;
  --btn: #0071e3; --btn-hov: #0077ed; --btn-fg: #ffffff;
}

/* ── Type: SF-style system stack ── */
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Helvetica Neue", system-ui, sans-serif;
  font-size: 17px; line-height: 1.47; letter-spacing: -0.012em;
  transition: background-color .3s, color .3s;
}
h1, h2, h3, h4, .stat-num, .score-big, .cfg-total, .ap-bar-sum strong, .ap-review-total strong,
.ap-choice-price strong, .ap-stage-cap b, .cfg-card-foot b {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Helvetica Neue", system-ui, sans-serif;
  letter-spacing: -0.022em;
}
h1, h2 { font-weight: 700; }

/* Calm the background: no orbs, no dot grid, no shimmer */
body::before, body::after, .hero-orb, .app-cover::before, .glow-divider { display: none !important; }
.app-card::before, .app-featured::before, .buy-panel::before, .why-card::before { display: none; }

/* ── Nav: thin frosted bar ── */
nav { height: 52px; border-bottom: 1px solid var(--stroke); background: var(--nav-bg); }
.nav-logo img { height: 26px; }
.nav-links { gap: 2px; }
.nav-links a { font-size: 12.5px; font-weight: 400; color: var(--text); opacity: .8; padding: 6px 12px; background: none !important; }
.nav-links a:hover { opacity: 1; }
.nav-cta { padding: 5px 14px; font-size: 12.5px; font-weight: 500; background: var(--btn); color: var(--btn-fg); box-shadow: none; }
.nav-cta:hover { background: var(--btn-hov); box-shadow: none; transform: none; }
.theme-toggle { width: 30px; height: 30px; font-size: 14px; border: 0; background: transparent; }
.theme-toggle:hover { background: var(--panel-b); }

/* ── Buttons: Apple pills ── */
.btn { font-weight: 500; font-size: 17px; padding: 12px 24px; letter-spacing: -0.01em; transition: background .2s, color .2s, transform .2s; }
.btn-primary { background: var(--btn); color: var(--btn-fg); box-shadow: none; }
.btn-primary:hover { background: var(--btn-hov); box-shadow: none; transform: none; }
.btn-glass { background: transparent; color: var(--link); border: 1px solid var(--link); backdrop-filter: none; }
.btn-glass:hover { background: var(--link); color: var(--btn-fg); border-color: var(--link); transform: none; }
.btn-msstore { border-radius: 999px; background: var(--panel); border: 1px solid var(--stroke-b); font-weight: 500; }

/* Labels become small, quiet eyebrows */
.sec-label { font-size: 14px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--text2); }
.pill-tag { background: transparent; border: 0; padding: 0; color: var(--c3); font-size: 14px; letter-spacing: 0; text-transform: none; font-weight: 600; backdrop-filter: none; }
.pill-tag::before { display: none; }

/* ── Hero ── */
.hero { padding: 96px 0 40px; }
.hero h1 { font-size: clamp(44px, 8vw, 96px); font-weight: 700; line-height: 1.04; letter-spacing: -0.035em; margin-bottom: 20px; }
.hero p { font-size: clamp(19px, 2.2vw, 24px); color: var(--text2); max-width: 640px; margin-bottom: 32px; line-height: 1.35; }
.hero-actions { gap: 14px; }
.hero-product { display: block; max-width: 1040px; margin: 64px auto 0; border-radius: 28px; overflow: hidden;
  box-shadow: var(--shadow-lift); transition: transform .8s cubic-bezier(.22,1,.36,1); }
.hero-product:hover { transform: scale(1.01); }
.hero-product img { width: 100%; height: auto; }

/* ── Sections ── */
section { padding: 100px 0; }
.sec-head { margin-bottom: 44px; }
.sec-head h2 { font-size: clamp(32px, 5vw, 56px); line-height: 1.07; letter-spacing: -0.03em; }
.sec-head .sub { color: var(--text2); font-size: 15px; }
.ap-band { background: var(--bg2); }

/* ── Cards: white tiles, soft shadow, big radius ── */
.app-card, .app-featured, .why-card, .feat-item, .review-card, .reviews-summary, .release-notes, .buy-panel, .stats-bar, .cfg-modal-card {
  background: var(--panel); border: 0; border-radius: 28px; box-shadow: var(--shadow-card); backdrop-filter: none; -webkit-backdrop-filter: none;
}
html[data-theme="dark"] .app-card, html[data-theme="dark"] .why-card, html[data-theme="dark"] .feat-item,
html[data-theme="dark"] .review-card, html[data-theme="dark"] .reviews-summary, html[data-theme="dark"] .release-notes,
html[data-theme="dark"] .buy-panel, html[data-theme="dark"] .app-featured { border: 1px solid var(--stroke); }
.app-card { transition: transform .5s cubic-bezier(.22,1,.36,1), box-shadow .5s; }
.app-card:hover, .app-featured:hover { transform: scale(1.015); border-color: transparent; box-shadow: var(--shadow-lift); }
.app-featured { min-height: 440px; margin-bottom: 0; }
.feat-info { padding: 56px 52px; }
.feat-info h2 { font-size: clamp(32px, 4vw, 48px); }
.feat-info p { font-size: 19px; line-height: 1.4; }
.app-body { padding: 26px 28px 28px; }
.app-body h3 { font-size: 24px; }
.app-body p { font-size: 15px; }
.app-tag { background: var(--panel-b); border: 0; color: var(--text2); font-weight: 500; }
.app-badge { backdrop-filter: blur(20px); }
.app-badge-live { background: rgba(255,255,255,0.85); border: 0; color: #1a8f4a; }
.version-dot { background: #30d158; box-shadow: none; }

.why-grid, .feat-grid { gap: 20px; }
.why-card, .feat-item { padding: 34px 30px; transition: transform .5s cubic-bezier(.22,1,.36,1), box-shadow .5s; }
.why-card:hover, .feat-item:hover { transform: scale(1.02); box-shadow: var(--shadow-lift); border-color: transparent; }
.why-icon, .feat-icon { width: auto; height: auto; background: none; border: 0; font-size: 34px; justify-content: flex-start; margin-bottom: 18px; }
.why-card h3, .feat-item h3 { font-size: 21px; margin-bottom: 8px; }
.why-card p, .feat-item p { font-size: 15px; line-height: 1.45; }

.stats-bar { gap: 0; overflow: hidden; margin-bottom: 0; }
.stat-item { background: transparent; padding: 40px 24px; border-left: 1px solid var(--stroke); }
.stat-item:first-child { border-left: 0; }
.stat-item:hover { background: transparent; }
.stat-num { font-size: 48px; font-weight: 700; }
.stat-label { font-size: 15px; color: var(--text2); }

/* ── Product page ── */
.back-link { color: var(--link); font-size: 14px; margin: 12px 0 0; }
.back-link:hover { text-decoration: underline; color: var(--link); }
.product-wrap { padding: 32px 0 60px; }
.product-grid { gap: 56px; }
.buy-panel { padding: 36px; top: 76px; }
.buy-panel h1 { font-size: clamp(32px, 4vw, 48px); line-height: 1.05; }
.buy-panel .sub { font-size: 19px; line-height: 1.35; }
.kv-row { font-size: 14px; padding: 13px 0; }
.score-big { font-size: 80px; font-weight: 700; }
.bar-track { background: var(--panel-b); }
.release-notes { padding: 32px; font-family: inherit; font-size: 15px; }
.review-card { padding: 28px; }
.review-card h4 { font-size: 19px; }

/* Previews: neutral frames instead of navy glow */
.pv-stage, .pv-lb-frame { border-radius: 28px !important; border: 0 !important; box-shadow: var(--shadow-lift); }
.pv-tab { border-radius: 14px; }
.pv-tab.is-active { border-color: var(--c1) !important; box-shadow: 0 0 0 1px var(--c1) !important; background: var(--panel) !important; }
.pv-tab:hover { border-color: var(--stroke-b); }
html[data-theme="light"] .pv-lb-backdrop { background: rgba(245,245,247,0.86); backdrop-filter: blur(20px); }

/* ── Configurator ── */
.cfg-steps li { border-color: var(--stroke-b); font-size: 13px; }
.cfg-steps li.is-active span { background: var(--btn); color: var(--btn-fg); }
.ap-stage { border: 0; border-radius: 32px; background: var(--bg2); box-shadow: var(--shadow-card); }
html[data-theme="light"] .ap-stage { background: linear-gradient(180deg, #ffffff, #f5f5f7); }
html[data-theme="light"] .ap-stage-glow { opacity: .5; }
.ap-choice { border-radius: 18px; background: var(--panel); }
.ap-choice.is-on { border-color: var(--cfg-on-b); box-shadow: 0 0 0 1px var(--cfg-on-b); background: var(--panel); }
.ap-next { color: var(--link); }
.ap-stage-dots i.is-active { background: var(--text); }
.cfg-badge { background: var(--panel); border-color: var(--stroke-b); color: var(--text); }
.cfg-form input, .cfg-form textarea { background: var(--panel); border-radius: 12px; }
html[data-theme="light"] .cfg-modal-backdrop { background: rgba(245,245,247,0.7); backdrop-filter: blur(20px); }
.cfg-modal-card { box-shadow: var(--shadow-lift); }

/* ── Footer: Apple's quiet grey footer ── */
footer { background: var(--panel-b); border-top: 0; margin-top: 0; padding: 36px 0; }
html[data-theme="light"] footer { background: #f5f5f7; border-top: 1px solid var(--stroke); }
.footer-copy, .footer-links a { font-size: 12px; color: var(--text2); }
.footer-links a:hover { color: var(--text); text-decoration: underline; }

/* ── Scroll reveal (added by app.js) ── */
.ap-reveal { opacity: 0; transform: translateY(40px); transition: opacity 1s cubic-bezier(.22,1,.36,1), transform 1s cubic-bezier(.22,1,.36,1); }
.ap-reveal.is-in { opacity: 1; transform: none; }

@media (max-width: 960px) {
  .stat-item:nth-child(3) { border-left: 0; }
  .stat-item:nth-child(n+3) { border-top: 1px solid var(--stroke); }
  .feat-info { padding: 36px 28px; }
}
@media (max-width: 640px) {
  .hero { padding: 64px 0 24px; }
  .hero-product { margin-top: 40px; border-radius: 20px; }
  section { padding: 64px 0; }
}
@media (prefers-reduced-motion: reduce) { .ap-reveal { opacity: 1; transform: none; transition: none; } }
