:root {
  --bg: #0b0710;
  --bg-accent-1: rgba(244, 63, 94, 0.22);
  --bg-accent-2: rgba(212, 175, 55, 0.16);
  --surface: rgba(25, 18, 34, 0.72);
  --surface-strong: rgba(36, 25, 48, 0.9);
  --border: rgba(255, 255, 255, 0.1);
  --text: #f8f4f9;
  --muted: #b8abc4;
  --rose: #ff4d79;
  --rose-soft: #ff85a3;
  --gold: #e5c158;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}

html[data-theme="light"] {
  --bg: #fdf6f8;
  --bg-accent-1: rgba(255, 77, 121, 0.14);
  --bg-accent-2: rgba(212, 175, 55, 0.14);
  --surface: rgba(255, 255, 255, 0.82);
  --surface-strong: rgba(255, 255, 255, 0.96);
  --border: rgba(140, 60, 90, 0.14);
  --text: #221426;
  --muted: #66526b;
  --rose: #d92659;
  --rose-soft: #ff5c8a;
  --gold: #b8860b;
  --shadow: 0 18px 40px rgba(115, 40, 70, 0.1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 15% 15%, var(--bg-accent-1), transparent 42%),
    radial-gradient(circle at 85% 25%, var(--bg-accent-2), transparent 40%),
    radial-gradient(circle at 50% 90%, var(--bg-accent-1), transparent 45%);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.65;
  overflow-x: hidden;
  transition: background-color 0.35s ease, color 0.35s ease;
}

#petalCanvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

/* TOPBAR */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 28px;
  backdrop-filter: blur(16px);
  background: color-mix(in srgb, var(--bg) 75%, transparent);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  font-size: 0.95rem;
}

.brand small {
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0.02em;
}

.brand-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--rose), var(--gold));
  box-shadow: 0 0 12px var(--rose);
}

.top-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* CONTAINER */
.container {
  position: relative;
  z-index: 1;
  max-width: 1040px;
  margin: 0 auto;
  padding: 40px 20px 64px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--text);
  background: var(--surface);
  transition: transform 0.18s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--rose) 55%, var(--border));
}

.btn:active {
  transform: translateY(0) scale(0.98);
}

.btn-primary {
  background: linear-gradient(135deg, var(--rose), #b91c5c);
  color: #fff;
  border: none;
  box-shadow: 0 10px 25px rgba(255, 77, 121, 0.35);
}

.btn-primary:hover {
  box-shadow: 0 14px 30px rgba(255, 77, 121, 0.5);
}

.btn-secondary {
  background: linear-gradient(135deg, rgba(229, 193, 88, 0.18), rgba(255, 77, 121, 0.18));
  border-color: rgba(229, 193, 88, 0.4);
}

.btn-glow {
  background: linear-gradient(135deg, rgba(255, 77, 121, 0.2), rgba(229, 193, 88, 0.2));
  border-color: rgba(255, 77, 121, 0.45);
}

.btn-ghost {
  background: transparent;
}

.full-width {
  width: 100%;
  margin-top: 14px;
}

/* HERO */
.hero {
  text-align: center;
  padding: 36px 16px 20px;
}

.badge {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gold);
  border: 1px solid color-mix(in srgb, var(--gold) 40%, transparent);
  background: color-mix(in srgb, var(--gold) 10%, transparent);
  margin-bottom: 18px;
}

.hero-title {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(3.6rem, 9vw, 6.2rem);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.02em;
  margin-bottom: 18px;
}

.part-ayse {
  background: linear-gradient(135deg, #fff, var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

html[data-theme="light"] .part-ayse {
  background: linear-gradient(135deg, #2b1630, #b8860b);
  -webkit-background-clip: text;
  background-clip: text;
}

.part-gul {
  background: linear-gradient(135deg, var(--rose-soft), var(--rose));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-style: italic;
}

.hero-subtitle {
  max-width: 680px;
  margin: 0 auto 28px;
  font-size: 1.08rem;
  color: var(--muted);
}

.hero-subtitle strong {
  color: var(--text);
}

.hero-controls {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 30px;
}

.quick-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  max-width: 780px;
  margin: 0 auto;
}

.stat-pill {
  background: var(--surface);
  border: 1px solid var(--border);
  backdrop-filter: blur(12px);
  border-radius: 16px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-label {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.stat-value {
  font-weight: 700;
  font-size: 0.98rem;
}

/* CARDS & SECTIONS */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 28px;
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.section-header {
  margin-bottom: 20px;
}

.section-header h2 {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.95rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.section-header p {
  color: var(--muted);
  font-size: 0.95rem;
}

/* TABS */
.tab-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.tab-btn {
  padding: 10px 18px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tab-btn:hover {
  color: var(--text);
  border-color: var(--rose-soft);
}

.tab-btn.active {
  background: linear-gradient(135deg, rgba(255, 77, 121, 0.24), rgba(229, 193, 88, 0.16));
  color: var(--text);
  border-color: var(--rose);
}

.tab-panel {
  display: none;
  animation: fadeSlide 0.3s ease;
}

.tab-panel.active {
  display: block;
}

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

.origin-grid {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 24px;
  align-items: center;
}

.origin-script-box {
  background: var(--surface-strong);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 24px 18px;
  text-align: center;
}

.combo-box {
  border-color: rgba(255, 77, 121, 0.45);
}

.script-lang {
  display: block;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold);
  margin-bottom: 8px;
}

.script-word {
  font-size: 2.8rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 6px;
}

.combo-word {
  font-family: "Cormorant Garamond", serif;
  font-size: 2.2rem;
  background: linear-gradient(135deg, var(--gold), var(--rose-soft));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.script-translit {
  font-size: 0.9rem;
  color: var(--muted);
}

.origin-details h3 {
  font-size: 1.25rem;
  margin-bottom: 10px;
}

.origin-details p {
  color: var(--muted);
  margin-bottom: 12px;
}

.detail-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.94rem;
}

.detail-list li {
  padding-left: 16px;
  position: relative;
}

.detail-list li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--rose);
  font-weight: 700;
}

/* TWO COLUMN LAB */
.two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

/* SYLLABLES */
.syllable-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.syllable-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 18px 10px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--surface-strong);
  color: var(--text);
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.syllable-btn:hover,
.syllable-btn.playing {
  transform: translateY(-3px);
  border-color: var(--rose);
  box-shadow: 0 10px 24px rgba(255, 77, 121, 0.28);
}

.syl-text {
  font-family: "Cormorant Garamond", serif;
  font-size: 1.7rem;
  font-weight: 700;
}

.syl-note {
  font-size: 0.78rem;
  color: var(--gold);
  font-weight: 600;
}

.info-banner {
  padding: 14px 16px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--rose) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--rose) 28%, transparent);
  font-size: 0.92rem;
}

/* LETTERS */
.letter-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.letter-btn {
  aspect-ratio: 1;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-strong);
  color: var(--text);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.18s ease;
}

.letter-btn:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
}

.letter-btn.active {
  background: linear-gradient(135deg, var(--rose), #b91c5c);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 6px 16px rgba(255, 77, 121, 0.35);
}

.letter-display {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--surface-strong);
  border: 1px solid var(--border);
}

.letter-badge {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-family: "Cormorant Garamond", serif;
  font-size: 1.6rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--gold), var(--rose));
  color: #fff;
}

.letter-display p {
  font-size: 0.9rem;
  color: var(--muted);
  margin-top: 2px;
}

.acrostic-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.9rem;
}

/* QUOTE SECTION */
.quote-box {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(1.35rem, 2.5vw, 1.75rem);
  font-style: italic;
  padding: 22px 24px;
  border-left: 4px solid var(--rose);
  border-radius: 0 18px 18px 0;
  background: var(--surface-strong);
  margin-bottom: 18px;
}

.quote-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.copy-toast {
  font-size: 0.88rem;
  color: var(--gold);
  font-weight: 600;
}

.footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 20px;
  color: var(--muted);
  font-size: 0.86rem;
}

@media (max-width: 780px) {
  .origin-grid,
  .two-col,
  .quick-stats {
    grid-template-columns: 1fr;
  }

  .topbar {
    padding: 12px 16px;
  }

  .brand small {
    display: none;
  }
}
