:root {
  --paper: #f3efe5;
  --paper-deep: #e7e0d1;
  --ink: #18241f;
  --muted: #59655f;
  --jade: #0f6b55;
  --jade-dark: #084b3d;
  --red: #b84837;
  --line: #cfc7b8;
  --white: #fffdf8;
  --shadow: 0 18px 45px rgba(28, 42, 35, 0.09);
  --sans: "Pretendard", "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
  --serif: "Iowan Old Style", "Noto Serif KR", "Batang", serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(rgba(24, 36, 31, 0.025) 1px, transparent 1px),
    var(--paper);
  background-size: 100% 34px;
  font-family: var(--sans);
  line-height: 1.65;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.22;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.09'/%3E%3C/svg%3E");
}

a { color: inherit; }

button, select { font: inherit; }

button { cursor: pointer; }

:focus-visible {
  outline: 3px solid #e59160;
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -6rem;
  z-index: 100;
  padding: .7rem 1rem;
  background: var(--ink);
  color: white;
}

.skip-link:focus { top: 1rem; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(24, 36, 31, .16);
  background: rgba(243, 239, 229, .94);
  backdrop-filter: blur(14px);
}

.nav-wrap {
  width: min(1180px, calc(100% - 2rem));
  min-height: 70px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  text-decoration: none;
  font-weight: 800;
  letter-spacing: -.025em;
}

.brand-image {
  display: block;
  width: min(300px, 58vw);
  height: auto;
  max-height: 66px;
  object-fit: contain;
  object-position: left center;
  background: transparent;
}

.brand-mark {
  width: 35px;
  height: 35px;
  display: grid;
  place-items: center;
  border: 1px solid var(--ink);
  color: var(--white);
  background: var(--red);
  font-family: var(--serif);
  font-size: 1rem;
  transform: rotate(-2deg);
}

.main-nav { display: flex; align-items: center; gap: 1.5rem; }
.main-nav a { text-decoration: none; font-size: .94rem; font-weight: 700; }
.main-nav a:hover { color: var(--jade); }

.nav-cta {
  padding: .55rem .85rem;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: white !important;
}

.nav-toggle {
  display: none;
  border: 1px solid var(--ink);
  background: transparent;
  padding: .45rem .7rem;
}

.hero {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 5rem 0 3.2rem;
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: clamp(2rem, 7vw, 7rem);
  align-items: center;
}

.eyebrow {
  margin: 0 0 .7rem;
  color: var(--red);
  font-weight: 850;
  font-size: .82rem;
  letter-spacing: .12em;
  text-transform: uppercase;
}

h1, h2, h3 { margin-top: 0; line-height: 1.14; letter-spacing: -.04em; }
h1, h2 { font-family: var(--serif); font-weight: 800; }
h1 { margin-bottom: 1.25rem; font-size: clamp(3rem, 7vw, 6.3rem); }
h2 { margin-bottom: 1rem; font-size: clamp(2rem, 4vw, 3.45rem); }
h3 { margin-bottom: .55rem; font-size: 1.18rem; }

.hero-copy { max-width: 650px; color: var(--muted); font-size: 1.12rem; }
.hero-actions { display: flex; gap: .8rem; flex-wrap: wrap; margin-top: 2rem; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: .72rem 1.05rem;
  border: 1px solid var(--ink);
  text-decoration: none;
  font-weight: 800;
  background: var(--ink);
  color: white;
  box-shadow: 4px 4px 0 var(--red);
}

.button:hover { background: var(--jade-dark); }
.button.secondary { background: transparent; color: var(--ink); box-shadow: none; }

.name-seal {
  position: relative;
  min-height: 350px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  background: var(--white);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.name-seal::before,
.name-seal::after {
  content: "";
  position: absolute;
  border: 1px solid var(--line);
  border-radius: 50%;
}

.name-seal::before { width: 290px; height: 290px; }
.name-seal::after { width: 230px; height: 230px; }

.seal-text { position: relative; z-index: 1; text-align: center; }
.seal-hangul { display: block; font-family: var(--serif); font-size: clamp(3.3rem, 8vw, 6rem); line-height: 1; }
.seal-roman { display: block; margin-top: .75rem; color: var(--muted); letter-spacing: .1em; text-transform: uppercase; font-size: .78rem; }
.seal-stamp { position: absolute; right: 2rem; bottom: 2rem; width: 52px; height: 52px; display: grid; place-items: center; border: 2px solid var(--red); color: var(--red); font-family: var(--serif); line-height: 1.05; transform: rotate(5deg); }

.generator-shell {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto 6rem;
  border: 1px solid var(--ink);
  background: var(--white);
  box-shadow: 9px 9px 0 var(--jade);
}

.generator-head {
  padding: 1.5rem clamp(1.2rem, 4vw, 2.5rem);
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  border-bottom: 1px solid var(--ink);
  background: var(--ink);
  color: white;
}

.generator-head h2 { margin: 0; font-family: var(--sans); font-size: 1.4rem; letter-spacing: -.02em; }
.generator-head p { margin: 0; color: #cbd5d0; font-size: .92rem; }

.filter-form {
  padding: 1.6rem clamp(1.2rem, 4vw, 2.5rem);
  display: grid;
  grid-template-columns: repeat(4, 1fr) auto;
  gap: 1rem;
  align-items: end;
  border-bottom: 1px solid var(--line);
}

.field label { display: block; margin-bottom: .45rem; font-weight: 800; font-size: .86rem; }
.field select {
  width: 100%;
  height: 48px;
  padding: 0 2.2rem 0 .8rem;
  border: 1px solid var(--line);
  border-radius: 0;
  color: var(--ink);
  background: var(--paper);
}

.generate-button {
  height: 48px;
  padding: 0 1.3rem;
  border: 1px solid var(--red);
  background: var(--red);
  color: white;
  font-weight: 900;
}

.generate-button:hover { background: #943626; }

.result-toolbar {
  padding: 1rem clamp(1.2rem, 4vw, 2.5rem) 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.result-status { margin: 0; color: var(--muted); font-size: .9rem; }
.text-button { border: 0; border-bottom: 1px solid currentColor; background: transparent; color: var(--jade-dark); font-weight: 800; padding: .2rem 0; }

.results {
  padding: 1.25rem clamp(1.2rem, 4vw, 2.5rem) 2.5rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
}

.name-card {
  min-width: 0;
  padding: 1.35rem;
  background: var(--white);
}

.name-card:nth-child(2) { background: #f8f3e9; }
.name-card:nth-child(5) { background: #f8f3e9; }

.name-top { display: flex; justify-content: space-between; gap: 1rem; align-items: start; }
.name-top h3 { margin: 0; font-family: var(--serif); font-size: 1.75rem; }
.copy-button { min-width: 46px; height: 34px; padding: 0 .45rem; flex: 0 0 auto; border: 1px solid var(--line); background: transparent; color: var(--muted); white-space: nowrap; }
.copy-button:hover { border-color: var(--jade); color: var(--jade); }
.romanization { margin: .2rem 0 .95rem; color: var(--jade-dark); font-weight: 800; font-size: .88rem; }
.meaning { margin: 0 0 1rem; min-height: 3.2em; color: var(--muted); font-size: .92rem; }
.name-meta { display: flex; flex-wrap: wrap; gap: .38rem; }
.tag { padding: .2rem .45rem; border: 1px solid var(--line); color: var(--muted); font-size: .75rem; }
.nickname { margin: 1rem 0 0; padding-top: .85rem; border-top: 1px solid var(--line); font-size: .84rem; }
.theme-fit { margin: .75rem 0 0; padding: .75rem; background: var(--paper); color: var(--muted); font-size: .82rem; }

.generator-note {
  margin: 0;
  padding: 1rem clamp(1.2rem, 4vw, 2.5rem);
  border-top: 1px solid var(--line);
  background: var(--paper);
  color: var(--muted);
  font-size: .84rem;
}

.section {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 5.5rem 0;
}

.section-intro { max-width: 670px; margin-bottom: 2.4rem; }
.section-intro p:last-child { color: var(--muted); }

.process-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}

.process-item { padding: 1.8rem 1.6rem; border-right: 1px solid var(--line); }
.process-item:last-child { border-right: 0; }
.process-number { display: block; margin-bottom: 2.2rem; color: var(--red); font-family: var(--serif); font-size: 1.8rem; }
.process-item p { color: var(--muted); margin-bottom: 0; }

.guide-section { background: var(--jade-dark); color: white; }
.guide-inner { width: min(1180px, calc(100% - 2rem)); margin: 0 auto; padding: 5.5rem 0; }
.guide-layout { display: grid; grid-template-columns: .8fr 1.2fr; gap: clamp(2rem, 8vw, 8rem); }
.guide-kicker { color: #ef9a80; }
.guide-content { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
.guide-block { border-top: 1px solid rgba(255,255,255,.35); padding-top: 1rem; }
.guide-block p { color: #c9d9d3; }

.use-grid { display: grid; grid-template-columns: 1.3fr .7fr .7fr; gap: 1rem; }
.use-card { min-height: 240px; padding: 1.5rem; border: 1px solid var(--line); background: var(--white); display: flex; flex-direction: column; justify-content: space-between; }
.use-card:first-child { background: var(--paper-deep); }
.use-card p { color: var(--muted); }
.use-icon { font-family: var(--serif); font-size: 2.5rem; color: var(--red); }

.faq-list { border-top: 1px solid var(--ink); }
.faq-list details { border-bottom: 1px solid var(--line); padding: 1.15rem 0; }
.faq-list summary { cursor: pointer; font-weight: 850; list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
.faq-list summary::after { content: "+"; color: var(--red); font-size: 1.3rem; }
.faq-list details[open] summary::after { content: "−"; }
.faq-list p { max-width: 780px; color: var(--muted); }

.theme-finder {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto 6rem;
  padding: clamp(1.4rem, 4vw, 2.5rem);
  border: 1px solid var(--ink);
  background: var(--white);
  box-shadow: 9px 9px 0 var(--red);
}

.finder-top { display: grid; grid-template-columns: 1fr .7fr; gap: 2rem; align-items: end; margin-bottom: 1.8rem; }
.finder-top h2 { margin-bottom: .5rem; }
.finder-top p { margin: 0; color: var(--muted); }
.theme-search { width: 100%; min-height: 52px; padding: .75rem 1rem; border: 1px solid var(--ink); background: var(--paper); color: var(--ink); }
.category-chips { display: flex; flex-wrap: wrap; gap: .55rem; margin-bottom: 1.5rem; }
.category-chip { padding: .5rem .72rem; border: 1px solid var(--line); background: transparent; color: var(--ink); font-weight: 750; }
.category-chip:hover, .category-chip.active { border-color: var(--jade); background: var(--jade); color: white; }
.theme-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.theme-card { min-width: 0; min-height: 180px; padding: 1.15rem; background: var(--white); text-decoration: none; display: flex; flex-direction: column; justify-content: space-between; }
.theme-card:hover { background: var(--paper); }
.theme-card .theme-category { color: var(--red); font-size: .72rem; font-weight: 850; letter-spacing: .06em; }
.theme-card h3 { margin: .65rem 0 .5rem; font-size: 1.08rem; }
.theme-card p { margin: 0; color: var(--muted); font-size: .83rem; }
.theme-card .theme-arrow { align-self: flex-end; color: var(--jade); font-weight: 900; }
.theme-empty { grid-column: 1 / -1; padding: 2rem; background: var(--white); color: var(--muted); text-align: center; }
.finder-footer { display: flex; justify-content: space-between; gap: 1rem; align-items: center; margin-top: 1.4rem; }
.finder-count { color: var(--muted); font-size: .88rem; }

.directory-hero { width: min(1180px, calc(100% - 2rem)); margin: 0 auto; padding: 4.5rem 0 2.5rem; }
.directory-hero h1 { max-width: 820px; }
.directory-hero p { max-width: 720px; color: var(--muted); font-size: 1.08rem; }
.directory-shell { width: min(1180px, calc(100% - 2rem)); margin: 0 auto 6rem; }
.category-section { margin-top: 4rem; scroll-margin-top: 90px; }
.category-heading { display: flex; justify-content: space-between; align-items: end; gap: 1rem; margin-bottom: 1rem; padding-bottom: .8rem; border-bottom: 1px solid var(--ink); }
.category-heading h2 { margin: 0; font-family: var(--sans); font-size: 1.6rem; }
.category-heading p { margin: 0; color: var(--muted); font-size: .86rem; }

.theme-hero { width: min(1180px, calc(100% - 2rem)); margin: 0 auto; padding: 4.5rem 0 3rem; display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(2rem, 7vw, 7rem); align-items: end; }
.theme-hero h1 { font-size: clamp(2.8rem, 6vw, 5.3rem); }
.theme-hero .hero-copy { font-size: 1.05rem; }
.breadcrumb { margin-bottom: 1.5rem; color: var(--muted); font-size: .84rem; }
.breadcrumb a { color: var(--jade-dark); }
.theme-brief { padding: 1.5rem; border: 1px solid var(--line); background: var(--white); }
.theme-brief-label { color: var(--red); font-weight: 850; font-size: .78rem; letter-spacing: .08em; }
.theme-brief h2 { margin: .6rem 0 1rem; font-family: var(--sans); font-size: 1.35rem; }
.theme-brief dl { margin: 0; }
.theme-brief div { display: grid; grid-template-columns: 5rem 1fr; gap: 1rem; padding: .7rem 0; border-top: 1px solid var(--line); }
.theme-brief dt { font-weight: 850; }
.theme-brief dd { margin: 0; color: var(--muted); }
.theme-content-grid { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); }
.theme-advice { padding: 1.5rem; border-right: 1px solid var(--line); }
.theme-advice:last-child { border-right: 0; }
.theme-advice h3 { color: var(--jade-dark); }
.theme-advice p { margin-bottom: 0; color: var(--muted); }
.theme-samples { display: flex; flex-wrap: wrap; gap: .55rem; margin-top: 1.2rem; }
.theme-sample { padding: .4rem .6rem; border: 1px solid var(--line); background: var(--white); font-family: var(--serif); }
.related-themes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.related-theme { padding: 1rem; border: 1px solid var(--line); background: var(--white); text-decoration: none; }
.related-theme:hover { border-color: var(--jade); }
.related-theme small { display: block; color: var(--red); margin-bottom: .4rem; }

.site-footer { border-top: 1px solid var(--ink); background: var(--paper-deep); }
.footer-inner { width: min(1180px, calc(100% - 2rem)); margin: 0 auto; padding: 2.5rem 0 1.6rem; }
.footer-top { display: flex; justify-content: space-between; gap: 2rem; }
.footer-copy { max-width: 520px; color: var(--muted); font-size: .9rem; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .55rem; align-items: start; max-width: 610px; }
.footer-links a { padding: .48rem .68rem; border: 1px solid var(--line); background: rgba(255,255,255,.38); font-weight: 750; font-size: .86rem; text-decoration: none; }
.footer-links a:hover { border-color: var(--jade); background: var(--jade); color: white; }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; gap: 1rem 2rem; margin-top: 2.4rem; padding-top: 1rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .78rem; }
.footer-legal { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .45rem 1rem; }
.footer-legal a { color: var(--muted); text-underline-offset: .2em; }
.footer-legal a:hover { color: var(--jade-dark); }

.legal-main { width: min(900px, calc(100% - 2rem)); margin: 0 auto; padding: 5rem 0 6rem; }
.legal-header { margin-bottom: 3.5rem; padding-bottom: 2rem; border-bottom: 1px solid var(--ink); }
.legal-header h1 { font-size: clamp(2.6rem, 6vw, 5rem); }
.legal-lede { max-width: 700px; color: var(--muted); font-size: 1.08rem; }
.legal-main section { margin-top: 2.7rem; }
.legal-main section h2 { font-family: var(--sans); font-size: 1.35rem; letter-spacing: -.02em; }
.legal-main p, .legal-main li { color: #46524c; }
.legal-main ul { padding-left: 1.25rem; }
.notice-box { padding: 1.2rem 1.35rem; border-left: 4px solid var(--red); background: var(--white); }

.not-found { min-height: 70vh; display: grid; place-items: center; text-align: center; padding: 2rem; }
.not-found strong { display: block; color: var(--red); font-family: var(--serif); font-size: clamp(5rem, 18vw, 11rem); line-height: .9; }

.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; }

@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; padding-top: 3.5rem; }
  .name-seal { min-height: 290px; }
  .filter-form { grid-template-columns: repeat(2, 1fr); }
  .generate-button { grid-column: 1 / -1; }
  .results { grid-template-columns: repeat(2, 1fr); }
  .guide-layout { grid-template-columns: 1fr; }
  .use-grid { grid-template-columns: 1fr 1fr; }
  .use-card:first-child { grid-column: 1 / -1; }
  .theme-grid { grid-template-columns: repeat(2, 1fr); }
  .theme-hero { grid-template-columns: 1fr; }
  .related-themes { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 1040px) {
  .nav-wrap { gap: .75rem; }
  .brand { min-width: 0; }
  .nav-toggle { display: block !important; flex: 0 0 auto; color: var(--ink); font-weight: 750; }
  .main-nav { display: none; position: absolute; left: 0; right: 0; top: 70px; padding: 1.2rem 1rem; flex-direction: column; align-items: stretch; background: var(--paper); border-bottom: 1px solid var(--ink); }
  .main-nav.open { display: flex; }
  .main-nav a { padding: .45rem 0; }
}

@media (max-width: 720px) {
  h1 { font-size: clamp(2.7rem, 13vw, 3.4rem); }
  .hero { gap: 2.2rem; }
  .generator-shell { width: calc(100% - 1rem); box-shadow: 5px 5px 0 var(--jade); }
  .generator-head { display: block; }
  .generator-head p { margin-top: .45rem; }
  .filter-form { grid-template-columns: 1fr; }
  .generate-button { grid-column: auto; }
  .result-toolbar { align-items: start; }
  .results { grid-template-columns: 1fr; }
  .process-grid, .guide-content, .use-grid { grid-template-columns: 1fr; }
  .process-item { border-right: 0; border-bottom: 1px solid var(--line); }
  .process-item:last-child { border-bottom: 0; }
  .use-card:first-child { grid-column: auto; }
  .footer-top { display: block; }
  .footer-links { justify-content: flex-start; margin-top: 1.6rem; max-width: none; }
  .footer-bottom { align-items: flex-start; flex-direction: column; }
  .footer-legal { justify-content: flex-start; }
  .brand-image { width: min(220px, 60vw); height: auto; max-height: 49px; }
  .finder-top { grid-template-columns: 1fr; }
  .theme-grid, .theme-content-grid, .related-themes { grid-template-columns: 1fr; }
  .theme-advice { border-right: 0; border-bottom: 1px solid var(--line); }
  .theme-advice:last-child { border-bottom: 0; }
  .finder-footer, .category-heading { align-items: start; flex-direction: column; }
}

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