/* =========================================================
   Dil Se Kaho — Refined Luxury 3D Design System
   ========================================================= */

:root {
  --paper: #FEFBF5;
  --ink: #0E3B4E;
  --card: rgba(255, 255, 255, 0.88);
  --card-solid: #FFFFFF;
  --card-glass: rgba(255, 255, 255, 0.78);
  --glass-border: rgba(14, 59, 78, 0.12);
  --glass-shadow: 0 20px 40px -15px rgba(14, 59, 78, 0.07);
  --accent: #F2664A;
  --accent-glow: rgba(242, 102, 74, 0.30);
  --accent2: #E0A83C;
  --muted: #4A6572;
  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Outfit', system-ui, -apple-system, sans-serif;
  --radius: 24px;
  --radius-sm: 14px;
  --radius-pill: 999px;
  --bd: 1.5px solid var(--glass-border);
  --shadow: 0 16px 36px -10px rgba(14, 59, 78, 0.08), 0 4px 12px rgba(14, 59, 78, 0.02);
  --glow: 0 0 28px rgba(242, 102, 74, 0.12);
  --dw: 600;
  --tr: -0.4px;
  --b1: rgba(242, 102, 74, 0.12);
  --b2: rgba(224, 168, 60, 0.14);
  --b3: rgba(14, 59, 78, 0.06);
}

[data-theme="poetic"] {
  --paper: #FEFBF5;
  --ink: #0E3B4E;
  --card: rgba(255, 255, 255, 0.88);
  --card-solid: #FFFFFF;
  --card-glass: rgba(255, 255, 255, 0.78);
  --glass-border: rgba(14, 59, 78, 0.12);
  --glass-shadow: 0 20px 40px -15px rgba(14, 59, 78, 0.07);
  --accent: #F2664A;
  --accent-glow: rgba(242, 102, 74, 0.30);
  --accent2: #E0A83C;
  --muted: #4A6572;
  --font-display: 'Fraunces', Georgia, serif;
  --radius: 24px;
  --bd: 1.5px solid var(--glass-border);
  --shadow: 0 16px 36px -10px rgba(14, 59, 78, 0.08);
  --dw: 600;
  --tr: -0.4px;
  --b1: rgba(242, 102, 74, 0.12);
  --b2: rgba(224, 168, 60, 0.14);
  --b3: rgba(14, 59, 78, 0.06);
}

[data-theme="calm"] {
  --paper: #F5F2FC;
  --ink: #2C2648;
  --card: rgba(255, 255, 255, 0.88);
  --card-solid: #FFFFFF;
  --card-glass: rgba(255, 255, 255, 0.78);
  --glass-border: rgba(139, 123, 232, 0.16);
  --glass-shadow: 0 20px 40px -15px rgba(44, 38, 72, 0.08);
  --accent: #7A69E6;
  --accent-glow: rgba(122, 105, 230, 0.30);
  --accent2: #48C4A5;
  --muted: #5C557E;
  --font-display: 'Outfit', system-ui, sans-serif;
  --radius: 28px;
  --bd: 1.5px solid var(--glass-border);
  --shadow: 0 18px 42px -10px rgba(44, 38, 72, 0.09);
  --dw: 600;
  --tr: -0.6px;
  --b1: rgba(139, 123, 232, 0.16);
  --b2: rgba(127, 216, 192, 0.16);
  --b3: rgba(244, 180, 214, 0.12);
}

[data-theme="night"] {
  --paper: #0B0813;
  --ink: #F4F0FE;
  --card: rgba(26, 21, 48, 0.78);
  --card-solid: #1A1530;
  --card-glass: rgba(26, 21, 48, 0.68);
  --glass-border: rgba(244, 240, 254, 0.15);
  --glass-shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.65);
  --accent: #F06CA8;
  --accent-glow: rgba(240, 108, 168, 0.35);
  --accent2: #8B7BE8;
  --muted: #A69DC9;
  --font-display: 'Instrument Serif', Georgia, serif;
  --radius: 24px;
  --bd: 1px solid var(--glass-border);
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.55);
  --glow: 0 0 38px rgba(240, 108, 168, 0.20);
  --dw: 400;
  --tr: 0px;
  --b1: rgba(240, 108, 168, 0.20);
  --b2: rgba(139, 123, 232, 0.22);
  --b3: rgba(60, 200, 220, 0.10);
}

[data-theme="genz"] {
  --paper: #FFF8F0;
  --ink: #150F2B;
  --card: rgba(255, 255, 255, 0.94);
  --card-solid: #FFFFFF;
  --card-glass: rgba(255, 255, 255, 0.88);
  --glass-border: #150F2B;
  --glass-shadow: 0 10px 0 #150F2B;
  --accent: #FF3377;
  --accent-glow: rgba(255, 51, 119, 0.35);
  --accent2: #BCE814;
  --muted: #57506D;
  --font-display: 'Baloo 2', cursive;
  --radius: 26px;
  --bd: 3px solid #150F2B;
  --shadow: 0 8px 0 #150F2B;
  --glow: 0 8px 0 #150F2B;
  --dw: 800;
  --tr: -1px;
  --b1: rgba(255, 77, 141, 0.24);
  --b2: rgba(200, 243, 29, 0.24);
  --b3: rgba(34, 211, 238, 0.20);
}

/* Global Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  min-height: 100%;
  overflow-x: hidden;
}

body {
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background 0.4s ease, color 0.4s ease;
  position: relative;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* Background Viewport */
#bg3d {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -2;
  pointer-events: none;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -3;
  background:
    radial-gradient(circle at 8% 8%, var(--b1), transparent 48%),
    radial-gradient(circle at 92% 14%, var(--b2), transparent 46%),
    radial-gradient(circle at 50% 96%, var(--b3), transparent 52%);
  transition: background 0.5s ease;
}

.perspective-container {
  perspective: 1200px;
  perspective-origin: 50% 50%;
}

.app {
  max-width: 540px;
  margin: 0 auto;
  padding: 16px 18px 32px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
}

.tilt-card {
  transform-style: preserve-3d;
  transition: transform 0.2s cubic-bezier(0.03, 0.98, 0.52, 0.99), box-shadow 0.3s ease;
  will-change: transform;
  position: relative;
}

.tilt-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(255, 255, 255, 0.22), transparent 60%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 5;
}

.tilt-card:hover::after { opacity: 1; }

[data-theme="night"] .tilt-card::after {
  background: radial-gradient(circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(255, 255, 255, 0.12), transparent 55%);
}

/* Navigation Bar */
.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
  padding: 8px 12px;
  background: var(--card-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: var(--bd);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow);
  position: sticky;
  top: 10px;
  z-index: 50;
  transition: transform 0.3s ease;
}

.bar .left { display: flex; align-items: center; gap: 8px; min-width: 0; }
/* keep the row from pushing the last button off-screen on small phones */
.bar .right { display: flex; align-items: center; gap: 8px; flex: none; }
.bar .ico, .bar .me { flex: none; }

.logo {
  position: relative;
  display: flex;
  align-items: center;
  cursor: pointer;
  padding: 4px 10px 4px 4px;
  border-radius: var(--radius-pill);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.logo::before {
  content: "";
  position: absolute;
  inset: -4px -6px;
  border-radius: var(--radius-pill);
  z-index: -1;
  background: radial-gradient(ellipse at 22% 50%, var(--accent-glow), transparent 70%);
  opacity: 0.7;
  filter: blur(8px);
}

.logo:hover { transform: translateY(-2px) scale(1.02); }

.logo img {
  height: 40px;
  width: auto;
  display: block;
}

.logo .light { display: none; }
[data-theme="night"] .logo .dark { display: none; }
[data-theme="night"] .logo .light { display: block; }

.wordmark {
  display: none;
  font-family: var(--font-display);
  font-weight: var(--dw);
  font-size: 21px;
  letter-spacing: var(--tr);
  white-space: nowrap;
  align-items: center;
  gap: 8px;
}
.wordmark b { color: var(--accent); font-weight: inherit; }
.wordmark::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  flex: none;
}

.logo.noimg img { display: none; }
.logo.noimg .wordmark { display: flex; }

.me {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  cursor: pointer;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  border: 0;
  box-shadow: 0 4px 14px var(--accent-glow);
  font-family: var(--font-body);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.me:hover { transform: translateY(-2px) scale(1.05); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  font-weight: 700;
  background: var(--card-solid);
  border: var(--bd);
  border-radius: var(--radius-pill);
  padding: 4px 11px;
  box-shadow: var(--shadow);
}

.ico {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  cursor: pointer;
  background: var(--card-solid);
  border: var(--bd);
  box-shadow: var(--shadow);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 700;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.2s ease, color 0.2s ease;
}
.ico:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  color: var(--accent);
}
.ico svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Screen Visibility Isolation Rules */
.screen {
  display: none !important;
}

.screen.on {
  display: flex !important;
  flex: 1;
  flex-direction: column;
  animation: screenFadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes screenFadeIn {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

h1 {
  font-family: var(--font-display);
  font-weight: var(--dw);
  letter-spacing: var(--tr);
  font-size: clamp(28px, 7.5vw, 42px);
  line-height: 1.12;
  margin: 12px 0 8px;
}
h1 em {
  font-style: italic;
  color: var(--accent);
}
[data-theme="genz"] h1 em {
  font-style: normal;
  background: linear-gradient(180deg, transparent 58%, var(--accent2) 58%);
  color: var(--ink);
  padding: 0 4px;
}

/* Pitch & Hero Preview */
.pitch {
  display: flex;
  gap: 16px;
  align-items: center;
  margin: 8px 0 20px;
}

.demo {
  flex: none;
  width: 42%;
  max-width: 180px;
  position: relative;
}

#demoCanvas {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 16px;
  box-shadow: var(--shadow), var(--glow);
  transform: rotate(-2.5deg);
  transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
  background: var(--card-solid);
}

#demoCanvas.swap {
  opacity: 0;
  transform: rotate(-2.5deg) scale(0.95);
}

.demo .tag {
  position: absolute;
  right: -8px;
  bottom: -9px;
  background: var(--accent);
  color: #fff;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  box-shadow: 0 4px 12px var(--accent-glow);
  z-index: 10;
}

.steps {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.stp {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.3;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--card-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: var(--bd);
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.stp:hover { transform: translateX(3px); border-color: var(--accent); }

.stp .n {
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--card-solid);
  border: var(--bd);
  box-shadow: var(--shadow);
}
.stp .n svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.stp.future { opacity: 0.65; }
.stp .soon {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.7px;
  text-transform: uppercase;
  border: 1.5px solid var(--accent);
  color: var(--accent);
  border-radius: var(--radius-pill);
  padding: 1px 6px;
  margin-left: 4px;
  white-space: nowrap;
}

.live {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 16px;
  padding: 4px 12px;
  background: var(--card-glass);
  border-radius: var(--radius-pill);
  width: fit-content;
  border: var(--bd);
}

.live i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22C55E;
  display: block;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6); }
  70% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.moods {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 9px;
  margin-bottom: 18px;
}

.mood {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: var(--card-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: var(--bd);
  border-radius: 18px;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
  font-family: var(--font-body);
  color: var(--ink);
  box-shadow: var(--shadow);
  padding: 4px;
}

.mood .e { line-height: 0; display: block; }
.mood .e svg {
  width: 40px;
  height: 40px;
  display: block;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.mood .n {
  font-size: 11px;
  font-weight: 600;
  opacity: 0.8;
}

.mood:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
}

.mood:hover .e svg { transform: rotate(-5deg) scale(1.08); }

.mood.sel {
  background: var(--accent);
  color: #fff;
  border-color: transparent;
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 10px 24px var(--accent-glow);
}

.mood.sel .e svg { transform: scale(1.08); }
.mood.sel .n { opacity: 1; font-weight: 700; }

.marquee {
  position: relative;
  overflow: hidden;
  margin: 0 -18px 18px;
  padding: 9px 0;
  border-top: 1px solid rgba(128, 128, 128, 0.14);
  border-bottom: 1px solid rgba(128, 128, 128, 0.14);
  background: var(--card-glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

.track {
  display: flex;
  align-items: center;
  gap: 0;
  width: max-content;
  animation: scroll 34s linear infinite;
}

.marquee:hover .track { animation-play-state: paused; }

@keyframes scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.mq {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 14px;
  white-space: nowrap;
  font-size: 12.5px;
  color: var(--muted);
}
.mq svg { width: 15px; height: 15px; color: var(--accent); flex: none; }
.mq b { font-weight: 600; color: var(--ink); opacity: 0.9; }
.mq em {
  font-style: normal;
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  border: 1px solid var(--accent);
  color: var(--accent);
  border-radius: var(--radius-pill);
  padding: 1px 6px;
}
.mqdot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.4;
  flex: none;
}

.writebox {
  background: var(--card-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: var(--bd);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 6px 6px 6px 0;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin-bottom: auto;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.writebox:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3.5px var(--accent-glow), var(--shadow);
}

textarea {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--ink);
  resize: none;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  padding: 16px 4px 16px 18px;
  min-height: 96px;
}
textarea:focus { outline: none; }
textarea::placeholder { color: var(--muted); opacity: 0.75; }

.send {
  width: 52px;
  height: 52px;
  flex: none;
  border-radius: 50%;
  border: 0;
  cursor: pointer;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease;
  box-shadow: 0 6px 16px var(--accent-glow);
}
[data-theme="genz"] .send { border: 3px solid var(--ink); }
.send:hover { transform: scale(1.06); }
.send:disabled { opacity: 0.35; cursor: not-allowed; transform: none; box-shadow: none; }
.send svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 20px;
}
.help {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px dotted currentColor;
  padding-bottom: 1px;
  transition: color 0.2s ease;
}
.help:hover { color: var(--accent); }

.dotsrow { display: flex; gap: 5px; }
.hdot {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 1px solid rgba(128, 128, 128, 0.28);
  display: grid;
  place-items: center;
  font-size: 10.5px;
}

.stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 6px 0 2px;
}

#canvas {
  max-width: 100%;
  max-height: 52vh;
  height: auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow), var(--glow);
  display: block;
  background: var(--card-solid);
}

.tools {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 10px;
  background: var(--card-glass);
  backdrop-filter: blur(16px);
  border: var(--bd);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow);
}
.tool {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  cursor: pointer;
  background: transparent;
  border: 1.5px solid rgba(128, 128, 128, 0.28);
  color: var(--ink);
  transition: transform 0.16s ease, border-color 0.16s ease;
}
.tool:hover { border-color: var(--accent); transform: translateY(-1px); }
.tool.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.tool svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.tool .r { fill: none; stroke: currentColor; stroke-width: 1.8; }
.sep { width: 1px; height: 22px; background: rgba(128, 128, 128, 0.25); margin: 0 3px; }

.actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  align-items: center;
  padding: 16px 0 4px;
  flex-wrap: wrap;
}

.act {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 0;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease;
  box-shadow: var(--shadow);
  color: #fff;
}
[data-theme="genz"] .act { border: 3px solid var(--ink); }
.act:hover { transform: translateY(-3px) scale(1.04); }
.act svg { width: 24px; height: 24px; }
.act.wa { background: #25D366; }
.act.ig { background: linear-gradient(45deg, #F9A03F, #E4405F, #8A3AB9); }
.act.dl { background: var(--card-solid); color: var(--ink); border: var(--bd); }
.act.cp { background: var(--card-solid); color: var(--ink); border: var(--bd); }
.act.rf { background: var(--card-solid); color: var(--ink); border: var(--bd); }

.together {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12.5px;
  padding-top: 14px;
}
.avs { display: flex; }
.av {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--paper);
  margin-left: -7px;
  display: grid;
  place-items: center;
  font-size: 11px;
  background: var(--card-solid);
}
.av:first-child { margin-left: 0; }

.sheet {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  align-items: flex-end;
  justify-content: center;
  background: rgba(0, 0, 0, 0.40);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.sheet.on { display: flex; }
.sheet .inner {
  background: var(--card-solid);
  border-radius: 26px 26px 0 0;
  width: 100%;
  max-width: 520px;
  padding: 22px 20px calc(24px + env(safe-area-inset-bottom));
  animation: sheetSlideUp 0.3s cubic-bezier(0.2, 0.9, 0.3, 1);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.15);
  border-top: var(--bd);
}

@keyframes sheetSlideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.sheet h4 {
  font-family: var(--font-display);
  font-weight: var(--dw);
  font-size: 19px;
  margin-bottom: 6px;
  letter-spacing: var(--tr);
}
.sheet p {
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 16px;
}

.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.sw {
  flex: 1;
  min-width: 104px;
  border-radius: 16px;
  padding: 13px 12px;
  cursor: pointer;
  border: 1.5px solid rgba(128, 128, 128, 0.25);
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  background: transparent;
  text-align: left;
  transition: transform 0.16s ease, border-color 0.16s ease;
}
.sw:hover { border-color: var(--accent); transform: translateY(-1px); }
.sw .dots { display: flex; gap: 4px; margin-bottom: 8px; }
.sw i { width: 15px; height: 15px; border-radius: 50%; display: block; }
.close {
  display: block;
  width: 100%;
  margin-top: 16px;
  padding: 13px;
  border-radius: var(--radius-pill);
  border: 0;
  cursor: pointer;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14.5px;
}

.about { padding-top: 6px; }
.about .lede {
  font-family: var(--font-display);
  font-weight: var(--dw);
  letter-spacing: var(--tr);
  font-size: clamp(24px, 6.4vw, 33px);
  line-height: 1.18;
  margin: 14px 0 12px;
}
.about .lede em { font-style: italic; color: var(--accent); }

.about h3 {
  font-family: var(--font-display);
  font-weight: var(--dw);
  font-size: 17px;
  letter-spacing: var(--tr);
  margin: 0 0 8px;
  display: flex;
  align-items: center;
  gap: 9px;
}
.about h3 svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}
.about p { font-size: 14px; line-height: 1.65; color: var(--muted); }

.block {
  background: var(--card-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: var(--bd);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  margin-bottom: 12px;
  transition: transform 0.25s ease, border-color 0.25s ease;
}
.block:hover { border-color: var(--accent); }

.rowitem {
  display: flex;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid rgba(128, 128, 128, 0.14);
}
.rowitem:last-child { border-bottom: 0; padding-bottom: 0; }
.rowitem .ic {
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent);
}
.rowitem .ic svg { width: 17px; height: 17px; }
.rowitem b { display: block; font-size: 14px; font-weight: 600; margin-bottom: 2px; }
.rowitem span { font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.tagline {
  display: inline-block;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.9px;
  text-transform: uppercase;
  border: 1px solid var(--accent);
  color: var(--accent);
  border-radius: var(--radius-pill);
  padding: 2px 8px;
  margin-left: 6px;
  vertical-align: 1px;
}

.authbox {
  max-width: 400px;
  width: 100%;
  margin: 0 auto;
  background: var(--card-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: var(--bd);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px 22px 22px;
}

.authhead { text-align: center; margin-bottom: 20px; }
.authface { display: block; margin: 0 auto 12px; width: 56px; height: 56px; }
.authface svg { width: 56px; height: 56px; }
.authhead h2 {
  font-family: var(--font-display);
  font-weight: var(--dw);
  font-size: 22px;
  letter-spacing: var(--tr);
  margin-bottom: 7px;
  line-height: 1.2;
}
.authhead p { font-size: 13px; color: var(--muted); line-height: 1.55; }
.authhead p b { color: var(--ink); font-weight: 600; word-break: break-all; }

.prov {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  padding: 12px 16px;
  margin-bottom: 9px;
  border-radius: 14px;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 14.5px;
  font-weight: 600;
  background: var(--card-solid);
  color: var(--ink);
  border: 1.5px solid rgba(128, 128, 128, 0.3);
  transition: transform 0.16s ease, border-color 0.16s ease;
}
.prov:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow); }
.prov svg { width: 19px; height: 19px; flex: none; }
.prov.apple { background: #111; color: #fff; border-color: #111; }
[data-theme="night"] .prov.apple { background: #EFEAFB; color: #111; border-color: #EFEAFB; }

.or {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0 14px;
  font-size: 11.5px;
  color: var(--muted);
}
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: rgba(128, 128, 128, 0.25); }

.field { display: block; margin-bottom: 12px; }
.field > span { display: block; font-size: 11.5px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.field input {
  width: 100%;
  padding: 13px 15px;
  border-radius: 14px;
  background: transparent;
  color: var(--ink);
  border: 1.5px solid rgba(128, 128, 128, 0.3);
  font-family: var(--font-body);
  font-size: 15.5px;
}
.field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent);
}
.field input.bad { border-color: #E0483C; }
.err { display: block; font-style: normal; font-size: 11.5px; color: #E0483C; margin-top: 5px; min-height: 1px; }

.otp { display: flex; gap: 8px; justify-content: center; margin: 4px 0 10px; }
.otp input {
  width: 44px;
  height: 52px;
  text-align: center;
  border-radius: 13px;
  background: transparent;
  color: var(--ink);
  border: 1.5px solid rgba(128, 128, 128, 0.3);
  font-family: var(--font-display);
  font-weight: var(--dw);
  font-size: 22px;
}
.otp input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent);
}
.otp input.filled { border-color: var(--accent); }

.opt {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  cursor: pointer;
  margin: 14px 0 16px;
  padding: 12px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--accent) 7%, transparent);
}
.opt input { width: 19px; height: 19px; flex: none; margin-top: 1px; accent-color: var(--accent); cursor: pointer; }
.opt b { display: block; font-size: 13.5px; font-weight: 600; }
.opt small { display: block; font-size: 11.5px; color: var(--muted); margin-top: 2px; line-height: 1.45; }

.btnfull {
  width: 100%;
  padding: 14px;
  border-radius: var(--radius-pill);
  border: 0;
  cursor: pointer;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-display);
  font-weight: var(--dw);
  font-size: 16px;
  transition: transform 0.16s ease, filter 0.16s ease;
}
[data-theme="genz"] .btnfull { border: 3px solid var(--ink); box-shadow: 0 5px 0 var(--ink); }
.btnfull:hover { filter: brightness(1.07); transform: translateY(-2px); }
.skip {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 10px;
  background: none;
  border: 0;
  cursor: pointer;
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 13px;
  text-decoration: underline;
}
.skip:hover { color: var(--accent); }
.skip:disabled { opacity: 0.5; cursor: default; text-decoration: none; }
.fineprint { font-size: 10.5px; color: var(--muted); text-align: center; margin-top: 12px; line-height: 1.5; opacity: 0.85; }

.okrow {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: 16px;
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  margin-bottom: 6px;
}
.okdot {
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #22C55E;
  color: #fff;
}
.okdot svg { width: 18px; height: 18px; }
.okrow b { display: block; font-size: 15px; font-weight: 600; }
.okrow small { display: block; font-size: 12px; color: var(--muted); word-break: break-all; }

/* Footer */
footer {
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px solid rgba(128, 128, 128, 0.18);
}
.fgrid {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.fbrand img { height: 26px; width: auto; display: block; margin-bottom: 8px; }
.fbrand .light { display: none; }
[data-theme="night"] .fbrand .dark { display: none; }
[data-theme="night"] .fbrand .light { display: block; }
.fbrand p { font-size: 11.5px; color: var(--muted); max-width: 24ch; line-height: 1.5; }
.flinks { display: flex; flex-direction: column; gap: 7px; }
.flinks a { font-size: 12.5px; color: var(--ink); opacity: 0.85; text-decoration: none; cursor: pointer; }
.flinks a:hover { opacity: 1; color: var(--accent); }
.fsocial { display: flex; gap: 8px; margin-bottom: 14px; }
.fsocial a {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: var(--bd);
  color: var(--ink);
  opacity: 0.85;
  transition: transform 0.16s ease, border-color 0.16s ease;
}
.fsocial a:hover { opacity: 1; color: var(--accent); border-color: var(--accent); transform: translateY(-1px); }
.fsocial svg { width: 15px; height: 15px; }
.fbase {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 11px;
  color: var(--muted);
  padding-bottom: 6px;
}

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink);
  color: var(--paper);
  padding: 11px 20px;
  border-radius: var(--radius-pill);
  font-size: 13.5px;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 90;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}
.toast.show { opacity: 1; pointer-events: auto; transform: translateX(-50%) translateY(0); }

/* Responsive Mobile Layout Fixes (< 540px)
   Keep the sample card and the 3 steps side by side — stacking them
   pushed the mood picker and the writing box below the fold. */
@media (max-width: 540px) {
  h1 { font-size: clamp(27px, 8.2vw, 36px); margin: 14px 0 6px; }
  .pitch {
    flex-direction: row;
    align-items: center;
    width: 100%;
    gap: 13px;
    margin: 6px 0 14px;
  }
  .demo { width: 43%; max-width: 150px; flex: none; }
  .steps { flex: 1; min-width: 0; gap: 7px; }
  .stp { font-size: 12px; padding: 7px 9px; gap: 8px; }
  .stp .n { width: 26px; height: 26px; }
  .stp .n svg { width: 13px; height: 13px; }
  .stp .soon { font-size: 8px; padding: 1px 5px; }
  .live { margin-bottom: 12px; }
  .marquee { margin-bottom: 14px; }
  .moods { gap: 7px; }
  .mood .e svg { width: 36px; height: 36px; }
  .bar { padding: 6px 10px; gap: 6px; }
  .bar .left { gap: 6px; }
}

/* Responsive Media Queries */

/* Tablet >= 720px */
@media (min-width: 720px) {
  .app { max-width: 900px; padding: 22px 28px 34px; }
  .marquee { margin-left: -28px; margin-right: -28px; }
  h1 { font-size: clamp(38px, 5vw, 50px); margin: 22px 0 10px; }
  .moods { grid-template-columns: repeat(8, 1fr); gap: 11px; }
  .mood { border-radius: 20px; }
  .mood .e svg { width: 44px; height: 44px; }
  .mood .n { font-size: 11.5px; }
  .demo { max-width: 210px; }
  .steps { gap: 14px; }
  .stp { font-size: 14.5px; }
  textarea { font-size: 17px; min-height: 110px; }
  .fgrid { flex-wrap: nowrap; }
  .flinks { flex-direction: row; gap: 20px; }
  .about .block { padding: 22px 24px; }
  .about .lede { font-size: clamp(30px, 4.4vw, 40px); }
}

/* Desktop >= 1040px — 2-Column Grid Layout (Only Active Screen `.on` Gets Displayed) */
@media (min-width: 1040px) {
  .app { max-width: 1180px; padding: 26px 40px 40px; }
  .marquee { margin-left: -40px; margin-right: -40px; padding: 11px 0; }
  .mq { font-size: 13.5px; padding: 0 18px; }

  #compose.on {
    display: grid !important;
    grid-template-columns: 1.15fr 0.85fr;
    grid-template-areas:
      "head demo"
      "live demo"
      "moods demo"
      "write demo"
      "foot demo";
    column-gap: 52px;
    align-content: start;
    padding-top: 46px;
    position: relative;
  }

  #compose.on .marquee {
    position: absolute;
    top: 0;
    left: -40px;
    right: -40px;
    grid-column: 1 / -1;
  }

  #compose h1 { grid-area: head; font-size: clamp(46px, 4.4vw, 60px); margin: 14px 0 6px; max-width: 14ch; }
  #compose .live { grid-area: live; justify-self: start; margin: 0 0 6px; }
  #compose .pitch {
    grid-area: demo;
    flex-direction: column;
    align-items: stretch;
    gap: 22px;
    align-self: center;
    padding-left: 8px;
  }
  #compose .demo { width: 100%; max-width: 300px; margin: 0 auto; }
  #compose .demo #demoCanvas { border-radius: 20px; }
  #compose .steps { gap: 16px; }
  #compose .stp { font-size: 15px; }
  #compose .stp .n { width: 36px; height: 36px; }
  #compose .stp .n svg { width: 17px; height: 17px; }
  #compose .moods { grid-area: moods; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 14px; }
  #compose .writebox { grid-area: write; margin-bottom: 0; }
  #compose .foot { grid-area: foot; }
  #compose textarea { min-height: 130px; font-size: 17px; }

  #result.on {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 260px;
    justify-content: center;
    align-items: center;
    column-gap: 40px;
    padding-top: 14px;
    max-width: 940px;
    margin: 0 auto;
  }
  #result .stage { padding: 0; min-width: 0; }
  #result #canvas { max-height: 62vh; max-width: 100%; }
  #result .actions {
    flex-direction: column;
    flex-wrap: nowrap;
    padding: 0;
    gap: 10px;
    align-items: stretch;
    align-self: center;
  }
  /* grid would stack the label under the icon — flex keeps them on one line */
  #result .actions .act {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    height: 50px;
    border-radius: 15px;
    padding: 0 18px;
    gap: 12px;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 14.5px;
    white-space: nowrap;
  }
  #result .actions .act svg { width: 20px; height: 20px; flex: none; }
  #result .actions .act::after { content: attr(data-label); line-height: 1; }
  #result .together { grid-column: 1 / -1; padding-top: 20px; }
  #result .backrow { grid-column: 1 / -1; }

  .about.on { display: grid !important; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
  .about > .ico, .about .lede { grid-column: 1 / -1; }
  .about .lede { max-width: 20ch; }
  .about .block { margin-bottom: 0; }

  footer { margin-top: 40px; }
  .fbrand p { font-size: 12.5px; max-width: 30ch; }
  .fsocial a { width: 36px; height: 36px; }
}

/* Mobile Small Devices (< 359px) */
@media (max-width: 359px) {
  .moods { grid-template-columns: repeat(3, 1fr); }
  .act { width: 50px; height: 50px; }
}

/* Small phones — declared last so they win the cascade */
@media (max-width: 430px) {
  .bar { padding: 7px 9px; gap: 6px; }
  .bar .right { gap: 5px; }
  .logo { padding: 3px 7px 3px 3px; }
  .logo img { height: 32px; }
  .ico, .me { width: 33px; height: 33px; }
  .ico svg { width: 15px; height: 15px; }
  #streakChip { padding: 4px 8px; font-size: 11.5px; }
}

@media (max-width: 360px) {
  #streakChip { display: none; }
}

/* Motion Reduced Override */
@media (prefers-reduced-motion: reduce) {
  .track { animation: none; }
  .marquee { overflow-x: auto; }
  .tilt-card { transform: none !important; }
}
