:root {
  --bg: #09080d;
  --bg-2: #120f18;
  --felt: #0e3a30;
  --gold: #e8c872;
  --gold-2: #f7e7b4;
  --crimson: #c43b4a;
  --ink: #f7f2e8;
  --muted: #b7ad9c;
  --card: #16131d;
  --line: rgba(232, 200, 114, 0.32);
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  --radius: 18px;
  --max: 1120px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background:
    radial-gradient(1200px 500px at 80% -10%, rgba(196, 59, 74, 0.22), transparent 55%),
    radial-gradient(900px 420px at -10% 20%, rgba(232, 200, 114, 0.12), transparent 50%),
    var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", system-ui, sans-serif;
  line-height: 1.65;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--gold-2); }

a:hover { color: #fff; }

.skip {
  position: absolute;
  left: 8px;
  top: -40px;
  background: #000;
  color: #fff;
  padding: 8px 12px;
  z-index: 50;
}

.skip:focus { top: 8px; }

.wrap {
  width: min(var(--max), calc(100% - 32px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)));
  margin: 0 auto;
}

.site-header {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 30;
  padding-top: env(safe-area-inset-top, 0px);
  background: rgba(9, 8, 13, 0.94);
  border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  min-height: 64px;
  gap: 8px 12px;
  padding: 8px 0;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--ink);
  text-decoration: none;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.logo img {
  width: auto;
  height: 48px;
  max-width: min(210px, 62vw);
}

.app-icon {
  width: 120px;
  height: 120px;
  border-radius: 28px;
  margin: 8px 0 4px;
}

.logo small {
  display: block;
  font-weight: 600;
  letter-spacing: 0.16em;
  font-size: 0.62rem;
  color: var(--gold);
}

.nav-toggle {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  margin-left: auto;
  padding: 0;
  border: 1px solid var(--line);
  background: #120f18;
  color: var(--gold);
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  -webkit-appearance: none;
  appearance: none;
  touch-action: manipulation;
}

.nav-toggle-bars,
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  position: relative;
}

.nav-toggle-bars::before,
.nav-toggle-bars::after {
  content: "";
  position: absolute;
  left: 0;
}

.nav-toggle-bars::before { top: -6px; }
.nav-toggle-bars::after { top: 6px; }

.nav-toggle[aria-expanded="true"] .nav-toggle-bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::before { top: 0; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::after { top: 0; transform: rotate(-45deg); }

.nav {
  display: none;
  flex: 1 1 100%;
  width: 100%;
  order: 3;
  padding: 4px 0 10px;
}

.nav.open { display: block; }

.nav a {
  display: flex;
  align-items: center;
  min-height: 44px;
  text-decoration: none;
  color: var(--ink);
  padding: 10px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  touch-action: manipulation;
}

.nav a[aria-current="page"] { color: var(--gold); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  border: 0;
  cursor: pointer;
}

.btn-gold {
  background: linear-gradient(180deg, #f7e7b4, #c9a24d);
  color: #1a1408;
}

.btn-ghost {
  border: 1px solid var(--line);
  color: var(--gold-2);
  background: transparent;
}

.hero { padding: 28px 0 8px; }

.kicker {
  color: var(--gold);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.75rem;
  font-weight: 700;
  margin: 0 0 8px;
}

h1, h2, h3, h4 {
  font-family: Palatino, "Palatino Linotype", "Times New Roman", serif;
  line-height: 1.2;
  font-weight: 700;
}

h1 { font-size: clamp(2rem, 7vw, 3.5rem); margin: 0 0 12px; }

h2 { font-size: clamp(1.5rem, 4vw, 2.15rem); margin: 0 0 12px; }

h3 { font-size: 1.25rem; margin: 0 0 8px; }

.lede { font-size: 1.05rem; color: var(--muted); margin-top: 0; }

.hero-grid, .split, .cards, .post-grid, .contact-grid {
  display: grid;
  gap: 16px;
}

.panel, .card, .post, .faq details, .author, .notice {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.panel, .card, .post, .author, .notice { padding: 18px; }

.felt {
  background:
    radial-gradient(circle at 20% 20%, rgba(232, 200, 114, 0.16), transparent 40%),
    var(--felt);
}

.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 18px 0 28px; }

.stat {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.2);
}

.stat b { display: block; color: var(--gold-2); font-size: 1.1rem; }

.stat span { color: var(--muted); font-size: 0.85rem; }

section { padding: 28px 0; }

.crumbs { color: var(--muted); font-size: 0.9rem; margin: 0 0 12px; }

.crumbs a { color: var(--gold); text-decoration: none; }

ul.clean, ol.clean { padding-left: 18px; }

.meta { color: var(--muted); font-size: 0.92rem; }

.faq details { padding: 4px 16px; margin-bottom: 10px; }

.faq summary {
  cursor: pointer;
  min-height: 48px;
  display: flex;
  align-items: center;
  font-weight: 700;
}

.faq details p { margin-top: 0; color: var(--muted); }

form { display: grid; gap: 12px; }

label { font-weight: 700; display: grid; gap: 6px; }

input, textarea, select {
  width: 100%;
  min-height: 48px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #0c0b10;
  color: var(--ink);
  padding: 10px 12px;
  font: inherit;
  font-size: 16px;
  -webkit-appearance: none;
  appearance: none;
}

textarea { min-height: 140px; }

.form-note { min-height: 1.4em; color: var(--gold-2); }

.site-footer {
  border-top: 1px solid var(--line);
  padding: 28px 0 calc(40px + env(safe-area-inset-bottom, 0px));
  color: var(--muted);
}

.foot-grid { display: grid; gap: 18px; }

.site-footer a { text-decoration: none; }

.site-footer ul { list-style: none; margin: 0; padding: 0; }

.site-footer li { margin: 6px 0; }

.legal { font-size: 0.85rem; }

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

th, td {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  text-align: left;
  padding: 10px 8px;
  vertical-align: top;
}

.tag {
  display: inline-block;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 8px;
  color: var(--gold);
  font-size: 0.75rem;
}

@media (max-width: 799px) {
  .stats { grid-template-columns: 1fr; }
  .btn { width: 100%; }
  .actions { flex-direction: column; }
}

@media (min-width: 800px) {
  .bar { min-height: 84px; flex-wrap: nowrap; }

  .logo img { height: 64px; max-width: none; }

  .nav-toggle { display: none; }

  .nav,
  .nav.open {
    display: flex;
    flex: 0 1 auto;
    width: auto;
    order: 0;
    align-items: center;
    gap: 16px;
    padding: 0;
  }

  .nav a,
  .nav.open a { border: 0; padding: 8px 0; }

  .hero-grid, .split, .contact-grid { grid-template-columns: 1.2fr 0.8fr; align-items: center; }

  .cards, .post-grid { grid-template-columns: repeat(3, 1fr); }

  .foot-grid { grid-template-columns: 1.4fr 1fr 1fr 1fr; }
}

@media (min-width: 1100px) {
  .wrap { width: min(var(--max), calc(100% - 48px)); }
}
