/* =====================================================================
   Mantra — landing styles
   House style, shared with nikhco.in / knob.nikhco.in: Inter + Instrument
   Serif from Google Fonts, warm neutral tokens, a real [data-theme] dark
   mode toggle. Values in this file are copied from the NiKhCo house
   system (~/dev/CLAUDE.md house references) so Mantra reads as a sibling
   of the rest of the studio, not a one-off template.
   ===================================================================== */

:root {
  /* Neutrals — verbatim from the house token system */
  --bg: #FBFAF7;
  --bg-soft: #F4F2EC;
  --bg-tile: #FFFFFF;
  --ink: #0E0E0F;
  --ink-2: #3A3A3C;
  --muted: #6B6B70;
  --muted-2: #9A9A9F;
  --border: #E6E4DD;
  --border-soft: #EFEDE6;

  /* Mantra's accent — warm sunrise, echoing the app's own default theme */
  --accent: #E08A2C;
  --accent-2: #FFA751;
  --accent-ink: #3A2500;

  /* Hero tints — verbatim from the house token system */
  --tint-hero-from: #FFF4E1;
  --tint-hero-via: #FBE7F1;
  --tint-hero-to: #EDE5FB;

  --shadow-card: 0 1px 0 rgba(0,0,0,0.02), 0 12px 32px -18px rgba(20,12,6,0.16);
  --shadow-soft: 0 1px 0 rgba(0,0,0,0.03), 0 8px 18px -14px rgba(20,12,6,0.18);
  --ring: 0 0 0 1px var(--border);

  --content-width: 1160px;
}

[data-theme="dark"] {
  --bg: #0E0E0F;
  --bg-soft: #131315;
  --bg-tile: #161618;
  --ink: #F3F1EC;
  --ink-2: #D5D3CD;
  --muted: #A8A69F;
  --muted-2: #72706B;
  --border: #2A2A2C;
  --border-soft: #1E1E20;

  --accent: #FFB64A;
  --accent-2: #FFD37A;
  --accent-ink: #1E1300;

  --tint-hero-from: #1B140E;
  --tint-hero-via: #1A0F15;
  --tint-hero-to: #120E1A;

  --shadow-card: 0 1px 0 rgba(0,0,0,0.4), 0 20px 40px -24px rgba(0,0,0,0.7);
  --shadow-soft: 0 1px 0 rgba(0,0,0,0.35), 0 10px 24px -18px rgba(0,0,0,0.7);
  --ring: 0 0 0 1px var(--border);
}

* { box-sizing: border-box; }

html {
  background: var(--bg);
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
}

body {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink-2);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  transition: background-color 0.25s ease, color 0.25s ease;
}

h1, h2, h3 {
  color: var(--ink);
  font-weight: 700;
  letter-spacing: -0.025em;
  margin: 0;
}

p { margin: 0; }

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

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

em {
  font-family: "Instrument Serif", Georgia, "Times New Roman", serif;
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.01em;
}

::selection { background: rgba(224, 138, 44, 0.28); }

.section-inner {
  max-width: var(--content-width);
  margin: 0 auto;
}

section {
  padding: 6rem 2.5rem;
  position: relative;
}

@media (max-width: 860px) {
  section { padding: 4.5rem 1.25rem; }
}

@media (max-width: 520px) {
  section { padding: 3.5rem 1rem; }
}

/* Focus visibility (accessibility) */
a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------------------------------------------------------------- */
/* Header — logo tile + nav, matches nikhco.in's .top shell           */
/* ---------------------------------------------------------------- */

.top {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  padding: 0.5rem 1.5rem;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, background-color 0.25s ease;
}

.top-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.top.is-scrolled {
  border-bottom-color: var(--border-soft);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
}

.logo-tile {
  display: inline-flex;
  align-items: center;
}

.logo-embed {
  display: block;
  width: 234px;
  height: 45px;
  border: 0;
  background: transparent;
  pointer-events: none;
}

.top-nav {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

.top-nav a {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--muted);
  transition: color 150ms;
}

.top-nav a:hover { color: var(--ink); }

.theme-toggle {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  background: var(--bg-tile);
  border-radius: 999px;
  color: var(--muted);
  cursor: pointer;
  transition: color 150ms, border-color 150ms, background-color 150ms;
}

.theme-toggle:hover { color: var(--ink); border-color: var(--ink); }
.theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-moon { display: inline-block; }

@media (max-width: 640px) {
  .top { padding: 0.75rem 1rem; }
  .top-nav { gap: 0.9rem; }
  .top-nav a:not(.theme-toggle) { font-size: 0.82rem; }
  .logo-embed { width: min(171px, 100vw - 210px); height: 33px; }
}

@media (max-width: 400px) {
  .top-nav { gap: 0.6rem; }
  .top-nav a:not(.theme-toggle) { display: none; }
  .logo-embed { width: min(160px, 100vw - 120px); height: 31px; }
}

/* ---------------------------------------------------------------- */
/* Hero                                                              */
/* ---------------------------------------------------------------- */

.hero {
  padding-top: 9.5rem;
  padding-bottom: 5rem;
  text-align: center;
  overflow: hidden;
  background:
    radial-gradient(1300px 700px at 88% -10%, var(--tint-hero-to) 0%, transparent 60%),
    radial-gradient(1100px 650px at 6% 0%, var(--tint-hero-from) 0%, transparent 55%),
    linear-gradient(180deg, var(--tint-hero-via) 0%, var(--tint-hero-via) 32%, var(--bg) 100%);
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
}

.brand-icon {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  display: block;
  box-shadow: var(--shadow-soft);
}

.brand-name {
  font-size: 1.1875rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--ink);
}

.hero h1 {
  font-size: clamp(2.15rem, 5vw, 3.75rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
  max-width: 21ch;
  text-wrap: balance;
}

.hero h1 em {
  color: var(--accent);
  font-size: 1.06em;
  padding: 0 0.02em;
}

.hero-sub {
  max-width: 38rem;
  font-size: 1.09rem;
  color: var(--ink-2);
  line-height: 1.55;
}

/* ---- Direct download CTA (Developer ID DMG) ---- */

.download-cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.625rem;
  margin-top: 0.5rem;
}

.btn-download {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 1.9rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #FFE259, var(--accent-2));
  color: var(--accent-ink);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.01em;
  text-decoration: none;
  box-shadow: var(--shadow-card);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-download:hover,
.btn-download:focus-visible {
  transform: translateY(-1px);
}

.btn-download svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  flex-shrink: 0;
}

.download-meta {
  font-size: 0.8125rem;
  color: var(--muted);
  letter-spacing: 0.01em;
}

/* ---- Mac App Store badge (hand-drawn, inline SVG — no hotlinked artwork) ---- */
.badge-link {
  display: inline-block;
  border-radius: 12px;
  transition: transform 0.15s ease;
}

.badge-link:hover,
.badge-link:focus-visible {
  transform: translateY(-1px);
}

.appstore-badge { display: block; }

.hero-shot {
  width: 100%;
  max-width: 720px;
  margin-top: 1.5rem;
}

.hero-shot img {
  width: 100%;
  height: auto;
  border-radius: 20px;
  box-shadow: var(--shadow-card), var(--ring);
}

/* ---------------------------------------------------------------- */
/* Three-beat feature row — "Write it. See it. Live it."             */
/* ---------------------------------------------------------------- */

.features .section-inner {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3rem;
  text-align: center;
}

@media (max-width: 720px) {
  .features .section-inner {
    grid-template-columns: 1fr;
    gap: 2.5rem;
    text-align: left;
  }
}

.feature {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

@media (max-width: 720px) {
  .feature {
    flex-direction: row;
    align-items: flex-start;
    gap: 1.25rem;
  }
}

.feature-glyph {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  border-radius: 14px;
  background: var(--bg-tile);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
  display: flex;
  align-items: center;
  justify-content: center;
}

.feature-glyph svg {
  width: 24px;
  height: 24px;
  stroke: var(--accent);
}

.feature h3 {
  font-size: 1.125rem;
  line-height: 1.3;
}

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

/* ---------------------------------------------------------------- */
/* Live preview (editor <-> widget) demo                             */
/* ---------------------------------------------------------------- */

.live-preview { background: var(--bg-soft); }

.live-preview h2,
.themes h2 {
  font-size: clamp(1.55rem, 2.6vw, 2.15rem);
  text-align: center;
  margin-bottom: 0.75rem;
}

.live-preview .section-lede,
.themes .section-lede {
  text-align: center;
  max-width: 44ch;
  margin: 0 auto 3rem;
  color: var(--muted);
  font-size: 1.02rem;
}

.preview-pair {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.preview-shot {
  flex: 1 1 0;
  width: 100%;
  max-width: 380px;
  display: flex;
  justify-content: center;
}

.preview-editor { max-width: 320px; }

.preview-editor img {
  width: 100%;
  height: auto;
  border-radius: 20px;
  box-shadow: var(--shadow-card), var(--ring);
}

.preview-widget img {
  width: 100%;
  height: auto;
}

.preview-arrow {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-arrow svg {
  width: 26px;
  height: 26px;
  stroke: var(--muted);
}

@media (max-width: 720px) {
  .preview-pair { flex-direction: column; gap: 1.5rem; }
  .preview-arrow svg { transform: rotate(90deg); }
  .preview-shot, .preview-editor { max-width: 300px; }
}

/* ---------------------------------------------------------------- */
/* Theme strip                                                       */
/* ---------------------------------------------------------------- */

.theme-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1.25rem;
}

@media (max-width: 860px) {
  .theme-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 520px) {
  .theme-grid { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
}

.theme-card {
  aspect-ratio: 1 / 1;
  border-radius: 16px;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem;
  text-align: center;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.theme-card:hover,
.theme-card:focus-visible {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}

.theme-sample {
  font-weight: 700;
  font-size: 1.0625rem;
  line-height: 1.25;
}

.theme-label {
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.65;
}

/* Fixed theme presets — identical in light & dark page mode, per SPEC. */
.theme-sunrise { background: linear-gradient(135deg, #FFE259, #FFA751); color: #3A2500; }
.theme-paper   { background: #F7F3EA; color: #3A3226; }
.theme-mint    { background: linear-gradient(135deg, #D4F1DF, #A8E6CF); color: #14382A; }
.theme-sky     { background: linear-gradient(135deg, #C2E9FB, #A1C4FD); color: #12344E; }
.theme-dusk    { background: linear-gradient(135deg, #E0C3FC, #9BB8F7); color: #2B1E4F; }
.theme-midnight{ background: linear-gradient(135deg, #232526, #414345); color: #F2F2F2; }

/* ---------------------------------------------------------------- */
/* Footer — matches nikhco.in's .site-footer exactly                 */
/* ---------------------------------------------------------------- */

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-soft);
}

.footer-inner {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 2.25rem 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.footer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.footer-left, .footer-right {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.footer-divider { color: var(--muted-2); }
.footer-inner a { color: var(--ink-2); transition: color 0.15s ease; }
.footer-inner a:hover { color: var(--ink); }

.made-in-canada {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 500;
  color: var(--ink-2);
}

.flag-ca { font-size: 1rem; }

.since {
  font-size: 0.85rem;
  color: var(--muted-2);
  letter-spacing: 0.02em;
}

@media (max-width: 520px) {
  .footer-inner { padding: 2rem 1.25rem; }
  .footer-row { flex-direction: column; align-items: flex-start; gap: 0.4rem; }
}

/* ---------------------------------------------------------------- */
/* Privacy page                                                      */
/* ---------------------------------------------------------------- */

.privacy-main { padding-top: 5rem; }

.privacy-main .section-inner { max-width: 640px; }

.privacy-main h1 {
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
}

.privacy-main h2 {
  font-size: 1.125rem;
  margin: 2rem 0 0.75rem;
}

.privacy-main p,
.privacy-main li {
  font-size: 1.0625rem;
  color: var(--ink-2);
}

.privacy-main ul {
  padding-left: 1.25rem;
  margin: 0.5rem 0;
}

.privacy-main li + li { margin-top: 0.375rem; }

.back-link {
  display: inline-block;
  margin-bottom: 2rem;
  font-size: 0.875rem;
  color: var(--muted);
  border-bottom: 1.5px solid currentColor;
  text-decoration: none;
  padding-bottom: 1px;
}

.back-link:hover { color: var(--ink); }

/* ---------------------------------------------------------------- */
/* Motion & responsive                                               */
/* ---------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn-download, .badge-link, .theme-card, .top, .top-nav a { transition: none; }
}
