:root {
  color-scheme: dark;
  --bg: #0b1220;
  --surface: #111827;
  --surface-muted: #192334;
  --surface-strong: #1f2b40;
  --text: #f8fafc;
  --muted: #94a3b8;
  --primary: #60a5fa;
  --primary-soft: rgba(96, 165, 250, 0.16);
  --border: #263449;
  --shadow: 0 18px 35px rgba(0, 0, 0, 0.4);
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-muted: #f8fafc;
  --surface-strong: #eef2f7;
  --text: #111827;
  --muted: #6b7280;
  --primary: #2563eb;
  --primary-soft: rgba(37, 99, 235, 0.12);
  --border: #e5e7eb;
  --shadow: 0 18px 35px rgba(15, 23, 42, 0.08);
}

:root[data-theme="dark"] {
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

a {
  color: inherit;
}

header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.05);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.header-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.header-title {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.theme-toggle {
  border: 1px solid var(--border);
  background: var(--surface-muted);
  color: var(--text);
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  font-weight: 600;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
  background: var(--surface-strong);
  border-color: var(--primary);
  color: var(--primary);
}

.theme-toggle-icon {
  font-size: 1rem;
  line-height: 1;
}

.header-title h1 {
  margin: 0;
  font-size: 2.2rem;
}

.header-title p {
  margin: 0;
  color: var(--muted);
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

nav a {
  text-decoration: none;
  font-weight: 600;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

nav a:hover,
nav a:focus-visible {
  color: var(--primary);
  background: var(--primary-soft);
  border-color: rgba(37, 99, 235, 0.2);
}

nav a[aria-current="page"] {
  color: var(--primary);
  background: var(--primary-soft);
  border-color: rgba(37, 99, 235, 0.3);
}

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2.5rem 2rem 3rem;
}

.hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 2rem;
  align-items: center;
  margin-bottom: 2rem;
}

.hero-card {
  background: var(--surface);
  border-radius: 20px;
  padding: 2rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.hero-card h2 {
  margin-top: 0;
  font-size: 1.8rem;
}

.hero-card p {
  margin-bottom: 0;
  color: var(--muted);
}

.section-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.section-card {
  background: var(--surface);
  padding: 1.6rem;
  border-radius: 18px;
  border: 1px solid var(--border);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.06);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.section-card h3 {
  margin: 0;
  font-size: 1.25rem;
}

.section-card p {
  margin: 0;
  color: var(--muted);
}

.section-card a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}

.content-panel {
  background: var(--surface);
  border-radius: 20px;
  padding: 2rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.page-intro {
  margin-bottom: 2rem;
}

.page-intro h2 {
  margin: 0 0 0.5rem;
  font-size: 2rem;
}

.page-intro p {
  margin: 0;
  color: var(--muted);
}

.article-section {
  background: var(--surface);
  border-radius: 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.5rem;
  margin-bottom: 1.75rem;
}

.article-banner {
  width: 100%;
  height: 220px;
  overflow: hidden;
}

.article-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.article-content {
  padding: 0 2rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.article-content h3 {
  margin: 0;
  font-size: 1.5rem;
}

.article-excerpt,
.article-body p {
  margin: 0;
  color: var(--muted);
}

.article-body {
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}

.article-toggle {
  align-self: flex-start;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-muted);
  color: var(--text);
  padding: 0.6rem 1.2rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.article-toggle:hover,
.article-toggle:focus-visible {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-soft);
}

.article-section.is-expanded .article-toggle {
  background: var(--surface-strong);
}

.content-panel h2 {
  margin-top: 1em;
  font-size: 1.9rem;
}

.content-panel p {
  color: var(--muted);
}

.highlight-list {
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.75rem;
}

.highlight-list li {
  background: var(--surface-muted);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
}

.books-list {
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.book-row {
  display: flex;
  gap: 1.5rem;
  align-items: stretch;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
}

.book-row:nth-child(even) {
  flex-direction: row-reverse;
}

.book-photo {
  flex: 0 0 30%;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.book-photo img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid var(--border);
  object-fit: cover;
  background: var(--surface);
}

.book-review {
  flex: 1 1 70%;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.book-review h3 {
  margin: 0;
  font-size: 1.25rem;
}

.upload-field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-weight: 600;
}

.review-field {
  border-radius: 10px;
  border: 1px solid var(--border);
  padding: 0.75rem 0.9rem;
  background: var(--surface);
  font-weight: 500;
  line-height: 1.6;
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: flex-start;
  width: 100%;
  overflow: auto;
}

.upload-field input {
  border-radius: 10px;
  border: 1px solid var(--border);
  padding: 0.65rem 0.85rem;
  font: inherit;
  background: var(--surface);
}

.upload-field input:focus {
  outline: 2px solid rgba(37, 99, 235, 0.35);
  border-color: rgba(37, 99, 235, 0.4);
}

.connect-panel {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.connect-panel + .connect-panel {
  margin-top: 2rem;
}

.connect-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  align-items: start;
}

.connect-card {
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.connect-card h3 {
  margin: 0;
  font-size: 1.3rem;
}

.contact-form label {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-weight: 600;
  color: var(--text);
}

.contact-form input,
.contact-form textarea {
  border-radius: 10px;
  border: 1px solid var(--border);
  padding: 0.75rem 0.9rem;
  font: inherit;
  background: var(--surface);
}

.contact-form textarea {
  resize: none;
  min-height: 140px;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: 2px solid rgba(37, 99, 235, 0.35);
  border-color: rgba(37, 99, 235, 0.4);
}

.button-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.25rem;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 12px 20px rgba(37, 99, 235, 0.25);
}

.button-primary:hover,
.button-primary:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 16px 26px rgba(37, 99, 235, 0.28);
}

.connect-actions p {
  margin: 0;
  color: var(--muted);
}

.social-link {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--text);
}

.social-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-strong);
  color: var(--primary);
}

.social-icon svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

footer {
  text-align: center;
  padding: 2rem;
  color: var(--muted);
}

@media (max-width: 720px) {
  .header-inner {
    padding: 1.5rem;
  }

  main {
    padding: 2rem 1.5rem 2.5rem;
  }

  .book-row,
  .book-row:nth-child(even) {
    flex-direction: column;
  }

  .book-photo,
  .book-review {
    flex: 1 1 auto;
  }

  .article-content {
    padding: 0 1.5rem 1.75rem;
  }
}
