:root {
  color-scheme: dark;
  --bg: #030405;
  --text: #f2f4f0;
  --muted: rgba(242, 244, 240, 0.48);
  --line: rgba(242, 244, 240, 0.12);
  --line-strong: rgba(242, 244, 240, 0.28);
  --panel: rgba(8, 10, 11, 0.76);
  --green: #bdf8cf;
  --blue: #cdd8ff;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 48% 12%, rgba(242, 244, 240, 0.07), transparent 30rem),
    radial-gradient(circle at 16% 68%, rgba(125, 217, 165, 0.07), transparent 24rem),
    radial-gradient(circle at 86% 58%, rgba(122, 168, 255, 0.07), transparent 24rem),
    #030405;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

button,
a {
  color: inherit;
}

a {
  text-decoration: none;
}

.ambient-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.7;
}

.news-shell {
  position: relative;
  width: min(78rem, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 1.25rem;
  isolation: isolate;
}

.news-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 3.5rem;
  color: rgba(242, 244, 240, 0.58);
  font-size: 0.78rem;
  font-weight: 600;
}

.news-header nav {
  display: flex;
  gap: clamp(0.8rem, 3vw, 1.6rem);
}

.news-header a:hover,
.news-header a:focus-visible {
  color: var(--text);
  outline: none;
}

.hero {
  display: grid;
  min-height: calc(100svh - 5rem);
  grid-template-columns: minmax(0, 1fr) minmax(18rem, 28rem);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: center;
}

.kicker {
  margin: 0 0 0.8rem;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
}

.hero h1,
.section-heading h2 {
  margin: 0;
  font-weight: 500;
  line-height: 0.92;
  text-shadow: 0 0 2.6rem rgba(242, 244, 240, 0.1);
}

.hero h1 {
  font-size: clamp(3.2rem, 9vw, 7.8rem);
}

.hero-line {
  max-width: 34rem;
  margin: 1.4rem 0 0;
  color: rgba(242, 244, 240, 0.58);
  font-size: clamp(1rem, 2vw, 1.25rem);
  line-height: 1.6;
}

.login-panel,
.preference-panel,
.article-card,
.source-model div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  backdrop-filter: blur(18px);
}

.login-panel {
  padding: 1rem;
}

.login-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 7rem;
  gap: 0.8rem;
  align-items: end;
}

label {
  display: grid;
  gap: 0.45rem;
}

label span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}

input,
button {
  min-height: 3rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(3, 4, 5, 0.78);
  color: var(--text);
}

input {
  width: 100%;
  outline: none;
  padding: 0 0.9rem;
}

button {
  cursor: pointer;
  padding: 0 1rem;
  transition:
    background 180ms ease,
    border-color 180ms ease,
    color 180ms ease;
}

button:hover,
button:focus-visible {
  border-color: var(--line-strong);
  background: rgba(242, 244, 240, 0.08);
  outline: none;
}

.status-text {
  min-height: 1.1rem;
  margin: 0.95rem 0 0;
  color: rgba(242, 244, 240, 0.5);
  font-size: 0.78rem;
}

.setup-grid,
.feed-section,
.sources-section {
  padding: clamp(4rem, 8vw, 7rem) 0;
}

.section-heading {
  margin-bottom: 1.5rem;
}

.section-heading h2 {
  font-size: clamp(2.7rem, 7vw, 6.5rem);
}

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

.setup-grid .section-heading {
  grid-column: 1 / -1;
}

.preference-panel {
  padding: 1rem;
}

.preference-panel h3 {
  margin: 0 0 1rem;
  font-size: 1.1rem;
  font-weight: 600;
}

.preference-panel p {
  margin: 1rem 0 0;
  color: rgba(242, 244, 240, 0.52);
  font-size: 0.86rem;
  line-height: 1.55;
}

.chip-grid,
.language-switch {
  display: grid;
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

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

.language-switch {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.chip-grid button,
.language-switch button {
  border: 0;
  border-radius: 0;
}

.chip-grid button.active,
.language-switch button.active {
  background: rgba(242, 244, 240, 0.12);
}

.feed-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  color: rgba(242, 244, 240, 0.56);
  font-size: 0.82rem;
  font-weight: 600;
}

.article-list {
  display: grid;
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.article-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 16rem;
  gap: 1rem;
  align-items: center;
  border: 0;
  border-radius: 0;
  padding: 1.1rem;
}

.article-card[hidden] {
  display: none;
}

.article-card span,
.source-model span {
  color: rgba(242, 244, 240, 0.38);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}

.article-card h3 {
  margin: 0.6rem 0;
  font-size: clamp(1.2rem, 2vw, 1.6rem);
  font-weight: 600;
}

.article-card p,
.source-model p {
  margin: 0;
  color: rgba(242, 244, 240, 0.54);
  line-height: 1.55;
}

.article-card em {
  color: rgba(242, 244, 240, 0.46);
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 700;
  text-align: right;
  text-transform: uppercase;
}

.source-model {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.source-model div {
  min-height: 14rem;
  border: 0;
  border-radius: 0;
  padding: 1rem;
}

.source-model strong {
  display: block;
  margin: 3rem 0 0.8rem;
  font-size: 1.1rem;
}

body[data-language="fa"] .article-card,
body[data-language="fa"] .hero-copy,
body[data-language="fa"] .status-text {
  direction: rtl;
}

body[data-language="fa"] .hero-copy {
  text-align: right;
}

@media (max-width: 980px) {
  .hero,
  .setup-grid,
  .source-model {
    grid-template-columns: 1fr;
  }

  .article-card {
    grid-template-columns: 1fr;
  }

  .article-card em {
    text-align: left;
  }
}

@media (max-width: 620px) {
  .news-shell {
    padding: 1rem;
  }

  .news-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 1rem;
  }

  .login-row,
  .chip-grid,
  .language-switch,
  .feed-toolbar {
    grid-template-columns: 1fr;
  }

  .feed-toolbar {
    display: grid;
  }
}
