:root {
  --bg: #f7f8fc;
  --surface: #ffffff;
  --text: #17191f;
  --muted: #6d7280;
  --line: #eaecf2;
  --accent: #7559e8;
  --header: rgba(247, 248, 252, 0.88);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "DM Sans", sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.header {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 78px;
  background: var(--header);
  border-bottom: 1px solid rgba(226, 228, 235, 0.72);
  backdrop-filter: blur(16px);
}

.nav-shell {
  width: min(1120px, calc(100% - 48px));
  height: 100%;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  width: fit-content;
  color: var(--text);
  text-decoration: none;
  font-family: "Manrope", sans-serif;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  color: white;
  background: var(--accent);
  transform: rotate(-2deg);
  box-shadow: 0 6px 16px rgba(117, 89, 232, 0.22);
}

.brand-mark svg {
  width: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-links { display: flex; align-items: center; gap: 38px; }
.nav-links a {
  position: relative;
  color: var(--muted);
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
  transition: color 180ms ease;
}
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-links a.active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -29px;
  width: 19px;
  height: 3px;
  border-radius: 3px;
  background: var(--accent);
  transform: translateX(-50%);
}

.icon-button {
  justify-self: end;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--text);
  background: var(--surface);
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease;
}
.icon-button:hover { transform: translateY(-2px); border-color: #d7d9e2; }
.icon-button svg {
  width: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hero {
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto;
  padding: 84px 0 68px;
  text-align: center;
}

.hero-copy { max-width: 760px; margin: 0 auto; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.eyebrow span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #9e8af0;
  box-shadow: 0 0 0 5px #ede9fc;
}

.hero h1 {
  margin: 0;
  font-family: "Manrope", sans-serif;
  font-size: clamp(44px, 6vw, 68px);
  line-height: 1.07;
  letter-spacing: -4px;
}
.hero h1 em {
  color: var(--accent);
  font-style: normal;
}
.hero-copy > p {
  max-width: 560px;
  margin: 22px auto 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.65;
}

.search-bar {
  width: min(680px, 100%);
  height: 68px;
  margin: 38px auto 0;
  padding: 8px 8px 8px 22px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid #e4e6ed;
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 14px 38px rgba(41, 44, 70, 0.07);
  transition: border-color 180ms ease, box-shadow 180ms ease;
}
.search-bar:focus-within {
  border-color: #b9acf2;
  box-shadow: 0 14px 38px rgba(117, 89, 232, 0.11);
}
.search-bar > svg {
  width: 21px;
  flex: 0 0 auto;
  fill: none;
  stroke: #969baa;
  stroke-width: 1.8;
  stroke-linecap: round;
}
.search-bar input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
  font-size: 16px;
}
.search-bar input::placeholder { color: #aaaebb; }
.search-bar button {
  height: 52px;
  padding: 0 18px 0 22px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 12px;
  color: white;
  background: var(--accent);
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(117, 89, 232, 0.2);
  transition: transform 180ms ease, background 180ms ease;
}
.search-bar button:hover { transform: translateY(-1px); background: #6850d4; }
.search-bar button svg {
  width: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tools-section {
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto;
  padding: 46px 0 78px;
}
.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 24px;
}
.section-kicker {
  margin: 0 0 7px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
}
.section-heading h2, .learn-copy h2 {
  margin: 0;
  font-family: "Manrope", sans-serif;
  font-size: 30px;
  letter-spacing: -1.4px;
}
.view-all {
  border: 0;
  color: var(--muted);
  background: transparent;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.view-all span { margin-left: 5px; color: var(--accent); }

.tool-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.tool-card {
  position: relative;
  min-height: 118px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 5px 18px rgba(38, 42, 65, 0.025);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}
.tool-card:hover {
  transform: translateY(-4px);
  border-color: #dddfea;
  box-shadow: 0 14px 28px rgba(38, 42, 65, 0.08);
}
.tool-card.hidden { display: none; }
.favorite-tool {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  color: #b1b4bf;
  background: transparent;
  cursor: pointer;
  opacity: 0;
  transition: 180ms ease;
}
.tool-card:hover .favorite-tool,
.favorite-tool.active,
.favorite-tool:focus-visible {
  opacity: 1;
}
.favorite-tool.active { color: #e1a33a; }
.tool-icon {
  width: 56px;
  height: 56px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 15px;
}
.tool-icon svg {
  width: 27px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.tool-icon.coral { color: #df715f; background: #fdebe7; }
.tool-icon.blue { color: #5b79cd; background: #edf1fc; }
.tool-icon.gold { color: #c99943; background: #fdf4dc; }
.tool-icon.mint { color: #449b80; background: #e6f5ef; }
.tool-icon.lavender { color: #7d69c9; background: #eeeafa; }
.tool-icon.pink { color: #c86991; background: #faeaf1; }
.tool-body { min-width: 0; flex: 1; }
.tool-body h3 {
  margin: 0 0 5px;
  font-size: 16px;
  letter-spacing: -0.2px;
}
.tool-body p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}
.card-arrow {
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 50%;
  color: #b1b4bf;
  background: transparent;
  cursor: pointer;
  transition: color 180ms ease, background 180ms ease;
}
.tool-card:hover .card-arrow { color: var(--accent); background: #f2effe; }

.learn-section {
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto 78px;
}
.learn-card {
  min-height: 290px;
  display: grid;
  grid-template-columns: 42% 58%;
  overflow: hidden;
  border-radius: 20px;
  background: #ece8fb;
}
.learn-art {
  position: relative;
  min-height: 290px;
  overflow: hidden;
  background: linear-gradient(145deg, #ebe6fb 0%, #ddd5f7 100%);
}
.shape {
  position: absolute;
  display: block;
  border-radius: 50%;
  background: #f8f6ff;
}
.shape-a { width: 260px; height: 260px; left: -90px; bottom: -145px; }
.shape-b { width: 150px; height: 150px; right: -35px; top: -45px; opacity: 0.75; }
.shape-c { width: 76px; height: 76px; left: 70px; top: 42px; background: #ffd8b6; opacity: 0.9; }
.bulb {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 118px;
  height: 118px;
  display: grid;
  place-items: center;
  border: 13px solid white;
  border-radius: 38px;
  color: #7559e8;
  background: #fff2a8;
  transform: translate(-50%, -50%) rotate(-8deg);
  box-shadow: 0 18px 40px rgba(117, 89, 232, 0.16);
}
.bulb svg {
  width: 58px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.learn-copy {
  align-self: center;
  max-width: 480px;
  padding: 44px 56px;
}
.learn-copy h2 { margin-bottom: 12px; }
.learn-copy > p:not(.section-kicker) {
  margin: 0 0 20px;
  color: #71727d;
  line-height: 1.65;
}
.learn-link {
  color: var(--accent);
  text-decoration: none;
  font-size: 14px;
  font-weight: 800;
}
.learn-link span { margin-left: 6px; }

footer {
  min-height: 110px;
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}
.footer-brand { font-size: 18px; }
.footer-brand .brand-mark { width: 30px; height: 30px; border-radius: 9px; }
.footer-brand .brand-mark svg { width: 19px; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 30;
  padding: 12px 18px;
  border-radius: 10px;
  color: white;
  background: #242631;
  font-size: 14px;
  opacity: 0;
  transform: translate(-50%, 20px);
  pointer-events: none;
  transition: 220ms ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.search-suggestions {
  position: fixed;
  z-index: 25;
  width: min(680px, calc(100% - 32px));
  max-height: 230px;
  overflow-y: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 16px 38px rgba(38, 42, 65, 0.12);
}
.search-suggestions[hidden] { display: none; }
.suggestion-button {
  width: 100%;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 0;
  border-radius: 9px;
  color: var(--text);
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.suggestion-button:hover,
.suggestion-button:focus-visible {
  background: var(--bg);
  outline: none;
}
.suggestion-button span:last-child {
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
}

body.dark {
  --bg: #171820;
  --surface: #20212b;
  --text: #f4f4f7;
  --muted: #a9abba;
  --line: #30313c;
  --header: rgba(23, 24, 32, 0.88);
}
body.dark .header { border-bottom-color: #292a34; }
body.dark .search-bar { border-color: #30313c; }
body.dark .tool-card:hover { border-color: #41424f; }
body.dark .learn-card { background: #2b2940; }
body.dark .learn-art { background: linear-gradient(145deg, #302d49, #29263d); }
body.dark .learn-copy > p:not(.section-kicker) { color: #b2b1bd; }

@media (max-width: 900px) {
  .tool-grid { grid-template-columns: repeat(2, 1fr); }
  .learn-card { grid-template-columns: 38% 62%; }
  .learn-copy { padding: 36px; }
}

@media (max-width: 640px) {
  .header { height: 68px; }
  .nav-shell, .hero, .tools-section, .learn-section, footer { width: min(100% - 32px, 1120px); }
  .nav-shell { grid-template-columns: 1fr auto; }
  .nav-links { display: none; }
  .hero { padding: 58px 0 48px; }
  .hero h1 { font-size: 42px; letter-spacing: -2.5px; }
  .hero h1 br { display: none; }
  .hero-copy > p { font-size: 16px; }
  .search-bar { height: 62px; padding-left: 16px; }
  .search-bar button { width: 48px; height: 48px; justify-content: center; padding: 0; }
  .search-bar button span { display: none; }
  .tool-grid { grid-template-columns: 1fr; }
  .tools-section { padding-top: 36px; }
  .section-heading h2 { font-size: 25px; }
  .learn-card { grid-template-columns: 1fr; }
  .learn-art { min-height: 220px; }
  .learn-copy { padding: 34px 28px 38px; }
  footer { padding: 24px 0; }
  footer p { display: none; }
}
