:root {
  --accent: #2575fc;
  --grad-start: #6a11cb;
  --grad-end: #2575fc;
  --bg-elev-1: rgba(255, 255, 255, 0.85);
  --bg-elev-2: rgba(255, 255, 255, 0.7);
  --text: #0b1220;
  --text-muted: #6b7280;
  --border: rgba(12, 18, 32, 0.08);
  --shadow: 0 10px 30px rgba(11, 18, 32, 0.08);
  --radius: 14px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, "Helvetica Neue", sans-serif;
  color: var(--text);
  background: linear-gradient(135deg, var(--grad-start), var(--grad-end)) fixed;
  min-height: 100%;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: saturate(140%) blur(6px);
  background: var(--bg-elev-2);
  border-bottom: 1px solid var(--border);
}

.site-header .brand {
  font-weight: 700;
  letter-spacing: 0.2px;
  color: var(--text);
}

.site-header,
.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
}

.site-nav a {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  margin-left: 16px;
  padding: 6px 10px;
  border-radius: 8px;
  transition: background-color 120ms ease, color 120ms ease;
}
.site-nav a:hover,
.site-nav a:focus-visible {
  background: rgba(11, 18, 32, 0.06);
  outline: none;
}

.site-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 20px 60px;
}

.hero {
  background: var(--bg-elev-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 22px;
  text-align: center;
  margin: 14px 0 26px;
}

.hero-title {
  margin: 0 0 12px;
  font-size: 28px;
  line-height: 1.2;
  letter-spacing: 0.2px;
}

.search-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  max-width: 680px;
  margin: 10px auto 6px;
}

.search-input {
  appearance: none;
  width: 100%;
  padding: 14px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  outline: none;
  font-size: 16px;
  transition: box-shadow 120ms ease, border-color 120ms ease, background-color 120ms ease;
  background: #fff;
}
.search-input:focus-visible {
  border-color: rgba(37, 117, 252, 0.55);
  box-shadow: 0 0 0 4px rgba(37, 117, 252, 0.18);
}

.search-button {
  padding: 12px 20px;
  border-radius: 999px;
  border: 0;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  transition: transform 80ms ease, box-shadow 120ms ease, filter 120ms ease;
  box-shadow: 0 6px 16px rgba(37, 117, 252, 0.35);
}
.search-button:hover,
.search-button:focus-visible {
  transform: translateY(-1px);
  filter: brightness(1.02);
}
.search-button:active {
  transform: translateY(0);
}

.subtle {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 13px;
}

.news-section {
  background: var(--bg-elev-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 18px 22px;
}

.news-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 4px 0 14px;
}
.news-header h2 {
  margin: 0;
  font-size: 18px;
  letter-spacing: 0.2px;
}

.news-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 14px;
}

@media (max-width: 1120px) {
  .news-grid { grid-template-columns: repeat(8, 1fr); }
}
@media (max-width: 860px) {
  .news-grid { grid-template-columns: repeat(6, 1fr); }
}
@media (max-width: 680px) {
  .news-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 420px) {
  .news-grid { grid-template-columns: 1fr; }
}

.card {
  grid-column: span 3;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 18px rgba(11, 18, 32, 0.06);
  transition: transform 90ms ease, box-shadow 120ms ease;
}
.card:hover,
.card:focus-within {
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(11, 18, 32, 0.1);
}

.card-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #f2f3f5;
}

.card-body {
  display: grid;
  gap: 8px;
  padding: 12px 12px 14px;
}
.card-title {
  margin: 0;
  font-size: 15px;
  line-height: 1.25;
}
.card-link {
  display: flex;
  flex-direction: column;
  height: 100%;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}
.card-link:hover .card-title,
.card-link:focus-visible .card-title {
  text-decoration: underline;
}

.loading {
  padding: 16px;
  color: var(--text-muted);
}

.news-error {
  padding: 12px 14px;
  margin-top: 8px;
  border-radius: 10px;
  border: 1px solid rgba(200, 30, 30, 0.25);
  background: rgba(200, 30, 30, 0.06);
  color: #8b1d1d;
}

.site-footer {
  color: var(--text);
  background: var(--bg-elev-2);
  border-top: 1px solid var(--border);
}

@media (prefers-reduced-motion: reduce) {
  .search-button { transition: none; }
  .card { transition: none; }
  .site-nav a { transition: none; }
}
