:root {
  --bg-gradient: linear-gradient(135deg, #f5f7fa, #c3cfe2);
  --container-bg: #ffffff;
  --section-bg: rgba(255, 255, 255, 0.82);
  --text-color: #222;
  --muted-text: #596273;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  --button-bg: #222;
  --button-color: #fff;
  --toggle-bg: #ffffff;
  --toggle-color: #222;
  --toggle-border: rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] {
  --bg-gradient: linear-gradient(135deg, #1f2937, #111827);
  --container-bg: #1e293b;
  --section-bg: rgba(30, 41, 59, 0.86);
  --text-color: #f1f5f9;
  --muted-text: #cbd5e1;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  --button-bg: #f1f5f9;
  --button-color: #111827;
  --toggle-bg: #1e293b;
  --toggle-color: #f1f5f9;
  --toggle-border: rgba(255, 255, 255, 0.15);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: var(--bg-gradient);
  color: var(--text-color);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  gap: 24px;
  padding: 96px 24px 32px;
  line-height: 1.65;
  transition: background 0.3s ease, color 0.3s ease;
}

a {
  color: inherit;
}

.theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--toggle-border);
  background: var(--toggle-bg);
  color: var(--toggle-color);
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: background 0.3s ease, color 0.3s ease, transform 0.2s ease;
}

.theme-toggle:hover {
  transform: scale(1.08);
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 88px 14px 24px;
  background: color-mix(in srgb, var(--container-bg) 88%, transparent);
  border-bottom: 1px solid var(--toggle-border);
  backdrop-filter: blur(12px);
}

.site-logo {
  font-weight: 700;
  text-decoration: none;
}

.site-nav,
.site-footer nav {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.site-nav a,
.site-footer a {
  color: var(--muted-text);
  font-size: 14px;
  text-decoration: none;
}

.site-nav a:hover,
.site-footer a:hover {
  color: var(--text-color);
}

.page {
  width: min(960px, 100%);
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  align-items: center;
  gap: 28px;
}

.hero-copy {
  background: var(--section-bg);
  border: 1px solid var(--toggle-border);
  border-radius: 20px;
  padding: 36px;
  box-shadow: var(--shadow);
}

.hero-copy h1 {
  margin: 0 0 12px;
  font-size: 42px;
  line-height: 1.2;
}

.hero-copy p {
  margin: 0;
  color: var(--muted-text);
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-color);
}

.container {
  background: var(--container-bg);
  color: var(--text-color);
  padding: 40px;
  border-radius: 20px;
  box-shadow: var(--shadow);
  text-align: center;
  width: min(420px, 100%);
  transition: background 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}

.container h2 {
  margin-top: 0;
}

.set {
  margin-bottom: 15px;
}

.numbers {
  display: flex;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}

.ball {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
  font-size: 14px;
}

.yellow {
  background: #f6c343;
}

.blue {
  background: #4a90e2;
}

.red {
  background: #e94b4b;
}

.gray {
  background: #777;
}

.green {
  background: #45b36b;
}

button.generate-btn,
button.submit-btn {
  margin-top: 20px;
  border: none;
  background: var(--button-bg);
  color: var(--button-color);
  padding: 14px 24px;
  border-radius: 999px;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.3s ease, color 0.3s ease;
}

.contact-form {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--toggle-border);
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: left;
}

.contact-form h3 {
  margin: 0 0 4px;
  text-align: center;
}

.contact-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  font-weight: bold;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  border: 1px solid var(--toggle-border);
  border-radius: 10px;
  background: var(--container-bg);
  color: var(--text-color);
  padding: 10px 12px;
  font: inherit;
}

.contact-form textarea {
  min-height: 96px;
  resize: vertical;
}

    button.submit-btn {
      width: 100%;
      margin-top: 4px;
    }

.content-section,
.comments-section {
  width: 100%;
  background: var(--container-bg);
  color: var(--text-color);
  padding: 32px;
  border-radius: 20px;
  box-shadow: var(--shadow);
  transition: background 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}

.content-section h2,
.comments-section h2 {
  margin: 0 0 20px;
}

.content-section h1 {
  margin: 0 0 16px;
  font-size: 38px;
  line-height: 1.2;
}

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.section-heading h2 {
  margin: 0;
}

.section-heading a {
  color: var(--muted-text);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

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

.content-grid article {
  border: 1px solid var(--toggle-border);
  border-radius: 14px;
  padding: 18px;
}

.content-grid h3,
.content-grid p,
.text-columns p,
.content-section > p {
  margin-top: 0;
}

.content-grid p,
.text-columns p,
.content-section > p,
.faq-list p {
  color: var(--muted-text);
}

.text-columns {
  columns: 2;
  column-gap: 28px;
}

.faq-list {
  display: grid;
  gap: 12px;
}

.faq-list details {
  border: 1px solid var(--toggle-border);
  border-radius: 12px;
  padding: 14px 16px;
}

.faq-list summary {
  cursor: pointer;
  font-weight: 700;
}

.article-hero p:last-child {
  max-width: 760px;
  color: var(--muted-text);
}

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

.article-list.expanded {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.article-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 178px;
  padding: 18px;
  border: 1px solid var(--toggle-border);
  border-radius: 8px;
  text-decoration: none;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.article-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--text-color) 34%, transparent);
  background: color-mix(in srgb, var(--container-bg) 88%, var(--text-color) 4%);
}

.article-card span,
.article-meta {
  color: var(--muted-text);
  font-size: 13px;
}

.article-card strong {
  line-height: 1.35;
}

.article-card p {
  margin: 0;
  color: var(--muted-text);
  font-size: 14px;
}

.article-body {
  max-width: 760px;
}

.article-body h1 {
  margin: 4px 0 12px;
  font-size: 40px;
  line-height: 1.2;
}

.article-body h2 {
  margin: 34px 0 12px;
}

.article-body p,
.article-body li {
  color: var(--muted-text);
}

.article-body ul,
.article-body ol {
  padding-left: 22px;
}

.article-note {
  margin: 28px 0;
  padding: 18px;
  border-left: 4px solid var(--button-bg);
  background: color-mix(in srgb, var(--container-bg) 84%, var(--text-color) 6%);
}

.article-note p {
  margin: 0;
}

.article-nav {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--toggle-border);
}

.article-nav a {
  color: var(--muted-text);
  font-weight: 700;
  text-decoration: none;
}

.contact-section {
  padding: 0;
  overflow: hidden;
}

.contact-section .contact-form {
  margin: 0;
  padding: 32px;
  border-top: 0;
}

.contact-section .contact-form h2 {
  margin: 0 0 8px;
  text-align: center;
}

.site-footer {
  width: min(960px, 100%);
  display: flex;
  justify-content: space-between;
  gap: 20px;
  color: var(--muted-text);
  font-size: 14px;
}

.site-footer p {
  margin: 0;
}

@media (max-width: 760px) {
  body {
    padding: 120px 16px 28px;
  }

  .site-header {
    align-items: flex-start;
    flex-direction: column;
    padding: 14px 76px 14px 16px;
  }

  .hero {
    grid-template-columns: 1fr;
  }

  .hero-copy,
  .container,
  .content-section,
  .comments-section {
    padding: 24px;
    border-radius: 16px;
  }

  .hero-copy h1 {
    font-size: 32px;
  }

  .content-grid {
    grid-template-columns: 1fr;
  }

  .article-list,
  .article-list.expanded {
    grid-template-columns: 1fr;
  }

  .content-section h1,
  .article-body h1 {
    font-size: 30px;
  }

  .text-columns {
    columns: 1;
  }

  .site-footer {
    flex-direction: column;
  }
}
