:root {
  color-scheme: light;
  --bg: #f7f4ed;
  --surface: #fffaf1;
  --surface-2: #eaf3ee;
  --text: #18201c;
  --muted: #65706a;
  --line: rgba(24, 32, 28, 0.14);
  --accent: #0f8b8d;
  --accent-strong: #0a5f61;
  --warm: #c56b36;
  --shadow: 0 18px 60px rgba(31, 47, 41, 0.18);
  --radius: 8px;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101413;
  --surface: #171d1b;
  --surface-2: #202926;
  --text: #f4f0e7;
  --muted: #a8b4ad;
  --line: rgba(244, 240, 231, 0.16);
  --accent: #49b8aa;
  --accent-strong: #8fe0d2;
  --warm: #e0a06f;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  min-height: 72px;
  padding: 14px clamp(18px, 4vw, 56px);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: max-content;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--text);
  color: var(--bg);
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
  line-height: 1.1;
}

.brand small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(12px, 2vw, 28px);
  color: var(--muted);
  font-size: 14px;
}

.site-nav a:hover,
.footer-links a:hover,
.feature-card a:hover {
  color: var(--accent-strong);
}

.theme-toggle {
  position: relative;
  width: 48px;
  height: 32px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  cursor: pointer;
}

.theme-toggle::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 5px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--warm);
  transition: transform 180ms ease;
}

[data-theme="dark"] .theme-toggle::after {
  transform: translateX(17px);
  background: var(--accent);
}

.sun,
.moon {
  position: absolute;
  top: 10px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.sun {
  left: 12px;
  background: #fff5c2;
}

.moon {
  right: 12px;
  border: 2px solid var(--muted);
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: end;
  min-height: calc(100svh - 72px);
  padding: clamp(54px, 8vw, 96px) clamp(18px, 4vw, 56px) clamp(42px, 6vw, 72px);
  overflow: hidden;
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: -2;
  background-image: linear-gradient(90deg, color-mix(in srgb, var(--bg) 96%, transparent), color-mix(in srgb, var(--bg) 66%, transparent) 43%, color-mix(in srgb, var(--bg) 16%, transparent)), url("./hero-tech-blog.png");
  background-size: cover;
  background-position: center;
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  z-index: -1;
  height: 36%;
  background: linear-gradient(0deg, var(--bg), transparent);
}

.hero-content {
  max-width: 760px;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 18px;
  font-size: clamp(48px, 9vw, 108px);
  line-height: 0.96;
  letter-spacing: 0;
}

.hero-copy {
  max-width: 620px;
  color: var(--muted);
  font-size: clamp(17px, 2vw, 22px);
  line-height: 1.8;
}

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

.primary-action,
.ghost-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-weight: 700;
}

.primary-action {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.ghost-action {
  background: color-mix(in srgb, var(--surface) 72%, transparent);
}

.section-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.feature-card {
  min-height: 300px;
  padding: clamp(24px, 4vw, 38px);
  background: var(--surface);
}

.card-icon {
  display: inline-grid;
  width: 46px;
  height: 46px;
  place-items: center;
  margin-bottom: 34px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--warm);
  font-weight: 800;
}

.feature-card h2 {
  margin-bottom: 14px;
  font-size: clamp(24px, 3vw, 36px);
  letter-spacing: 0;
}

.feature-card p {
  color: var(--muted);
  line-height: 1.8;
}

.feature-card a {
  display: inline-flex;
  margin-top: 18px;
  color: var(--accent);
  font-weight: 800;
}

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--surface-2);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 24px clamp(18px, 4vw, 56px);
  color: var(--muted);
  font-size: 14px;
}

.footer-brand strong,
.footer-brand span {
  display: block;
}

.footer-brand strong {
  margin-bottom: 5px;
  color: var(--text);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 14px 18px;
}

.police-record {
  color: var(--muted);
}

.site-detail {
  position: relative;
  cursor: help;
}

.detail-popover {
  position: absolute;
  right: 0;
  bottom: calc(100% + 12px);
  width: max-content;
  max-width: min(320px, calc(100vw - 36px));
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  color: var(--text);
  line-height: 1.9;
  opacity: 0;
  pointer-events: none;
  transform: translateY(6px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.site-detail:hover .detail-popover,
.site-detail:focus .detail-popover {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 980px) {
  .site-header {
    flex-wrap: wrap;
  }

  .site-nav {
    order: 3;
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 2px;
  }

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

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

@media (max-width: 620px) {
  .site-header {
    min-height: 64px;
    gap: 12px;
  }

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

  .hero {
    min-height: auto;
    padding-top: 48px;
  }

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

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

  .feature-card {
    min-height: 230px;
  }

  .note-list a,
  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .detail-popover {
    right: auto;
    left: 0;
  }
}
