:root {
  --bg: #fbf8f5;
  --surface: #ffffff;
  --text: #1f1416;
  --muted: #6b5d60;
  --line: #ece4de;
  --accent: #d97a2e;
  --accent-ink: #a8541a;
  --wine: #140c0e;
  --todo-bg: #fff3c4;
  --todo-text: #6b4e00;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #140c0e;
    --surface: #1e1517;
    --text: #f4ece8;
    --muted: #b3a5a1;
    --line: #33272a;
    --accent: #e8914b;
    --accent-ink: #f0a76a;
    --todo-bg: #4a3a0a;
    --todo-text: #ffe28a;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Noto Sans Georgian", "Noto Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.7;
}

a { color: var(--accent-ink); }

.wrap { max-width: 860px; margin: 0 auto; padding: 0 16px; }

/* Header */
header.site {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 10;
}
header.site .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  flex-wrap: wrap;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  font-size: 20px;
}
.brand img { width: 36px; height: 36px; border-radius: 9px; }
nav.main { display: flex; gap: 4px 18px; flex-wrap: wrap; font-size: 14px; }
nav.main a { color: var(--muted); text-decoration: none; }
nav.main a:hover, nav.main a[aria-current="page"] { color: var(--accent-ink); }

/* Content */
main { padding: 40px 0 64px; }
h1 { font-family: "Noto Serif Georgian", "Noto Serif", Georgia, serif; font-size: 32px; line-height: 1.3; margin: 0 0 8px; }
h2 { font-size: 20px; margin: 36px 0 8px; }
h3 { font-size: 17px; margin: 24px 0 6px; }
.updated { color: var(--muted); font-size: 14px; margin-bottom: 28px; }
p, li { color: var(--text); }
ul, ol { padding-left: 22px; }
li { margin: 4px 0; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px 22px;
  margin: 20px 0;
}

table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 15px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; width: 38%; }

/* Hero */
.hero { padding: 64px 0 24px; text-align: center; }
.hero img { width: 112px; height: 112px; border-radius: 26px; box-shadow: 0 12px 32px rgba(20, 12, 14, .25); }
.hero h1 { font-size: 40px; margin-top: 24px; }
.hero p { color: var(--muted); font-size: 18px; max-width: 560px; margin: 8px auto 0; }
.button {
  display: inline-block;
  margin-top: 28px;
  padding: 12px 24px;
  border-radius: 999px;
  background: var(--wine);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
}
@media (prefers-color-scheme: dark) { .button { background: var(--accent); color: var(--wine); } }

.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin: 40px 0; }
.features .card { margin: 0; }
.features h3 { margin-top: 0; }
.features p { margin: 0; color: var(--muted); font-size: 15px; }

.age {
  display: inline-block;
  border: 2px solid var(--accent);
  color: var(--accent-ink);
  border-radius: 999px;
  padding: 0 10px;
  font-weight: 700;
  font-size: 14px;
}

/* Fill-in markers: remove once the real data is written in */
.todo {
  background: var(--todo-bg);
  color: var(--todo-text);
  border-radius: 4px;
  padding: 0 4px;
  font-weight: 600;
}

/* Footer */
footer.site { border-top: 1px solid var(--line); background: var(--surface); padding: 28px 0 36px; font-size: 14px; color: var(--muted); }
footer.site nav { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-bottom: 14px; }
footer.site nav a { color: var(--muted); }
footer.site p { margin: 4px 0; color: var(--muted); }
.cards { display: flex; gap: 8px; margin-top: 12px; align-items: center; }
.cards span { border: 1px solid var(--line); border-radius: 6px; padding: 2px 8px; font-weight: 700; font-size: 12px; letter-spacing: .5px; }

/* Language menu */
details.lang { position: relative; }
details.lang summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  user-select: none;
}
details.lang summary::-webkit-details-marker { display: none; }
details.lang summary::after {
  content: "";
  width: 6px; height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  margin-left: 2px;
  opacity: .6;
}
details.lang[open] summary::after { transform: translateY(1px) rotate(-135deg); }
details.lang summary svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; opacity: .7; }
details.lang .menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 170px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 6px;
  box-shadow: 0 12px 32px rgba(20, 12, 14, .18);
  z-index: 20;
}
details.lang .menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  font-size: 15px;
}
details.lang .menu a span { width: 24px; color: var(--muted); font-size: 12px; font-weight: 700; }
details.lang .menu a:hover { background: var(--bg); }
details.lang .menu a[aria-current="true"] { background: var(--line); font-weight: 600; }
header.site .wrap { max-width: 1160px; flex-wrap: nowrap; }
header.site nav.main { margin-left: auto; flex-wrap: nowrap; white-space: nowrap; }
@media (max-width: 900px) {
  header.site .wrap { flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; }
  header.site details.lang { margin-left: auto; }
  header.site nav.main { order: 3; width: 100%; margin-left: 0; flex-wrap: wrap; white-space: normal; }
}
