:root {
  --bg: #f5f5f5;
  --surface: #ffffff;
  --border: #e6e6e6;
  --text: #1f2328;
  --muted: #777777;
  --accent: #2f6feb;
  --accent-contrast: #ffffff;
  --radius: 12px;
  --maxw: 960px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1115;
    --surface: #171a21;
    --border: #262b33;
    --text: #e7e9ee;
    --muted: #9aa1ab;
    --accent: #5b8cff;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.5;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0;
}
.brand { font-size: 18px; font-weight: 700; letter-spacing: 0.3px; color: var(--text); }
.topbar-nav { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.topbar-nav .btn { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: 0.15s;
}
.btn:hover { border-color: var(--muted); text-decoration: none; }
.btn-primary { background: var(--accent); color: var(--accent-contrast); border-color: var(--accent); }
.btn-primary:hover { opacity: 0.9; }
.btn-block { width: 100%; justify-content: center; }

main { flex: 1 0 auto; padding: 40px 0 64px; }

.hero { text-align: center; padding: 48px 0 40px; }
.hero .badge {
  display: inline-block;
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 12px;
  margin-bottom: 20px;
}
.hero h1 { margin: 0 0 12px; font-size: 44px; font-weight: 200; letter-spacing: 1px; }
.hero p { margin: 0 auto; max-width: 520px; color: var(--muted); font-size: 16px; }

.divider { width: 56px; height: 1px; background: var(--border); margin: 28px auto; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 32px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.card h3 { margin: 0 0 6px; font-size: 15px; font-weight: 600; }
.card p { margin: 0; color: var(--muted); font-size: 14px; }

.section { margin-top: 48px; }
.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 16px;
}
.section-title h2 { margin: 0; font-size: 20px; font-weight: 500; }
.section-title a { font-size: 14px; }

.news-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.news-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.news-item img { width: 100%; height: 150px; object-fit: cover; display: block; }
.news-item .body { padding: 16px; }
.news-item .cat { font-size: 12px; color: var(--muted); }
.news-item h3 { margin: 4px 0 0; font-size: 16px; font-weight: 600; }
.news-item h3 a { color: var(--text); }

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  max-width: 420px;
  margin: 0 auto;
}
.panel h2 { margin: 0 0 4px; font-size: 20px; font-weight: 500; }
.panel .hint { margin: 0 0 20px; color: var(--muted); font-size: 14px; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.field input {
  width: 100%;
  padding: 10px 12px;
  font-size: 15px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: none;
}
.field input:focus { border-color: var(--accent); }

.form-msg { font-size: 14px; margin-top: 12px; min-height: 18px; }
.form-msg.ok { color: #2fa84f; }
.form-msg.err { color: #e5484d; }

footer { padding: 24px 0; border-top: 1px solid var(--border); color: var(--muted); font-size: 13px; text-align: center; }

@media (max-width: 560px) {
  .hero h1 { font-size: 34px; }
}
