:root {
  --paper: #f4f1e9;
  --surface: #fffdf8;
  --ink: #17212b;
  --muted: #5f6870;
  --line: #c9c5bb;
  --navy: #123b59;
  --teal: #087f7a;
  --coral: #e25b44;
  --yellow: #e7b94f;
  --white: #ffffff;
  --shadow: 0 18px 42px rgba(31, 40, 46, 0.13);
  --radius: 6px;
  --shell: 1180px;
  --header-height: 68px;
}

:root[data-theme="dark"] {
  --paper: #171b1d;
  --surface: #202629;
  --ink: #f3f0e8;
  --muted: #b3bbb9;
  --line: #41494a;
  --navy: #8ac6df;
  --teal: #55c6bb;
  --coral: #ff806b;
  --yellow: #f1ca67;
  --white: #f7f5ef;
  --shadow: 0 20px 46px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
  letter-spacing: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 20px);
  background: var(--paper);
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, "Segoe UI", "PingFang SC", "Microsoft YaHei UI", sans-serif;
  font-size: 16px;
  line-height: 1.7;
  text-rendering: optimizeLegibility;
}

body,
.topbar,
.project-card,
.featured-project,
.update-item {
  transition: color 180ms ease, background-color 180ms ease, border-color 180ms ease;
}

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

a {
  color: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
  font: inherit;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 100;
  padding: 10px 14px;
  color: #17212b;
  background: #ffffff;
  border: 2px solid #17212b;
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.shell {
  width: min(var(--shell), calc(100% - 48px));
  margin-inline: auto;
}

.topbar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  height: var(--header-height);
  color: var(--ink);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  border-bottom: 1px solid transparent;
  backdrop-filter: blur(14px);
}

.topbar.is-scrolled {
  border-color: var(--line);
}

.nav {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  height: 100%;
  gap: 28px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  font-weight: 800;
  text-decoration: none;
}

.brand-index {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  color: #ffffff;
  background: #17212b;
  border-radius: 50%;
  font-size: 11px;
}

:root[data-theme="dark"] .brand-index {
  color: #17212b;
  background: var(--white);
}

.nav-links {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 28px;
}

.nav-links a {
  position: relative;
  padding: 8px 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: 4px;
  height: 2px;
  background: var(--coral);
  transition: right 160ms ease;
}

.nav-links a:hover::after {
  right: 0;
}

.nav-toggle,
.theme-toggle {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
}

.nav-toggle {
  display: none;
}

.theme-toggle:hover,
.nav-toggle:hover {
  background: var(--surface);
}

.hero {
  position: relative;
  display: grid;
  align-items: center;
  min-height: 82svh;
  padding: calc(var(--header-height) + 70px) 0 76px;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  isolation: isolate;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background-image: url("assets/query-dashboard.png");
  background-repeat: no-repeat;
  background-position: center top;
  background-size: cover;
  opacity: 0.42;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgba(244, 241, 233, 0.82);
}

:root[data-theme="dark"] .hero::before {
  opacity: 0.24;
}

:root[data-theme="dark"] .hero::after {
  background: rgba(23, 27, 29, 0.86);
}

.hero-inner {
  position: relative;
  z-index: 1;
}

.eyebrow,
.section-number,
.project-kicker {
  margin-bottom: 16px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 860px;
  margin-bottom: 26px;
  font-family: Georgia, "Noto Serif SC", "Songti SC", serif;
  font-size: 68px;
  line-height: 1.12;
  font-weight: 700;
}

.hero-copy {
  max-width: 690px;
  margin-bottom: 34px;
  color: var(--muted);
  font-size: 20px;
  line-height: 1.8;
}

.hero-actions,
.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  transition: transform 160ms ease, background-color 160ms ease, border-color 160ms ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button-primary {
  color: #ffffff;
  background: #17212b;
}

.button-primary:hover {
  background: var(--coral);
}

.button-secondary {
  color: var(--ink);
  background: var(--surface);
  border-color: var(--line);
}

.button-secondary:hover {
  border-color: var(--ink);
}

.hero-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin: 58px 0 0;
}

.hero-metrics div {
  min-width: 180px;
  padding: 0 34px;
  border-left: 1px solid var(--line);
}

.hero-metrics div:first-child {
  padding-left: 0;
  border-left: 0;
}

.hero-metrics dt {
  font-family: Georgia, serif;
  font-size: 30px;
  font-weight: 700;
  line-height: 1.2;
}

.hero-metrics dd {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.hero-preview {
  position: absolute;
  right: 28px;
  bottom: 24px;
  display: grid;
  grid-template-columns: auto auto;
  gap: 0 16px;
  width: 300px;
  padding: 16px 18px;
  color: #ffffff;
  background: #123b59;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-decoration: none;
}

.hero-preview span:first-child {
  grid-column: 1 / -1;
  margin-bottom: 2px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 11px;
}

.hero-preview strong {
  font-size: 14px;
}

.hero-preview span:last-child {
  justify-self: end;
}

.section {
  padding: 112px 0;
}

.section-heading {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr);
  gap: 60px;
  align-items: end;
  margin-bottom: 58px;
}

.section-heading .section-number {
  grid-column: 1 / -1;
  margin-bottom: -40px;
}

.section-heading h2,
.method-heading h2,
.contact h2 {
  margin-bottom: 0;
  font-family: Georgia, "Noto Serif SC", "Songti SC", serif;
  font-size: 48px;
  line-height: 1.2;
}

.section-heading > p:last-child {
  margin-bottom: 4px;
  color: var(--muted);
}

.featured-project {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(320px, 0.75fr);
  gap: 54px;
  align-items: center;
  margin-bottom: 70px;
  padding: 26px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.featured-media {
  display: block;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #dce8ef;
}

.featured-media img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: top center;
  transition: transform 280ms ease;
}

.featured-media:hover img {
  transform: scale(1.018);
}

.featured-copy h3,
.project-card h3,
.update-item h3 {
  margin-bottom: 14px;
  font-size: 28px;
  line-height: 1.35;
}

.featured-copy > p:not(.project-kicker),
.project-card > p:not(.project-kicker) {
  color: var(--muted);
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 24px 0;
  padding: 0;
  list-style: none;
}

.tag-list li,
.card-status {
  padding: 5px 9px;
  color: var(--muted);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 3px;
  font-size: 12px;
  font-weight: 700;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--coral);
  font-weight: 850;
  text-underline-offset: 5px;
}

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

.project-card {
  position: relative;
  min-height: 470px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.project-card-media {
  height: 220px;
  margin: -24px -24px 22px;
  overflow: hidden;
  background: #e4e8e5;
  border-bottom: 1px solid var(--line);
  border-radius: var(--radius) var(--radius) 0 0;
}

.project-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.project-card-text {
  display: flex;
  flex-direction: column;
}

.project-card-accent {
  border-top: 5px solid var(--coral);
}

.card-stat {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: auto 0 24px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.card-stat strong {
  color: var(--teal);
  font-family: Georgia, serif;
  font-size: 52px;
  line-height: 1;
}

.card-stat span {
  color: var(--muted);
  font-size: 13px;
}

.card-status {
  align-self: flex-start;
  margin-top: auto;
}

.code-sample {
  display: grid;
  gap: 8px;
  margin: auto 0 24px;
  padding: 20px;
  color: #dfeee9;
  background: #17212b;
  border-left: 4px solid var(--yellow);
  border-radius: 3px;
  font-family: Consolas, monospace;
  font-size: 13px;
}

.code-sample span::before {
  content: "> ";
  color: #55c6bb;
}

.method {
  padding: 108px 0;
  color: #f7f5ef;
  background: #17212b;
}

.method-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(0, 1.2fr);
  gap: 96px;
}

.method .section-number,
.method .method-list > li > span {
  color: #66d0c6;
}

.method-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid rgba(255, 255, 255, 0.22);
}

.method-list li {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 20px;
  padding: 28px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.22);
}

.method-list > li > span {
  font-weight: 850;
}

.method-list h3 {
  margin-bottom: 8px;
  font-size: 20px;
}

.method-list p {
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.68);
}

.about-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(0, 1.1fr);
  gap: 100px;
}

.about .section-heading {
  display: block;
  margin-bottom: 0;
}

.about .section-heading .section-number {
  margin-bottom: 16px;
}

.about-copy {
  max-width: 650px;
  color: var(--muted);
  font-size: 18px;
}

.about-lead {
  color: var(--ink);
  font-family: Georgia, "Noto Serif SC", "Songti SC", serif;
  font-size: 30px;
  line-height: 1.45;
}

.updates {
  padding-top: 20px;
}

.update-list {
  border-top: 1px solid var(--line);
}

.update-item {
  display: grid;
  grid-template-columns: 140px minmax(300px, 0.9fr) minmax(280px, 1.1fr);
  gap: 34px;
  padding: 30px 0;
  border-bottom: 1px solid var(--line);
}

.update-item time {
  color: var(--teal);
  font-size: 13px;
  font-weight: 800;
}

.update-item h3 {
  margin-bottom: 0;
  font-size: 20px;
}

.update-item p {
  margin-bottom: 0;
  color: var(--muted);
}

.contact {
  padding: 82px 0;
  color: #ffffff;
  background: #e25b44;
}

.contact[hidden] {
  display: none;
}

.contact .section-number {
  color: #17212b;
}

.contact-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 40px;
  align-items: center;
}

.contact h2 {
  max-width: 760px;
}

.button-light,
.copy-button {
  min-height: 48px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 850;
}

.button-light {
  color: #17212b;
  background: #ffffff;
}

.copy-button {
  padding: 0 18px;
  color: #ffffff;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.68);
  cursor: pointer;
}

.footer {
  color: #c5cccb;
  background: #101618;
}

.footer-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 24px;
  align-items: center;
  min-height: 110px;
  font-size: 13px;
}

.footer p {
  margin-bottom: 0;
}

.footer a {
  justify-self: end;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 80;
  padding: 10px 16px;
  color: #ffffff;
  background: #17212b;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: var(--radius);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 520ms ease, transform 520ms ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 980px) {
  .hero h1 {
    font-size: 54px;
  }

  .hero-preview {
    display: none;
  }

  .featured-project,
  .method-layout,
  .about-layout {
    grid-template-columns: 1fr;
    gap: 42px;
  }

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

  .project-card:last-child {
    grid-column: 1 / -1;
    min-height: 390px;
  }

  .section-heading {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .section-heading .section-number {
    margin-bottom: 0;
  }

  .update-item {
    grid-template-columns: 110px 1fr;
  }

  .update-item p {
    grid-column: 2;
  }

  .contact-layout {
    grid-template-columns: 1fr;
  }

  .footer-inner {
    grid-template-columns: 1fr auto;
  }

  .footer-inner p:nth-child(2) {
    display: none;
  }
}

@media (max-width: 760px) {
  :root {
    --header-height: 62px;
  }

  .shell {
    width: min(100% - 30px, var(--shell));
  }

  .nav {
    grid-template-columns: 1fr auto auto;
    gap: 10px;
  }

  .nav-toggle {
    display: grid;
  }

  .nav-links {
    position: absolute;
    top: calc(var(--header-height) - 1px);
    left: 15px;
    right: 15px;
    display: none;
    justify-content: stretch;
    align-items: stretch;
    gap: 0;
    padding: 10px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
  }

  .nav-links.is-open {
    display: grid;
  }

  .nav-links a {
    padding: 11px 12px;
    border-bottom: 1px solid var(--line);
    text-align: left;
  }

  .nav-links a:last-child {
    border-bottom: 0;
  }

  .nav-links a::after {
    display: none;
  }

  .hero {
    min-height: 86svh;
    padding: calc(var(--header-height) + 54px) 0 54px;
  }

  .hero::before {
    background-position: 38% top;
  }

  .hero h1 {
    margin-bottom: 22px;
    font-size: 42px;
  }

  .hero-copy {
    font-size: 17px;
  }

  .hero-actions .button {
    flex: 1 1 140px;
    padding-inline: 12px;
  }

  .hero-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px 0;
    margin-top: 46px;
  }

  .hero-metrics div {
    min-width: 0;
    padding: 0 16px;
  }

  .hero-metrics div:nth-child(3) {
    grid-column: 1 / -1;
    padding-left: 0;
    border-left: 0;
  }

  .hero-metrics dt {
    font-size: 25px;
  }

  .section,
  .method {
    padding: 78px 0;
  }

  .section-heading {
    margin-bottom: 38px;
  }

  .section-heading h2,
  .method-heading h2,
  .contact h2 {
    font-size: 38px;
  }

  .featured-project {
    gap: 28px;
    margin-bottom: 48px;
    padding: 14px;
  }

  .featured-copy {
    padding: 4px 8px 12px;
  }

  .featured-copy h3,
  .project-card h3 {
    font-size: 24px;
  }

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

  .project-card,
  .project-card:last-child {
    grid-column: auto;
    min-height: 430px;
  }

  .method-layout {
    gap: 30px;
  }

  .about-copy {
    font-size: 16px;
  }

  .about-lead {
    font-size: 25px;
  }

  .updates {
    padding-top: 0;
  }

  .update-item {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .update-item p {
    grid-column: auto;
  }

  .contact {
    padding: 64px 0;
  }

  .contact-actions > * {
    flex: 1 1 160px;
  }
}

@media (max-width: 430px) {
  .brand-index {
    display: none;
  }

  .hero h1 {
    font-size: 35px;
  }

  .hero-metrics {
    grid-template-columns: 1fr 1fr;
  }

  .hero-metrics div {
    padding-left: 12px;
    padding-right: 8px;
  }

  .hero-metrics dt {
    font-size: 22px;
  }

  .section-heading h2,
  .method-heading h2,
  .contact h2 {
    font-size: 32px;
  }

  .project-card {
    min-height: 410px;
  }

  .footer-inner {
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 24px 0;
  }

  .footer a {
    justify-self: start;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
