:root {
  color-scheme: light dark;
  --page: #f7fbff;
  --surface: #ffffff;
  --surface-muted: #edf5ff;
  --ink: #162338;
  --muted: #61718a;
  --line: #d8e4f0;
  --accent: #ff6858;
  --accent-strong: #dd4537;
  --accent-soft: #ffe7e2;
  --shadow: 0 20px 55px rgba(76, 113, 152, 0.14);
  --hero-start: #fff3ef;
  --hero-mid: #f7fbff;
  --hero-end: #f0fbfa;
  --featured-bg: #f3f8ff;
  --radius: 14px;
  font-family: "Segoe UI Variable", "Segoe UI", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --page: #15191b;
    --surface: #1e2528;
    --surface-muted: #252d30;
    --ink: #f1f4f3;
    --muted: #aeb8bb;
    --line: #354145;
    --accent: #ff7965;
    --accent-strong: #ff9a8d;
    --accent-soft: #3f2926;
    --shadow: 0 20px 55px rgba(0, 0, 0, 0.24);
    --hero-start: #241c22;
    --hero-mid: #15191b;
    --hero-end: #172521;
    --featured-bg: #1a2228;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background: var(--page);
}

button,
input { font: inherit; }

button { cursor: pointer; }

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

svg { width: 20px; height: 20px; stroke-width: 1.9; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
  padding: 12px clamp(18px, 4vw, 64px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  background: color-mix(in srgb, var(--page) 88%, transparent);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 1.03rem;
  font-weight: 850;
  letter-spacing: 0.01em;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 10px;
  color: #fff;
  background: var(--accent);
  font-size: 0.81rem;
  letter-spacing: -0.03em;
}

.brand-accent { color: var(--accent); }

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(16px, 2.5vw, 34px);
}

.site-nav a {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 750;
  transition: color 180ms ease;
}

.site-nav a:hover { color: var(--accent); }

.hero,
.category-section,
.featured-section,
.tools-section {
  width: min(1360px, 100%);
  margin: 0 auto;
  padding-inline: clamp(18px, 4vw, 64px);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.84fr) minmax(520px, 1.16fr);
  gap: clamp(40px, 6vw, 96px);
  align-items: center;
  min-height: min(700px, calc(100dvh - 68px));
  padding-block: clamp(48px, 7vw, 88px);
  background: linear-gradient(112deg, var(--hero-start) 0%, var(--hero-mid) 47%, var(--hero-end) 100%);
}

.hero-copy { max-width: 570px; }

.kicker {
  margin: 0 0 14px;
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 18px;
  font-size: clamp(3.15rem, 5.2vw, 5.8rem);
  line-height: 0.94;
  letter-spacing: -0.045em;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(2rem, 3vw, 3.25rem);
  line-height: 1;
  letter-spacing: -0.035em;
}

h3 { letter-spacing: -0.02em; }

.hero-text {
  max-width: 470px;
  margin-bottom: 30px;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.62;
}

.search-area {
  position: relative;
  width: min(100%, 520px);
}

.search-box {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) 40px;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 62px;
  padding: 8px 10px 8px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--accent);
  background: var(--surface);
  box-shadow: 0 12px 32px rgba(38, 56, 62, 0.07);
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.search-box:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.search-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
}

.search-box input::placeholder { color: var(--muted); opacity: 0.85; }

.search-box button {
  display: grid;
  width: 40px;
  height: 40px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  background: transparent;
}

.search-box button:hover { color: var(--accent); border-color: var(--accent); }

.search-suggestions {
  position: absolute;
  z-index: 4;
  top: calc(100% + 8px);
  left: 0;
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.search-suggestion {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 11px;
  min-height: 64px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  transition: background 160ms ease;
}

.search-suggestion:last-child { border-bottom: 0; }

.search-suggestion:hover { background: var(--surface-muted); }

.search-suggestion-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 10px;
  color: color-mix(in srgb, var(--category-color) 55%, #101828);
  background: color-mix(in srgb, var(--category-color) 13%, var(--surface));
}

.search-suggestion strong,
.search-suggestion small { display: block; }

.search-suggestion strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 0.9rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-suggestion small { margin-top: 2px; color: var(--muted); font-size: 0.76rem; }

.search-suggestion > svg { color: var(--muted); }

.search-empty { margin: 0; padding: 18px; color: var(--muted); font-size: 0.9rem; }

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  margin-top: 20px;
  color: var(--muted);
  font-size: 0.9rem;
}

.hero-stats strong { color: var(--ink); font-size: 1.08rem; }

.hero-media {
  position: relative;
  min-height: 390px;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-muted);
  box-shadow: var(--shadow);
  transform: rotate(1.2deg);
}

.hero-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.category-section,
.featured-section,
.tools-section { padding-block: clamp(64px, 8vw, 112px); }

.category-section {
  padding-bottom: clamp(44px, 5vw, 66px);
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.section-intro { max-width: 600px; margin-bottom: 30px; }

.section-intro--wide { max-width: 720px; }

.category-tabs {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 9px;
}

.category-tab {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  min-height: 60px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  background: color-mix(in srgb, var(--category-color, var(--accent)) 7%, var(--surface));
  text-align: left;
  transition: transform 180ms ease, border-color 180ms ease, color 180ms ease, background 180ms ease;
  --category-ink: color-mix(in srgb, var(--category-color, var(--accent)) 55%, #101828);
}

.category-tab:hover,
.category-tab.is-active {
  border-color: var(--category-color, var(--accent));
  color: var(--category-ink);
  background: color-mix(in srgb, var(--category-color, var(--accent)) 13%, var(--surface));
  transform: translateY(-2px);
}

.category-icon { display: grid; place-items: center; }

.category-icon { color: var(--category-ink); }

.category-name {
  overflow: hidden;
  font-size: 0.87rem;
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-tab strong { font-size: 0.83rem; }

.featured-section {
  width: 100%;
  max-width: none;
  padding-top: clamp(52px, 6vw, 82px);
  padding-bottom: clamp(52px, 5vw, 66px);
  padding-inline: max(18px, calc((100% - 1360px) / 2 + 64px));
  background: var(--featured-bg);
}

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

.featured-empty {
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  gap: 18px;
  min-height: 170px;
  padding: 26px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  background: var(--surface);
}

.featured-empty > svg { width: 32px; height: 32px; color: var(--accent); }

.featured-empty h3 { margin-bottom: 6px; color: var(--ink); font-size: 1.08rem; }

.featured-empty p { margin: 0; line-height: 1.5; }

.featured-card {
  position: relative;
  display: grid;
  grid-template-rows: 188px auto;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  isolation: isolate;
  cursor: pointer;
  transition: transform 220ms ease, box-shadow 220ms ease;
  --category-ink: color-mix(in srgb, var(--category-color, var(--accent)) 55%, #101828);
}

.featured-card:hover { box-shadow: var(--shadow); transform: translateY(-4px); }

.featured-media,
.card-media {
  position: relative;
  display: grid;
  min-width: 0;
  overflow: hidden;
  place-items: center;
  background: color-mix(in srgb, var(--category-color, var(--accent)) 16%, var(--surface));
}

.featured-media { min-height: 100%; }

.tool-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 200ms ease, transform 500ms cubic-bezier(0.16, 1, 0.3, 1);
}

.tool-media.has-image .tool-image { opacity: 1; }

.featured-card:hover .tool-media.has-image .tool-image,
.tool-card:hover .tool-media.has-image .tool-image { transform: scale(1.045); }

.tool-icon {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--category-color, var(--accent)) 26%, transparent);
  border-radius: 12px;
  color: var(--category-ink, var(--category-color, var(--accent)));
  background: var(--surface);
  box-shadow: 0 10px 28px rgba(123, 52, 43, 0.08);
  transition: transform 280ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 280ms ease;
}

.tool-icon svg { width: 26px; height: 26px; }

.featured-copy {
  align-self: end;
  padding: 20px;
}

.featured-copy p,
.tool-meta {
  margin-bottom: 7px;
  color: var(--category-ink, var(--category-color, var(--accent)));
  font-size: 0.76rem;
  font-weight: 850;
}

.featured-copy h3 {
  margin-bottom: 9px;
  font-size: 1.24rem;
  line-height: 1.1;
}

.featured-copy > span {
  display: -webkit-box;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.48;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.featured-copy a,
.open-tool {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 17px;
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 800;
}

.featured-copy a:hover,
.open-tool:hover { color: var(--accent); }

.featured-copy a svg,
.open-tool svg { width: 17px; height: 17px; transition: transform 180ms ease; }

.featured-card:hover .tool-icon,
.tool-card:hover .tool-icon { transform: rotate(-7deg) scale(1.06); }

.featured-copy a:hover svg,
.open-tool:hover svg { transform: translate(2px, -2px); }

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

.tools-section { padding-top: clamp(56px, 5vw, 70px); }

.tools-controls { display: flex; align-items: center; gap: 14px; }

.result-meta { color: var(--muted); font-size: 0.92rem; font-weight: 750; }

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  background: var(--surface);
  transition: color 180ms ease, border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.icon-button:hover,
.icon-button.is-active {
  border-color: var(--accent);
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.pin-button.is-active { border-color: var(--accent); color: var(--accent-strong); background: var(--accent-soft); }

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

.tool-card {
  display: grid;
  grid-template-rows: 178px auto;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  isolation: isolate;
  cursor: pointer;
  transition: transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease;
  --category-ink: color-mix(in srgb, var(--category-color, var(--accent)) 55%, #101828);
}

.tool-card:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); box-shadow: var(--shadow); transform: translateY(-4px); }

.featured-card:focus-visible,
.tool-card:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--category-color, var(--accent)) 60%, transparent);
  outline-offset: 3px;
}

.tool-copy { display: flex; min-width: 0; flex-direction: column; padding: 20px; }

.tool-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.tool-meta span:last-child { color: var(--muted); font-weight: 720; }

.tool-copy h3 { margin-bottom: 9px; font-size: 1.25rem; line-height: 1.12; }

.tool-copy > p {
  display: -webkit-box;
  margin-bottom: 16px;
  overflow: hidden;
  color: var(--muted);
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.tag-row {
  display: flex;
  min-height: 25px;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 18px;
}

.tag-row span {
  padding: 4px 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.tag-row span:not(:last-child)::after { padding-left: 6px; color: var(--line); content: "/"; }

.tool-actions {
  display: grid;
  grid-template-columns: 1fr 40px;
  gap: 8px;
  align-items: center;
  margin-top: auto;
}

.open-tool { min-height: 40px; margin: 0; }

.icon-button { width: 40px; height: 40px; padding: 0; }

.icon-button:active,
.category-tab:active { transform: translateY(1px) scale(0.98); }

.empty-state {
  padding: 72px 18px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}

.empty-state svg { width: 36px; height: 36px; margin-bottom: 10px; color: var(--accent); }

.empty-state h3 { margin-bottom: 8px; color: var(--ink); }

.empty-state p { margin-bottom: 0; }

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 94px;
  padding: 20px clamp(18px, 4vw, 64px);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
}

[data-reveal] { opacity: 0; transform: translateY(18px); }

[data-reveal].is-visible { animation: reveal 560ms cubic-bezier(0.16, 1, 0.3, 1) forwards; }

.hero-reveal { animation: hero-reveal 650ms cubic-bezier(0.16, 1, 0.3, 1) both; }

.hero-media.hero-reveal { animation-delay: 110ms; }

@keyframes reveal { to { opacity: 1; transform: translateY(0); } }

@keyframes hero-reveal { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 1050px) {
  .hero { grid-template-columns: minmax(0, 0.95fr) minmax(360px, 1.05fr); gap: 42px; }
  .category-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .site-header { position: static; min-height: 62px; }
  .site-nav { gap: 15px; overflow-x: auto; }
  .site-nav a { white-space: nowrap; font-size: 0.82rem; }
  .hero { grid-template-columns: 1fr; min-height: auto; gap: 36px; padding-block: 44px 56px; }
  h1 { font-size: clamp(3rem, 14vw, 4.2rem); }
  .hero-media { min-height: 310px; transform: none; }
  .category-section, .featured-section, .tools-section { padding-block: 64px; }
  .category-tabs { grid-template-columns: 1fr 1fr; }
  .featured-section { padding-inline: 18px; }
  .featured-grid { grid-template-columns: 1fr; grid-template-rows: none; }
  .featured-card { grid-template-columns: 38% minmax(0, 1fr); grid-template-rows: none; min-height: 184px; }
  .tools-heading { align-items: flex-start; flex-direction: column; margin-bottom: 24px; }
  .tool-grid { grid-template-columns: 1fr; }
  .tool-card { grid-template-columns: 1fr; grid-template-rows: 190px auto; }
  .site-footer { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 430px) {
  .site-header { align-items: flex-start; gap: 12px; flex-direction: column; }
  .site-nav { width: 100%; justify-content: space-between; }
  .hero-stats { gap: 10px; flex-direction: column; }
  .category-tab { grid-template-columns: 22px minmax(0, 1fr) auto; min-height: 54px; }
  .featured-card { grid-template-columns: 104px minmax(0, 1fr); min-height: 170px; }
  .featured-copy { padding: 16px; }
  .featured-copy > span { font-size: 0.86rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  [data-reveal] { opacity: 1; transform: none; }
}
