:root {
  --paper: #090d13;
  --panel: #111824;
  --panel-soft: rgba(17, 24, 36, 0.82);
  --ink: #f8fafc;
  --muted: #b8c4d4;
  --line: #253449;
  --red: #e10600;
  --yellow: #fff200;
  --blue: #38bdf8;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
  color-scheme: dark;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background:
    radial-gradient(circle at 8% 0%, rgba(225, 6, 0, 0.16), transparent 26%),
    radial-gradient(circle at 85% 0%, rgba(56, 189, 248, 0.12), transparent 25%),
    var(--paper);
  color: var(--ink);
  margin: 0;
  min-width: 1440px;
}

a {
  color: inherit;
  text-decoration: none;
}

.f1-site-header {
  align-items: center;
  background: rgba(9, 13, 19, 0.9);
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 28px;
  justify-content: space-between;
  min-height: 68px;
  padding: 0 34px;
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand {
  align-items: center;
  background: #f8fafc;
  border-radius: 8px;
  color: #0f172a;
  display: inline-flex;
  font-weight: 950;
  height: 34px;
  justify-content: center;
  width: 34px;
}

.f1-site-header nav {
  align-items: center;
  display: flex;
  gap: 8px;
}

.f1-site-header nav a {
  border-radius: 7px;
  color: #dbeafe;
  font-size: 14px;
  font-weight: 850;
  padding: 10px 13px;
}

.f1-site-header nav a:hover {
  background: #1f2b3b;
  color: #ffffff;
}

main {
  display: grid;
  gap: 20px;
  padding: 20px;
}

.f1-hero,
.editor-note,
.article-grid,
.f1-article {
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.f1-hero {
  min-height: 620px;
  overflow: hidden;
  padding: 70px 56px 46px;
  position: relative;
}

.hero-slideshow {
  background-image: var(--active-slide);
  background-position: center;
  background-size: cover;
  inset: 0;
  opacity: 0.78;
  position: absolute;
  transition: background-image 400ms ease, opacity 400ms ease, transform 900ms ease;
  z-index: 0;
}

.hero-slideshow.is-changing {
  opacity: 0.46;
  transform: scale(1.015);
}

.hero-scrim {
  background:
    linear-gradient(90deg, rgba(9, 13, 19, 0.94) 0 38%, rgba(9, 13, 19, 0.72) 58%, rgba(9, 13, 19, 0.42)),
    linear-gradient(0deg, rgba(9, 13, 19, 0.92), transparent 42%, rgba(9, 13, 19, 0.36));
  inset: 0;
  position: absolute;
  z-index: 1;
}

.hero-copy {
  display: grid;
  gap: 18px;
  max-width: 870px;
  min-height: 470px;
  place-content: end start;
  position: relative;
  z-index: 2;
}

.eyebrow {
  color: var(--blue);
  font-size: 13px;
  font-weight: 950;
  letter-spacing: 0.08em;
  margin: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  letter-spacing: 0;
}

h1 {
  font-size: clamp(54px, 6.5vw, 96px);
  line-height: 0.94;
  margin: 0;
  max-width: 940px;
  text-shadow:
    0 2px 0 rgba(0, 0, 0, 0.68),
    0 0 24px rgba(0, 0, 0, 0.9);
}

h2 {
  font-size: clamp(34px, 4vw, 60px);
  line-height: 1;
  margin: 0;
}

p {
  color: var(--muted);
  font-size: 17px;
  line-height: 1.72;
  margin: 0;
  text-align: justify;
  text-justify: inter-word;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.hero-actions a,
.f1-article .source-list a,
.article-grid a {
  border-radius: 7px;
}

.hero-actions a {
  background: #f8fafc;
  color: #0f172a;
  display: inline-flex;
  font-weight: 950;
  min-height: 44px;
  padding: 0 18px;
  place-items: center;
}

.hero-actions a:nth-child(2) {
  background: rgba(248, 250, 252, 0.12);
  border: 1px solid rgba(248, 250, 252, 0.24);
  color: #f8fafc;
}

.hero-actions a:hover {
  background: var(--yellow);
  color: #111111;
}

.photo-credit {
  bottom: 18px;
  color: #cbd5e1;
  font-size: 12px;
  left: 56px;
  max-width: 760px;
  position: absolute;
  text-align: left;
  z-index: 2;
}

.editor-note {
  background: var(--panel);
  display: grid;
  gap: 8px;
  padding: 24px;
}

.editor-note strong {
  color: #f8fafc;
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.article-grid {
  background: rgba(17, 24, 36, 0.78);
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 18px;
}

.article-grid a {
  background:
    linear-gradient(180deg, rgba(248, 250, 252, 0.07), rgba(248, 250, 252, 0.025)),
    rgba(15, 23, 42, 0.74);
  border: 1px solid rgba(226, 232, 240, 0.14);
  display: grid;
  gap: 8px;
  min-height: 140px;
  padding: 18px;
}

.article-grid a:hover {
  border-color: rgba(255, 242, 0, 0.5);
}

.article-grid span {
  color: var(--blue);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.article-grid strong {
  color: #f8fafc;
  font-size: 22px;
  line-height: 1.05;
}

.article-grid small {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.f1-article {
  scroll-margin-top: 80px;
  background: var(--panel);
  display: grid;
  gap: 0;
  grid-template-columns: minmax(0, 0.82fr) minmax(0, 1fr);
  isolation: isolate;
  overflow: hidden;
  position: relative;
}

.f1-article::before {
  background:
    linear-gradient(90deg, rgba(17, 24, 36, 0.96), rgba(17, 24, 36, 0.88)),
    var(--article-bg) center / cover no-repeat;
  content: "";
  inset: 0;
  opacity: 0.24;
  pointer-events: none;
  position: absolute;
  z-index: 0;
}

.f1-article.reverse {
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.82fr);
}

.f1-article.reverse .article-media {
  order: 2;
}

.article-media {
  background: #0f172a;
  min-height: 620px;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

.article-hero-figure {
  height: 100%;
  margin: 0;
  position: relative;
}

.article-media img {
  filter: saturate(0.96) contrast(1.02) brightness(0.78);
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.article-media::after {
  background: linear-gradient(0deg, rgba(9, 13, 19, 0.74), transparent 45%);
  bottom: 0;
  content: "";
  height: 42%;
  left: 0;
  position: absolute;
  right: 0;
}

.article-media figcaption,
.article-gallery figcaption {
  background: linear-gradient(90deg, rgba(9, 13, 19, 0.84), rgba(9, 13, 19, 0.36), transparent);
  bottom: 0;
  color: #dbeafe;
  font-size: 11px;
  font-weight: 750;
  left: 0;
  line-height: 1.35;
  padding: 10px 12px;
  position: absolute;
  right: 0;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.82);
  z-index: 2;
}

.article-media figcaption a,
.article-gallery figcaption a {
  color: #ffffff;
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.42);
}

.article-media span {
  bottom: 18px;
  color: #dbeafe;
  font-size: 12px;
  font-weight: 800;
  left: 18px;
  position: absolute;
  right: 18px;
  z-index: 1;
}

.article-copy {
  display: grid;
  gap: 18px;
  padding: 46px;
  position: relative;
  z-index: 1;
}

.article-copy h2 {
  color: #f8fafc;
}

.tech-box {
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.22);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  padding: 18px;
}

.tech-box strong {
  color: #f8fafc;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.result-table {
  border-collapse: collapse;
  border-radius: 8px;
  box-shadow: inset 0 0 0 1px rgba(248, 250, 252, 0.13);
  color: #e5edf8;
  font-size: 14px;
  overflow: hidden;
  width: 100%;
}

.result-table th,
.result-table td {
  border-bottom: 1px solid rgba(248, 250, 252, 0.1);
  padding: 11px 12px;
  text-align: left;
}

.result-table th {
  background: rgba(56, 189, 248, 0.12);
  color: #f8fafc;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.result-table tbody tr:nth-child(even) {
  background: rgba(248, 250, 252, 0.035);
}

.result-table tbody tr:last-child td {
  border-bottom: 0;
}

.article-gallery {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.article-gallery figure {
  aspect-ratio: 1 / 1;
  border: 1px solid rgba(248, 250, 252, 0.12);
  border-radius: 8px;
  margin: 0;
  overflow: hidden;
  position: relative;
}

.article-gallery img {
  display: block;
  filter: saturate(1.05) contrast(1.02) brightness(0.82);
  height: 100%;
  object-fit: cover;
  transition: transform 220ms ease, filter 220ms ease;
  width: 100%;
}

.article-gallery figure:hover img {
  filter: saturate(1.1) contrast(1.04) brightness(0.96);
  transform: scale(1.04);
}

.article-gallery small {
  color: #94a3b8;
  font-size: 12px;
  font-weight: 750;
  grid-column: 1 / -1;
  line-height: 1.45;
}

/* ── Inline article photo (inserted after paragraphs) ───────── */
.article-inline-photo {
  border-radius: 10px;
  margin: 20px 0 18px;
  overflow: hidden;
  position: relative;
  width: 100%;
}

.article-inline-photo img {
  display: block;
  filter: saturate(1.06) contrast(1.03) brightness(0.88);
  height: auto;
  max-height: 460px;
  object-fit: cover;
  object-position: center top;
  width: 100%;
}

.article-inline-photo figcaption {
  background: rgba(10, 14, 26, 0.78);
  border-radius: 0 0 10px 10px;
  color: #94a3b8;
  font-size: 11px;
  letter-spacing: 0.03em;
  line-height: 1.5;
  padding: 6px 10px 7px;
}

.source-list {
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
  padding-top: 18px;
}

.source-list strong {
  align-items: center;
  color: #f8fafc;
  display: inline-flex;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.source-list a {
  background: rgba(248, 250, 252, 0.1);
  border: 1px solid rgba(248, 250, 252, 0.16);
  color: #e2e8f0;
  display: inline-flex;
  font-size: 13px;
  font-weight: 850;
  min-height: 34px;
  padding: 0 11px;
  place-items: center;
}

.source-list a:hover {
  background: #f8fafc;
  color: #0f172a;
}

.f1-footer {
  color: #94a3b8;
  font-size: 12px;
  font-weight: 850;
  padding: 0 20px 24px;
  text-align: center;
}

@media (max-width: 1120px) {
  body {
    min-width: 0;
  }

  .article-grid,
  .f1-article,
  .f1-article.reverse {
    grid-template-columns: 1fr;
  }

  .f1-article.reverse .article-media {
    order: 0;
  }

  .article-media {
    min-height: 420px;
  }

  .article-gallery {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .f1-site-header {
    align-items: flex-start;
    display: grid;
    gap: 12px;
    grid-template-columns: auto 1fr;
    padding: 12px 14px;
  }

  .f1-site-header nav {
    display: grid;
    gap: 8px;
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .f1-site-header nav a {
    background: #152033;
    border: 1px solid var(--line);
    display: inline-flex;
    justify-content: center;
    text-align: center;
  }

  main {
    gap: 12px;
    padding: 10px;
  }

  .f1-hero {
    min-height: 560px;
    padding: 42px 22px 54px;
  }

  h1 {
    font-size: clamp(40px, 13vw, 62px);
  }

  h2 {
    font-size: clamp(30px, 10vw, 46px);
  }

  p {
    font-size: 15px;
    line-height: 1.64;
  }

  .photo-credit {
    left: 22px;
    right: 22px;
  }

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

  .article-media {
    min-height: 280px;
  }

  .article-copy {
    padding: 24px 20px;
  }

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