:root {
  color-scheme: light;
  --bg: #f5f7f3;
  --surface: #ffffff;
  --ink: #14231f;
  --muted: #63706b;
  --line: #dce3de;
  --teal: #167d71;
  --teal-soft: #d9efea;
  --coral: #df684f;
  --coral-soft: #f8dfd8;
  --yellow: #e8bd58;
  --shadow: 0 22px 60px rgba(25, 49, 42, 0.1);
  --radius: 8px;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111816;
  --surface: #19221f;
  --ink: #f1f5f2;
  --muted: #9ba9a4;
  --line: #2c3834;
  --teal: #57c4b5;
  --teal-soft: #203f39;
  --coral: #f08a72;
  --coral-soft: #492d28;
  --yellow: #edc96f;
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  letter-spacing: 0;
  transition: background-color 180ms ease, color 180ms ease;
}

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

a {
  color: inherit;
}

.page-shell {
  width: min(1440px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 64px);
}

.topbar {
  min-height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-size: 18px;
  font-weight: 760;
}

.brand-mark,
.icon-button,
.service-icon,
.open-icon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--bg);
}

.brand-mark svg {
  width: 21px;
  height: 21px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}

.domain {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12px;
}

.domain-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 5px var(--teal-soft);
}

.icon-button {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: transform 150ms ease, background-color 150ms ease;
}

.icon-button:hover {
  transform: translateY(-2px);
  background: var(--surface);
}

.icon-button svg {
  width: 18px;
  height: 18px;
}

.intro {
  min-height: 560px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(390px, 0.82fr);
  align-items: stretch;
  gap: clamp(48px, 7vw, 110px);
  padding: clamp(54px, 7vw, 98px) 0 70px;
}

.intro-copy {
  align-self: center;
  max-width: 650px;
}

.eyebrow {
  margin: 0 0 24px;
  color: var(--teal);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 11px;
  font-weight: 760;
  letter-spacing: 0;
}

.eyebrow span {
  padding: 0 6px;
  color: var(--line);
}

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

h1 {
  margin: 0;
  max-width: 680px;
  font-size: clamp(54px, 6.4vw, 92px);
  line-height: 0.98;
  font-weight: 780;
}

h1 span {
  color: var(--teal);
}

.intro-text {
  max-width: 480px;
  margin: 30px 0 34px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.8;
}

.jump-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.jump-link svg {
  width: 17px;
  height: 17px;
  transition: transform 160ms ease;
}

.jump-link:hover svg {
  transform: translateY(4px);
}

.cat-stage {
  position: relative;
  align-self: stretch;
  min-height: 430px;
  isolation: isolate;
}

.cat-stage::before {
  content: "";
  position: absolute;
  inset: 9% -7% -3% 12%;
  z-index: -1;
  border-radius: 50%;
  background: var(--teal-soft);
  opacity: 0.72;
  transform: rotate(-5deg);
}

.cat-image {
  background-image: url("assets/cat-life.jpg");
  background-repeat: no-repeat;
}

.cat-image-main {
  width: 100%;
  height: 100%;
  min-height: 430px;
  border-radius: 48% 48% 42% 42% / 42% 42% 54% 54%;
  background-size: 300% 200%;
  background-position: 50% 0%;
  box-shadow: var(--shadow);
  filter: saturate(0.94) contrast(1.02);
  animation: settle 700ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.cat-note {
  position: absolute;
  top: 24px;
  right: -14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 15px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.86);
  color: #23302c;
  box-shadow: 0 12px 30px rgba(35, 48, 44, 0.14);
  backdrop-filter: blur(10px);
  font-size: 12px;
  font-weight: 700;
  transform: rotate(3deg);
}

.cat-note svg {
  width: 15px;
  height: 15px;
  color: var(--coral);
}

.cat-caption {
  position: absolute;
  bottom: 20px;
  left: -18px;
  padding: 12px 16px;
  border-left: 3px solid var(--yellow);
  background: var(--surface);
  box-shadow: var(--shadow);
  color: var(--muted);
  font-size: 12px;
}

.services {
  padding: 70px 0 88px;
  border-top: 1px solid var(--line);
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 34px;
}

.section-heading .eyebrow {
  margin-bottom: 10px;
}

h2 {
  margin: 0;
  font-size: 32px;
  line-height: 1.15;
}

.service-count {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12px;
}

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

.service-card {
  position: relative;
  min-height: 330px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  padding: clamp(24px, 3vw, 38px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  text-decoration: none;
  box-shadow: 0 1px 0 rgba(25, 49, 42, 0.03);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.service-card::after {
  content: "";
  position: absolute;
  width: 210px;
  height: 210px;
  right: -72px;
  bottom: -92px;
  border-radius: 50%;
  opacity: 0.55;
  transition: transform 260ms ease;
}

.service-card-api::after {
  background: var(--teal-soft);
}

.service-card-sui::after {
  background: var(--coral-soft);
}

.service-card:hover {
  transform: translateY(-5px);
  border-color: color-mix(in srgb, var(--ink) 22%, var(--line));
  box-shadow: var(--shadow);
}

.service-card:hover::after {
  transform: scale(1.13);
}

.card-topline,
.card-footer {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.service-icon {
  width: 48px;
  height: 48px;
  border-radius: 8px;
}

.service-card-api .service-icon {
  background: var(--teal-soft);
  color: var(--teal);
}

.service-card-sui .service-icon {
  background: var(--coral-soft);
  color: var(--coral);
}

.service-icon svg {
  width: 23px;
  height: 23px;
}

.service-number,
.service-kicker,
.card-footer {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}

.service-number {
  color: var(--muted);
  font-size: 12px;
}

.service-content {
  position: relative;
  z-index: 1;
  margin: 42px 0;
}

.service-kicker {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.service-content h3 {
  margin: 0 0 10px;
  font-size: clamp(31px, 4vw, 48px);
  line-height: 1;
}

.service-content > p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.card-footer {
  color: var(--muted);
  font-size: 11px;
}

.open-icon {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink);
  background: var(--surface);
  transition: background-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.open-icon svg {
  width: 18px;
  height: 18px;
}

.service-card:hover .open-icon {
  transform: rotate(4deg);
  background: var(--ink);
  color: var(--surface);
}

.footer {
  min-height: 86px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.footer-note {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.footer-note svg {
  width: 15px;
  height: 15px;
  color: var(--coral);
}

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

@keyframes settle {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 860px) {
  .intro {
    min-height: 0;
    grid-template-columns: 1fr;
    gap: 46px;
    padding-top: 56px;
  }

  .cat-stage,
  .cat-image-main {
    min-height: 480px;
  }

  .cat-stage {
    width: min(520px, 92%);
    justify-self: center;
  }

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

@media (max-width: 560px) {
  .page-shell {
    padding: 0 18px;
  }

  .topbar {
    min-height: 74px;
  }

  .domain {
    display: none;
  }

  .brand {
    font-size: 16px;
  }

  .brand-mark,
  .icon-button {
    width: 36px;
    height: 36px;
  }

  .intro {
    padding: 46px 0 56px;
  }

  h1 {
    font-size: 51px;
  }

  .intro-text {
    margin-top: 24px;
    font-size: 14px;
  }

  .cat-stage,
  .cat-image-main {
    min-height: 390px;
  }

  .cat-note {
    right: -7px;
  }

  .cat-caption {
    left: -8px;
  }

  .services {
    padding: 56px 0 64px;
  }

  .service-card {
    min-height: 292px;
  }

  .card-footer > span:first-child {
    max-width: calc(100% - 56px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .footer {
    min-height: 96px;
    align-items: flex-start;
    justify-content: center;
    flex-direction: column;
    gap: 8px;
  }
}

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

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