:root {
  --bg: #f4f8ff;
  --bg-soft: #ecf3ff;
  --surface: #ffffff;
  --surface-2: #f8fbff;
  --text: #0f2445;
  --muted: #4b638a;
  --border: #cfe0ff;
  --brand: #0b63f3;
  --brand-2: #2e89ff;
  --brand-ink: #ffffff;
  --shadow: 0 16px 42px rgba(9, 53, 133, 0.16);
}

html[data-theme="dark"] {
  --bg: #091225;
  --bg-soft: #0d1c37;
  --surface: #122546;
  --surface-2: #16305c;
  --text: #eaf2ff;
  --muted: #b4c7ea;
  --border: #2a4679;
  --brand: #59a2ff;
  --brand-2: #83bbff;
  --brand-ink: #061731;
  --shadow: 0 20px 46px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Sora", "Segoe UI", sans-serif;
  color: var(--text);
  background: radial-gradient(circle at 10% 15%, rgba(81,148,255,0.16), transparent 34%),
              radial-gradient(circle at 88% 5%, rgba(11,99,243,0.14), transparent 28%),
              linear-gradient(160deg, var(--bg), var(--bg-soft));
  min-height: 100vh;
}

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

.site-wrap { width: min(1160px, 92vw); margin: 0 auto; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(14px);
  background: color-mix(in oklab, var(--bg) 76%, transparent);
  border-bottom: 1px solid color-mix(in oklab, var(--border) 70%, transparent);
}

.header-inner {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
}

.brand img {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.brand-title {
  font-family: "Unbounded", "Segoe UI", sans-serif;
  font-size: 1rem;
  line-height: 1.1;
}

.brand-sub { font-size: 0.78rem; color: var(--muted); margin-top: 2px; }

.nav-links { display: flex; align-items: center; gap: 14px; }
.nav-links a {
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 10px;
}
.nav-links a:hover,
.nav-links a.active { background: color-mix(in oklab, var(--brand) 16%, transparent); text-decoration: none; }

.controls { display: flex; align-items: center; gap: 8px; }
.controls { margin-left: auto; }

.theme-toggle {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  padding: 5px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.theme-toggle .pill {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.theme-toggle .pill.active {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: var(--brand-ink);
}

.menu-btn {
  display: none;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 10px;
  width: 42px;
  height: 42px;
  cursor: pointer;
}

.mobile-drawer {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
}
.mobile-drawer.open { display: block; }
.drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(1, 9, 20, 0.55);
}
.drawer-panel {
  position: absolute;
  right: 0;
  top: 0;
  height: 100%;
  width: min(310px, 86vw);
  background: var(--surface);
  border-left: 1px solid var(--border);
  padding: 20px;
  display: grid;
  align-content: start;
  gap: 12px;
}
.drawer-panel a {
  color: var(--text);
  font-weight: 600;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
}

main { padding: 30px 0 56px; }
.hero {
  background: linear-gradient(160deg, color-mix(in oklab, var(--brand) 8%, var(--surface)), var(--surface));
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: clamp(34px, 5vw, 58px);
}
.hero h1 {
  margin: 0 0 12px;
  font-family: "Unbounded", "Segoe UI", sans-serif;
  line-height: 1.15;
  font-size: clamp(1.7rem, 4.4vw, 2.9rem);
}
.hero p { margin: 0; color: var(--muted); max-width: 760px; line-height: 1.7; }

.section-title { margin: 38px 0 14px; font-size: 1.28rem; font-family: "Unbounded", "Segoe UI", sans-serif; }

.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card-body { padding: 18px; }
.app-top { display: flex; align-items: center; gap: 12px; }
.app-top img { width: 58px; height: 58px; border-radius: 16px; object-fit: cover; background: var(--surface-2); border: 1px solid var(--border); }
.app-top h3 { margin: 0; font-size: 1.04rem; line-height: 1.25; }
.app-top p { margin: 5px 0 0; color: var(--muted); font-size: 0.95rem; }

.tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 16px; }
.tags span {
  display: inline-block;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: .01em;
  color: var(--brand);
  border: 1px solid color-mix(in oklab, var(--brand) 28%, var(--border));
  padding: 6px 8px;
  border-radius: 999px;
  background: color-mix(in oklab, var(--brand) 10%, transparent);
}

.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.btn {
  display: inline-block;
  border-radius: 10px;
  padding: 10px 14px;
  font-weight: 700;
  font-size: 0.88rem;
  border: 1px solid transparent;
}
.btn.primary { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: var(--brand-ink); }
.btn.ghost { border-color: var(--border); color: var(--text); background: var(--surface-2); }

.content-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: clamp(16px, 2.7vw, 28px);
}
.content-panel h1 { margin-top: 0; }
.content-panel h2 { margin-top: 28px; }
.content-panel p, .content-panel li { color: var(--muted); line-height: 1.75; }
.content-panel ul { padding-left: 22px; }

.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 36px;
  padding: 26px 0 40px;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.9rem;
}
.footer-links { display: flex; gap: 12px; flex-wrap: wrap; }

@media (max-width: 1120px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 960px) {
  .grid { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  .menu-btn { display: inline-grid; place-items: center; }
}

@media (max-width: 600px) {
  .header-inner { min-height: 68px; }
  .brand-title { font-size: 0.9rem; }
  .brand-sub { font-size: 0.72rem; }
  .hero { border-radius: 18px; }
}
