/* ============================================================
   Kaalaakshari — v2 styles
   Classic navy & gold legal theme, modern friendly UX
   ============================================================ */
:root {
  --ink: #0e1b2e;
  --ink-2: #16273f;
  --ink-3: #1e3350;
  --gold: #d4af37;
  --gold-soft: #e8c96a;
  --paper: #f7f4ec;
  --paper-2: #fffdf7;
  --text: #24344d;
  --muted: #6b7a92;
  --line: #e3ddcc;
  --danger: #c0392b;
  --ok: #1e7d4f;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(14,27,46,.10);
  --shadow-lg: 0 24px 60px rgba(14,27,46,.18);
  --font-display: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-body: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-serif: 'Source Serif 4', Georgia, serif;
}
* {
  filter: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--paper);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: inline-block; vertical-align: middle; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: .95rem; }

/* ---------- reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s ease, transform .7s ease; }
.reveal.revealed { opacity: 1; transform: none; }

/* ---------- reading progress ---------- */
.progress-track-top { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 200; background: transparent; }
.progress-fill-top { height: 100%; width: 0; background: linear-gradient(90deg, var(--gold), #f2dd8c); transition: width .1s linear; }

/* ---------- navbar ---------- */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(14,27,46,.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(212,175,55,.25);
}
.nav-inner {
  max-width: 1220px; margin: 0 auto; padding: .65rem 1.25rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.brand { display: flex; align-items: center; gap: .7rem; }
.brand-icon {
  width: 42px; height: 42px; flex: none;
  display: grid; place-items: center;
  color: var(--gold);
  background: linear-gradient(160deg, #1c3352, #0e1b2e);
  border: 1px solid rgba(212,175,55,.45);
  border-radius: 12px;
  transition: transform .25s;
}
.brand:hover .brand-icon { transform: rotate(-4deg) scale(1.05); }
.brand-icon svg { width: 26px; height: 26px; }
.brand-text { line-height: 1.1; }
.brand-hi { font-size: 1.05rem; font-weight: 700; color: #fff; letter-spacing: .02em; }
.brand-en { font-size: .78rem; color: var(--gold-soft); letter-spacing: .14em; text-transform: uppercase; }

.nav-links { display: flex; align-items: center; gap: 1.4rem; }
.nav-links a {
  color: #c9d4e4; font-size: .9rem; font-weight: 500;
  padding: .35rem 0; position: relative; transition: color .2s;
}
.nav-links a::after {
  content: ''; position: absolute; left: 0; bottom: 0; height: 2px; width: 0;
  background: var(--gold); transition: width .25s;
}
.nav-links a:hover { color: #fff; }
.nav-links a:hover::after { width: 100%; }
.nav-links a.active { color: var(--gold-soft); }
.nav-links a.active::after { width: 100%; }
.nav-cta {
  background: linear-gradient(120deg, var(--gold), #b8922a);
  color: #1a1404 !important; padding: .5rem 1.1rem !important; border-radius: 999px;
  font-weight: 600; box-shadow: 0 4px 14px rgba(212,175,55,.35);
}
.nav-cta::after { display: none; }
.nav-cta:hover { color: #1a1404 !important; filter: brightness(1.06); }
.nav-burger { display: none; background: none; border: 0; padding: .4rem; }
.nav-burger span { display: block; width: 22px; height: 2px; background: #fff; margin: 4px 0; border-radius: 2px; }

/* ---------- hero ---------- */
.hero {
  position: relative;
  background: radial-gradient(1200px 620px at 72% -12%, #1e3350 0%, var(--ink) 58%);
  color: #fff; overflow: hidden;
}
.hero-bg { position: absolute; inset: 0; pointer-events: none; }
.hero-grid {
  position: absolute; inset: 0; opacity: .5;
  background-image:
    linear-gradient(rgba(212,175,55,.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(212,175,55,.06) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse at 50% 30%, #000 30%, transparent 78%);
}
.hero-scales { position: absolute; right: -40px; top: 90px; width: 240px; height: 240px; opacity: .8; animation: floaty 7s ease-in-out infinite; }
.hero-feather { position: absolute; left: -60px; bottom: 60px; width: 260px; height: 260px; animation: floaty 9s ease-in-out infinite reverse; }
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }
.hero-inner { position: relative; max-width: 1220px; margin: 0 auto; padding: 4.2rem 1.25rem 4.4rem; text-align: center; }
.hero-kicker {
  display: inline-block; font-size: .78rem; letter-spacing: .22em; text-transform: uppercase;
  color: var(--gold-soft); border: 1px solid rgba(212,175,55,.4);
  padding: .4rem 1.1rem; border-radius: 999px; margin-bottom: 1.3rem;
  background: rgba(212,175,55,.06);
}
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.7rem, 7.5vw, 4.8rem);
  font-weight: 900; line-height: 1.02;
}
.hero-title span {
  display: block; font-size: clamp(1.1rem, 3vw, 1.7rem);
  font-weight: 600; letter-spacing: .32em; text-transform: uppercase;
  color: var(--gold); margin-top: .5rem;
}
.hero-typing-wrap { min-height: 2rem; margin-top: 1rem; font-size: 1.08rem; color: #dce5f1; font-weight: 500; }
.hero-caret { display: inline-block; width: 2px; height: 1.1em; background: var(--gold); vertical-align: text-bottom; margin-left: 3px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.hero-sub { max-width: 700px; margin: .9rem auto 0; color: #c3cfdf; font-size: 1.05rem; }
.hero-sub strong { color: #fff; }
.hero-actions { display: flex; gap: .9rem; justify-content: center; flex-wrap: wrap; margin-top: 1.6rem; }
.btn-lg { padding: .85rem 1.6rem; font-size: 1rem; }
.btn-outline-light { background: transparent; border: 1.5px solid rgba(255,255,255,.55); color: #fff; }
.btn-outline-light:hover { background: rgba(255,255,255,.1); border-color: #fff; }
.hero-clock {
  display: inline-flex; align-items: center; gap: .9rem; flex-wrap: wrap; justify-content: center;
  margin-top: 1.6rem; background: rgba(255,255,255,.05);
  border: 1px solid rgba(212,175,55,.25); border-radius: 999px; padding: .5rem 1.3rem;
}
.hc-date { font-weight: 600; color: #fff; }
.hc-time { font-family: var(--font-display); font-size: 1.15rem; color: var(--gold-soft); font-weight: 700; }
.hc-note { font-size: .72rem; color: #9fb0c6; letter-spacing: .08em; text-transform: uppercase; }

.hero-cards {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.6rem; max-width: 980px; margin: 2.6rem auto 0; text-align: left;
}
.feature-card {
  position: relative; display: block;
  background: linear-gradient(165deg, #1c3352, #122238);
  border: 1px solid rgba(212,175,55,.28);
  border-radius: var(--radius);
  padding: 1.8rem 1.7rem 1.6rem;
  transition: transform .25s, box-shadow .25s, border-color .25s;
  overflow: hidden;
}
.feature-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--gold), transparent 70%);
}
.feature-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: var(--gold); }
.feature-icon {
  width: 76px; height: 76px; display: grid; place-items: center;
  color: var(--gold); background: rgba(212,175,55,.12);
  border: 1px solid rgba(212,175,55,.35); border-radius: 18px;
  margin-bottom: 1.1rem; transition: transform .3s;
}
.feature-card:hover .feature-icon { transform: scale(1.08) rotate(-3deg); }
.feature-icon svg { width: 46px; height: 46px; }
.feature-tag {
  position: absolute; top: 1.2rem; right: 1.2rem;
  font-size: .68rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--gold-soft); border: 1px solid rgba(212,175,55,.4);
  padding: .22rem .7rem; border-radius: 999px;
}
.feature-card h3 { font-family: var(--font-display); font-size: 1.45rem; color: #fff; margin-bottom: .45rem; }
.feature-card p { color: #b6c3d6; font-size: .93rem; margin-bottom: 1rem; }
.feature-cta { color: var(--gold); font-weight: 600; font-size: .92rem; }
.feature-cta span { transition: transform .2s; display: inline-block; }
.feature-card:hover .feature-cta span { transform: translateX(4px); }

/* hero stats */
.stats-hero {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: .8rem;
  max-width: 820px; margin: 2.4rem auto 0;
}
.stat-h {
  background: rgba(255,255,255,.06); border: 1px solid rgba(212,175,55,.22);
  border-radius: 14px; padding: 1rem .6rem; text-align: center;
}
.stat-h .stat-num { display: block; font-family: var(--font-display); font-size: 1.9rem; color: var(--gold); font-weight: 700; line-height: 1.1; }
.stat-h label { font-size: .72rem; color: #b9c6d8; letter-spacing: .04em; }

/* ---------- ticker ---------- */
.ticker {
  display: flex; align-items: stretch; background: var(--ink-2);
  border-top: 1px solid rgba(212,175,55,.25); border-bottom: 1px solid rgba(212,175,55,.25);
  overflow: hidden;
}
.ticker-label {
  flex: none; z-index: 2; text-align: center; font-size: .72rem; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase; color: #1a1404;
  background: linear-gradient(120deg, var(--gold), #e3c35c);
  padding: .55rem .9rem; line-height: 1.15;
}
.ticker-window { flex: 1; overflow: hidden; position: relative; }
.ticker-track { display: flex; gap: 2.6rem; white-space: nowrap; width: max-content; animation: ticker 38s linear infinite; padding: .55rem 1rem; }
.ticker:hover .ticker-track { animation-play-state: paused; }
.ticker-track span { color: #cfd9e7; font-size: .85rem; display: inline-flex; align-items: center; gap: .4rem; }
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---------- sections ---------- */
.section { padding: 4.4rem 1.25rem; max-width: 1220px; margin: 0 auto; }
.section-alt { background: linear-gradient(180deg, #efe9db, #f4efe3); max-width: none; padding-left: 1.25rem; padding-right: 1.25rem; }
.section-alt > * { max-width: 1220px; margin-left: auto; margin-right: auto; }
.section-alt .section-head { text-align: center; }
.section-head { text-align: center; margin-bottom: 2.4rem; }
.section-icon {
  width: 58px; height: 58px; display: grid; place-items: center; margin: 0 auto 1rem;
  color: var(--gold); background: #fff; border: 1px solid var(--line);
  border-radius: 16px; box-shadow: var(--shadow);
}
.section-icon svg { width: 30px; height: 30px; }
.section-head h2 {
  font-family: var(--font-display); font-size: clamp(1.7rem, 4vw, 2.4rem);
  color: var(--ink); font-weight: 800;
}
.section-head h2::after {
  content: '— ✦ —'; display: block; color: var(--gold);
  font-size: .95rem; margin: .5rem auto 0; letter-spacing: .2em;
}
.section-sub { max-width: 660px; margin: .9rem auto 0; color: var(--muted); font-size: .98rem; }

/* ---------- judiciary grid ---------- */
.jud-grid { display: grid; grid-template-columns: 400px 1fr; gap: 1.6rem; align-items: start; }
.panel {
  background: var(--paper-2); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 1.5rem;
}
.panel-title {
  display: flex; align-items: center; gap: .55rem;
  font-family: var(--font-display); font-size: 1.25rem; color: var(--ink);
  margin-bottom: 1.1rem;
}
.panel-title svg { width: 22px; height: 22px; color: var(--gold); }

.drop-zone {
  border: 2px dashed #cbbf9e; border-radius: 14px;
  background: #fbf9f2; padding: 1.7rem 1rem; text-align: center;
  color: var(--muted); margin-bottom: 1.1rem; transition: border-color .2s, background .2s, transform .2s;
}
.drop-zone:hover { border-color: var(--gold); }
.drop-zone.dragover { border-color: var(--gold); background: #f6efd8; transform: scale(1.01); }
.drop-zone svg { width: 40px; height: 40px; color: var(--gold); margin-bottom: .5rem; }
.drop-zone p { font-size: .95rem; }
.link-like { color: var(--gold); font-weight: 600; text-decoration: underline; }
.drop-hint { font-size: .8rem !important; color: var(--muted); margin-top: .2rem; }

.field { display: block; margin-bottom: .9rem; }
.field > span { display: block; font-size: .82rem; font-weight: 600; color: var(--ink); margin-bottom: .3rem; }
.field em { color: var(--muted); font-weight: 400; font-style: italic; }
.field input, .field select, .field textarea {
  width: 100%; padding: .65rem .8rem; border: 1px solid var(--line);
  border-radius: 10px; background: #fff; color: var(--text); outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(212,175,55,.18); }
.field textarea { min-height: 90px; resize: vertical; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .72rem 1.35rem; border-radius: 11px; border: 0;
  font-weight: 600; font-size: .92rem; transition: transform .15s, box-shadow .2s, background .2s;
}
.btn svg { width: 18px; height: 18px; }
.btn:active { transform: scale(.97); }
.btn-gold { background: linear-gradient(120deg, var(--gold), #b8922a); color: #1a1404; box-shadow: 0 6px 18px rgba(212,175,55,.35); }
.btn-gold:hover { box-shadow: 0 10px 26px rgba(212,175,55,.45); filter: brightness(1.04); }
.btn-outline { background: transparent; border: 1.5px solid var(--gold); color: var(--gold); }
.btn-outline:hover { background: rgba(212,175,55,.08); }
.btn-ink { background: var(--ink); color: #fff; }
.btn-ink:hover { background: var(--ink-2); }
.btn-sm { padding: .42rem .85rem; font-size: .82rem; border-radius: 9px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* ---------- library ---------- */
.library-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.count-badge {
  background: var(--gold); color: #1a1404; font-size: .78rem; font-weight: 700;
  padding: .1rem .55rem; border-radius: 999px; font-family: var(--font-body);
}
.search-box {
  display: flex; align-items: center; gap: .5rem;
  border: 1px solid var(--line); border-radius: 10px; padding: .4rem .7rem;
  background: #fff; min-width: 220px; transition: border-color .2s, box-shadow .2s;
}
.search-box:focus-within { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(212,175,55,.18); }
.search-box svg { width: 16px; height: 16px; color: var(--muted); flex: none; }
.search-box input { border: 0; outline: 0; width: 100%; background: transparent; }

.chips { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0 1.1rem; }
.chip {
  border: 1px solid var(--line); background: #fff; color: var(--muted);
  font-size: .8rem; font-weight: 500; padding: .38rem .85rem; border-radius: 999px;
  transition: all .2s;
}
.chip:hover { border-color: var(--gold); color: var(--ink); transform: translateY(-1px); }
.chip.active { background: var(--ink); border-color: var(--ink); color: #fff; }

.file-list { display: flex; flex-direction: column; gap: .7rem; max-height: 520px; overflow-y: auto; padding-right: .2rem; }
.file-list::-webkit-scrollbar { width: 8px; }
.file-list::-webkit-scrollbar-thumb { background: #d8d2bf; border-radius: 8px; }
.file-item {
  display: flex; align-items: center; gap: .85rem;
  background: #fdfbf5; border: 1px solid var(--line); border-radius: 12px;
  padding: .8rem .9rem; transition: border-color .2s, box-shadow .2s, transform .15s;
  animation: slideIn .35s ease both;
}
@keyframes slideIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.file-item:hover { border-color: var(--gold); box-shadow: var(--shadow); transform: translateY(-1px); }
.file-thumb {
  width: 42px; height: 48px; flex: none; display: grid; place-items: center;
  background: linear-gradient(160deg, #eef3fa, #dfe8f4); color: #33475f;
  border-radius: 8px; border: 1px solid #d3dfec;
}
.file-thumb svg { width: 22px; height: 22px; }
.file-info { flex: 1; min-width: 0; }
.file-info h4 { font-size: .94rem; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-info .file-meta { font-size: .76rem; color: var(--muted); display: flex; gap: .6rem; flex-wrap: wrap; }
.file-cat { color: var(--gold); font-weight: 600; }
.file-actions { display: flex; gap: .4rem; flex: none; }
.empty-state { text-align: center; color: var(--muted); padding: 3rem 1rem; }
.empty-state svg { width: 46px; height: 46px; color: #cfc6a8; margin-bottom: .6rem; }

/* ---------- tools ---------- */
.tools-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.2rem; margin-bottom: 3rem;
}
.tool-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.4rem 1.3rem; text-align: left; transition: transform .2s, box-shadow .2s, border-color .2s;
  display: flex; flex-direction: column; gap: .5rem;
}
.tool-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--gold); }
.tool-ic {
  width: 52px; height: 52px; display: grid; place-items: center;
  color: var(--gold); background: #fbf3dc; border-radius: 13px;
  border: 1px solid #eedfae; margin-bottom: .35rem; transition: transform .25s;
}
.tool-card:hover .tool-ic { transform: scale(1.1) rotate(-4deg); }
.tool-ic svg { width: 28px; height: 28px; }
.tool-card h4 { font-size: 1.02rem; color: var(--ink); font-family: var(--font-display); }
.tool-card p { font-size: .83rem; color: var(--muted); flex: 1; }
.tool-open { font-size: .82rem; color: var(--gold); font-weight: 600; margin-top: .4rem; display: inline-flex; align-items: center; gap: .3rem; }
.tool-card:hover .tool-open span { transform: translateX(4px); }
.tool-open span { transition: transform .2s; }

.templates-block { margin-top: 1rem; }
.block-title { font-family: var(--font-display); color: var(--ink); font-size: 1.35rem; margin-bottom: .2rem; }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; margin-top: 1rem; }
.tpl-card {
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  padding: 1.1rem 1.15rem; text-align: left; transition: transform .2s, box-shadow .2s, border-color .2s;
  display: flex; align-items: center; gap: .8rem;
}
.tpl-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--gold); }
.tpl-ic { width: 42px; height: 42px; flex: none; display: grid; place-items: center; color: var(--ink-3); background: #e9eef6; border-radius: 10px; }
.tpl-ic svg { width: 24px; height: 24px; }
.tpl-card .tpl-name { font-weight: 600; color: var(--ink); font-size: .93rem; line-height: 1.3; }
.tpl-card .tpl-desc { font-size: .75rem; color: var(--muted); }

/* ---------- knowledge hub ---------- */
.tabs { display: flex; gap: .6rem; flex-wrap: wrap; justify-content: center; margin-bottom: 1.8rem; }
.tab {
  border: 1.5px solid var(--line); background: #fff; color: var(--text);
  font-size: .9rem; font-weight: 600; padding: .6rem 1.3rem; border-radius: 999px;
  transition: all .2s;
}
.tab:hover { border-color: var(--gold); transform: translateY(-2px); }
.tab.active { background: var(--ink); border-color: var(--ink); color: var(--gold-soft); box-shadow: var(--shadow); }
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeUp .4s ease; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.judgments-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.2rem; }
.jcase {
  background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--gold);
  border-radius: 14px; padding: 1.2rem 1.3rem; box-shadow: var(--shadow);
  transition: transform .2s, box-shadow .2s;
}
.jcase:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.jcase .jc-year { font-family: var(--font-display); color: var(--gold); font-weight: 800; font-size: .95rem; letter-spacing: .06em; }
.jcase h4 { font-family: var(--font-display); color: var(--ink); font-size: 1.12rem; margin: .2rem 0 .4rem; line-height: 1.3; }
.jcase p { font-size: .86rem; color: var(--muted); }
.jcase .jc-tag { display: inline-block; margin-top: .6rem; font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); background: #e9eef6; padding: .2rem .6rem; border-radius: 999px; }

.maxims-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1.2rem; }
.maxim {
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  padding: 1.2rem 1.3rem; box-shadow: var(--shadow); transition: transform .2s, box-shadow .2s;
}
.maxim:hover { transform: translateY(-4px) rotate(-.5deg); box-shadow: var(--shadow-lg); }
.maxim .mx-latin { font-family: var(--font-serif); font-style: italic; font-size: 1.05rem; color: var(--ink-3); font-weight: 600; }
.maxim p { font-size: .85rem; color: var(--muted); margin-top: .3rem; }

.bareacts-panel { max-width: 760px; margin: 0 auto; }
.ba-row {
  display: flex; align-items: center; gap: 1rem; background: #fff;
  border: 1px solid var(--line); border-radius: 12px; padding: .9rem 1.1rem;
  margin-bottom: .7rem; transition: border-color .2s, transform .15s; box-shadow: var(--shadow);
}
.ba-row:hover { border-color: var(--gold); transform: translateX(4px); }
.ba-row .ba-num { font-family: var(--font-display); color: var(--gold); font-weight: 800; font-size: 1.1rem; width: 34px; flex: none; }
.ba-row .ba-name { flex: 1; font-weight: 600; color: var(--ink); }
.ba-row .ba-link { font-size: .8rem; color: var(--gold); font-weight: 700; }

/* ---------- quiz ---------- */
.quiz-card {
  max-width: 640px; margin: 0 auto; background: #fff;
  border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow-lg);
  padding: 1.8rem; position: relative; overflow: hidden;
}
.quiz-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px; background: linear-gradient(90deg, var(--gold), #b8922a, var(--gold)); }
.quiz-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.quiz-day { font-size: .75rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); background: #e9eef6; padding: .3rem .8rem; border-radius: 999px; }
.quiz-streak { font-size: .8rem; font-weight: 600; color: var(--gold); }
.quiz-question { font-family: var(--font-display); font-size: 1.3rem; color: var(--ink); margin-bottom: 1.2rem; line-height: 1.4; }
.quiz-options { display: grid; gap: .6rem; }
.quiz-opt {
  text-align: left; border: 1.5px solid var(--line); background: #fdfbf5;
  border-radius: 12px; padding: .8rem 1rem; font-size: .95rem; color: var(--text);
  transition: all .18s; display: flex; gap: .6rem; align-items: center;
}
.quiz-opt:hover { border-color: var(--gold); transform: translateX(4px); }
.quiz-opt .qopt-letter { font-weight: 800; color: var(--gold); flex: none; }
.quiz-opt.correct { border-color: var(--ok); background: #e9f6ee; color: var(--ok); font-weight: 600; }
.quiz-opt.wrong { border-color: var(--danger); background: #fbecea; color: var(--danger); }
.quiz-opt:disabled { cursor: default; }
.quiz-feedback {
  margin-top: 1rem; background: #faf7ee; border: 1px dashed #cfc29a;
  border-radius: 12px; padding: .9rem 1rem; font-size: .9rem; color: var(--text);
}
.quiz-feedback b { color: var(--ink); }
#quizNext { margin-top: 1rem; }

/* ---------- FAQ ---------- */
.faq-list { max-width: 760px; margin: 0 auto; }
.faq-item { background: #fff; border: 1px solid var(--line); border-radius: 14px; margin-bottom: .8rem; overflow: hidden; box-shadow: var(--shadow); transition: border-color .2s; }
.faq-item.open { border-color: var(--gold); }
.faq-q {
  width: 100%; text-align: left; background: none; border: 0;
  padding: 1.05rem 1.2rem; font-size: 1rem; font-weight: 600; color: var(--ink);
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
}
.faq-q .faq-arrow { transition: transform .25s; color: var(--gold); font-size: 1.1rem; }
.faq-item.open .faq-arrow { transform: rotate(180deg); }
.faq-a { max-height: 0; overflow: hidden; transition: max-height .3s ease; }
.faq-a p { padding: 0 1.2rem 1.1rem; font-size: .92rem; color: var(--muted); }

/* ---------- contact ---------- */
.contact-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 2rem; align-items: start; }
.contact-form { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.6rem; box-shadow: var(--shadow); }
.contact-info { display: grid; gap: 1rem; }
.ci-block { display: flex; gap: 1rem; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 1.1rem 1.2rem; box-shadow: var(--shadow); transition: transform .2s; }
.ci-block:hover { transform: translateY(-3px); }
.ci-ic { font-size: 1.6rem; flex: none; }
.ci-block b { color: var(--ink); display: block; }
.ci-block p { font-size: .86rem; color: var(--muted); }

/* ---------- footer ---------- */
.footer { background: var(--ink); color: #b6c3d6; padding: 2.4rem 1.25rem; margin-top: 1rem; }
.footer-inner { max-width: 1220px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; }
.footer-brand { display: flex; align-items: center; gap: .8rem; }
.footer-note { font-size: .82rem; line-height: 1.7; text-align: right; }

/* ---------- back to top ---------- */
.back-top {
  position: fixed; right: 1.3rem; bottom: 1.3rem; z-index: 90;
  width: 46px; height: 46px; border-radius: 50%; border: 0;
  background: linear-gradient(140deg, var(--gold), #b8922a); color: #1a1404;
  font-size: 1.2rem; font-weight: 800; box-shadow: var(--shadow-lg);
  opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s;
}
.back-top.show { opacity: 1; pointer-events: auto; }
.back-top:hover { transform: translateY(-3px); }

/* ---------- modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 150;
  background: rgba(10,18,32,.62); backdrop-filter: blur(3px);
  display: grid; place-items: center; padding: 1.2rem;
}
.modal {
  background: #fff; border-radius: 18px; width: min(680px, 100%);
  max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-lg);
  animation: pop .22s ease;
}
@keyframes pop { from { transform: translateY(14px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem;
  padding: 1.4rem 1.5rem 1rem; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: #fff; z-index: 2; border-radius: 18px 18px 0 0;
}
.modal-head h3 { font-family: var(--font-display); color: var(--ink); font-size: 1.3rem; display: flex; align-items: center; gap: .6rem; }
.modal-head h3 svg { width: 24px; height: 24px; color: var(--gold); }
.modal-close { background: none; border: 0; width: 34px; height: 34px; flex: none; border-radius: 9px; color: var(--muted); font-size: 1.3rem; line-height: 1; transition: background .2s, color .2s; }
.modal-close:hover { background: #f2ede0; color: var(--danger); }
.modal-body { padding: 1.4rem 1.5rem 1.6rem; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; }
.result-box {
  background: #faf7ee; border: 1px dashed #cfc29a; border-radius: 12px;
  padding: 1rem 1.1rem; margin-top: 1.1rem; white-space: pre-wrap;
  font-size: .9rem; color: var(--text); line-height: 1.65;
}
.result-box.big { font-size: 1.05rem; }
.result-row { display: flex; justify-content: space-between; gap: 1rem; padding: .45rem 0; border-bottom: 1px dashed #e2dbc4; }
.result-row:last-child { border-bottom: 0; }
.result-row .lbl { color: var(--muted); }
.result-row .val { font-weight: 700; color: var(--ink); }
.result-note { font-size: .78rem; color: var(--muted); margin-top: .6rem; }
.toolbar { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: 1rem; }

.check-item { display: flex; align-items: flex-start; gap: .7rem; padding: .55rem .2rem; border-bottom: 1px dashed var(--line); font-size: .92rem; cursor: pointer; }
.check-item input { margin-top: .28rem; accent-color: var(--gold); width: 16px; height: 16px; flex: none; }
.check-item.done span { text-decoration: line-through; color: var(--muted); }
.progress-track { background: #efe9d8; border-radius: 999px; height: 10px; overflow: hidden; margin-top: 1rem; }
.progress-fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--gold), #b8922a); transition: width .3s; }

.lookup-list { display: flex; flex-direction: column; gap: .5rem; margin-top: .8rem; max-height: 340px; overflow-y: auto; }
.lookup-item { background: #fdfbf5; border: 1px solid var(--line); border-radius: 10px; padding: .6rem .8rem; transition: border-color .2s; }
.lookup-item:hover { border-color: var(--gold); }
.lookup-item b { color: var(--ink); }
.lookup-item .code { color: var(--gold); font-weight: 700; }

/* tracker */
.task-input { display: flex; gap: .6rem; margin-bottom: 1rem; }
.task-input input { flex: 1; padding: .65rem .8rem; border: 1px solid var(--line); border-radius: 10px; outline: none; }
.task-input input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(212,175,55,.18); }
.task-list { display: grid; gap: .5rem; margin-top: .8rem; }
.task-item { display: flex; align-items: center; gap: .7rem; background: #fdfbf5; border: 1px solid var(--line); border-radius: 10px; padding: .6rem .8rem; }
.task-item .t-label { flex: 1; font-size: .9rem; color: var(--text); }
.task-item.done .t-label { text-decoration: line-through; color: var(--muted); }
.task-item .t-del { background: none; border: 0; color: var(--muted); font-size: 1rem; }
.task-item .t-del:hover { color: var(--danger); }
.task-tag { font-size: .68rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: .15rem .5rem; border-radius: 999px; }
.task-tag.urgent { background: #fbecea; color: var(--danger); }
.task-tag.normal { background: #e9eef6; color: var(--ink-3); }

/* word counter */
.wc-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: .7rem; margin-top: .9rem; }
.wc-stat { background: #faf7ee; border: 1px dashed #cfc29a; border-radius: 12px; padding: .8rem .5rem; text-align: center; }
.wc-stat span { display: block; font-family: var(--font-display); font-size: 1.4rem; color: var(--gold); font-weight: 700; }
.wc-stat label { font-size: .7rem; color: var(--muted); }

/* ---------- toast ---------- */
.toast {
  position: fixed; bottom: 1.4rem; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: .75rem 1.3rem; border-radius: 12px;
  font-size: .9rem; z-index: 250; box-shadow: var(--shadow-lg);
  border-left: 4px solid var(--gold); max-width: 90vw;
  animation: toastIn .25s ease;
}
.toast.err { border-left-color: var(--danger); }
@keyframes toastIn { from { transform: translate(-50%, 12px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .jud-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .stats-hero { grid-template-columns: repeat(2, 1fr); }
  .hero-scales, .hero-feather { display: none; }
}
@media (max-width: 720px) {
  .nav-links {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; gap: 0; background: var(--ink-2);
    border-bottom: 1px solid rgba(212,175,55,.3);
    display: none; padding: .6rem 1.25rem;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: .75rem 0; border-bottom: 1px solid rgba(255,255,255,.06); }
  .nav-cta { margin-top: .5rem; text-align: center; }
  .nav-burger { display: block; }
  .hero-inner { padding: 3rem 1.1rem 3.4rem; }
  .form-row { grid-template-columns: 1fr; }
  .wc-stats { grid-template-columns: repeat(2, 1fr); }
  .footer-note { text-align: left; }
}

/* ---------- language toggle ---------- */
.lang-toggle {
  background: transparent; border: 1.5px solid rgba(212,175,55,.5); color: var(--gold-soft);
  font-size: .82rem; font-weight: 700; padding: .42rem .95rem; border-radius: 999px;
  transition: all .2s; letter-spacing: .04em; flex: none;
}
.lang-toggle:hover { background: rgba(212,175,55,.15); color: #fff; transform: translateY(-1px); }
@media (max-width: 720px) {
  .lang-toggle { margin: .4rem 0 0 .6rem; align-self: flex-start; }
}
