:root {
  --ink: #142b2b;
  --muted: #526764;
  --night: #17324d;
  --spruce: #315c4c;
  --spruce-dark: #24483c;
  --snow: #f7f8f4;
  --paper: #fffdf8;
  --birch: #e9e0cf;
  --berry: #b84956;
  --berry-dark: #983945;
  --ice: #d9ebed;
  --line: #d8dfd9;
  --shadow: 0 18px 60px rgba(23, 50, 77, 0.11);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --max: 1180px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--snow);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.62;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  height: 5px;
  z-index: 100;
  background: linear-gradient(90deg, var(--spruce) 0 38%, var(--ice) 38% 68%, var(--berry) 68%);
}

a { color: var(--spruce-dark); text-decoration-thickness: 1.5px; text-underline-offset: 0.18em; }
a:hover { color: var(--berry-dark); }
button, input, select { font: inherit; }
button { cursor: pointer; }
img, svg { display: block; max-width: 100%; }

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

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 999;
  padding: 10px 16px;
  border-radius: 10px;
  color: #fff;
  background: var(--night);
  transform: translateY(-150%);
}
.skip-link:focus { transform: translateY(0); }

.container { width: min(calc(100% - 40px), var(--max)); margin-inline: auto; }
.narrow { width: min(calc(100% - 40px), 820px); margin-inline: auto; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid rgba(49, 92, 76, 0.13);
  background: rgba(247, 248, 244, 0.94);
  backdrop-filter: blur(16px);
}

.header-inner { min-height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); font-weight: 800; letter-spacing: -0.025em; text-decoration: none; }
.brand-mark { width: 38px; height: 38px; }
.brand small { display: block; margin-top: -4px; color: var(--muted); font-size: 0.67rem; font-weight: 650; letter-spacing: 0.08em; text-transform: uppercase; }

.site-nav { display: flex; align-items: center; gap: 24px; }
.site-nav a { color: var(--ink); font-size: 0.9rem; font-weight: 700; text-decoration: none; }
.site-nav a[aria-current="page"] { color: var(--berry-dark); }
.nav-button { display: none; width: 44px; height: 44px; padding: 0; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.nav-button span, .nav-button::before, .nav-button::after { content: ""; display: block; width: 20px; height: 2px; margin: 5px auto; background: var(--ink); }

.hero { position: relative; overflow: hidden; padding: 88px 0 70px; }
.hero::before, .hero::after { content: ""; position: absolute; z-index: -1; border-radius: 50%; filter: blur(1px); }
.hero::before { width: 480px; height: 480px; top: -240px; right: -70px; background: radial-gradient(circle, rgba(217,235,237,.92), rgba(217,235,237,0)); }
.hero::after { width: 340px; height: 340px; left: -180px; bottom: -190px; background: radial-gradient(circle, rgba(233,224,207,.9), rgba(233,224,207,0)); }
.hero-grid { display: grid; grid-template-columns: 1.12fr 0.88fr; align-items: center; gap: clamp(40px, 7vw, 90px); }
.eyebrow { margin: 0 0 14px; color: var(--berry-dark); font-size: 0.78rem; font-weight: 800; letter-spacing: 0.13em; text-transform: uppercase; }
h1, h2, h3 { margin-top: 0; color: var(--night); font-family: Georgia, "Times New Roman", serif; line-height: 1.08; letter-spacing: -0.035em; }
h1 { max-width: 790px; margin-bottom: 23px; font-size: clamp(2.6rem, 6.5vw, 5.65rem); }
h2 { margin-bottom: 18px; font-size: clamp(2rem, 4vw, 3.25rem); }
h3 { margin-bottom: 10px; font-size: 1.45rem; }
.hero-copy { max-width: 690px; color: var(--muted); font-size: clamp(1.05rem, 2vw, 1.25rem); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 13px; margin-top: 30px; }

.button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-weight: 800;
  text-decoration: none;
  transition: transform .18s ease, background .18s ease, border-color .18s ease;
}
.button:hover { transform: translateY(-2px); }
.button-primary { color: #fff; background: var(--berry); box-shadow: 0 9px 24px rgba(184,73,86,.2); }
.button-primary:hover { color: #fff; background: var(--berry-dark); }
.button-secondary { color: var(--ink); border-color: var(--line); background: var(--paper); }
.button-small { min-height: 40px; padding: 8px 14px; font-size: .85rem; }

.hero-art { position: relative; min-height: 430px; }
.aurora-card { position: absolute; inset: 0; overflow: hidden; border: 1px solid rgba(255,255,255,.7); border-radius: 48% 48% 34px 34px; background: linear-gradient(155deg, #17324d 2%, #315c4c 58%, #abc9bd 100%); box-shadow: var(--shadow); }
.aurora-card::before { content: ""; position: absolute; width: 430px; height: 160px; top: 35px; left: -60px; border-radius: 50%; background: radial-gradient(ellipse, rgba(180,239,204,.75), rgba(119,187,180,.12) 55%, transparent 70%); transform: rotate(-13deg); }
.moon { position: absolute; width: 74px; height: 74px; top: 48px; right: 54px; border-radius: 50%; background: #fffbe8; box-shadow: 0 0 50px rgba(255,251,232,.5); }
.pine { position: absolute; bottom: 0; width: 0; height: 0; border-right: 56px solid transparent; border-bottom: 210px solid rgba(11,44,39,.9); border-left: 56px solid transparent; }
.pine::before, .pine::after { content: ""; position: absolute; border-right: 49px solid transparent; border-bottom: 145px solid rgba(20,67,58,.96); border-left: 49px solid transparent; }
.pine::before { left: -49px; top: 62px; }
.pine::after { left: -49px; top: 118px; }
.pine-one { left: 30px; transform: scale(.8); transform-origin: bottom; }
.pine-two { right: 20px; }
.pet-orbit { position: absolute; inset: auto 12% 9%; display: grid; place-items: center; height: 170px; border: 1px solid rgba(255,255,255,.2); border-radius: 50%; background: rgba(247,248,244,.13); backdrop-filter: blur(3px); }
.pet-face { width: 116px; height: 100px; position: relative; border-radius: 48% 48% 43% 43%; background: #f2dfbd; box-shadow: 0 18px 30px rgba(0,0,0,.17); }
.pet-face::before, .pet-face::after { content: ""; position: absolute; width: 48px; height: 58px; top: -26px; z-index: -1; border-radius: 9px 42px 4px 42px; background: #f2dfbd; }
.pet-face::before { left: 1px; transform: rotate(-15deg); }
.pet-face::after { right: 1px; transform: scaleX(-1) rotate(-15deg); }
.pet-eyes { position: absolute; inset: 40px 28px auto; display: flex; justify-content: space-between; }
.pet-eyes i { width: 8px; height: 11px; border-radius: 50%; background: var(--ink); }
.pet-nose { position: absolute; width: 12px; height: 8px; left: calc(50% - 6px); top: 61px; border-radius: 50% 50% 60% 60%; background: var(--berry-dark); }
.name-tag { position: absolute; right: -18px; bottom: 24px; padding: 15px 20px; border-radius: 16px; color: var(--night); background: var(--paper); box-shadow: var(--shadow); font-family: Georgia, serif; font-size: 1.25rem; font-weight: 700; transform: rotate(-3deg); }

.section { padding: 90px 0; }
.section-soft { background: #eef2ec; }
.section-dark { color: #e9f1ec; background: var(--night); }
.section-dark h2, .section-dark h3 { color: #fff; }
.section-head { max-width: 720px; margin-bottom: 36px; }
.section-head p { color: var(--muted); }

.generator-shell { display: grid; grid-template-columns: minmax(310px, .86fr) minmax(0, 1.4fr); align-items: start; gap: 26px; }
.generator-panel, .results-panel { border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--paper); box-shadow: var(--shadow); }
.generator-panel { position: sticky; top: 105px; padding: clamp(22px, 3vw, 34px); }
.results-panel { min-height: 650px; padding: clamp(22px, 3vw, 34px); }
.panel-kicker { color: var(--berry-dark); font-size: .75rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.form-grid { display: grid; gap: 18px; }
.field label, .field legend { display: block; margin-bottom: 7px; color: var(--ink); font-size: .86rem; font-weight: 800; }
.field select { width: 100%; min-height: 48px; padding: 10px 42px 10px 13px; border: 1px solid #c8d3cc; border-radius: 12px; color: var(--ink); background: #fff; }
.field select:hover { border-color: var(--spruce); }
.generator-submit { width: 100%; margin-top: 4px; }
.privacy-note { margin: 15px 0 0; color: var(--muted); font-size: .76rem; }
.results-header { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.results-header h2 { margin: 0; font-size: clamp(1.8rem, 3vw, 2.45rem); }
.results-status { min-height: 26px; margin: 0; color: var(--muted); font-size: .84rem; }
.result-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.name-card { position: relative; overflow: hidden; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius-md); background: #fff; }
.name-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--ice); }
.name-card h3 { margin-bottom: 6px; font-size: 1.75rem; }
.pronunciation { margin: 0 0 10px; color: var(--berry-dark); font-size: .77rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.meaning { margin: 0 0 10px; color: var(--muted); font-size: .9rem; }
.match-reason { margin: 0 0 16px; color: var(--ink); font-size: .83rem; }
.nickname { display: inline-block; margin-right: 5px; padding: 3px 9px; border-radius: 999px; color: var(--spruce-dark); background: #edf3ef; font-size: .72rem; font-weight: 750; }
.card-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.card-button { min-height: 38px; padding: 7px 11px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: var(--snow); font-size: .75rem; font-weight: 800; }
.card-button:hover { border-color: var(--spruce); background: #edf3ef; }

.steps, .feature-grid, .category-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.step, .feature-card, .category-card { padding: 28px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--paper); }
.step-number { display: grid; width: 42px; height: 42px; margin-bottom: 22px; place-items: center; border-radius: 50%; color: #fff; background: var(--spruce); font-weight: 900; }
.step p, .feature-card p, .category-card p { margin-bottom: 0; color: var(--muted); }
.category-card { position: relative; display: flex; min-height: 230px; flex-direction: column; justify-content: space-between; text-decoration: none; transition: transform .2s ease, box-shadow .2s ease; }
.category-card:hover { transform: translateY(-5px); box-shadow: var(--shadow); }
.category-icon { display: grid; width: 54px; height: 54px; margin-bottom: 30px; place-items: center; border-radius: 18px; color: var(--night); background: var(--ice); font-size: 1.5rem; }
.category-card:nth-child(2n) .category-icon { background: #f4dfe1; }
.category-card:nth-child(3n) .category-icon { background: var(--birch); }
.category-link { margin-top: 20px; color: var(--berry-dark); font-size: .84rem; font-weight: 850; }

.theme-hub { display: grid; gap: 92px; }
.theme-hub-group { scroll-margin-top: 100px; }
.theme-link-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.theme-link-card { display: flex; min-height: 160px; flex-direction: column; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius-md); color: var(--ink); background: var(--paper); text-decoration: none; transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
.theme-link-card:hover { transform: translateY(-3px); border-color: var(--spruce); box-shadow: var(--shadow); }
.theme-link-card span { margin-bottom: 16px; color: var(--berry-dark); font-size: .72rem; font-weight: 850; letter-spacing: .09em; text-transform: uppercase; }
.theme-link-card strong { color: var(--night); font-family: Georgia, "Times New Roman", serif; font-size: 1.25rem; line-height: 1.15; }
.theme-link-card small { margin-top: auto; padding-top: 18px; color: var(--muted); line-height: 1.45; }

.faq-list { display: grid; gap: 12px; }
.faq-list details { padding: 20px 22px; border: 1px solid rgba(255,255,255,.16); border-radius: var(--radius-sm); background: rgba(255,255,255,.06); }
.faq-list summary { cursor: pointer; color: #fff; font-weight: 800; }
.faq-list p { margin: 13px 0 0; color: #cbdad4; }

.example-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.example-chip { padding: 20px; border-radius: 15px; color: #fff; background: rgba(255,255,255,.08); }
.example-chip strong { display: block; margin-bottom: 4px; font-family: Georgia, serif; font-size: 1.35rem; }
.example-chip span { color: #cbdad4; font-size: .82rem; }

.content-layout { display: grid; grid-template-columns: minmax(0, 1fr) 290px; align-items: start; gap: 60px; }
.prose { color: #334845; }
.prose h2 { margin-top: 54px; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin-top: 30px; }
.prose p, .prose li { max-width: 76ch; }
.prose ul { padding-left: 1.2em; }
.prose .notice { padding: 20px 22px; border-left: 4px solid var(--berry); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; background: #f6ecec; }
.toc { position: sticky; top: 110px; padding: 23px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--paper); }
.toc strong { display: block; margin-bottom: 11px; }
.toc a { display: block; margin: 8px 0; font-size: .86rem; }

.page-hero { padding: 76px 0 54px; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, #edf3ef, var(--snow)); }
.page-hero h1 { max-width: 940px; font-size: clamp(2.5rem, 5.5vw, 4.6rem); }
.page-hero p { max-width: 760px; color: var(--muted); font-size: 1.12rem; }
.breadcrumbs { margin-bottom: 22px; color: var(--muted); font-size: .78rem; font-weight: 700; }
.breadcrumbs a { color: inherit; }

.site-footer { padding: 60px 0 30px; color: #dfe9e4; background: #102c2b; }
.footer-grid { display: grid; grid-template-columns: 1.2fr .8fr .8fr; gap: 50px; }
.footer-brand { max-width: 400px; }
.footer-brand p { color: #aabdb7; }
.footer-links strong { display: block; margin-bottom: 12px; color: #fff; }
.footer-links a { display: block; margin: 7px 0; color: #c8d6d1; text-decoration: none; }
.footer-bottom { display: flex; justify-content: space-between; gap: 20px; margin-top: 45px; padding-top: 22px; border-top: 1px solid rgba(255,255,255,.12); color: #9fb3ad; font-size: .76rem; }

.not-found { min-height: 68vh; display: grid; place-items: center; text-align: center; }
.not-found strong { display: block; color: var(--ice); font-family: Georgia, serif; font-size: clamp(5rem, 18vw, 12rem); line-height: .8; }
.not-found h1 { margin-top: 30px; font-size: clamp(2.3rem, 5vw, 4.2rem); }

.reveal { opacity: 0; transform: translateY(16px); transition: opacity .55s ease, transform .55s ease; }
.reveal.is-visible { opacity: 1; transform: none; }

@media (max-width: 980px) {
  .site-nav { position: absolute; top: calc(100% + 1px); right: 20px; left: 20px; display: none; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); box-shadow: var(--shadow); }
  .site-nav.is-open { display: grid; }
  .nav-button { display: block; }
  .hero-grid, .generator-shell, .content-layout { grid-template-columns: 1fr; }
  .hero-art { min-height: 390px; max-width: 560px; width: 100%; margin-inline: auto; }
  .generator-panel, .toc { position: static; }
  .steps, .feature-grid, .category-grid, .theme-link-grid { grid-template-columns: repeat(2, 1fr); }
  .example-strip { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 650px) {
  body { font-size: 16px; }
  .container, .narrow { width: min(calc(100% - 28px), var(--max)); }
  .header-inner { min-height: 68px; }
  .brand small { display: none; }
  .hero { padding: 58px 0 46px; }
  .hero-art { min-height: 320px; }
  .name-tag { right: 8px; }
  .section { padding: 64px 0; }
  .result-grid, .steps, .feature-grid, .category-grid, .theme-link-grid, .example-strip, .footer-grid { grid-template-columns: 1fr; }
  .results-header, .footer-bottom { align-items: flex-start; flex-direction: column; }
  .generator-panel, .results-panel { border-radius: 20px; }
  .name-card { padding: 20px; }
}

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

@media print {
  .site-header, .site-footer, .hero-actions, .generator-panel, .card-actions, .toc { display: none !important; }
  body { color: #000; background: #fff; }
  .results-panel, .name-card { box-shadow: none; }
}
