:root {
  color-scheme: light;
  --background: #fafafa;
  --surface: #ffffff;
  --surface-hover: #f7f7f7;
  --text: #202020;
  --muted: #707070;
  --line: #e5e5e5;
  --accent: #222222;
  --radius: 12px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Noto Sans SC", sans-serif;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

.page-shell {
  width: min(900px, calc(100% - 40px));
  margin: 0 auto;
  padding-bottom: 34px;
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 92px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  color: var(--text);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.hero {
  max-width: 620px;
  padding: 36px 0 40px;
}

.language-toggle {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  transition: background-color 150ms ease;
}

.language-toggle:hover {
  background: var(--surface-hover);
}

.hero h1 {
  margin: 0;
  font-size: clamp(1.7rem, 3.5vw, 2.25rem);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.2;
}

.tools-section {
  padding: 56px 0 96px;
  border-top: 1px solid var(--line);
}

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

.section-heading h2 {
  margin: 0;
  font-size: 1.35rem;
  letter-spacing: -0.025em;
}

.tool-count {
  color: var(--muted);
  margin: 0 0 5px;
  font-size: 0.82rem;
}

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

.tool-card {
  position: relative;
  display: flex;
  min-height: 220px;
  flex-direction: column;
  padding: 24px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  text-decoration: none;
  transition: border-color 150ms ease, background-color 150ms ease;
}

.tool-card:hover {
  background: var(--surface-hover);
  border-color: #c9c9c9;
}

.tool-card:focus-visible,
.brand:focus-visible,
.language-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.card-number {
  position: relative;
  margin-bottom: auto;
  color: var(--muted);
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.08em;
}

.tool-card h3 {
  position: relative;
  margin: 38px 0 0;
  font-size: 1.2rem;
  letter-spacing: -0.035em;
}

.tool-description {
  position: relative;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.6;
}

.card-arrow {
  position: absolute;
  top: 25px;
  right: 25px;
  z-index: 1;
  font-size: 1.2rem;
}

.noscript-message {
  padding: 72px 24px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}

.noscript-message {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.7;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding-top: 34px;
  color: #686d76;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
}

.footer-site-name {
  color: #161719;
}

.site-footer a {
  color: #161719;
  text-decoration: none;
}

.site-footer a:hover {
  color: #0071e3;
}

@media (max-width: 820px) {
  .hero {
    padding: 32px 0 36px;
  }

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

@media (max-width: 560px) {
  .page-shell {
    width: min(100% - 28px, 900px);
  }

  .site-header {
    min-height: 76px;
  }

  .hero {
    padding: 28px 0 32px;
  }

  .hero h1 {
    font-size: clamp(1.65rem, 8vw, 2rem);
  }

  .tools-section {
    padding: 56px 0 72px;
  }

  .section-heading {
    align-items: start;
    flex-direction: column;
  }

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

  .tool-card {
    min-height: 210px;
  }

}

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

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