/* Echoes — Design System v4 (Clean Emotional Palette) */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Playfair+Display:ital,wght@0,600;1,500&display=swap');

:root {
  --bg: #f7f5f2;
  --bg-card: #ffffff;
  --text: #1b1b1f;
  --text-secondary: rgba(27,27,31,.5);
  --text-muted: rgba(27,27,31,.28);
  --accent: #7c5cfc;
  --accent-subtle: rgba(124,92,252,.08);
  --success: #30b883;
  --success-bg: rgba(48,184,131,.1);
  --border: rgba(27,27,31,.06);
  --radius: 20px;
  --radius-sm: 12px;
  --shadow-sm: 0 1px 3px rgba(27,27,31,.04);
  --shadow: 0 2px 12px rgba(27,27,31,.06);
  --shadow-lg: 0 8px 32px rgba(27,27,31,.08);
  --font-display: 'Playfair Display', Georgia, serif;
  --font-sans: Inter, -apple-system, sans-serif;
}
@media(prefers-color-scheme:dark){
  :root{--bg:#0c0c10;--bg-card:#15151a;--text:#ebebeb;--text-secondary:rgba(235,235,235,.45);--text-muted:rgba(235,235,235,.25);--accent:#8b7cfc;--accent-subtle:rgba(139,124,252,.1);--border:rgba(235,235,235,.06);--shadow-sm:0 1px 3px rgba(0,0,0,.2);--shadow:0 2px 12px rgba(0,0,0,.25);--shadow-lg:0 8px 32px rgba(0,0,0,.3);}
}

*{box-sizing:border-box;margin:0;padding:0}
html{-webkit-text-size-adjust:100%}
body{
  font-family:var(--font-sans);
  background:var(--bg);color:var(--text);
  -webkit-font-smoothing:antialiased;
  min-height:100vh;max-width:430px;margin:0 auto;
  line-height:1.5;
}
::selection{background:rgba(124,92,252,.15)}
.container{padding:0 20px}

/* ── Nav ── */
nav{display:flex;align-items:center;justify-content:space-between;padding:14px 20px;position:sticky;top:0;z-index:50;background:var(--bg);border-bottom:1px solid var(--border)}
nav .logo{display:flex;align-items:center;gap:8px;text-decoration:none;color:var(--text);font-weight:600;font-size:16px}
nav .logo-icon{width:28px;height:28px;border-radius:7px;background:var(--accent);display:flex;align-items:center;justify-content:center;color:#fff;font-weight:700;font-size:13px}
nav .links{display:flex;align-items:center;gap:14px}
nav .links a{color:var(--text-secondary);text-decoration:none;font-size:14px}

/* ── Buttons ── */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:11px 22px;border-radius:10px;font-size:14px;font-weight:600;font-family:inherit;border:none;cursor:pointer;transition:all .15s;text-decoration:none;-webkit-tap-highlight-color:transparent}
.btn-primary{background:var(--accent);color:#fff}
.btn-primary:active{transform:scale(.97)}
.btn-primary:disabled{opacity:.4;cursor:not-allowed}
.btn-secondary{background:var(--bg-card);color:var(--text);box-shadow:var(--shadow)}
.btn-secondary:active{transform:scale(.97)}
.btn-ghost{background:transparent;color:var(--text-secondary)}
.btn-full{width:100%}
.btn-sm{padding:7px 14px;font-size:13px}

/* ── Landing ── */
.landing{padding:24px 0 8px;text-align:center}
.landing .icon{width:48px;height:48px;border-radius:14px;background:var(--accent);display:flex;align-items:center;justify-content:center;margin:0 auto 16px;color:#fff;font-weight:700;font-size:20px}
.landing h1{font-family:var(--font-display);font-size:30px;font-weight:600;line-height:1.15;margin-bottom:10px;letter-spacing:-.01em}
.landing h1 span{background:linear-gradient(135deg,#7c5cfc,#5b8def);-webkit-background-clip:text;-webkit-text-fill-color:transparent;background-clip:text}
.landing .sub{font-size:15px;color:var(--text-secondary);line-height:1.55;margin-bottom:28px;padding:0 4px}
.steps{text-align:left;padding:0 4px;margin-bottom:28px}
.step{display:flex;align-items:flex-start;gap:14px;padding:10px 0;border-bottom:1px solid var(--border)}
.step:last-child{border-bottom:none}
.step-num{width:26px;height:26px;border-radius:50%;background:var(--accent-subtle);color:var(--accent);display:flex;align-items:center;justify-content:center;font-size:12px;font-weight:600;flex-shrink:0;margin-top:2px}
.step-text h3{font-size:14px;font-weight:600;margin-bottom:1px}
.step-text p{font-size:13px;color:var(--text-secondary);line-height:1.4}

/* ── Memory Artifact Card (clean, shareable) ── */
.memory-card{
  border-radius:var(--radius);overflow:hidden;
  box-shadow:var(--shadow-lg);margin-bottom:20px;
  background:var(--bg-card);position:relative;
}
.memory-card .art{
  padding:28px 24px 24px;position:relative;
  min-height:180px;display:flex;flex-direction:column;justify-content:flex-end;
}
.memory-card .art .title{
  font-family:var(--font-display);font-size:26px;font-weight:600;
  color:#fff;line-height:1.2;margin-bottom:10px;position:relative;
}
.memory-card .art .quote{
  font-family:var(--font-display);font-size:14px;font-style:italic;
  color:rgba(255,255,255,.7);line-height:1.45;margin-bottom:14px;
  max-width:90%;position:relative;
}
.memory-card .art .meta{
  display:flex;align-items:center;gap:12px;position:relative;
}
.memory-card .art .meta .date{font-size:11px;color:rgba(255,255,255,.5);font-weight:500}
.memory-card .art .meta .mood-tag{
  font-size:10px;padding:3px 10px;border-radius:20px;
  background:rgba(255,255,255,.12);color:rgba(255,255,255,.8);
  font-weight:500;letter-spacing:.02em;
}
.memory-card .echoes-mark{
  position:absolute;bottom:24px;right:24px;
  font-size:10px;color:rgba(255,255,255,.2);font-weight:600;letter-spacing:.04em;
}

/* Card backgrounds — 2-stop subtle gradients */
.grad-memorial{background:linear-gradient(135deg,#2d2b55,#433b7c)}
.grad-nostalgic{background:linear-gradient(135deg,#6b3a2a,#8b4e36)}
.grad-joyful{background:linear-gradient(135deg,#6b2d52,#8a3d6a)}
.grad-peaceful{background:linear-gradient(135deg,#1d4a3e,#2a6352)}
.grad-hopeful{background:linear-gradient(135deg,#1a3a5c,#26528c)}
.grad-adventure{background:linear-gradient(135deg,#3c2a6b,#5440a0)}
.grad-mystery{background:linear-gradient(135deg,#2a2450,#3d3570)}
.grad-whimsical{background:linear-gradient(135deg,#4a2a6b,#6d3d8a)}

/* ── Collection Card (dashboard) ── */
.premium-card{
  border-radius:var(--radius-sm);overflow:hidden;
  box-shadow:var(--shadow-sm);background:var(--bg-card);
  margin-bottom:10px;position:relative;
}
.premium-card .strip{height:3px;width:100%}
.premium-card .body{padding:12px 14px 10px}
.premium-card .body .card-title{font-size:14px;font-weight:600;margin-bottom:2px;line-height:1.3;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.premium-card .body .card-sub{font-size:12px;color:var(--text-secondary);margin-bottom:6px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;line-height:1.4}
.premium-card .body .card-footer{display:flex;align-items:center;justify-content:space-between;font-size:11px;color:var(--text-muted);padding-top:6px;border-top:1px solid var(--border)}

/* ── Certificate Card (seal/keepsake style) ── */
.cert-card{border-radius:var(--radius);overflow:hidden;box-shadow:var(--shadow-lg);margin-bottom:20px}
.cert-card .cert-seal{
  background:linear-gradient(135deg,#2d2b55,#433b7c);
  padding:32px 24px 28px;text-align:center;position:relative;
}
.cert-card .cert-seal .seal-icon{
  width:56px;height:56px;border-radius:50%;
  background:rgba(255,255,255,.1);backdrop-filter:blur(8px);
  display:flex;align-items:center;justify-content:center;
  margin:0 auto 14px;border:1px solid rgba(255,255,255,.08);
}
.cert-card .cert-seal .seal-icon svg{width:24px;height:24px;color:#fff}
.cert-card .cert-seal .cert-id{
  font-family:var(--font-display);font-size:20px;font-weight:600;
  color:#fff;margin-bottom:6px;letter-spacing:.01em;
}
.cert-card .cert-seal .cert-status{
  display:inline-flex;align-items:center;gap:5px;
  padding:4px 14px;border-radius:20px;
  background:rgba(48,184,131,.15);color:#5cdba0;
  font-size:12px;font-weight:500;
}
.cert-card .cert-seal .cert-watermark{
  position:absolute;bottom:12px;right:20px;
  font-size:9px;color:rgba(255,255,255,.12);font-weight:600;letter-spacing:.06em;
}
.cert-card .cert-body{padding:16px 20px;background:var(--bg-card)}
.cert-card .cert-line{display:flex;justify-content:space-between;padding:7px 0;font-size:13px}
.cert-card .cert-line:not(:last-child){border-bottom:1px solid var(--border)}
.cert-card .cert-line .l{color:var(--text-muted)}
.cert-card .cert-line .v{color:var(--text);font-weight:500}
.cert-card .cert-line .v a{color:var(--accent);text-decoration:none}

/* ── Inputs ── */
.input,.textarea{
  width:100%;background:var(--bg-card);border:1px solid var(--border);
  border-radius:10px;padding:13px 15px;color:var(--text);font-size:15px;
  font-family:inherit;outline:none;transition:border .15s;
}
.input:focus,.textarea:focus{border-color:var(--accent)}
.textarea{resize:none;min-height:110px;line-height:1.6}
label{display:block;font-size:13px;font-weight:600;color:var(--text-secondary);margin-bottom:6px}

/* ── Recording ── */
.record-btn-wrap{text-align:center;padding:28px 0}
.record-btn{width:68px;height:68px;border-radius:50%;border:none;background:var(--accent);color:#fff;cursor:pointer;box-shadow:0 6px 24px rgba(124,92,252,.25);transition:all .15s;-webkit-tap-highlight-color:transparent}
.record-btn:active{transform:scale(.93)}
.record-btn svg{width:26px;height:26px}
.waveform-wrap{background:var(--bg-card);border-radius:var(--radius-sm);padding:14px;margin-bottom:16px;box-shadow:var(--shadow-sm)}
.waveform-wrap .wf-row{display:flex;align-items:center;gap:10px}
.waveform-wrap .wf-row .wf-canvas{flex:1;height:44px;border-radius:6px;overflow:hidden}
.waveform-wrap .wf-row .wf-time{font-size:12px;font-family:SFMono-Regular,Menlo,monospace;color:var(--text-muted);min-width:40px;text-align:center}
.transcript-card{background:var(--bg-card);border-radius:var(--radius-sm);padding:14px;margin-bottom:16px;box-shadow:var(--shadow-sm)}

/* ── Badges / Tags ── */
.badge{display:inline-flex;align-items:center;gap:4px;padding:3px 10px;border-radius:20px;font-size:11px;font-weight:500}
.badge-accent{background:var(--accent-subtle);color:var(--accent)}
.badge-success{background:var(--success-bg);color:var(--success)}

/* ── Empty State ── */
.empty-state{text-align:center;padding:48px 20px}
.empty-state .icon{width:48px;height:48px;border-radius:14px;background:var(--accent-subtle);display:flex;align-items:center;justify-content:center;margin:0 auto 14px;color:var(--accent);font-size:20px}
.empty-state h3{font-size:16px;font-weight:600;margin-bottom:4px}
.empty-state p{font-size:14px;color:var(--text-secondary);margin-bottom:16px;line-height:1.45}

/* ── Tabs ── */
.mode-tabs{display:flex;gap:3px;margin-bottom:20px;background:rgba(27,27,31,.03);border-radius:9px;padding:3px}
@media(prefers-color-scheme:dark){.mode-tabs{background:rgba(235,235,235,.04)}}
.mode-tabs .tab{flex:1;padding:8px;text-align:center;font-size:13px;border-radius:7px;border:none;background:transparent;color:var(--text-secondary);cursor:pointer;font-family:inherit;font-weight:500;transition:all .15s}
.mode-tabs .tab.active{background:var(--bg-card);color:var(--text);box-shadow:var(--shadow-sm)}

/* ── Vault Grid ── */
.vault-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}

/* ── Modal ── */
.overlay{position:fixed;top:0;left:0;right:0;bottom:0;background:rgba(0,0,0,.4);backdrop-filter:blur(12px);z-index:100;display:flex;align-items:flex-end;justify-content:center;animation:fadeUp .2s ease}
.modal{background:var(--bg-card);border-radius:var(--radius) var(--radius) 0 0;padding:24px 20px 32px;width:100%;max-width:430px;animation:slideUp .2s ease}
@keyframes fadeUp{from{opacity:0}to{opacity:1}}
@keyframes slideUp{from{transform:translateY(20px);opacity:0}to{transform:translateY(0);opacity:1}}
@keyframes spin{to{transform:rotate(360deg)}}
.spin{width:18px;height:18px;border:2px solid var(--border);border-top-color:var(--accent);border-radius:50%;animation:spin .5s linear infinite;display:inline-block;vertical-align:middle}

/* ── Utilities ── */
.flex{display:flex}.fc{flex-direction:column}.aic{align-items:center}.jsb{justify-content:space-between}.jcc{justify-content:center}.fw{flex-wrap:wrap}
.gap-2{gap:8px}.gap-3{gap:12px}.gap-4{gap:16px}
.mt-2{margin-top:8px}.mt-4{margin-top:16px}.mb-2{margin-bottom:8px}.mb-4{margin-bottom:16px}
.text-sm{font-size:13px}.text-xs{font-size:12px}.text-secondary{color:var(--text-secondary)}.text-muted{color:var(--text-muted)}.text-center{text-align:center}
.hidden{display:none}.w-full{width:100%}
.font-mono{font-family:SFMono-Regular,Menlo,monospace}.serif{font-family:var(--font-display)}
.pb-safe{padding-bottom:16px}
