:root {
  color-scheme: light;
  --bg: #f7fbfb;
  --surface: #ffffff;
  --surface-soft: #f2f8f7;
  --ink: #15222a;
  --muted: #5c6b74;
  --line: rgba(31, 94, 106, 0.18);
  --blue: #2864d8;
  --teal: #009c9c;
  --green: #16855f;
  --amber: #ad6b13;
  --rose: #c14d72;
  --shadow: 0 18px 48px rgba(24, 60, 75, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  padding-bottom: calc(124px + env(safe-area-inset-bottom));
  background:
    linear-gradient(90deg, rgba(0, 156, 156, 0.08) 1px, transparent 1px),
    linear-gradient(0deg, rgba(40, 100, 216, 0.06) 1px, transparent 1px),
    linear-gradient(180deg, #fbfefd 0%, #eef8f6 44%, #fff8ef 100%);
  background-size: 72px 72px, 72px 72px, auto;
  line-height: 1.6;
}

img {
  max-width: 100%;
  display: block;
}

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

a:hover {
  color: var(--blue);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(16px);
}

.nav {
  width: min(1120px, calc(100% - 32px));
  min-height: 64px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 900;
  white-space: nowrap;
}

.brand img {
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 156, 156, 0.2);
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px 14px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 760;
}

.nav-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px 16px;
}

.language-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 820;
}

.language-switch select {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px 28px 4px 10px;
  color: var(--ink);
  background: #ffffff;
  font: inherit;
}

.hero {
  min-height: min(650px, calc(100vh - 64px));
  display: grid;
  align-items: center;
  border-bottom: 1px solid var(--line);
  background-image:
    linear-gradient(90deg, rgba(247, 251, 251, 0.98) 0%, rgba(247, 251, 251, 0.88) 48%, rgba(247, 251, 251, 0.62) 100%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.12) 0%, rgba(247, 251, 251, 0.94) 100%),
    url("/assets/ai-proficient-lab-hero.png");
  background-position: center;
  background-size: cover;
}

.hero-inner {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 76px 0 86px;
}

.kicker {
  margin: 0 0 10px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

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

h1 {
  max-width: 760px;
  font-size: clamp(44px, 8vw, 92px);
  line-height: 0.98;
}

.lead {
  max-width: 680px;
  margin: 22px 0 0;
  color: #344653;
  font-size: 19px;
  font-weight: 650;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 16px;
  font-weight: 860;
  line-height: 1.2;
}

.button.primary {
  color: #ffffff;
  background: var(--blue);
  border-color: var(--blue);
  box-shadow: 0 14px 34px rgba(40, 100, 216, 0.22);
}

.button.secondary {
  background: rgba(255, 255, 255, 0.84);
}

.metric-band {
  width: min(1120px, calc(100% - 32px));
  margin: -48px auto 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  position: relative;
  z-index: 3;
}

.metric {
  min-height: 112px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.metric span,
.metric small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 780;
}

.metric strong {
  display: block;
  margin: 2px 0;
  color: var(--ink);
  font-size: 32px;
  line-height: 1.1;
}

.ad-message {
  width: min(1120px, calc(100% - 32px));
  margin: 18px auto 0;
  padding: 12px 16px;
  position: relative;
  z-index: 2;
  border: 1px solid rgba(31, 94, 106, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--muted);
  font-size: 13px;
  font-weight: 720;
  box-shadow: 0 10px 28px rgba(24, 60, 75, 0.08);
}

.ad-message p {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
}

.ad-message span {
  min-width: 0;
}

.section {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 82px 0;
}

.section.alt {
  width: 100%;
  max-width: none;
  padding-inline: max(16px, calc((100% - 1120px) / 2));
  background: rgba(255, 255, 255, 0.54);
  border-block: 1px solid var(--line);
}

.section-head {
  display: grid;
  grid-template-columns: minmax(220px, 0.68fr) minmax(280px, 1fr);
  gap: 28px;
  align-items: end;
  margin-bottom: 28px;
}

.section-head h2 {
  font-size: clamp(28px, 4vw, 48px);
  line-height: 1.08;
}

.section-head p:not(.kicker) {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  font-weight: 620;
}

.about-grid,
.timeline,
.article-list {
  display: grid;
  gap: 12px;
}

.about-grid {
  grid-template-columns: repeat(3, 1fr);
}

.about-grid article,
.timeline article,
.app-card,
.article-list a {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 10px 28px rgba(24, 60, 75, 0.08);
}

.about-grid article {
  min-height: 190px;
  padding: 22px;
}

.about-grid h3,
.timeline h3 {
  font-size: 18px;
}

.about-grid p,
.timeline p {
  margin: 10px 0 0;
  color: var(--muted);
}

.app-directory {
  display: grid;
  gap: 18px;
}

.category-group {
  display: grid;
  gap: 10px;
}

.category-title {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.category-title::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--teal);
}

.category-group:nth-child(2) .category-title::before {
  background: var(--rose);
}

.category-group:nth-child(3) .category-title::before {
  background: var(--amber);
}

.app-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.app-card {
  min-height: 168px;
  display: grid;
  gap: 12px;
  padding: 18px;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.app-card:hover {
  transform: translateY(-2px);
  border-color: rgba(40, 100, 216, 0.34);
  background: #ffffff;
}

.app-card-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
}

.app-card strong {
  font-size: 18px;
  line-height: 1.22;
}

.status {
  flex: 0 0 auto;
  max-width: 44%;
  border: 1px solid rgba(0, 156, 156, 0.22);
  border-radius: 8px;
  padding: 3px 8px;
  color: var(--green);
  background: #eefaf5;
  font-size: 12px;
  font-weight: 850;
  text-align: center;
}

.purpose {
  color: var(--blue);
  font-size: 13px;
  font-weight: 900;
}

.description {
  margin: 0;
  color: #4d5c66;
}

.companion-label {
  width: fit-content;
  border: 1px solid rgba(173, 107, 19, 0.26);
  border-radius: 8px;
  padding: 4px 8px;
  color: #87520d;
  background: #fff7e8;
  font-size: 12px;
  font-weight: 860;
}

.app-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 840;
}

.loading,
.error {
  margin: 0;
  color: var(--muted);
  font-weight: 760;
}

.timeline {
  grid-template-columns: repeat(3, 1fr);
}

.timeline article {
  min-height: 188px;
  padding: 22px;
}

.timeline span {
  display: inline-flex;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  border-radius: 8px;
  color: #ffffff;
  background: var(--amber);
  font-weight: 900;
}

.article-list a {
  min-height: 94px;
  display: grid;
  grid-template-columns: minmax(220px, 0.52fr) minmax(260px, 1fr);
  gap: 18px;
  align-items: center;
  padding: 18px 20px;
}

.article-list strong {
  font-size: 17px;
}

.article-list span {
  color: var(--muted);
}

.footer {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0 calc(36px + env(safe-area-inset-bottom));
  color: var(--muted);
  font-size: 14px;
  font-weight: 680;
}

.side-ad {
  display: none;
}

.side-ad .ad-frame {
  width: 300px;
  min-height: 250px;
  overflow: hidden;
}

.video-ad-loader {
  width: 0;
  height: 0;
  overflow: hidden;
}

.bottom-ad {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 80;
  min-height: 108px;
  display: grid;
  grid-template-columns: minmax(120px, auto) minmax(300px, 1fr);
  gap: 12px;
  align-items: center;
  justify-content: center;
  padding: 8px max(10px, calc((100vw - 980px) / 2)) calc(8px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(31, 94, 106, 0.18);
  background: rgba(250, 253, 252, 0.94);
  box-shadow: 0 -12px 34px rgba(24, 60, 75, 0.14);
  backdrop-filter: blur(14px);
}

.bottom-ad-copy {
  display: grid;
  gap: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 780;
}

.bottom-ad-copy strong {
  color: var(--ink);
  font-size: 13px;
  text-transform: uppercase;
}

.bottom-ad .ad-frame {
  width: min(728px, calc(100vw - 28px));
  min-height: 96px;
  display: grid;
  place-items: center;
  overflow: hidden;
}

@media (min-width: 1700px) {
  .side-ad {
    position: fixed;
    top: 104px;
    right: 24px;
    bottom: calc(132px + env(safe-area-inset-bottom));
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
  }

  .side-ad .ad-frame {
    pointer-events: auto;
  }
}

@media (max-width: 900px) {
  .nav {
    min-height: auto;
    padding: 12px 0;
    align-items: flex-start;
    flex-direction: column;
  }

  .nav-links {
    justify-content: flex-start;
  }

  .nav-actions {
    justify-content: flex-start;
  }

  .hero {
    min-height: 560px;
  }

  .metric-band,
  .about-grid,
  .timeline,
  .app-grid {
    grid-template-columns: 1fr;
  }

  .metric-band {
    margin-top: 14px;
  }

  .section-head,
  .article-list a {
    grid-template-columns: 1fr;
  }

  .section {
    padding: 62px 0;
  }
}

@media (max-width: 620px) {
  body {
    padding-bottom: calc(118px + env(safe-area-inset-bottom));
  }

  .hero-inner {
    padding-top: 60px;
    padding-bottom: 70px;
  }

  .lead {
    font-size: 17px;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .button {
    width: 100%;
  }

  .app-card-header,
  .app-card-footer {
    align-items: start;
    flex-direction: column;
  }

  .status {
    max-width: 100%;
  }

  .bottom-ad {
    min-height: 104px;
    grid-template-columns: 1fr;
    gap: 4px;
    padding-inline: 8px;
  }

  .bottom-ad-copy {
    text-align: center;
  }

  .bottom-ad-copy span {
    display: none;
  }

  .ad-message {
    margin-top: 14px;
    padding: 10px 12px;
    font-size: 12px;
  }

  .ad-message p {
    display: grid;
    gap: 3px;
  }

  .bottom-ad .ad-frame {
    width: calc(100vw - 16px);
    min-height: 82px;
  }
}
