:root {
  --blue: #1764f5;
  --blue-dark: #0b4fd6;
  --navy: #10213f;
  --text: #17233a;
  --muted: #64748b;
  --line: #dce4ef;
  --soft-line: #edf1f6;
  --surface: #ffffff;
  --canvas: #f8faff;
  --focus: #0f5fff;
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --shadow-focus: 0 0 0 4px rgba(23, 100, 245, .14);
  --shadow-card: 0 12px 32px rgba(26, 50, 87, .08);
  --max-width: 1280px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--surface);
  color: var(--text);
  font-family: Pretendard, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; }
a { color: inherit; text-decoration: none; }
svg { display: block; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 200;
  transform: translateY(-160%);
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--navy);
  color: white;
}
.skip-link:focus { transform: translateY(0); }
.mobile-only { display: none; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: 72px;
  background: rgba(255, 255, 255, .94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}
.header-inner {
  width: min(calc(100% - 48px), var(--max-width));
  height: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-height: 44px;
  color: var(--navy);
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -.02em;
}
.brand-mark {
  width: 38px;
  height: 38px;
  fill: none;
  stroke: var(--blue);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.brand-mark path:first-of-type { fill: rgba(23, 100, 245, .13); }
.primary-nav { display: flex; align-items: stretch; height: 100%; gap: 46px; }
.primary-nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: #334155;
  font-weight: 650;
}
.primary-nav a:hover { color: var(--blue); }
.primary-nav a.is-current { color: var(--blue); }
.primary-nav a.is-current::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: var(--blue);
  border-radius: 3px 3px 0 0;
}
.primary-nav .external-link { margin-left: 110px; font-size: 14px; font-weight: 550; }
.menu-button { display: none; }

.hero {
  position: relative;
  overflow: hidden;
  min-height: 330px;
  background: linear-gradient(#fbfdff, #f8fbff);
  border-bottom: 1px solid var(--soft-line);
}
.compass-lines {
  position: absolute;
  inset: 0;
  opacity: .75;
  background:
    radial-gradient(circle at 80% 55%, transparent 0 56px, rgba(23,100,245,.08) 57px 58px, transparent 59px 96px, rgba(23,100,245,.06) 97px 98px, transparent 99px),
    linear-gradient(154deg, transparent 0 62%, rgba(23,100,245,.07) 62.1% 62.3%, transparent 62.4%);
  pointer-events: none;
}
.hero-inner {
  position: relative;
  width: min(calc(100% - 48px), 920px);
  margin: 0 auto;
  padding: 56px 0 62px;
  text-align: center;
}
.hero h1 {
  margin: 0;
  color: var(--navy);
  font-size: clamp(34px, 3.2vw, 48px);
  line-height: 1.18;
  letter-spacing: -.04em;
  font-weight: 850;
}
.hero p { margin: 14px 0 0; color: #52637d; font-size: 18px; }
.search-form {
  width: min(100%, 780px);
  height: 64px;
  margin: 30px auto 0;
  display: grid;
  grid-template-columns: 24px 1fr 44px;
  align-items: center;
  gap: 13px;
  padding: 8px 9px 8px 19px;
  background: white;
  border: 2px solid var(--blue);
  border-radius: 15px;
  box-shadow: 0 12px 28px rgba(23, 100, 245, .12);
}
.search-form:focus-within { box-shadow: var(--shadow-focus), 0 12px 28px rgba(23,100,245,.12); }
.search-form > svg { width: 22px; fill: none; stroke: #41536d; stroke-width: 2; stroke-linecap: round; }
.search-form input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--navy);
  font-size: 17px;
}
.search-form input::placeholder { color: #8a97aa; }
.search-form button {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--blue);
  color: white;
  cursor: pointer;
  transition: transform .2s ease, background .2s ease;
}
.search-form button:hover { background: var(--blue-dark); transform: translateX(2px); }
.search-form button svg { width: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.category-wrap {
  position: relative;
  z-index: 5;
  width: min(calc(100% - 48px), 1030px);
  margin: -28px auto 0;
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.category-list { display: flex; align-items: center; justify-content: center; padding: 8px; }
.category-button {
  flex: 1;
  min-width: max-content;
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  border: 0;
  border-right: 1px solid var(--soft-line);
  background: white;
  color: #42516a;
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
  border-radius: 10px;
}
.category-button:last-child { border-right: 0; }
.category-button:hover { background: #f7f9fc; color: var(--blue); }
.category-button.is-selected { background: #eef5ff; color: var(--blue); }
.category-button svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.content-shell { width: min(calc(100% - 48px), var(--max-width)); margin: 0 auto; padding: 54px 0 80px; }
.featured-section { padding-bottom: 28px; border-bottom: 1px solid var(--line); }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 18px; }
.section-heading h2 { margin: 0; color: var(--navy); font-size: 23px; line-height: 1.3; letter-spacing: -.02em; }
.text-button {
  display: none;
  min-height: 44px;
  border: 0;
  background: transparent;
  color: var(--blue);
  font-weight: 700;
  cursor: pointer;
}
.featured-tools { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.featured-card,
.tool-card {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
  background: white;
  border: 1px solid var(--line);
  color: inherit;
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
.featured-card:hover,
.tool-card:hover { border-color: #b8c8df; box-shadow: var(--shadow-card); transform: translateY(-2px); }
.featured-card { min-height: 110px; gap: 16px; padding: 20px; border-radius: var(--radius-md); }
.tool-icon {
  flex: 0 0 auto;
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 15px;
}
.featured-card .tool-icon { width: 60px; height: 60px; }
.tool-icon svg { width: 27px; height: 27px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tone-blue { color: #1764f5; background: #edf4ff; border-color: #c8dcff; }
.tone-mint { color: #129b77; background: #edfbf6; border-color: #bcebdc; }
.tone-lilac { color: #7248e8; background: #f4f0ff; border-color: #dcd1ff; }
.tone-rose { color: #e63c5c; background: #fff0f3; border-color: #ffd1da; }
.tone-amber { color: #ec7608; background: #fff5e9; border-color: #ffd8b0; }
.tone-yellow { color: #c88900; background: #fff9df; border-color: #f3dfa2; }
.tone-cyan { color: #0797a7; background: #ebfbfd; border-color: #bcebf0; }
.tone-slate { color: #52637d; background: #f3f6f9; border-color: #dce3eb; }
.tool-copy { min-width: 0; flex: 1; }
.tool-copy h3 { margin: 0; color: var(--navy); font-size: 17px; line-height: 1.35; letter-spacing: -.015em; }
.tool-copy p { margin: 5px 0 0; color: var(--muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.audience { display: inline-flex; align-items: center; gap: 5px; margin-top: 9px; color: #53647e; font-size: 12px; }
.audience svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.card-arrow {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: #354760;
  font-size: 19px;
  transition: transform .2s ease, border-color .2s ease, color .2s ease;
}
.featured-card:hover .card-arrow,
.tool-card:hover .card-arrow { transform: translateX(2px); border-color: var(--blue); color: var(--blue); }

.all-tools-section { padding-top: 28px; }
.tools-heading { align-items: center; }
.result-count { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.sort-control select {
  min-width: 114px;
  height: 44px;
  padding: 0 34px 0 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
  color: #40516b;
  cursor: pointer;
}
.tool-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.tool-card { min-height: 122px; gap: 14px; padding: 18px; border-radius: var(--radius-md); }
.empty-state { padding: 70px 20px; text-align: center; border: 1px dashed #c6d1df; border-radius: var(--radius-lg); background: var(--canvas); }
.empty-state h3 { margin: 0; color: var(--navy); }
.empty-state p { margin: 8px 0 18px; color: var(--muted); }
.empty-state button { min-height: 44px; padding: 0 18px; border: 0; border-radius: 10px; background: var(--blue); color: white; font-weight: 700; cursor: pointer; }
.fortune-link {
  margin-top: 48px;
  padding: 20px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border: 1px solid #f0dfaf;
  border-radius: var(--radius-md);
  background: #fffdf5;
}
.fortune-link > div { display: flex; align-items: center; gap: 14px; }
.fortune-icon { font-size: 28px; }
.fortune-link strong, .fortune-link div span { display: block; }
.fortune-link div span { margin-top: 2px; color: #786d52; font-size: 13px; }
.fortune-link a { min-height: 44px; display: inline-flex; align-items: center; gap: 8px; color: #8a6400; font-weight: 700; white-space: nowrap; }

.site-footer {
  width: min(calc(100% - 48px), var(--max-width));
  min-height: 150px;
  margin: 0 auto;
  padding: 36px 0;
  display: flex;
  justify-content: space-between;
  gap: 32px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}
.footer-brand { color: var(--navy); font-size: 17px; font-weight: 800; }
.site-footer p { margin: 6px 0 0; }
.footer-links { display: flex; align-items: flex-start; gap: 22px; }
.footer-links a:hover { color: var(--blue); }

.guide-page { width: min(calc(100% - 48px), 980px); margin: 0 auto; padding: 74px 0 90px; }
.guide-hero { max-width: 760px; padding-bottom: 58px; }
.guide-hero h1 { margin: 0; color: var(--navy); font-size: clamp(36px, 4vw, 54px); line-height: 1.18; letter-spacing: -.045em; }
.guide-hero p { margin: 18px 0 28px; color: var(--muted); font-size: 18px; }
.guide-hero a { min-height: 46px; display: inline-flex; align-items: center; gap: 8px; padding: 0 18px; border-radius: 11px; background: var(--blue); color: white; font-weight: 750; }
.guide-section { padding: 42px 0; border-top: 1px solid var(--line); }
.guide-section h2 { margin: 0 0 24px; color: var(--navy); font-size: 25px; }
.guide-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 34px; }
.guide-list article { padding: 20px 0; border-bottom: 1px solid var(--soft-line); }
.guide-list strong { color: var(--navy); font-size: 17px; }
.guide-list p, .guide-steps p { margin: 7px 0 0; color: var(--muted); }
.guide-steps ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.guide-steps li { display: flex; align-items: flex-start; gap: 18px; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius-md); }
.guide-steps li > span { flex: 0 0 auto; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: #eef5ff; color: var(--blue); font-weight: 800; }
.guide-steps strong { color: var(--navy); font-size: 17px; }

@media (max-width: 1180px) {
  .primary-nav { gap: 28px; }
  .primary-nav .external-link { margin-left: 30px; }
  .tool-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .tool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .mobile-only { display: block; }
  .site-header { height: 68px; }
  .header-inner { width: min(calc(100% - 32px), var(--max-width)); }
  .brand { font-size: 20px; }
  .brand-mark { width: 36px; height: 36px; }
  .menu-button {
    width: 44px;
    height: 44px;
    display: grid;
    place-content: center;
    gap: 5px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--navy);
    cursor: pointer;
  }
  .menu-button span:not(.sr-only) { width: 24px; height: 2px; background: currentColor; border-radius: 2px; }
  .primary-nav {
    position: absolute;
    top: 60px;
    left: 16px;
    right: 16px;
    height: auto;
    display: none;
    flex-direction: column;
    gap: 2px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: white;
    box-shadow: var(--shadow-card);
  }
  .primary-nav.is-open { display: flex; }
  .primary-nav a { min-height: 46px; padding: 0 12px; border-radius: 8px; }
  .primary-nav a.is-current::after { display: none; }
  .primary-nav a.is-current { background: #eef5ff; }
  .primary-nav .external-link { margin-left: 0; font-size: 15px; }
  .hero { min-height: auto; }
  .hero-inner { width: min(calc(100% - 32px), 520px); padding: 52px 0 64px; }
  .hero h1 { max-width: 340px; margin: 0 auto; font-size: 34px; line-height: 1.23; }
  .hero p { margin-top: 17px; font-size: 16px; line-height: 1.7; }
  .search-form { height: 58px; margin-top: 28px; grid-template-columns: 22px 1fr 42px; padding-left: 15px; }
  .search-form input { font-size: 15px; }
  .search-form button { width: 42px; height: 42px; }
  .category-wrap { width: 100%; margin: 0; border-width: 1px 0; border-radius: 0; box-shadow: none; overflow-x: auto; scrollbar-width: none; }
  .category-wrap::-webkit-scrollbar { display: none; }
  .category-list { width: max-content; justify-content: flex-start; padding: 12px 16px; gap: 10px; }
  .category-button { flex: 0 0 auto; min-height: 48px; border: 1px solid var(--line); padding: 0 17px; }
  .category-button:last-child { border-right: 1px solid var(--line); }
  .category-button.is-selected { border-color: #c9ddff; }
  .content-shell { width: min(calc(100% - 32px), 520px); padding: 38px 0 60px; }
  .section-heading h2 { font-size: 22px; }
  .text-button { display: inline-flex; align-items: center; gap: 6px; }
  .featured-tools { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; padding: 2px 1px 16px; scrollbar-width: none; }
  .featured-tools::-webkit-scrollbar { display: none; }
  .featured-card { flex: 0 0 92%; scroll-snap-align: start; min-height: 126px; }
  .all-tools-section { padding-top: 24px; }
  .tools-heading { align-items: flex-start; }
  .tool-grid { grid-template-columns: 1fr; gap: 10px; }
  .tool-card { min-height: 118px; }
  .fortune-link { align-items: flex-start; flex-direction: column; }
  .fortune-link a { width: 100%; justify-content: flex-end; }
  .site-footer { width: min(calc(100% - 32px), 520px); min-height: 0; flex-direction: column; padding: 30px 0; }
  .footer-links { flex-direction: column; gap: 8px; }
  .guide-page { width: min(calc(100% - 32px), 520px); padding: 54px 0 64px; }
  .guide-hero { padding-bottom: 42px; }
  .guide-hero h1 { font-size: 36px; word-break: keep-all; }
  .guide-list { grid-template-columns: 1fr; }
}

@media (max-width: 390px) {
  .hero h1 { font-size: 31px; }
  .tool-card { padding: 16px; gap: 12px; }
  .tool-icon { width: 50px; height: 50px; }
  .tool-copy h3 { font-size: 16px; }
  .tool-copy p { font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
