/* Korean Zodiac — Modern Redesign */
/* Aesthetic: Celadon & Ink — cool paper white, deep jade-teal, brush-ink black */

:root {
  --bg:         #F0F3EE;
  --bg-card:    #E4E8E1;
  --bg-raised:  #D7DCD4;
  --border:     #B5BDB2;
  --border-teal:#3A7060;
  --teal:       #2D6455;
  --teal-bright:#1D4D3E;
  --teal-dim:   #7AB0A0;
  --text:       #0C1A14;
  --text-muted: #2C4A3C;
  --text-dim:   #688078;

  --font-display: 'Nanum Myeongjo', 'Noto Serif KR', Georgia, serif;
  --font-body:    'Lora', Georgia, serif;
  --font-label:   'Cinzel', 'Palatino Linotype', serif;

  --container: 1100px;
  --nav-height: 64px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.75;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

a { color: inherit; }
img { max-width: 100%; height: auto; display: block; }

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 28px;
}

/* ── Navigation ── */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 200;
  height: var(--nav-height);
  background: rgba(240,243,238,0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.nav-logo {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--teal-bright);
  text-decoration: none;
  letter-spacing: 0.04em;
  white-space: nowrap;
  flex-shrink: 0;
  line-height: 1;
}

.nav-logo span { color: var(--teal); font-style: italic; font-weight: 400; }

.nav-links {
  list-style: none;
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
}

.nav-links > li { position: relative; }

.nav-links > li > a {
  display: flex;
  align-items: center;
  padding: 0 12px;
  height: var(--nav-height);
  font-family: var(--font-label);
  font-size: 0.6rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
  white-space: nowrap;
}

.nav-links > li > a:hover,
.nav-links > li > a.active { color: var(--teal-bright); }

.dropdown {
  position: absolute;
  top: 100%; left: 0;
  background: #E4EAE2;
  border: 1px solid var(--border-teal);
  border-top: 2px solid var(--teal);
  min-width: 210px;
  padding: 8px 0;
  list-style: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
  z-index: 100;
}

.nav-links > li:hover .dropdown { opacity: 1; visibility: visible; transform: translateY(0); }

.dropdown li a {
  display: block;
  padding: 9px 20px;
  font-family: var(--font-label);
  font-size: 0.58rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s, background 0.15s;
}

.dropdown li a:hover { color: var(--teal-bright); background: rgba(45,100,85,0.08); }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  flex-direction: column;
  gap: 5px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 1px;
  background: var(--text-muted);
  transition: transform 0.25s, opacity 0.25s;
}

/* ── Hero ── */
.hero {
  padding-top: calc(var(--nav-height) + 96px);
  padding-bottom: 80px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 60% at 50% 0%, rgba(45,100,85,0.08) 0%, transparent 70%),
    radial-gradient(ellipse 40% 30% at 50% 60%, rgba(45,100,85,0.04) 0%, transparent 70%);
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--border-teal), transparent);
}

.hero-ornament {
  font-family: var(--font-label);
  font-size: 0.6rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.hero-ornament::before,
.hero-ornament::after { content: ''; width: 64px; height: 1px; background: linear-gradient(to right, transparent, var(--teal-dim)); }
.hero-ornament::before { background: linear-gradient(to left, transparent, var(--teal-dim)); }

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(3.2rem, 9vw, 7rem);
  font-weight: 700;
  line-height: 1.02;
  color: var(--text);
  letter-spacing: -0.01em;
  margin-bottom: 20px;
}

.hero-title em { font-style: italic; color: var(--teal-bright); font-weight: 400; }

.hero-subtitle {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 420px;
  margin: 0 auto;
  line-height: 1.9;
  font-style: italic;
}

/* ── Calculator ── */
.calculator-wrap {
  padding: 56px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  transition-delay: 0.15s !important;
}

.calculator {
  max-width: 480px;
  margin: 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--border-teal);
  padding: 40px 36px;
  position: relative;
}

.calculator::before {
  content: '';
  position: absolute;
  top: -1px; left: 32px; right: 32px;
  height: 2px;
  background: linear-gradient(to right, transparent, var(--teal), transparent);
}

.calc-heading {
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--teal-bright);
  text-align: center;
  margin-bottom: 6px;
  letter-spacing: 0.02em;
}

.calc-sub {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 28px;
  font-style: italic;
}

.calc-form { display: flex; gap: 10px; }

.calc-input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border-teal);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.1rem;
  padding: 13px 16px;
  outline: none;
  transition: border-color 0.2s;
  -moz-appearance: textfield;
}

.calc-input::-webkit-outer-spin-button,
.calc-input::-webkit-inner-spin-button { -webkit-appearance: none; }
.calc-input::placeholder { color: var(--text-dim); }
.calc-input:focus { border-color: var(--teal); }

.calc-btn {
  background: var(--teal);
  color: var(--bg);
  border: none;
  font-family: var(--font-label);
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 13px 20px;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
  font-weight: 600;
}

.calc-btn:hover { background: var(--teal-bright); }

.calc-result {
  margin-top: 24px;
  padding: 22px 20px;
  border: 1px solid var(--border);
  background: rgba(45,100,85,0.05);
  text-align: center;
  display: none;
}

.calc-result.visible { display: block; animation: fadeUp 0.35s ease; }

.calc-result-animal { font-size: 2.4rem; line-height: 1; margin-bottom: 8px; }

.calc-result-sign {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--teal-bright);
  margin-bottom: 6px;
  letter-spacing: 0.02em;
}

.calc-result-year { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 14px; font-style: italic; }

.calc-result-link {
  display: inline-block;
  font-family: var(--font-label);
  font-size: 0.58rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--teal);
  text-decoration: none;
  border-bottom: 1px solid var(--teal-dim);
  padding-bottom: 2px;
  transition: color 0.2s, border-color 0.2s;
}

.calc-result-link:hover { color: var(--teal-bright); border-color: var(--teal); }

/* ── Section ── */
.section { padding: 72px 0; }

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 4vw, 2.9rem);
  font-weight: 700;
  color: var(--text);
  text-align: center;
  margin-bottom: 6px;
}

.section-sub { font-size: 0.9rem; color: var(--text-muted); text-align: center; margin-bottom: 48px; font-style: italic; }

/* ── Zodiac Grid ── */
.zodiac-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
}

.zodiac-card {
  background: var(--bg-card);
  padding: 28px 14px 24px;
  text-align: center;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transition: background 0.22s;
  position: relative;
}

.zodiac-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 2px solid transparent;
  pointer-events: none;
  transition: border-color 0.22s;
}

.zodiac-card:hover { background: var(--bg-raised); box-shadow: 0 4px 20px rgba(45,100,85,0.12); }
.zodiac-card:hover::after { border-color: var(--teal-dim); }

.zodiac-card img {
  width: 64px; height: 64px;
  object-fit: contain;
  filter: brightness(0.85) saturate(0.65);
  transition: filter 0.28s ease, transform 0.28s ease;
  margin-bottom: 4px;
}

.zodiac-card:hover img { filter: brightness(1.05) saturate(1.1); transform: scale(1.08) translateY(-2px); }

.zodiac-card-num { font-family: var(--font-label); font-size: 0.5rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--teal-dim); }
.zodiac-card-name { font-family: var(--font-display); font-size: 1.2rem; font-weight: 700; color: var(--text); line-height: 1.1; }
.zodiac-card-years { font-size: 0.68rem; color: var(--text-dim); font-style: italic; }

/* ── Page Hero ── */
.page-hero {
  padding-top: calc(var(--nav-height) + 72px);
  padding-bottom: 64px;
  text-align: center;
  border-bottom: 1px solid var(--border);
  position: relative;
}

.page-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 55% at 50% 0%, rgba(45,100,85,0.07) 0%, transparent 70%);
  pointer-events: none;
}

.page-hero-label { font-family: var(--font-label); font-size: 0.58rem; letter-spacing: 0.28em; text-transform: uppercase; color: var(--teal); margin-bottom: 20px; }
.page-hero img { width: 110px; height: 110px; object-fit: contain; margin: 0 auto 28px; filter: brightness(0.9) saturate(0.85); }
.page-hero-title { font-family: var(--font-display); font-size: clamp(2.4rem, 6vw, 4.2rem); font-weight: 700; line-height: 1.08; color: var(--text); margin-bottom: 14px; }
.page-hero-title em { font-style: italic; color: var(--teal-bright); font-weight: 400; }
.page-hero-desc { font-size: 0.95rem; color: var(--text-muted); max-width: 480px; margin: 0 auto; line-height: 1.85; font-style: italic; }

/* ── Article ── */
.article { max-width: 720px; margin: 0 auto; padding: 60px 28px 80px; overflow-wrap: break-word; }

.article > h2 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--teal-bright);
  margin: 52px 0 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.article > h2:first-child { margin-top: 0; }

.article > h3 { font-family: var(--font-label); font-size: 0.6rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--teal); margin: 28px 0 14px; }
.article > p { color: var(--text); margin-bottom: 18px; font-size: 1rem; line-height: 1.88; }

/* ── Traits Grid ── */
.traits-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--border); border: 1px solid var(--border); margin: 24px 0 40px; }
.traits-col { background: var(--bg-card); padding: 24px 22px; }
.traits-col-label { font-family: var(--font-label); font-size: 0.55rem; letter-spacing: 0.22em; text-transform: uppercase; margin-bottom: 18px; display: flex; align-items: center; gap: 8px; }
.traits-col-label::before { content: ''; width: 20px; height: 1px; }
.traits-col-label.pos { color: #3A8A55; }
.traits-col-label.pos::before { background: #3A8A55; }
.traits-col-label.neg { color: #A04040; }
.traits-col-label.neg::before { background: #A04040; }
.traits-col ul { list-style: none; }
.traits-col li { font-size: 0.92rem; color: var(--text); padding: 7px 0; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; }
.traits-col li:last-child { border-bottom: none; }
.traits-col li::before { content: '—'; color: var(--text-dim); flex-shrink: 0; font-size: 0.7rem; }

/* ── Compatibility ── */
.compat-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1px; background: var(--border); border: 1px solid var(--border); margin: 24px 0 40px; }
.compat-col { background: var(--bg-card); padding: 20px 18px; }
.compat-col-label { font-family: var(--font-label); font-size: 0.52rem; letter-spacing: 0.2em; text-transform: uppercase; margin-bottom: 14px; }
.compat-col-label.best { color: #3A8A55; }
.compat-col-label.ok { color: var(--teal); }
.compat-col-label.worst { color: #A04040; }
.compat-col ul { list-style: none; }
.compat-col li { font-size: 0.88rem; color: var(--text-muted); padding: 5px 0; border-bottom: 1px solid var(--border); }
.compat-col li:last-child { border-bottom: none; }

/* ── Famous ── */
.famous-block { background: var(--bg-card); border: 1px solid var(--border); border-left: 3px solid var(--teal-dim); padding: 22px 24px; margin: 28px 0; font-style: italic; color: var(--text-muted); font-size: 0.95rem; line-height: 1.9; }

/* ── Korean script block ── */
.hangul-block { background: var(--bg-card); border: 1px solid var(--border-teal); padding: 28px 32px; margin: 28px 0; text-align: center; }
.hangul-char { font-family: var(--font-display); font-size: 3.5rem; font-weight: 700; color: var(--teal-bright); line-height: 1; margin-bottom: 12px; }
.hangul-romanji { font-family: var(--font-label); font-size: 0.65rem; letter-spacing: 0.3em; text-transform: uppercase; color: var(--text-muted); }

/* ── Sign nav ── */
.sign-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 60px; padding-top: 28px; border-top: 1px solid var(--border); }
.sign-nav a { font-family: var(--font-label); font-size: 0.56rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--text-dim); text-decoration: none; transition: color 0.2s; }
.sign-nav a:hover { color: var(--teal); }

/* ── Element page ── */
.element-intro { display: grid; grid-template-columns: 130px 1fr; gap: 40px; align-items: start; margin: 40px 0; padding: 36px; background: var(--bg-card); border: 1px solid var(--border-teal); }
.element-intro img { width: 130px; height: 130px; object-fit: contain; filter: brightness(0.88) saturate(0.8); }
.element-traits { list-style: none; }
.element-traits li { font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; color: var(--teal-bright); padding: 6px 0; display: flex; align-items: center; gap: 14px; border-bottom: 1px solid var(--border); }
.element-traits li:last-child { border-bottom: none; }
.element-traits li::before { content: '✦'; font-size: 0.55rem; color: var(--teal-dim); flex-shrink: 0; }

/* ── Info grid ── */
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--border); border: 1px solid var(--border); margin: 28px 0; }
.info-col { background: var(--bg-card); padding: 28px 24px; }
.info-col-label { font-family: var(--font-label); font-size: 0.55rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--teal); margin-bottom: 16px; }
.info-col ul { list-style: none; }
.info-col li { font-size: 0.9rem; color: var(--text); padding: 7px 0; border-bottom: 1px solid var(--border); display: flex; gap: 10px; }
.info-col li:last-child { border-bottom: none; }
.info-col li::before { content: '—'; color: var(--text-dim); flex-shrink: 0; }

/* ── Animal Time ── */
.animal-time-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); }
.animal-time-card { background: var(--bg-card); padding: 28px 16px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; transition: background 0.22s; text-decoration: none; color: inherit; cursor: pointer; }
.animal-time-card:hover { background: var(--bg-raised); }
.animal-time-card img { width: 62px; height: 62px; object-fit: contain; filter: brightness(0.85) saturate(0.7); transition: filter 0.22s; }
.animal-time-card:hover img { filter: brightness(1) saturate(1); }
.at-name { font-family: var(--font-display); font-size: 1.1rem; font-weight: 700; color: var(--text); }
.at-hours { font-family: var(--font-label); font-size: 0.56rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--teal); }

/* ── Ad units ── */
.ad-unit { max-width: var(--container); margin: 0 auto; padding: 24px 28px; text-align: center; }

/* ── Footer ── */
footer { margin-top: auto; border-top: 1px solid var(--border); padding: 48px 0 32px; }
.footer-grid { display: flex; justify-content: space-between; align-items: flex-start; gap: 32px; flex-wrap: wrap; margin-bottom: 32px; }
.footer-brand .footer-logo { font-family: var(--font-display); font-size: 1.2rem; font-weight: 700; color: var(--teal-bright); margin-bottom: 8px; }
.footer-brand p { font-size: 0.82rem; color: var(--text-dim); font-style: italic; max-width: 220px; line-height: 1.6; }
.footer-nav-title { font-family: var(--font-label); font-size: 0.52rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--teal); margin-bottom: 12px; }
.footer-nav-links { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.footer-nav-links a { font-size: 0.82rem; color: var(--text-dim); text-decoration: none; transition: color 0.2s; }
.footer-nav-links a:hover { color: var(--teal); }
.footer-bottom { border-top: 1px solid var(--border); padding-top: 24px; text-align: center; font-size: 0.78rem; color: var(--text-dim); font-style: italic; }

/* ── Index pages ── */
.index-intro { max-width: 700px; margin: 0 auto; padding: 60px 28px; }
.index-intro h2 { font-family: var(--font-display); font-size: 1.6rem; font-weight: 700; color: var(--teal-bright); margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.index-intro p { color: var(--text); font-size: 1rem; line-height: 1.85; margin-bottom: 20px; }

.element-ref { background: var(--bg-card); border: 1px solid var(--border); padding: 28px; margin: 28px 0; }
.element-ref-row { display: flex; align-items: center; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.element-ref-row:last-child { border-bottom: none; }
.element-ref-years { font-family: var(--font-label); font-size: 0.58rem; letter-spacing: 0.12em; color: var(--teal-dim); min-width: 60px; }
.element-ref-name a { font-family: var(--font-display); font-size: 1.1rem; font-weight: 700; color: var(--teal-bright); text-decoration: none; transition: color 0.2s; }
.element-ref-name a:hover { color: var(--text); }

.about-content { max-width: 700px; margin: 0 auto; padding: 60px 28px 80px; overflow-wrap: break-word; }
.about-content h2 { font-family: var(--font-display); font-size: 1.7rem; font-weight: 700; color: var(--teal-bright); margin: 48px 0 16px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.about-content h2:first-child { margin-top: 0; }
.about-content p { color: var(--text); font-size: 1rem; line-height: 1.88; margin-bottom: 18px; }

/* ── Animations ── */
@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ── Grain overlay ── */
html::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.022;
}

.hero-ornament { animation: fadeUp 0.8s 0.08s ease both; }
.hero-title    { animation: fadeUp 0.95s 0.22s ease both; }
.hero-subtitle { animation: fadeUp 0.8s 0.44s ease both; }
.page-hero-label { animation: fadeUp 0.7s 0.1s ease both; }
.page-hero img   { animation: fadeIn 0.9s 0.18s ease both; }
.page-hero-title { animation: fadeUp 0.85s 0.22s ease both; }
.page-hero-desc  { animation: fadeUp 0.75s 0.4s ease both; }

[data-reveal] { opacity: 0; transform: translateY(22px); transition: opacity 0.72s ease, transform 0.72s ease; }
[data-reveal].in-view { opacity: 1; transform: none; }

.zodiac-grid.in-view .zodiac-card,
.animal-time-grid.in-view .animal-time-card { animation: fadeUp 0.5s ease both; }
.zodiac-grid.in-view .zodiac-card:nth-child(1),.animal-time-grid.in-view .animal-time-card:nth-child(1)  { animation-delay: 0.00s; }
.zodiac-grid.in-view .zodiac-card:nth-child(2),.animal-time-grid.in-view .animal-time-card:nth-child(2)  { animation-delay: 0.04s; }
.zodiac-grid.in-view .zodiac-card:nth-child(3),.animal-time-grid.in-view .animal-time-card:nth-child(3)  { animation-delay: 0.08s; }
.zodiac-grid.in-view .zodiac-card:nth-child(4),.animal-time-grid.in-view .animal-time-card:nth-child(4)  { animation-delay: 0.12s; }
.zodiac-grid.in-view .zodiac-card:nth-child(5),.animal-time-grid.in-view .animal-time-card:nth-child(5)  { animation-delay: 0.16s; }
.zodiac-grid.in-view .zodiac-card:nth-child(6),.animal-time-grid.in-view .animal-time-card:nth-child(6)  { animation-delay: 0.20s; }
.zodiac-grid.in-view .zodiac-card:nth-child(7),.animal-time-grid.in-view .animal-time-card:nth-child(7)  { animation-delay: 0.24s; }
.zodiac-grid.in-view .zodiac-card:nth-child(8),.animal-time-grid.in-view .animal-time-card:nth-child(8)  { animation-delay: 0.28s; }
.zodiac-grid.in-view .zodiac-card:nth-child(9),.animal-time-grid.in-view .animal-time-card:nth-child(9)  { animation-delay: 0.32s; }
.zodiac-grid.in-view .zodiac-card:nth-child(10),.animal-time-grid.in-view .animal-time-card:nth-child(10) { animation-delay: 0.36s; }
.zodiac-grid.in-view .zodiac-card:nth-child(11),.animal-time-grid.in-view .animal-time-card:nth-child(11) { animation-delay: 0.40s; }
.zodiac-grid.in-view .zodiac-card:nth-child(12),.animal-time-grid.in-view .animal-time-card:nth-child(12) { animation-delay: 0.44s; }

/* ── Site Hero (homepage) ── */
.site-hero {
  padding-top: calc(var(--nav-height) + 100px);
  padding-bottom: 88px;
  position: relative;
  overflow: hidden;
}

.site-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 60% at 30% 0%, rgba(45,100,85,0.09) 0%, transparent 70%),
    radial-gradient(ellipse 40% 40% at 70% 80%, rgba(45,100,85,0.05) 0%, transparent 70%);
  pointer-events: none;
}

.site-hero::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--border-teal), transparent);
}

.site-hero-label {
  font-family: var(--font-label);
  font-size: 0.58rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.site-hero-label::before,
.site-hero-label::after {
  content: '';
  height: 1px;
  width: 48px;
  background: linear-gradient(to right, transparent, var(--teal-dim));
}
.site-hero-label::before { background: linear-gradient(to left, transparent, var(--teal-dim)); }

.site-hero-title {
  font-family: var(--font-display);
  font-size: clamp(3rem, 8vw, 6.5rem);
  font-weight: 700;
  line-height: 1.03;
  color: var(--text);
  letter-spacing: -0.01em;
  margin-bottom: 24px;
  animation: fadeUp 0.95s 0.12s ease both;
}

.site-hero-title em { font-style: italic; color: var(--teal-bright); font-weight: 400; }

.site-hero-sub {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 480px;
  line-height: 1.9;
  margin-bottom: 36px;
  animation: fadeUp 0.8s 0.32s ease both;
}

/* ── CTA Button ── */
.btn {
  display: inline-block;
  font-family: var(--font-label);
  font-size: 0.58rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--bg);
  background: var(--teal);
  padding: 14px 28px;
  text-decoration: none;
  border: 1px solid var(--teal);
  transition: background 0.2s, color 0.2s;
  animation: fadeUp 0.75s 0.48s ease both;
}

.btn:hover { background: var(--teal-bright); border-color: var(--teal-bright); }

/* ── Section variants ── */
.section-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 48px;
  font-style: italic;
  max-width: 580px;
  margin-left: auto;
  margin-right: auto;
}

.section-alt { background: var(--bg-card); }

/* ── Calculator (homepage version) ── */
.calculator {
  max-width: 520px;
  margin: 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--border-teal);
  padding: 40px 36px;
  position: relative;
}

.calculator::before {
  content: '';
  position: absolute;
  top: -1px; left: 32px; right: 32px;
  height: 2px;
  background: linear-gradient(to right, transparent, var(--teal), transparent);
}

.calc-form { display: flex; gap: 10px; }

.calc-form input[type="number"] {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border-teal);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.1rem;
  padding: 13px 16px;
  outline: none;
  transition: border-color 0.2s;
  -moz-appearance: textfield;
}

.calc-form input[type="number"]::-webkit-outer-spin-button,
.calc-form input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; }
.calc-form input[type="number"]::placeholder { color: var(--text-dim); }
.calc-form input[type="number"]:focus { border-color: var(--teal); }

.calc-form button {
  background: var(--teal);
  color: var(--bg);
  border: none;
  font-family: var(--font-label);
  font-size: 0.58rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 13px 22px;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
  font-weight: 600;
}

.calc-form button:hover { background: var(--teal-bright); }

.calc-result { margin-top: 24px; display: none; }
.calc-result:not(:empty) { display: block; animation: fadeUp 0.35s ease; }

.calc-animal {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 22px 20px;
  border: 1px solid var(--border);
  background: rgba(45,100,85,0.05);
}

.calc-animal img { width: 72px; height: 72px; object-fit: contain; flex-shrink: 0; }
.calc-animal h3 { font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; color: var(--teal-bright); margin-bottom: 4px; }
.calc-animal p { font-size: 0.88rem; color: var(--text-muted); line-height: 1.6; }
.calc-animal a { color: var(--teal); text-decoration: underline; text-underline-offset: 3px; transition: color 0.2s; }
.calc-animal a:hover { color: var(--teal-bright); }

/* ── Hangul block — compact in cards ── */
.zodiac-card .hangul-block,
.animal-time-card .hangul-block,
.element-card-body .hangul-block {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.zodiac-card .hangul-char { font-size: 1.8rem; }
.zodiac-card .hangul-romanji { font-size: 0.5rem; }
.animal-time-card .hangul-char { font-size: 2rem; }
.animal-time-card .hangul-romanji { font-size: 0.52rem; }

/* ── Zodiac card body ── */
.zodiac-card-body { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.zodiac-card-body h3 { font-family: var(--font-display); font-size: 1.1rem; font-weight: 700; color: var(--text); }
.zodiac-card-body p { font-size: 0.7rem; color: var(--text-dim); font-style: italic; line-height: 1.5; }

/* ── Elements grid ── */
.elements-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  margin-top: 40px;
}

.element-card {
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 28px 16px 24px;
  text-align: center;
  text-decoration: none;
  gap: 10px;
  transition: background 0.22s;
  position: relative;
}

.element-card::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 2px;
  background: transparent;
  transition: background 0.22s;
}

.element-card:hover { background: var(--bg-raised); }
.element-card:hover::after { background: var(--teal-dim); }

.element-card img { width: 64px; height: 64px; object-fit: contain; filter: brightness(0.88) saturate(0.75); transition: filter 0.25s, transform 0.25s; }
.element-card:hover img { filter: brightness(1.05) saturate(1); transform: scale(1.06) translateY(-2px); }

.element-card-body { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.element-card-body h3 { font-family: var(--font-display); font-size: 1.1rem; font-weight: 700; color: var(--text); }
.element-card-body p { font-size: 0.68rem; color: var(--text-dim); font-style: italic; }

/* ── Sign intro block ── */
.sign-intro {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 36px;
  align-items: start;
  margin: 36px 0 44px;
  padding: 32px;
  background: var(--bg-card);
  border: 1px solid var(--border-teal);
}

.sign-intro img { width: 140px; height: 140px; object-fit: contain; filter: brightness(0.88) saturate(0.8); }

.sign-traits { list-style: none; }
.sign-traits li {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--teal-bright);
  padding: 7px 0;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border);
}
.sign-traits li:last-child { border-bottom: none; }
.sign-traits li::before { content: '✦'; font-size: 0.5rem; color: var(--teal-dim); flex-shrink: 0; }

/* ── Animal time card parts ── */
.at-time {
  font-family: var(--font-label);
  font-size: 0.52rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--teal);
}

.at-sign {
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-muted);
}

.at-name {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

/* ── Compat table ── */
.compat-table { margin: 24px 0 40px; overflow-x: auto; }
.compat-table table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.compat-table th { font-family: var(--font-label); font-size: 0.52rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--teal); padding: 12px 16px; border-bottom: 2px solid var(--border-teal); text-align: left; background: var(--bg-card); }
.compat-table td { padding: 11px 16px; border-bottom: 1px solid var(--border); color: var(--text); }
.compat-table tr:last-child td { border-bottom: none; }
.compat-table tr:nth-child(even) td { background: rgba(45,100,85,0.03); }
.compat-table td a { color: var(--teal); text-decoration: none; }
.compat-table td a:hover { color: var(--teal-bright); text-decoration: underline; }

/* ── Page hero hangul large ── */
.hangul-block.large {
  margin: 16px auto 24px;
  background: none;
  border: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.hangul-block.large .hangul-char { font-size: 5rem; }
.hangul-block.large .hangul-romanji { font-size: 0.62rem; }

@media (max-width: 900px) { .zodiac-grid { grid-template-columns: repeat(3, 1fr); } }

@media (max-width: 768px) {
  :root { --nav-height: 58px; }
  .nav-links { display: none; position: fixed; top: var(--nav-height); left: 0; right: 0; bottom: 0; background: #E4EAE2; flex-direction: column; padding: 24px; overflow-y: auto; gap: 0; border-top: 1px solid var(--border); }
  .nav-links.open { display: flex; }
  .nav-links > li > a { height: auto; padding: 14px 0; font-size: 0.72rem; border-bottom: 1px solid var(--border); color: var(--text-muted); }
  .dropdown { position: static; opacity: 1; visibility: visible; transform: none; background: transparent; border: none; padding: 4px 0 12px 16px; min-width: 0; }
  .dropdown li a { padding: 8px 0; font-size: 0.65rem; border-bottom: none; color: var(--text-dim); }
  .nav-toggle { display: flex; }
  .zodiac-grid { grid-template-columns: repeat(3, 1fr); }
  .traits-grid,.compat-grid,.info-grid { grid-template-columns: 1fr; }
  .animal-time-grid { grid-template-columns: repeat(2, 1fr); }
  .element-intro { grid-template-columns: 1fr; text-align: center; }
  .elements-grid { grid-template-columns: repeat(3, 1fr); }
  .sign-intro { grid-template-columns: 1fr; text-align: center; }
  .footer-grid { justify-content: center; text-align: center; }
  .footer-nav-links { align-items: center; }
  .footer-brand p { max-width: 100%; }
}

@media (max-width: 540px) {
  .zodiac-grid { grid-template-columns: repeat(2, 1fr); }
  .animal-time-grid { grid-template-columns: repeat(2, 1fr); }
  .elements-grid { grid-template-columns: repeat(2, 1fr); }
  .calc-form { flex-direction: column; }
  .calculator { padding: 28px 20px; }
  .calc-animal { flex-direction: column; text-align: center; }
  .sign-nav { flex-direction: column; gap: 16px; text-align: center; }
  .about-content { padding: 40px 20px 60px; }
  .about-content h2 { font-size: 1.35rem; }
  .article { padding: 40px 20px 60px; }
  .article > h2 { font-size: 1.35rem; }
  .page-hero-title { font-size: clamp(1.9rem, 8vw, 2.4rem); }
}
