/*
 * theme.css — INKDEW Odia Converter design tokens.
 *
 * Direction: a publisher's instrument, not a gadget — premium and quiet, like
 * Stripe's dashboard set in a book typeface. Deep ink-blue (#123B67) carries
 * every action; teal (#0D9488) marks "done/included"; warm gold (#D9A441) is
 * used only at large scale (one headline word, the hero glyph). Fraunces for
 * display, Public Sans for interface, Noto Sans Oriya for every Odia glyph.
 */

:root {
  --canvas: #f8fafc;
  --surface: #ffffff;
  --surface-2: #eef2f7;
  --border: #dde3eb;
  --border-strong: #a3b1c2;
  --ink: #172033;
  --muted: #556178;
  --accent: #123b67;
  --accent-hover: #0c2d50;
  --accent-ink: #ffffff;
  --accent-text: #154a82;
  --accent-strong: #0f3459;
  --accent-soft: #e4edf7;
  --accent-border: #b9cde3;
  --success: #15803d;
  --success-ink: #ffffff;
  --success-soft: #e3f2e8;
  --success-strong: #146c35;
  --warning: #b45309;
  --warning-ink: #ffffff;
  --warning-soft: #fbeedc;
  --warning-strong: #8f4207;
  --danger: #b91c1c;
  --danger-ink: #ffffff;
  --danger-soft: #fbe6e6;
  --danger-strong: #9f1818;
  --chart-1: #123b67;
  --chart-2: #0d9488;
  --chart-3: #d9a441;
  --chart-4: #5b7fa8;
  --chart-5: #8a6a2f;
  --chart-6: #64748b;

  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Public Sans", "Noto Sans Oriya", ui-sans-serif, system-ui, sans-serif;
  --font-sans: "Public Sans", "Noto Sans Oriya", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --display-weight: 600;
  --display-tracking: -0.02em;
  --eyebrow-tracking: 0.08em;

  --radius-btn: 10px;
  --radius-card: 16px;
  --radius-input: 10px;
  --btn-weight: 600;
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.04), 0 12px 32px -20px rgba(0, 0, 0, 0.22);
  --shadow-raised: 0 2px 6px rgba(0, 0, 0, 0.06), 0 24px 48px -24px rgba(0, 0, 0, 0.3);
  --measure: 70ch;

  --x-teal: #0d9488;
  --x-teal-text: #0b7a70;
  --x-gold: #d9a441;
  --x-gold-text: #8a5f0d;
  --x-band-dark: #0e2a4a;
  --x-band-dark-ink: #f2f5f9;
  --x-band-dark-muted: #b7c4d6;
  --x-specimen: #fbfaf6;
  --x-font-odia: "Noto Sans Oriya", "Kalinga", "Odia Sangam MN", sans-serif;
}

html[data-theme="dark"] {
  --canvas: #0a1322;
  --surface: #101c30;
  --surface-2: #17263e;
  --border: #22344f;
  --border-strong: #3b5272;
  --ink: #e7edf5;
  --muted: #9dabbf;
  --accent: #8cbdf0;
  --accent-hover: #a9cff5;
  --accent-ink: #0a1322;
  --accent-text: #8cbdf0;
  --accent-strong: #cfe3f9;
  --accent-soft: #15304f;
  --accent-border: #2c5480;
  --success: #2fa563;
  --success-ink: #06180d;
  --success-soft: #11301f;
  --success-strong: #7dd3a0;
  --warning: #e08a2e;
  --warning-ink: #1a0d00;
  --warning-soft: #3a2814;
  --warning-strong: #f2b36b;
  --danger: #e05555;
  --danger-ink: #1a0505;
  --danger-soft: #3b1719;
  --danger-strong: #f29a9a;
  --chart-1: #8cbdf0;
  --chart-2: #2dd4bf;
  --chart-3: #e6b85c;
  --chart-4: #93a9c6;
  --chart-5: #c9a45e;
  --chart-6: #94a3b8;

  --x-teal: #2dd4bf;
  --x-teal-text: #5eead4;
  --x-gold: #e6b85c;
  --x-gold-text: #e6b85c;
  --x-band-dark: #06101e;
  --x-band-dark-ink: #eef3f9;
  --x-band-dark-muted: #a9b7ca;
  --x-specimen: #0e1a2d;
  --x-font-odia: "Noto Sans Oriya", "Kalinga", "Odia Sangam MN", sans-serif;
}

/* app.css — INKDEW Odia Converter's own styles (tokens only). */

body { font-family: var(--font-body); -webkit-font-smoothing: antialiased; }
.font-display { font-family: var(--font-display); font-weight: var(--display-weight); letter-spacing: var(--display-tracking); font-optical-sizing: auto; }
.font-odia, [lang="or"] { font-family: var(--x-font-odia); }
.font-legacy { font-family: var(--font-mono); }
.text-gold { color: var(--x-gold); }
.text-teal { color: var(--x-teal-text); }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.skip-link { position: absolute; left: -10000px; top: 0; }
.skip-link:focus { left: 1rem; top: 1rem; z-index: 100; padding: 0.5rem 1rem; background: var(--surface); color: var(--ink); border-radius: var(--radius-btn); box-shadow: var(--shadow-raised); }

/* ---- Header & footer ---- */
.site-header { border-bottom: 1px solid var(--border); background: var(--canvas); }
.wordmark-glyph { display: inline-grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: 12px; background: var(--accent); color: var(--accent-ink); font-family: var(--x-font-odia); font-size: 1.45rem; font-weight: 600; line-height: 1; }
.nav-link { padding: 0.5rem 0.75rem; border-radius: 8px; font-size: 0.9rem; font-weight: 500; color: var(--muted); text-decoration: none; }
.nav-link:hover { color: var(--ink); background: var(--surface-2); }
.nav-link.is-current { color: var(--ink); box-shadow: inset 0 -2px 0 var(--accent); border-radius: 0; }
.site-footer { background: var(--surface); }

/* ---- Type ---- */
.eyebrow { font-size: 0.78rem; font-weight: 600; text-transform: uppercase; letter-spacing: var(--eyebrow-tracking); color: var(--x-teal-text); }
.section-title { margin-top: 0.75rem; font-size: clamp(2.1rem, 4.5vw, 3.6rem); line-height: 1.05; text-wrap: balance; }
.page-title { margin-top: 0.75rem; font-size: clamp(2.4rem, 5.5vw, 4.4rem); line-height: 1.02; text-wrap: balance; }

/* ---- Hero ---- */
.hero-title { font-size: clamp(3rem, 9vw, 7.6rem); line-height: 0.95; letter-spacing: -0.035em; text-wrap: balance; max-width: 15ch; }
.hero-accent { color: var(--x-teal); font-style: italic; }
.promise-row { display: grid; grid-template-columns: 1fr; gap: 0.75rem; border-top: 1px solid var(--border); padding-top: 1.5rem; }
@media (min-width: 48rem) { .promise-row { grid-template-columns: repeat(3, 1fr); } }
.promise-row li { display: flex; align-items: center; gap: 0.75rem; color: var(--muted); font-size: 0.95rem; }
.promise-row li .icon { color: var(--accent-text); flex-shrink: 0; }
.promise-row strong { color: var(--ink); font-weight: 600; }

.specimen { margin-top: 0.5rem; padding-bottom: 1rem; }
.specimen-plate { display: grid; grid-template-columns: 1fr; gap: 1.5rem; align-items: center; padding: 2rem; border: 1px solid var(--border); border-radius: 24px; background: var(--x-specimen); box-shadow: var(--shadow-card); }
@media (min-width: 64rem) { .specimen-plate { grid-template-columns: 1fr auto 1.4fr; padding: 3rem 3.5rem; min-height: 18rem; } }
.specimen-side { display: flex; flex-direction: column; gap: 0.75rem; min-width: 0; }
.specimen-label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: var(--eyebrow-tracking); color: var(--muted); font-weight: 600; }
.specimen-legacy { font-family: var(--font-mono); font-size: clamp(1.5rem, 3.4vw, 2.6rem); color: var(--muted); overflow-wrap: anywhere; }
.specimen-odia { font-family: var(--x-font-odia); font-weight: 600; font-size: clamp(3rem, 9vw, 7rem); line-height: 1.15; color: var(--accent-text); }
.specimen-arrow { display: grid; place-items: center; width: 3.5rem; height: 3.5rem; border-radius: 999px; background: var(--x-gold); color: var(--x-band-dark); transform: rotate(90deg); }
@media (min-width: 64rem) { .specimen-arrow { transform: none; } }
.specimen-caption { display: flex; justify-content: space-between; gap: 1rem; margin-top: 0.75rem; padding: 0 0.5rem; font-size: 0.78rem; color: var(--muted); text-transform: uppercase; letter-spacing: var(--eyebrow-tracking); }

/* ---- Converter ---- */
.converter { display: grid; grid-template-columns: 1fr; gap: 1rem; padding: 1rem; border: 1px solid var(--border); border-radius: 20px; background: var(--surface); box-shadow: var(--shadow-card); }
@media (min-width: 64rem) { .converter { grid-template-columns: 1fr 1fr; padding: 1.25rem; } }
.converter-in, .converter-out { display: flex; flex-direction: column; min-width: 0; }
.converter-bar { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.75rem; }
.converter-bar .select { min-width: 0; flex: 1 1 0; }
.converter-text { min-height: 15rem; font-size: 1.05rem; line-height: 1.7; resize: vertical; }
.converter-out .converter-text { font-size: 1.2rem; background: var(--surface-2); }
.converter-meta { display: flex; flex-wrap: nowrap; align-items: center; justify-content: space-between; gap: 0.75rem; margin-top: 0.6rem; font-size: 0.85rem; color: var(--muted); }
.counter { font-variant-numeric: tabular-nums; white-space: nowrap; }
.counter.is-over { color: var(--danger-strong); font-weight: 600; }
.usage-pill { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0.2rem 0.65rem; border-radius: 999px; background: var(--surface-2); font-size: 0.78rem; }
.usage-pill-pro { display: inline-flex; align-items: center; gap: 0.35rem; background: var(--accent-soft); color: var(--accent-strong); font-weight: 600; }
.limit-msg { margin-top: 0.75rem; padding: 0.75rem 1rem; border-radius: 12px; background: var(--warning-soft); color: var(--warning-strong); font-size: 0.9rem; }
.converter-actions { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 1rem; }
@media (min-width: 40rem) { .converter-actions { flex-direction: row; } }
.result-head { display: flex; align-items: center; gap: 0.5rem; min-height: 2.5rem; margin-bottom: 0.75rem; }
.converter-out.just-converted .converter-text { animation: out-flash 900ms ease-out; }
@keyframes out-flash { from { box-shadow: 0 0 0 3px var(--x-teal); } to { box-shadow: 0 0 0 0 transparent; } }
html.reduced-motion .converter-out.just-converted .converter-text { animation: none; }
.inline-note { font-size: 0.85rem; }

/* ---- Bands & sections ---- */
.band-tint { background: var(--surface-2); border-block: 1px solid var(--border); }
.band-dark { background: var(--x-band-dark); color: var(--x-band-dark-ink); }
.band-dark p { color: var(--x-band-dark-muted); }
.band-dark strong { color: var(--x-band-dark-ink); }
.band-dark .statement { color: var(--x-band-dark-ink); }
.statement { font-size: clamp(2rem, 5vw, 4.2rem); line-height: 1.08; max-width: 22ch; text-wrap: balance; }
.feature-list { display: grid; grid-template-columns: 1fr; gap: 2rem 3rem; }
@media (min-width: 48rem) { .feature-list { grid-template-columns: 1fr 1fr; } }
.feature-item { padding-top: 1.25rem; border-top: 1px solid var(--border-strong); }
.feature-item .icon { color: var(--accent-text); }
.how-list { display: grid; grid-template-columns: 1fr; gap: 2rem; }
@media (min-width: 64rem) { .how-list { grid-template-columns: repeat(3, 1fr); } }
.how-step { display: flex; gap: 1.25rem; align-items: flex-start; }
.how-num { flex-shrink: 0; font-size: 4rem; line-height: 0.85; color: var(--x-gold); }
.price-card { display: flex; flex-direction: column; padding: 2rem; }
.price-card > a.btn { margin-top: auto; }
.price-card ul { margin-bottom: 2rem; }
.price-card-pro { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow-raised); }
.faq-item { border-bottom: 1px solid var(--border); }
.faq-q { cursor: pointer; list-style: none; padding: 1.25rem 0; font-size: 1.1rem; font-weight: 600; display: flex; justify-content: space-between; gap: 1rem; }
.faq-q::-webkit-details-marker { display: none; }
.faq-q::after { content: "+"; color: var(--accent-text); font-weight: 400; font-size: 1.4rem; line-height: 1; }
.faq-item[open] .faq-q::after { content: "–"; }
.faq-a { padding-bottom: 1.25rem; color: var(--muted); max-width: 68ch; }
.closing { border-top: 1px solid var(--border); }
.closing-title { font-size: clamp(3rem, 9vw, 7.6rem); line-height: 0.95; letter-spacing: -0.035em; text-wrap: balance; }
.page-head { border-bottom: 1px solid var(--border); margin-bottom: 3rem; }
.feature-row { display: flex; gap: 1.25rem; padding: 1.5rem 0; border-bottom: 1px solid var(--border); }
.feature-ic { display: grid; place-items: center; width: 2.75rem; height: 2.75rem; flex-shrink: 0; border-radius: 12px; background: var(--accent-soft); color: var(--accent-strong); }
.licence-text { white-space: pre-wrap; font-family: var(--font-mono); font-size: 0.8rem; line-height: 1.6; padding: 1.5rem; border: 1px solid var(--border); border-radius: var(--radius-card); background: var(--surface); overflow-x: auto; }

/* ---- Auth ---- */
.auth-wrap { display: grid; place-items: center; padding: 3.5rem 1.25rem 6rem; }
.auth-card { width: 100%; max-width: 30rem; padding: 2rem; }

/* ---- App shell ---- */
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 1fr; }
@media (min-width: 64rem) { .app-shell { grid-template-columns: 16rem 1fr; } }
.app-side { display: flex; flex-direction: column; gap: 0.25rem; padding: 1rem; border-bottom: 1px solid var(--border); background: var(--surface); }
@media (min-width: 64rem) { .app-side { position: sticky; top: 0; height: 100vh; border-bottom: 0; border-right: 1px solid var(--border); padding: 1.25rem 1rem; } }
.side-nav { display: flex; gap: 0.25rem; overflow-x: auto; scrollbar-width: none; }
.side-nav::-webkit-scrollbar { display: none; }
@media (min-width: 64rem) { .side-nav { flex-direction: column; overflow: visible; } }
.side-link { display: flex; align-items: center; gap: 0.65rem; padding: 0.55rem 0.75rem; border-radius: 10px; font-size: 0.9rem; font-weight: 500; color: var(--muted); text-decoration: none; white-space: nowrap; }
.side-link:hover { background: var(--surface-2); color: var(--ink); }
.side-link.is-current { background: var(--accent-soft); color: var(--accent-strong); font-weight: 600; }
.side-foot { display: none; }
@media (min-width: 64rem) { .side-foot { display: flex; flex-direction: column; gap: 0.75rem; margin-top: auto; padding-top: 1rem; border-top: 1px solid var(--border); } }
.app-main { min-width: 0; padding: 1.5rem 1.25rem 4rem; }
@media (min-width: 48rem) { .app-main { padding: 2.5rem 2.5rem 5rem; } }
.app-head { display: flex; flex-direction: column; gap: 1rem; margin-bottom: 2rem; }
@media (min-width: 48rem) { .app-head { flex-direction: row; align-items: flex-end; justify-content: space-between; } }
.stat-label { font-size: 0.8rem; font-weight: 600; color: var(--muted); }
.stat-value { margin-top: 0.35rem; font-family: var(--font-display); font-size: 2rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-foot { margin-top: 0.25rem; font-size: 0.8rem; color: var(--muted); }
.tool-row { display: flex; align-items: center; gap: 0.85rem; padding: 0.9rem 1rem; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); text-decoration: none; color: var(--ink); }
.tool-row:hover { border-color: var(--accent-border); }
.tool-row > .icon:first-child { color: var(--accent-text); }
.tool-row.is-off { opacity: 0.7; }
.danger-zone { border-color: var(--danger-soft); }
.receipt-grid, .detail-list { display: grid; grid-template-columns: max-content 1fr; gap: 0.6rem 1.5rem; }
.receipt-grid dt, .detail-list dt { color: var(--muted); }
.file-input { height: auto; padding: 0.6rem; }

/* ---- Admin ---- */
.admin-bar { border-bottom: 1px solid var(--border); background: var(--surface); }
.admin-tab { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.55rem 0.8rem; border-radius: 10px; font-size: 0.88rem; font-weight: 500; color: var(--muted); white-space: nowrap; text-decoration: none; }
.admin-tab:hover { background: var(--surface-2); color: var(--ink); }
.admin-tab.is-current { background: var(--accent-soft); color: var(--accent-strong); font-weight: 600; }

@media print {
  .app-side, .app-head .btn, .site-header, .site-footer { display: none; }
  .app-shell { display: block; }
}
