* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --blue: #155d9c;
  --ink: #17212f;
  --muted: #667085;
  --line: #d9e2ec;
  --surface: #ffffff;
  --wash: #f4f7fb;
  --green: #207a4c;
  --amber: #b7791f;
  --red: #be3434;
  --gold: #a46a00;
  --shadow: 0 12px 35px rgba(28, 45, 71, 0.12);
}

body {
  min-height: 100vh;
  font-family: "Segoe UI", Arial, sans-serif;
  background: var(--wash);
  color: var(--ink);
  line-height: 1.55;
}

a {
  color: inherit;
}

header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.container {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 72px;
}

.logo {
  color: var(--blue);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 0;
  text-decoration: none;
}

nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
}

nav a {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 6px;
  color: var(--muted);
  font-weight: 650;
  text-decoration: none;
}

nav a:hover {
  background: #e8f1fb;
  color: var(--blue);
}

.language-switch {
  min-height: 36px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  color: var(--blue);
  font-weight: 850;
  cursor: pointer;
}

.language-switch:hover {
  background: #e8f1fb;
}

main {
  min-height: calc(100vh - 170px);
}

.hero {
  background:
    linear-gradient(90deg, rgba(17, 71, 123, 0.92), rgba(32, 122, 76, 0.74)),
    url("https://images.unsplash.com/photo-1436491865332-7a61a109cc05?auto=format&fit=crop&w=1800&q=80") center/cover;
  color: white;
  margin-bottom: 34px;
}

.hero.compact {
  margin-bottom: 28px;
}

.hero-inner {
  min-height: 260px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: 42px 0;
}

.hero.compact .hero-inner {
  min-height: 180px;
}

.hero h1 {
  font-size: clamp(42px, 8vw, 82px);
  line-height: 0.95;
  margin: 4px 0 14px;
}

.hero p {
  max-width: 650px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 18px;
}

.eyebrow {
  font-size: 13px !important;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.hero-stat {
  min-width: 190px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.14);
}

.hero-stat strong,
.hero-stat span {
  display: block;
}

.hero-stat strong {
  font-size: 30px;
}

.content-section {
  margin-bottom: 34px;
}

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

.section-heading h2 {
  font-size: 28px;
}

.section-heading p {
  color: var(--muted);
}

.button,
button.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 16px;
  border: 0;
  border-radius: 6px;
  background: var(--blue);
  color: white;
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
}

.button.secondary {
  background: #e7eef6;
  color: var(--blue);
}

.filter-section,
.compare-selector {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 12px;
  margin-bottom: 22px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.search-input,
.filter-select,
.aircraft-select,
input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  color: var(--ink);
  font: inherit;
}

.search-input {
  flex: 2 1 310px;
}

.filter-select {
  flex: 1 1 190px;
}

.selector-group {
  flex: 1 1 260px;
  color: var(--muted);
  font-weight: 700;
}

.selector-group span {
  display: block;
  margin-bottom: 7px;
}

.aircraft-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
}

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

.news-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.18s ease;
}

.news-card:hover {
  transform: translateY(-3px);
}

.news-card.featured {
  grid-column: span 2;
}

.news-card-image {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #d7e3ef;
}

.news-card-content {
  padding: 18px;
}

.news-card-category,
.category-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 10px;
  border-radius: 999px;
  background: #e8f1fb;
  color: var(--blue);
  font-size: 12px;
  font-weight: 850;
  text-decoration: none;
}

.news-card-title {
  margin: 12px 0 8px;
  font-size: 22px;
  line-height: 1.18;
}

.news-card.featured .news-card-title {
  font-size: clamp(26px, 4vw, 40px);
}

.news-card-excerpt {
  color: var(--muted);
}

.news-card-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.source-link {
  display: inline-flex;
  margin-top: 12px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.source-link:hover {
  text-decoration: underline;
}

.article-source {
  margin-top: 24px;
}

.category-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.article-detail {
  overflow: hidden;
  margin: 34px auto 0;
  max-width: 920px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.article-detail-image {
  display: block;
  width: 100%;
  max-height: 520px;
  object-fit: cover;
  background: #d7e3ef;
}

.article-detail-body {
  padding: clamp(22px, 5vw, 42px);
}

.article-detail h1 {
  margin: 12px 0;
  font-size: clamp(34px, 6vw, 62px);
  line-height: 1;
}

.article-detail .lead {
  margin: 22px 0;
  color: var(--ink);
  font-size: 20px;
  font-weight: 700;
}

.article-copy p {
  margin-bottom: 18px;
  color: #344054;
  font-size: 18px;
}

.back-row {
  margin-top: 22px;
  text-align: center;
}

.aircraft-card,
.spotting-card,
.leaderboard,
.spotting-form,
.profile-header,
.stats-strip,
.spotting-detail,
.detail-hero {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.aircraft-card {
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.aircraft-card:hover {
  transform: translateY(-3px);
}

.aircraft-card-image {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: #d7e3ef;
}

.aircraft-card-content,
.spotting-body {
  padding: 16px;
}

.card-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 8px;
}

.aircraft-card-title,
.spotting-title {
  font-size: 19px;
  line-height: 1.2;
  margin-bottom: 12px;
}

.mini-specs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.mini-specs div,
.spec-item,
.stats-strip div {
  padding: 12px;
  border-radius: 6px;
  background: #f7fafc;
}

dt,
.mini-specs dt,
.spec-item dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

dd,
.mini-specs dd,
.spec-item dd {
  font-weight: 750;
}

.aircraft-rarity {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 8px;
  border-radius: 999px;
  color: white;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.rarity-common { background: var(--green); }
.rarity-uncommon { background: var(--amber); }
.rarity-very-rare { background: var(--red); }
.rarity-legendary { background: var(--gold); }

.detail-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 520px);
  gap: 24px;
  align-items: center;
  padding: 28px;
  margin: 34px 0;
}

.detail-hero h1 {
  margin: 12px 0 8px;
  font-size: clamp(34px, 6vw, 62px);
  line-height: 1;
}

.detail-hero p {
  color: var(--muted);
  font-size: 18px;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.visualizer-panel {
  min-height: 360px;
  border-radius: 8px;
  background: radial-gradient(circle at 30% 25%, #ffffff, #d9e8f5 58%, #b8cbe0);
  overflow: hidden;
}

#aircraftCanvas {
  width: 100%;
  height: 360px;
  display: block;
}

.aircraft-specs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
}

.spec-item.wide {
  grid-column: span 2;
}

.comparison-header {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px 8px 0 0;
  background: var(--line);
}

.comparison-header > div {
  padding: 20px;
  background: white;
}

.comparison-table {
  overflow: hidden;
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 8px 8px;
  background: white;
}

.comparison-row {
  display: grid;
  grid-template-columns: minmax(150px, 220px) 1fr 1fr;
  border-bottom: 1px solid var(--line);
}

.comparison-row:last-child {
  border-bottom: 0;
}

.comparison-label,
.comparison-value {
  padding: 14px 16px;
}

.comparison-label {
  background: #f3f7fb;
  color: var(--muted);
  font-weight: 800;
}

.comparison-value {
  border-left: 1px solid var(--line);
}

.comparison-value.is-best {
  background: #ecf8f1;
  color: var(--green);
  font-weight: 850;
}

.split-layout {
  display: grid;
  grid-template-columns: minmax(290px, 360px) 1fr;
  gap: 20px;
  align-items: start;
}

.spotting-form {
  position: sticky;
  top: 92px;
  padding: 18px;
}

.spotting-form h2 {
  margin-bottom: 14px;
}

.spotting-form label {
  display: block;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.spottings-feed,
.compact-feed {
  display: grid;
  gap: 14px;
}

.spotting-card {
  display: grid;
  grid-template-columns: 220px 1fr;
  overflow: hidden;
}

.spotting-image-link,
.spotting-image {
  display: block;
  width: 100%;
  height: 100%;
}

.spotting-image {
  min-height: 210px;
  object-fit: cover;
  background: #d7e3ef;
}

.spotting-details {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
  margin: 10px 0;
}

.spotting-details span {
  padding: 4px 8px;
  border-radius: 999px;
  background: #eef4fa;
}

.spotting-footer {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.spotting-action {
  min-height: 36px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  color: var(--blue);
  font-weight: 800;
  cursor: pointer;
}

.plain-link {
  color: var(--blue);
  text-decoration: none;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.tab-btn {
  min-height: 42px;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  color: var(--muted);
  font-weight: 800;
  cursor: pointer;
}

.tab-btn.active {
  background: var(--blue);
  border-color: var(--blue);
  color: white;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.leaderboard {
  overflow: hidden;
}

.leaderboard-item {
  display: grid;
  grid-template-columns: 58px 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}

.leaderboard-item:last-child {
  border-bottom: 0;
}

.leaderboard-item:hover {
  background: #f7fbff;
}

.leaderboard-rank {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #e8f1fb;
  color: var(--blue);
  font-weight: 850;
}

.leaderboard-name {
  font-size: 18px;
  font-weight: 850;
}

.leaderboard-stats {
  color: var(--muted);
  font-size: 14px;
}

.leaderboard-score {
  text-align: right;
  color: var(--green);
  font-size: 22px;
  font-weight: 850;
}

.leaderboard-score span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.profile-header {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 24px;
  margin: 34px 0 18px;
}

.avatar {
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #e8f1fb;
  color: var(--blue);
  font-size: 20px;
  font-weight: 900;
}

.stats-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding: 12px;
  margin-bottom: 24px;
}

.stats-strip strong,
.stats-strip span {
  display: block;
}

.stats-strip strong {
  font-size: 26px;
}

.stats-strip span {
  color: var(--muted);
}

.collection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.collection-item,
.compact-feed a {
  display: grid;
  gap: 7px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  text-decoration: none;
}

.collection-item span:last-child,
.compact-feed a {
  color: var(--muted);
}

.spotting-detail {
  overflow: hidden;
  margin: 34px 0;
}

.spotting-detail img {
  width: 100%;
  max-height: 520px;
  object-fit: cover;
  background: #d7e3ef;
}

.spotting-detail-body {
  padding: 24px;
}

.spotting-detail h1 {
  margin: 10px 0;
  font-size: clamp(30px, 6vw, 58px);
}

.message {
  grid-column: 1 / -1;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--muted);
}

.message.error {
  border-color: #f1b8b8;
  background: #fff1f1;
  color: var(--red);
}

.message.success {
  border-color: #b9e2c8;
  background: #effaf3;
  color: var(--green);
}

footer {
  margin-top: 56px;
  border-top: 1px solid var(--line);
  background: white;
}

.footer-bottom {
  padding: 28px 0;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 820px) {
  .header-content,
  .hero-inner,
  .section-heading,
  .profile-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero-inner {
    min-height: 230px;
  }

  .detail-hero,
  .split-layout,
  .spotting-card,
  .comparison-header,
  .comparison-row,
  .news-grid {
    grid-template-columns: 1fr;
  }

  .news-card.featured {
    grid-column: auto;
  }

  .spotting-form {
    position: static;
  }

  .comparison-value {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .stats-strip {
    grid-template-columns: 1fr 1fr;
  }

  .leaderboard-item {
    grid-template-columns: 48px 1fr;
  }

  .leaderboard-score {
    grid-column: 2;
    text-align: left;
  }

  .spec-item.wide {
    grid-column: auto;
  }
}
