/* Spin Journal — spinjournal.app
   Hand-written CSS. No framework, no build step. Warm & confident palette,
   mirrored from the app's constants/theme.ts. Light/dark via
   prefers-color-scheme. Every animation is gated behind
   prefers-reduced-motion: no-preference (see bottom of file). */

:root {
  --bg: #FAF7F2;
  --surface: #FFFFFF;
  --surface-alt: #F3EDE4;
  --primary: #C4785A;
  --primary-text: #9C5236;
  --secondary: #7D8E72;
  --tertiary: #C9A09A;
  --text: #3A342E;
  --text-muted: #6E665C;
  --border: #E5DDD3;
  --warning: #D4A24E;
  --shadow: rgba(58, 42, 30, 0.12);

  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-pill: 999px;

  --max-width: 1120px;
  --gap: clamp(16px, 3vw, 32px);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #211D19;
    --surface: #2C2722;
    --surface-alt: #35302B;
    --primary: #D4917A;
    --primary-text: #E3A88F;
    --secondary: #9AAD8F;
    --tertiary: #C9A09A;
    --text: #F5F0E8;
    --text-muted: #B8AFA3;
    --border: #453F38;
    --warning: #E0B65C;
    --shadow: rgba(0, 0, 0, 0.35);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

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

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  margin: 0 0 0.4em;
  color: var(--text);
}

h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); }
h2 { font-size: clamp(1.6rem, 3.2vw, 2.4rem); }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1em; color: var(--text-muted); }
a { color: var(--primary-text); }
a.plain { color: inherit; text-decoration: none; }

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

.section {
  padding: clamp(48px, 8vw, 96px) 0;
}

.eyebrow {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary-text);
  margin-bottom: 8px;
  display: block;
}

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  transition: background-color 0.3s ease, border-color 0.3s ease, backdrop-filter 0.3s ease;
}
.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.nav.scrolled {
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  color: var(--text);
  text-decoration: none;
}
.brand svg { width: 28px; height: 28px; flex-shrink: 0; }
.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a {
  color: var(--text);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  opacity: 0.85;
}
.nav-links a:hover { opacity: 1; }
.nav-toggle { display: none; }

@media (max-width: 720px) {
  .nav-links { display: none; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-secondary { background: transparent; color: var(--text); border-color: var(--border); }
@media (prefers-reduced-motion: no-preference) {
  .btn:hover { transform: scale(1.02); box-shadow: 0 8px 20px var(--shadow); }
  .btn:active { transform: scale(0.98); }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(56px, 10vw, 120px) 0 clamp(40px, 6vw, 72px);
}
.aurora {
  position: absolute;
  inset: -20%;
  z-index: -1;
  background:
    radial-gradient(circle at 20% 20%, color-mix(in srgb, var(--primary) 35%, transparent), transparent 55%),
    radial-gradient(circle at 80% 10%, color-mix(in srgb, var(--tertiary) 30%, transparent), transparent 50%),
    radial-gradient(circle at 50% 80%, color-mix(in srgb, var(--secondary) 30%, transparent), transparent 55%);
  filter: blur(60px);
  opacity: 0.55;
}
@media (prefers-reduced-motion: no-preference) {
  .aurora { animation: aurora-drift 24s ease-in-out infinite; }
}
@keyframes aurora-drift {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(-2%, 2%, 0) scale(1.08); }
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: var(--gap);
  align-items: center;
}
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; text-align: center; }
  .hero-badges, .hero-mark { justify-content: center; }
}
.hero p.lead {
  font-size: clamp(17px, 2vw, 20px);
  max-width: 46ch;
}
@media (max-width: 860px) { .hero p.lead { margin-left: auto; margin-right: auto; } }

.hero-badges {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 28px;
}
.badge-slot {
  display: inline-flex;
  border-radius: 10px;
  overflow: hidden;
}
.badge-slot img { display: block; }
@media (prefers-reduced-motion: no-preference) {
  .badge-slot { transition: transform 0.15s ease; }
  .badge-slot:hover { transform: scale(1.03); }
}

.hero-mark { display: flex; justify-content: flex-end; }
.device {
  position: relative;
  width: min(280px, 70vw);
  aspect-ratio: 9 / 18.5;
  border-radius: 40px;
  border: 8px solid var(--text);
  background: var(--surface);
  box-shadow: 0 30px 60px var(--shadow);
  overflow: hidden;
}
@media (prefers-reduced-motion: no-preference) {
  .device { animation: device-float 7s ease-in-out infinite; }
}
@keyframes device-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
.device .screen-fade {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
}
.device .screen-fade.is-active { opacity: 1; }
@media (prefers-reduced-motion: no-preference) {
  .device .screen-fade { transition: opacity 1.2s ease; }
}

/* mark draw-in (hero only) */
.mark-draw path, .mark-draw circle {
  stroke-dasharray: 240;
  stroke-dashoffset: 240;
}
@media (prefers-reduced-motion: no-preference) {
  .mark-draw path, .mark-draw circle {
    animation: draw-in 1.2s ease-out forwards;
  }
}
@media (prefers-reduced-motion: reduce) {
  .mark-draw path, .mark-draw circle { stroke-dashoffset: 0; }
}
@keyframes draw-in {
  to { stroke-dashoffset: 0; }
}

/* ---------- Scroll reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(12px);
}
@media (prefers-reduced-motion: no-preference) {
  .reveal {
    animation: fade-up 0.6s ease-out forwards;
    animation-timeline: view();
    animation-range: entry 0% cover 25%;
  }
  .reveal.js-visible { animation: none; opacity: 1; transform: none; transition: opacity 0.6s ease, transform 0.6s ease; }
  .reveal.js-pending { transition: opacity 0.6s ease, transform 0.6s ease; }
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; }
}
@keyframes fade-up {
  to { opacity: 1; transform: none; }
}
.reveal-stagger > * { animation-delay: calc(var(--i, 0) * 60ms); }

/* ---------- Feature grid ---------- */
.grid-6 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
  margin-top: 40px;
}
@media (max-width: 860px) { .grid-6 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .grid-6 { grid-template-columns: 1fr; } }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
}
.feature-card .icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--primary) 16%, var(--surface));
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  font-size: 20px;
}
.feature-card h3 { margin-bottom: 6px; }
.feature-card p { margin: 0; font-size: 14.5px; }

/* ---------- Screenshot rail ---------- */
.rail {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 8px 4px 24px;
  margin-top: 32px;
  -webkit-overflow-scrolling: touch;
}
.rail::-webkit-scrollbar { height: 6px; }
.rail::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.rail-item {
  scroll-snap-align: center;
  flex: 0 0 auto;
  width: min(240px, 60vw);
  aspect-ratio: 9 / 18;
  border-radius: 24px;
  border: 6px solid var(--surface);
  background: linear-gradient(160deg, var(--surface-alt), var(--surface));
  box-shadow: 0 12px 30px var(--shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
  padding: 20px;
}
@media (prefers-reduced-motion: no-preference) and (hover: hover) {
  .rail-item { transition: transform 0.2s ease; transform-style: preserve-3d; }
  .rail-item:hover { transform: perspective(600px) rotateY(3deg) translateY(-4px); }
}

/* ---------- Steps ---------- */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
  margin-top: 40px;
  counter-reset: step;
}
@media (max-width: 720px) { .steps { grid-template-columns: 1fr; } }
.step { position: relative; padding-left: 52px; }
.step::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0; top: 0;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-family: var(--font-display);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---------- Pricing ---------- */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--gap);
  margin-top: 40px;
  align-items: stretch;
}
@media (max-width: 720px) { .pricing-grid { grid-template-columns: 1fr; } }
.price-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.price-card.featured {
  border-color: var(--primary);
  box-shadow: 0 20px 40px var(--shadow);
}
@media (prefers-reduced-motion: no-preference) {
  .price-card { transition: transform 0.2s ease, box-shadow 0.2s ease; }
  .price-card:hover { transform: translateY(-4px); box-shadow: 0 16px 32px var(--shadow); }
}
.price-tag { font-family: var(--font-display); font-size: 2.4rem; font-weight: 700; }
.price-tag small { font-family: var(--font-body); font-size: 14px; font-weight: 500; color: var(--text-muted); }
.price-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.price-list li { display: flex; gap: 10px; font-size: 14.5px; color: var(--text); }
.price-list li::before { content: '✓'; color: var(--secondary); font-weight: 700; }
.price-note { font-size: 12.5px; color: var(--text-muted); margin-top: auto; }

/* ---------- FAQ ---------- */
.faq { max-width: 760px; margin: 40px auto 0; display: grid; gap: 12px; }
.faq details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 22px;
}
.faq summary {
  cursor: pointer;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: '›';
  font-size: 20px;
  transform: rotate(90deg);
  color: var(--text-muted);
}
@media (prefers-reduced-motion: no-preference) {
  .faq summary::after { transition: transform 0.25s ease; }
}
.faq details[open] summary::after { transform: rotate(270deg); }
.faq details p { margin-top: 12px; margin-bottom: 0; }

/* ---------- Download band ---------- */
.download-band {
  background: linear-gradient(135deg, var(--primary), color-mix(in srgb, var(--primary) 70%, var(--tertiary)));
  color: #fff;
  text-align: center;
  border-radius: var(--radius-lg);
  padding: clamp(40px, 6vw, 64px) 24px;
}
.download-band h2 { color: #fff; }
.download-band p { color: rgba(255,255,255,0.88); }
.download-band .hero-badges { justify-content: center; }

/* ---------- Footer ---------- */
footer {
  border-top: 1px solid var(--border);
  padding: 40px 0;
  font-size: 13.5px;
  color: var(--text-muted);
}
.footer-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 20px;
}
.footer-links { display: flex; gap: 20px; flex-wrap: wrap; list-style: none; margin: 0; padding: 0; }
.footer-links a { color: var(--text-muted); text-decoration: none; }
.footer-links a:hover { color: var(--text); }
.footer-fine { margin-top: 20px; font-size: 12px; opacity: 0.75; }

/* ---------- Legal / simple pages ---------- */
.legal {
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(48px, 8vw, 80px) 24px;
}
.legal h2 { margin-top: 1.6em; }
.legal .updated { color: var(--text-muted); font-size: 14px; margin-bottom: 2em; }

/* ---------- 404 ---------- */
.notfound {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 24px;
  gap: 12px;
}
