:root {
  --bg: #ffffff;
  --surface: #fff5ec;
  --surface-2: #fbeee3;
  --card: #ffffff;
  --ink: #2a1f1a;
  --muted: #7d6c62;
  --line: #eee1d6;
  --primary: #e4572e;
  --primary-dark: #c4451f;
  --primary-soft: #fdeae2;
  --primary-ink: #ffffff;
  --green: #2e8b57;
  --green-soft: #e3f3ea;
  --gold: #f2a93b;
  --error: #c62828;
  --danger-soft: #fdecea;
  --off: #f1ebe6;
  --shadow: 0 2px 6px rgba(80, 40, 20, 0.06), 0 14px 32px -16px rgba(80, 40, 20, 0.25);
  --shadow-lg: 0 8px 20px rgba(80, 40, 20, 0.08), 0 30px 60px -24px rgba(80, 40, 20, 0.35);
  color-scheme: light;
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius: 0.875rem;
  --radius-lg: 1.5rem;
  --max: 76rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);
}
:root[data-theme="dark"] {
  --bg: #1a1513;
  --surface: #221b18;
  --surface-2: #2a211d;
  --card: #241d1a;
  --ink: #f7f0ea;
  --muted: #b7a79c;
  --line: #3a302b;
  --primary: #ff7a50;
  --primary-dark: #ff8f6b;
  --primary-soft: #3d2620;
  --primary-ink: #1a1513;
  --green: #5fcf8a;
  --green-soft: #1e3328;
  --gold: #f6bb55;
  --error: #ff8a80;
  --danger-soft: #3d2222;
  --off: #2f2723;
  --shadow: 0 2px 6px rgba(0, 0, 0, 0.3), 0 14px 32px -16px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 8px 20px rgba(0, 0, 0, 0.35), 0 30px 60px -24px rgba(0, 0, 0, 0.7);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { font-size: clamp(15px, 10px + 0.45vw, 19px); -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 1rem; line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--primary-soft); outline-offset: 0; box-shadow: 0 0 0 1px var(--primary); }
[hidden] { display: none !important; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.serif { font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.muted { color: var(--muted); }

.leader { display: flex; align-items: baseline; gap: 0.6rem; min-width: 0; }
.leader > span:first-child { flex: 0 1 auto; min-width: 0; }
.leader::after { content: ""; flex: 1 1 1rem; order: 1; border-bottom: 1px dotted var(--line); transform: translateY(-0.3em); min-width: 1rem; }
.leader > span:last-child { order: 2; flex: 0 0 auto; white-space: nowrap; }

header.top { position: sticky; top: 0; z-index: 20; background: var(--bg); border-bottom: 1px solid var(--line); }
.nav { display: flex; align-items: center; justify-content: space-between; height: 4.25rem; gap: 1.25rem; }
.logo { display: inline-flex; align-items: center; gap: 0.5rem; font-size: 1.55rem; font-weight: 800; letter-spacing: -0.03em; text-decoration: none; color: var(--ink); }
.logo::before { content: ""; width: 1.6rem; height: 1.6rem; border-radius: 0.5rem; background: var(--primary); mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 2v8a3 3 0 0 0 2 2.8V22h2V12.8A3 3 0 0 0 13 10V2h-2v7h-1V2H8v7H7zm10 0c-1.7 0-3 2-3 5v6h2v9h2V2z' fill='%23000'/%3E%3C/svg%3E") center / contain no-repeat; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 2v8a3 3 0 0 0 2 2.8V22h2V12.8A3 3 0 0 0 13 10V2h-2v7h-1V2H8v7H7zm10 0c-1.7 0-3 2-3 5v6h2v9h2V2z' fill='%23000'/%3E%3C/svg%3E") center / contain no-repeat; }
.nav-right { display: flex; align-items: center; gap: 1.25rem; }
.nav-links { display: flex; gap: 1.25rem; }
.nav-links a { text-decoration: none; font-weight: 600; font-size: 0.95rem; padding: 0.45rem 0.1rem; color: var(--muted); border-bottom: 2px solid transparent; transition: color 0.15s; }
.nav-links a:hover { color: var(--ink); }
.nav-links a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--primary); }
.lang { display: flex; background: var(--off); border-radius: 999px; padding: 0.2rem; }
.lang button { height: 1.8rem; padding: 0 0.65rem; border: 0; border-radius: 999px; background: transparent; font-size: 0.75rem; font-weight: 700; color: var(--muted); transition: background 0.15s, color 0.15s; }
.lang button:hover { color: var(--ink); }
.lang button[aria-pressed="true"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,0.12); }
footer { background: var(--surface); margin-top: 6rem; padding: 3rem 0; font-size: 0.9rem; color: var(--muted); }
main > *:last-child { margin-bottom: 4rem; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; height: 3rem; padding: 0 1.4rem; border: 1px solid var(--primary); border-radius: 999px; background: var(--primary); color: var(--primary-ink); font-weight: 700; text-decoration: none; white-space: nowrap; transition: background 0.15s, border-color 0.15s, transform 0.15s, box-shadow 0.15s; }
.btn:hover { background: var(--primary-dark); border-color: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 8px 20px -10px var(--primary); }
.btn:active { transform: none; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn.secondary { background: var(--card); color: var(--ink); border-color: var(--line); }
.btn.secondary:hover { background: var(--surface); border-color: var(--ink); box-shadow: none; }
.btn.danger { background: transparent; color: var(--error); border-color: var(--error); }
.btn.danger:hover { background: var(--danger-soft); box-shadow: none; }
.btn.small { height: 2.25rem; padding: 0 0.9rem; font-size: 0.85rem; }
.btn.wide { width: 100%; height: 3.25rem; }
.btn.big { height: 3.6rem; padding: 0 2rem; font-size: 1.05rem; }

.field { margin-bottom: 1rem; }
.field label { display: block; font-size: 0.85rem; font-weight: 700; margin-bottom: 0.4rem; }
.field input, .field select, .field textarea { width: 100%; height: 3rem; padding: 0 1rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); color: var(--ink); transition: border-color 0.15s, box-shadow 0.15s; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.field textarea { height: auto; min-height: 6rem; padding: 0.7rem 1rem; resize: vertical; }
.field input[aria-invalid="true"] { border-color: var(--error); }
.field .err { font-size: 0.85rem; color: var(--error); margin-top: 0.375rem; }
.field .hint { font-size: 0.85rem; color: var(--muted); margin-top: 0.375rem; }
.error { color: var(--error); font-size: 0.9rem; }
.ok { color: var(--green); font-size: 0.9rem; }

dl { margin: 0; display: grid; grid-template-columns: 8.75rem 1fr; row-gap: 0.75rem; column-gap: 1.25rem; }
dt { color: var(--muted); }
dd { margin: 0; }

.theme { width: 2.2rem; height: 2.2rem; border: 1px solid var(--line); border-radius: 999px; background: var(--card); display: inline-flex; align-items: center; justify-content: center; padding: 0; color: var(--muted); flex-shrink: 0; }
.theme:hover { color: var(--ink); border-color: var(--ink); }
.theme svg { width: 1rem; height: 1rem; }
.theme .moon { display: none; }
:root[data-theme="dark"] .theme .sun { display: none; }
:root[data-theme="dark"] .theme .moon { display: block; }

.lb { position: fixed; inset: 0; z-index: 50; background: rgba(20, 10, 5, 0.92); display: grid; place-items: center; padding: 1rem; }
.lb img { max-width: 100%; max-height: 90vh; border-radius: var(--radius); }
.lb button { position: absolute; background: rgba(255,255,255,0.14); color: #fff; border: 0; border-radius: 999px; width: 2.75rem; height: 2.75rem; font-size: 1.75rem; line-height: 1; display: grid; place-items: center; }
.lb button:hover { background: rgba(255,255,255,0.28); }
.lb-close { top: 1rem; right: 1rem; }
.lb-prev { left: 1rem; top: 50%; transform: translateY(-50%); }
.lb-next { right: 1rem; top: 50%; transform: translateY(-50%); }
.lb-count { position: absolute; bottom: 1rem; left: 50%; transform: translateX(-50%); color: rgba(255,255,255,0.7); font-size: 0.875rem; }

@media (max-width: 600px) {
  .nav { height: auto; flex-wrap: wrap; padding: 0.75rem 0 0.25rem; gap: 0.5rem 0.75rem; }
  .nav-right { display: contents; }
  .nav .lang { order: 1; margin-left: auto; }
  .nav .theme { order: 2; }
  .nav-links { order: 3; width: 100%; gap: 1.25rem; overflow-x: auto; scrollbar-width: none; }
  .nav-links::-webkit-scrollbar { display: none; }
  .nav-links a { font-size: 0.9rem; white-space: nowrap; }
  input, select, textarea { font-size: 16px; }
  dl { grid-template-columns: 1fr; row-gap: 0.125rem; }
  dt { margin-top: 0.625rem; }
}
