/* MKY Telugu Typing + Unicode → Unicode2A converter — modern glass theme */
:root {
  --bg: #eef1f8;
  --card: rgba(255, 255, 255, 0.72);
  --card-solid: #ffffff;
  --card-2: rgba(240, 244, 252, 0.9);
  --text: #171c2e;
  --muted: #5a6378;
  --border: rgba(23, 28, 46, 0.10);
  --brand: #4f46e5;
  --brand-2: #7c3aed;
  --brand-3: #0891b2;
  --gold: #e8a33d;
  --accent-hover: #4338ca;
  --chip-bg: rgba(79, 70, 229, 0.08);
  --shadow: 0 18px 50px rgba(31, 38, 90, 0.14);
  --shadow-sm: 0 8px 24px rgba(31, 38, 90, 0.10);
  --mono: 'Consolas', 'SF Mono', 'Menlo', monospace;
  --glass-blur: 16px;
}
html.dark {
  --bg: #0a0f1f;
  --card: rgba(21, 28, 50, 0.66);
  --card-solid: #141b33;
  --card-2: rgba(28, 37, 66, 0.85);
  --text: #eef1fa;
  --muted: #9aa4bd;
  --border: rgba(255, 255, 255, 0.10);
  --chip-bg: rgba(99, 102, 241, 0.16);
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  --shadow-sm: 0 8px 24px rgba(0, 0, 0, 0.30);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Inter', 'Noto Sans Telugu', system-ui, -apple-system, sans-serif;
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(900px 520px at 12% -8%, rgba(79, 70, 229, 0.16), transparent 60%),
    radial-gradient(800px 460px at 88% -6%, rgba(8, 145, 178, 0.14), transparent 60%),
    radial-gradient(700px 500px at 50% 115%, rgba(232, 163, 61, 0.13), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}
html.dark body {
  background:
    radial-gradient(900px 520px at 12% -8%, rgba(99, 102, 241, 0.22), transparent 60%),
    radial-gradient(800px 460px at 88% -6%, rgba(8, 145, 178, 0.16), transparent 60%),
    radial-gradient(700px 500px at 50% 115%, rgba(232, 163, 61, 0.10), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}

/* ---------- topbar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 26px;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(var(--glass-blur)) saturate(1.4);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.4);
  border-bottom: 1px solid var(--border);
}
html.dark .topbar { background: rgba(10, 15, 31, 0.55); }
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}
.brand img { height: 34px; width: auto; }
.brand-name {
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  background: linear-gradient(90deg, var(--brand), var(--brand-2), var(--brand-3));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.lang-badge {
  font-family: 'Noto Sans Telugu', sans-serif;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  border-radius: 999px;
  font-size: 0.72rem;
  padding: 3px 11px;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.35);
}
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.5);
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
}
html.dark .icon-btn { background: rgba(255, 255, 255, 0.06); }
.icon-btn:hover { background: var(--card-2); box-shadow: var(--shadow-sm); }
.icon-btn:active { transform: scale(0.94); }
.icon-btn svg { width: 19px; height: 19px; }
.icon-btn .i-sun { display: none; }
html.dark .icon-btn .i-sun { display: block; }
html.dark .icon-btn .i-moon { display: none; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: none;
  border-radius: 12px;
  padding: 10px 18px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.1s, box-shadow 0.15s, filter 0.15s;
}
.btn:active { transform: scale(0.96); }
.btn-wa {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #fff;
  box-shadow: 0 6px 18px rgba(34, 197, 94, 0.35);
}
.btn-wa:hover { filter: brightness(1.08); }
.btn-wa .wa-ico { width: 16px; height: 16px; border-radius: 4px; object-fit: cover; }
.btn-primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-2), var(--brand-3));
  color: #fff;
  box-shadow: 0 8px 22px rgba(79, 70, 229, 0.38);
}
.btn-primary:hover { filter: brightness(1.08); box-shadow: 0 10px 26px rgba(79, 70, 229, 0.5); }
.btn-primary svg { width: 16px; height: 16px; }
.btn-ghost {
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid var(--border);
  color: var(--text);
}
html.dark .btn-ghost { background: rgba(255, 255, 255, 0.06); }
.btn-ghost:hover { background: var(--card-2); }
.feedback-link { color: var(--muted); text-decoration: none; font-size: 0.9rem; transition: color 0.15s; }
.feedback-link:hover { color: var(--brand); }

/* ---------- hero ---------- */
.hero {
  padding: 72px 26px 44px;
  text-align: center;
}
.hero-inner { max-width: 860px; margin: 0 auto; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--card);
  border: 1px solid var(--border);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 999px;
  padding: 6px 16px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}
.eyebrow .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.18);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.35); opacity: 0.7; }
}
h1 {
  font-size: clamp(1.9rem, 4.8vw, 3.2rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.12;
  margin: 0 0 18px;
}
.grad-blue {
  background: linear-gradient(90deg, var(--brand), var(--brand-2), var(--brand-3));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.grad-gold {
  background: linear-gradient(90deg, var(--gold), #f5c26b);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-sub { font-size: 1.08rem; color: var(--muted); max-width: 680px; margin: 0 auto; }
.hero-sub code, .note-card code, .faq code {
  font-family: var(--mono);
  font-size: 0.85em;
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1px 6px;
}

/* ---------- split converter ---------- */
.split {
  max-width: 1380px;
  margin: 0 auto;
  padding: 12px 26px 50px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: stretch;
  gap: 0;
}
.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 26px 28px;
  backdrop-filter: blur(var(--glass-blur)) saturate(1.3);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.3);
}
.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.panel-head label {
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.panel-head label::before {
  content: '';
  width: 10px; height: 10px;
  border-radius: 3px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2), var(--brand-3));
  box-shadow: 0 0 12px rgba(79, 70, 229, 0.55);
}
.panel-hint { color: var(--muted); font-size: 0.84rem; }

/* ---------- typing editor ---------- */
.editor-wrap { position: relative; }
.editor {
  width: 100%;
  min-height: 330px;
  max-height: 440px;
  overflow-y: auto;
  padding: 18px 20px 46px;
  font-size: 1.3rem;
  font-family: 'Noto Sans Telugu', 'Noto Serif Telugu', sans-serif;
  line-height: 1.8;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--card-2);
  color: var(--text);
  outline: none;
  white-space: pre-wrap;
  word-break: break-word;
  box-shadow: inset 0 2px 8px rgba(23, 28, 46, 0.05);
  transition: border 0.15s, box-shadow 0.15s;
}
.editor:focus {
  border-color: var(--brand-2);
  box-shadow: inset 0 2px 8px rgba(23, 28, 46, 0.05), 0 0 0 4px rgba(124, 58, 237, 0.16);
}
.placeholder {
  position: absolute;
  top: 20px;
  left: 21px;
  color: var(--muted);
  opacity: 0.75;
  font-size: 1.05rem;
  pointer-events: none;
  max-width: calc(100% - 42px);
}
.editor:not(:empty) ~ .placeholder,
.editor:focus ~ .placeholder { display: none; }
.suggestion-box {
  position: fixed;
  z-index: 999;
  min-width: 220px;
  max-width: 340px;
  max-height: 280px;
  overflow-y: auto;
  background: var(--card-solid);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 6px;
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
}
.suggestion-item {
  padding: 8px 14px;
  border-radius: 10px;
  cursor: pointer;
  font-family: 'Noto Sans Telugu', sans-serif;
  font-size: 1.15rem;
  line-height: 1.4;
  transition: background 0.1s;
}
.suggestion-item:hover { background: var(--card-2); }
.suggestion-item.selected {
  background: linear-gradient(135deg, var(--brand), var(--brand-2), var(--brand-3));
  color: #fff;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35);
}

/* ---------- output ---------- */
.text-input {
  width: 100%;
  min-height: 330px;
  padding: 18px 20px;
  font-size: 1.05rem;
  font-family: 'Noto Sans Telugu', 'Noto Serif Telugu', sans-serif;
  line-height: 1.8;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--card-2);
  color: var(--text);
  resize: vertical;
  outline: none;
  box-shadow: inset 0 2px 8px rgba(23, 28, 46, 0.05);
  transition: border 0.15s, box-shadow 0.15s;
}
.text-input:focus { border-color: var(--brand-2); box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.16); }
.text-input.output {
  background: var(--card-2);
  font-family: var(--mono);
  font-size: 1.05rem;
}

.samples {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.samples-label { color: var(--muted); font-size: 0.84rem; }
.chip {
  font-family: 'Noto Sans Telugu', sans-serif;
  font-size: 0.86rem;
  border: 1px solid var(--border);
  background: var(--chip-bg);
  color: var(--text);
  border-radius: 999px;
  padding: 5px 14px;
  cursor: pointer;
  transition: border 0.15s, background 0.15s, box-shadow 0.15s, transform 0.1s;
}
.chip:hover {
  border-color: var(--brand-2);
  background: var(--card-2);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.18);
  transform: translateY(-1px);
}

.panel-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}
.spacer { flex: 1; }
.stats { color: var(--muted); font-size: 0.84rem; font-family: var(--mono); }

.arrow-row { display: flex; justify-content: center; align-items: center; padding: 0 18px; }
.arrow {
  width: 46px; height: 46px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--brand), var(--brand-2), var(--brand-3));
  color: #fff;
  font-size: 1.3rem;
  font-weight: 700;
  box-shadow: 0 8px 24px rgba(79, 70, 229, 0.45);
}

/* ---------- notes ---------- */
.notes {
  max-width: 1380px;
  margin: 0 auto;
  padding: 10px 26px 56px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}
.note-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 24px;
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s, box-shadow 0.2s;
}
.note-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.note-ico { font-size: 1.6rem; }
.note-card h3 { margin: 12px 0 6px; font-size: 1.02rem; font-weight: 700; }
.note-card p { margin: 0; color: var(--muted); font-size: 0.9rem; }

/* ---------- faq ---------- */
.faq {
  max-width: 900px;
  margin: 0 auto;
  padding: 10px 26px 70px;
}
.faq h2 { font-size: 1.5rem; margin-bottom: 18px; letter-spacing: -0.02em; }
.faq details {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  margin-bottom: 12px;
  padding: 6px 20px;
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  box-shadow: var(--shadow-sm);
}
.faq summary {
  cursor: pointer;
  font-weight: 600;
  padding: 13px 0;
}
.faq summary::-webkit-details-marker { color: var(--brand); }
.faq details p { color: var(--muted); font-size: 0.92rem; margin-top: 0; }

/* ---------- footer ---------- */
.footer {
  border-top: 1px solid var(--border);
  background: rgba(10, 15, 31, 0.9);
  color: #cdd5e6;
  padding: 44px 26px 22px;
}
.footer-grid {
  max-width: 1380px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 28px;
}
.f-brand img { height: 40px; width: auto; margin-bottom: 10px; }
.f-brand p { color: #8b95ad; font-size: 0.9rem; max-width: 260px; }
.f-col h4 {
  margin: 0 0 10px;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #8b95ad;
}
.f-col a { display: block; color: #cdd5e6; text-decoration: none; font-size: 0.92rem; padding: 3px 0; transition: color 0.15s; }
.f-col a:hover { color: #a5b4fc; }
.f-addr { display: block; color: #8b95ad; font-size: 0.9rem; padding: 3px 0; }
.footer-bottom {
  max-width: 1380px;
  margin: 28px auto 0;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: #8b95ad;
  font-size: 0.8rem;
  text-align: center;
}

/* ---------- toast ---------- */
.toast {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  border-radius: 14px;
  padding: 11px 20px;
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(79, 70, 229, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 100;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- responsive: stack split ---------- */
@media (max-width: 960px) {
  .split { grid-template-columns: 1fr; }
  .arrow-row { padding: 10px 0; }
  .arrow { transform: rotate(90deg); }
}
@media (max-width: 640px) {
  .panel { padding: 18px 16px; }
  .editor, .text-input { min-height: 260px; font-size: 1.1rem; }
}

/* ---------- utilities ---------- */
.hidden { display: none !important; }

/* ---------- accessibility ---------- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  font-weight: 700;
  padding: 10px 18px;
  border-radius: 0 0 12px 0;
  text-decoration: none;
}
.skip-link:focus {
  left: 0;
}
:focus-visible {
  outline: 3px solid var(--brand-2);
  outline-offset: 2px;
  border-radius: 4px;
}
.editor:focus-visible {
  outline: none;
  border-color: var(--brand-2);
  box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.16);
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
