/* ============ Tamizh Quest — shared glass design system ============ */
:root {
  --bg-0: #0b0620;
  --bg-1: #1a0b3d;
  --ink: #f5f1ff;
  --ink-soft: #c9bfe8;
  --ink-mute: #8e84b3;
  --glass: rgba(255, 255, 255, 0.07);
  --glass-strong: rgba(255, 255, 255, 0.12);
  --glass-border: rgba(255, 255, 255, 0.16);
  --glass-hi: rgba(255, 255, 255, 0.28);
  --saffron: #ffb347;
  --turmeric: #ffd166;
  --kumkum: #ff4f7b;
  --peacock: #1fd1c1;
  --lotus: #c77dff;
  --leaf: #7ae582;
  --sky: #5ab0ff;
  --grad-main: linear-gradient(135deg, #ffb347 0%, #ff4f7b 45%, #c77dff 100%);
  --grad-cool: linear-gradient(135deg, #1fd1c1 0%, #5ab0ff 50%, #c77dff 100%);
  --radius: 22px;
  --radius-sm: 14px;
  --shadow: 0 20px 60px rgba(5, 0, 25, 0.45);
  --font-ta: "Baloo Thambi 2", "Noto Sans Tamil", "Latha", sans-serif;
  --font-ui: "Outfit", "Baloo Thambi 2", system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; background: var(--bg-0); }
body {
  font-family: var(--font-ui);
  color: var(--ink);
  background: radial-gradient(1200px 800px at 10% -10%, #3a1670 0%, transparent 60%),
              radial-gradient(900px 700px at 110% 20%, #0f4b6e 0%, transparent 55%),
              radial-gradient(900px 900px at 50% 120%, #5a1245 0%, transparent 60%),
              linear-gradient(180deg, var(--bg-0), var(--bg-1));
  background-attachment: fixed;
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.55;
}
.ta { font-family: var(--font-ta); }
a { color: var(--turmeric); text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
img, svg, canvas { display: block; max-width: 100%; }
:focus-visible { outline: 3px solid var(--turmeric); outline-offset: 3px; border-radius: 8px; }

/* floating color blobs behind glass */
.blobs { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.blobs span {
  position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.45;
  animation: drift 22s ease-in-out infinite alternate;
}
.blobs span:nth-child(1) { width: 420px; height: 420px; background: #ff4f7b; top: 10%; left: -120px; }
.blobs span:nth-child(2) { width: 380px; height: 380px; background: #1fd1c1; top: 50%; right: -120px; animation-delay: -6s; }
.blobs span:nth-child(3) { width: 320px; height: 320px; background: #ffb347; bottom: -80px; left: 35%; animation-delay: -12s; }
@keyframes drift { to { transform: translate(60px, -40px) scale(1.15); } }

/* ---------- glass primitives ---------- */
.glass {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  box-shadow: var(--shadow), inset 0 1px 0 var(--glass-hi);
}
.glass-strong { background: var(--glass-strong); }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: 999px; font-size: 0.78rem; font-weight: 600;
  background: rgba(255,255,255,0.1); border: 1px solid var(--glass-border); color: var(--ink-soft);
  white-space: nowrap;
}
.chip.hot { background: rgba(255,79,123,0.18); color: #ffc2d2; border-color: rgba(255,79,123,0.4); }
.chip.cool { background: rgba(31,209,193,0.15); color: #b5fff6; border-color: rgba(31,209,193,0.4); }
.chip.gold { background: rgba(255,209,102,0.15); color: #ffe7a8; border-color: rgba(255,209,102,0.4); }
.chip.soon { background: rgba(199,125,255,0.15); color: #e7cbff; border-color: rgba(199,125,255,0.4); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: 999px; font-weight: 700; letter-spacing: 0.2px;
  transition: transform .2s ease, box-shadow .2s ease, background .2s;
  min-height: 44px;
}
.btn-primary { background: var(--grad-main); color: #fff; box-shadow: 0 10px 30px rgba(255,79,123,0.4); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 36px rgba(255,79,123,0.55); }
.btn-ghost { background: rgba(255,255,255,0.08); border: 1px solid var(--glass-border); }
.btn-ghost:hover { background: rgba(255,255,255,0.16); }
.btn-sm { padding: 8px 14px; min-height: 36px; font-size: 0.88rem; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

.grad-text { background: var(--grad-main); -webkit-background-clip: text; background-clip: text; color: transparent;
  /* the colour is painted only inside the box: room above and below for Tamil signs that reach out (ரு, ழ், கீ) */
  padding: .12em .06em .22em; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.muted { color: var(--ink-mute); }
.soft { color: var(--ink-soft); }

/* ---------- toast ---------- */
.toast-wrap { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); z-index: 999; display: grid; gap: 8px; width: min(92vw, 420px); }
.toast { padding: 12px 18px; border-radius: 16px; font-weight: 600; animation: toastIn .35s ease; text-align: center; }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px); } }

/* ---------- modal ---------- */
.modal-back {
  position: fixed; inset: 0; z-index: 900; display: none; place-items: center; padding: 16px;
  background: rgba(8, 2, 25, 0.55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.modal-back.open { display: grid; animation: fadeIn .25s ease; }
@keyframes fadeIn { from { opacity: 0; } }
.modal { width: min(440px, 100%); padding: 30px 26px; position: relative; }
.modal h3 { font-size: 1.6rem; margin-bottom: 4px; }
.modal .close { position: absolute; top: 14px; right: 14px; width: 36px; height: 36px; border-radius: 50%; background: rgba(255,255,255,0.1); font-size: 1.1rem; }
.field { display: grid; gap: 6px; margin-top: 16px; }
.field label { font-size: 0.85rem; color: var(--ink-soft); font-weight: 600; }
.field input {
  padding: 13px 16px; border-radius: 14px; font: inherit; color: var(--ink);
  background: rgba(255,255,255,0.08); border: 1px solid var(--glass-border); outline: none;
}
.field input:focus { border-color: var(--turmeric); background: rgba(255,255,255,0.12); }
.err { color: #ff9db5; font-size: 0.88rem; min-height: 1.2em; margin-top: 10px; }
.demo-hint { margin-top: 16px; padding: 10px 14px; border-radius: 12px; background: rgba(255,209,102,0.1); border: 1px dashed rgba(255,209,102,0.45); font-size: 0.85rem; color: #ffe7a8; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
