/* playback.kids — shared styles
 * Mirrors the in-app palette so the marketing surface and the product feel
 * like the same thing. Mobile-first; one breakpoint at 720px.
 */

:root {
  --bg: #FBFAF6;
  --surface: #FFFFFF;
  --ink: #1F2A24;
  --ink-soft: #5A6661;
  --ink-muted: #8C9690;
  --border: #E7E2D5;
  --primary: #3FA66A;
  --primary-dark: #2E8553;
  --primary-soft: #E5F3EB;
  --warm: #C9A96A;
  --warm-soft: #F4ECD6;
  --danger: #C66B6B;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-pill: 999px;
  --max: 720px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--primary-dark);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 120ms ease;
}
a:hover { border-bottom-color: var(--primary-dark); }

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

/* ---------- header ---------- */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand {
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.3px;
  color: var(--ink);
  border: none;
}
.brand::before {
  content: "▶ ";
  color: var(--primary);
}
.site-nav {
  display: flex;
  gap: 20px;
  font-size: 14px;
}
.site-nav a {
  color: var(--ink-soft);
  border: none;
}
.site-nav a:hover { color: var(--primary-dark); }

/* ---------- hero ---------- */
.hero {
  text-align: center;
  padding: 64px 24px 56px;
  border-bottom: 1px solid var(--border);
}
.hero .eyebrow {
  display: inline-block;
  font-size: 12px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--primary-dark);
  font-weight: 700;
  margin-bottom: 12px;
}
.hero h1 {
  font-size: 44px;
  letter-spacing: -1.5px;
  line-height: 1.1;
  margin: 0 0 16px;
  color: var(--ink);
}
.hero .lede {
  font-size: 18px;
  color: var(--ink-soft);
  max-width: 540px;
  margin: 0 auto 28px;
}
.hero .cta-row {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-block;
  padding: 12px 22px;
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-size: 15px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 120ms ease, opacity 120ms ease;
}
.btn:hover { transform: translateY(-1px); opacity: 0.95; border-bottom-color: transparent; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--border); }

/* ---------- sections ---------- */
section {
  max-width: var(--max);
  margin: 0 auto;
  padding: 48px 24px;
}
section h2 {
  font-size: 28px;
  letter-spacing: -0.6px;
  margin: 0 0 12px;
}
section p { font-size: 17px; color: var(--ink-soft); }

/* ---------- animated phone mockup ---------- */
/* 10-second loop showing the "polish" flow. Pure CSS — no JS, no images.
 * Respect prefers-reduced-motion: locks to the polished state without movement.
 */
.demo-section {
  text-align: center;
  padding: 24px 24px 48px;
}
.demo-section h2 { margin-bottom: 8px; }
.demo-section > p { margin: 0 auto 32px; max-width: 480px; }

.phone-mockup {
  display: flex;
  justify-content: center;
  perspective: 1200px;
}

.phone-frame {
  width: 280px;
  height: 570px;
  background: #1F2A24;
  border-radius: 36px;
  padding: 14px;
  box-shadow:
    0 30px 60px -20px rgba(31, 42, 36, 0.35),
    0 0 0 1px rgba(31, 42, 36, 0.1);
  position: relative;
  transform: rotate(-2deg);
}

.phone-notch {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  width: 96px;
  height: 22px;
  background: #1F2A24;
  border-radius: 0 0 14px 14px;
  z-index: 2;
}

.phone-screen {
  width: 100%;
  height: 100%;
  background: var(--bg);
  border-radius: 24px;
  padding: 38px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
  position: relative;
}

.screen-brand {
  font-weight: 800;
  font-size: 14px;
  color: var(--ink);
  letter-spacing: -0.2px;
}
.screen-brand::before { color: var(--primary); margin-right: 2px; }

.screen-meta {
  font-size: 12px;
  color: var(--ink-soft);
}
.screen-meta strong { color: var(--ink); }

.screen-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.screen-label {
  font-size: 9px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--ink-muted);
  font-weight: 700;
}

.memory-area {
  position: relative;
  min-height: 120px;
  flex: 1;
}

.memory-raw,
.memory-polished {
  position: absolute;
  inset: 0;
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink);
}
.memory-raw {
  color: var(--ink-soft);
  animation: phoneRawText 10s ease-in-out infinite;
}
.memory-polished {
  opacity: 0;
  transform: translateY(6px);
  animation: phonePolishedText 10s ease-in-out infinite;
}

.memory-cursor {
  display: inline-block;
  width: 1.5px;
  height: 14px;
  background: var(--primary);
  position: absolute;
  animation: phoneCursor 10s linear infinite;
  border-radius: 1px;
}

.polish-status {
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.4px;
  color: var(--primary-dark);
  font-weight: 600;
  opacity: 0;
  animation: phonePolishStatus 10s ease-in-out infinite;
}

.screen-tags { display: flex; gap: 4px; flex-wrap: wrap; }
.screen-tag {
  font-size: 10px;
  font-weight: 600;
  background: var(--primary-soft);
  color: var(--primary-dark);
  padding: 3px 8px;
  border-radius: 999px;
  opacity: 0;
  animation: phoneTagFade 10s ease-in-out infinite;
}
.screen-tag:nth-child(2) { animation-delay: 0.2s; }

.screen-actions { display: flex; gap: 8px; }
.btn-polish,
.btn-save {
  flex: 1;
  padding: 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  border: none;
  cursor: default;
}
.btn-polish {
  background: var(--surface);
  border: 1px solid var(--primary);
  color: var(--primary-dark);
  animation: phonePolishBtn 10s ease-in-out infinite;
}
.btn-save {
  background: var(--primary);
  color: #fff;
}

/* Keyframes — all share the same 10s timeline so they stay in sync.
 *  0–28%   : raw text shown, cursor blinking, polish button calm
 *  28–34%  : polish button "tap" (scale + glow)
 *  32–48%  : "Polishing..." indicator visible; raw fades out
 *  44–52%  : polished text fades in
 *  52–88%  : polished text shown, tags appear
 *  88–100% : reset back to raw */

@keyframes phoneRawText {
  0%, 28%   { opacity: 1; }
  40%, 88%  { opacity: 0; }
  100%      { opacity: 1; }
}
@keyframes phonePolishedText {
  0%, 32%   { opacity: 0; transform: translateY(6px); }
  52%, 88%  { opacity: 1; transform: translateY(0); }
  100%      { opacity: 0; transform: translateY(6px); }
}
@keyframes phoneCursor {
  /* Cursor blinks during raw display, hidden during polished display */
  0%, 6%   { left: 0; top: 18px; opacity: 1; }
  6.5%     { opacity: 0; }
  12%      { opacity: 1; }
  12.5%    { opacity: 0; }
  18%      { opacity: 1; }
  18.5%, 28% { opacity: 0; }
  28%, 88% { left: 0; top: 18px; opacity: 0; }
  100%     { opacity: 1; }
}
@keyframes phonePolishBtn {
  0%, 26%   { background: var(--surface); transform: scale(1); box-shadow: none; }
  30%       { background: var(--primary-soft); transform: scale(0.95); box-shadow: 0 0 0 6px rgba(63,166,106,0.18); }
  36%       { background: var(--primary-soft); transform: scale(1); box-shadow: 0 0 16px rgba(63,166,106,0.45); }
  46%, 100% { background: var(--surface); transform: scale(1); box-shadow: none; }
}
@keyframes phonePolishStatus {
  0%, 30%   { opacity: 0; }
  36%, 50%  { opacity: 1; }
  56%, 100% { opacity: 0; }
}
@keyframes phoneTagFade {
  0%, 50%   { opacity: 0; transform: translateY(4px); }
  60%, 88%  { opacity: 1; transform: translateY(0); }
  100%      { opacity: 0; transform: translateY(4px); }
}

/* Reduced-motion users get a static "after" state — no animation, no flicker. */
@media (prefers-reduced-motion: reduce) {
  .memory-raw       { animation: none; opacity: 0; }
  .memory-polished  { animation: none; opacity: 1; transform: none; }
  .memory-cursor    { animation: none; opacity: 0; }
  .polish-status    { animation: none; opacity: 0; }
  .screen-tag       { animation: none; opacity: 1; transform: none; }
  .btn-polish       { animation: none; }
}

/* Mobile: shrink the phone slightly so it fits under 320px viewport without scroll. */
@media (max-width: 380px) {
  .phone-frame { width: 240px; height: 490px; transform: rotate(-1.5deg); }
  .phone-screen { padding: 32px 14px 14px; }
  .screen-brand { font-size: 13px; }
  .memory-raw, .memory-polished { font-size: 12px; }
}

/* ---------- feature grid ---------- */
.features {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-top: 24px;
}
@media (min-width: 720px) {
  .features { grid-template-columns: 1fr 1fr; }
}
.feature {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}
.feature h3 {
  font-size: 17px;
  margin: 0 0 6px;
  color: var(--ink);
}
.feature p { font-size: 15px; color: var(--ink-soft); margin: 0; }

/* ---------- legal ---------- */
.legal {
  max-width: var(--max);
  margin: 0 auto;
  padding: 32px 24px 64px;
}
.legal h1 {
  font-size: 32px;
  letter-spacing: -0.8px;
  margin-bottom: 8px;
}
.legal h2 {
  font-size: 20px;
  margin-top: 36px;
  letter-spacing: -0.3px;
}
.legal h3 {
  font-size: 16px;
  margin-top: 24px;
  color: var(--ink);
}
.legal p, .legal li { font-size: 15px; color: var(--ink); }
.legal table {
  border-collapse: collapse;
  width: 100%;
  margin: 16px 0;
  font-size: 14px;
}
.legal th, .legal td {
  border: 1px solid var(--border);
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}
.legal th {
  background: var(--warm-soft);
  font-weight: 700;
}
.legal hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 32px 0;
}
.legal .meta {
  color: var(--ink-muted);
  font-size: 14px;
  margin-bottom: 24px;
}

/* ---------- support page ---------- */
.support-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-top: 16px;
}
.support-email {
  display: inline-block;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  background: var(--primary-soft);
  color: var(--primary-dark);
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  font-weight: 700;
  border: none;
}

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 32px 24px 48px;
  text-align: center;
  color: var(--ink-muted);
  font-size: 13px;
}
.site-footer a { color: var(--ink-soft); border: none; }
.site-footer a:hover { color: var(--primary-dark); }
.site-footer .links {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
