/* ==========================================================================
   DAYZIP.KR — 2027 정미년(丁未年) 정밀 사주 · 궁합 · 띠별 신년운세
   Aesthetic: Modern Korean Hanji & Ink Editorial
   ========================================================================== */

:root {
  --bg: #f6f3ec;
  --panel: #ffffff;
  --surface: #efeae0;
  --ink: #17151c;
  --ink-soft: #4e4a52;
  --muted: #847e77;
  --line: #e4ddd1;
  --line-dark: #17151c;
  --seal: #b83b2a;
  --seal-soft: #fbeee9;
  --gold: #a6834b;
  --gold-soft: #f6efe2;
  --night: #16141a;
  --night-2: #201d26;
  --serif-en: 'Cormorant Garamond', Georgia, serif;
  --serif-ko: 'Gowun Batang', 'Noto Serif KR', Georgia, serif;
  --sans: 'Pretendard', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14.5px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

.container {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(246, 243, 236, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 20px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.brand-seal {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--night);
  color: #f5f0e6;
  font-family: var(--serif-en);
  font-size: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.brand-seal::after {
  content: '';
  position: absolute;
  right: 4px;
  bottom: 5px;
  width: 4px;
  height: 4px;
  background: var(--seal);
}
.brand-text {
  font-family: var(--serif-en);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: 0.14em;
}
.brand-sub {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.04em;
}
.top-nav {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 13px;
  color: var(--ink-soft);
}
.top-nav a {
  text-decoration: none;
}
.top-nav a:hover {
  color: var(--ink);
}

/* ---------- Hero Section (Midnight Ink + Seal) ---------- */
.hero {
  background:
    radial-gradient(circle at 80% 18%, rgba(201, 174, 130, 0.16), transparent 46%),
    linear-gradient(160deg, #16141a 0%, #1f1c25 60%, #141218 100%);
  color: #f5f0e6;
  padding: 52px 20px 64px;
  text-align: center;
  border-bottom: 1px solid rgba(223, 200, 162, 0.18);
}
.hero-inner {
  max-width: 720px;
  margin: 0 auto;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border: 1px solid rgba(201, 174, 130, 0.35);
  color: #dcc39a;
  font-size: 11.5px;
  letter-spacing: 0.14em;
  margin-bottom: 20px;
}
.hero-badge .red-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--seal);
}
.hero h1 {
  font-family: var(--serif-ko);
  font-size: clamp(26px, 4.4vw, 40px);
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.02em;
  margin: 0 0 16px;
}
.hero h1 em {
  font-style: normal;
  color: #e4cca2;
}
.hero p {
  margin: 0 auto;
  max-width: 560px;
  color: #bdb6aa;
  font-size: 14.5px;
  line-height: 1.75;
}

/* ---------- Main App Tabs ---------- */
.tabs-bar {
  max-width: 980px;
  margin: -28px auto 26px;
  padding: 0 20px;
  position: relative;
  z-index: 10;
}
.tabs-shell {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: 0 12px 36px rgba(22, 20, 26, 0.08);
}
.tab-btn {
  padding: 16px 10px;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  color: var(--ink-soft);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}
.tab-btn:last-child {
  border-right: 0;
}
.tab-btn.active {
  background: var(--night);
  color: #f5f0e6;
  font-weight: 600;
}

.tab-panel {
  display: none;
}
.tab-panel.active {
  display: block;
}

/* ---------- Card & Form ---------- */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 28px 26px;
  margin-bottom: 22px;
}
.card-title-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.card-title-row h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}
.card-title-row span {
  font-size: 12.5px;
  color: var(--muted);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.form-grid.cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field.span-2 {
  grid-column: span 2;
}
.field label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
}
.input,
.select {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  background: #fbfaf7;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  outline: none;
}
.input:focus,
.select:focus {
  border-color: var(--ink);
  background: #ffffff;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 22px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: #ffffff;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.16s ease, transform 0.12s ease, background 0.16s ease;
}
.btn:hover {
  opacity: 0.92;
}
.btn:active {
  transform: scale(0.985);
}
.btn-seal {
  background: var(--seal);
  border-color: var(--seal);
}
.btn-outline {
  background: transparent;
  color: var(--ink);
}
.btn-outline:hover {
  background: var(--ink);
  color: #ffffff;
}
.btn-full {
  width: 100%;
}

/* ---------- Loading Animation ---------- */
.loading-box {
  display: none;
  text-align: center;
  padding: 46px 20px;
  background: var(--night);
  color: #f5f0e6;
  margin-bottom: 22px;
}
.loading-box.show {
  display: block;
}
.loading-ring {
  width: 44px;
  height: 44px;
  border: 2px solid rgba(201, 174, 130, 0.25);
  border-top-color: #dcc39a;
  border-radius: 50%;
  margin: 0 auto 16px;
  animation: spin 0.85s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---------- Result Hero & 4 Pillars ---------- */
.result-wrap {
  display: none;
  animation: fadeUp 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.result-wrap.show {
  display: block;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.result-hero {
  background: var(--night);
  color: #f5f0e6;
  padding: 36px 26px;
  border: 1px solid rgba(201, 174, 130, 0.25);
  text-align: center;
  margin-bottom: 20px;
}
.seal-tag {
  display: inline-block;
  padding: 4px 12px;
  background: var(--seal);
  color: #ffffff;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  margin-bottom: 14px;
}
.score-big {
  font-family: var(--serif-en);
  font-size: 74px;
  line-height: 1;
  color: #e4cca2;
  margin: 4px 0 6px;
}
.score-sub {
  font-size: 12.5px;
  color: #a9a194;
  margin-bottom: 16px;
}
.keyword-quote {
  font-family: var(--serif-ko);
  font-size: clamp(18px, 3vw, 24px);
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 12px;
}
.archetype-line {
  font-size: 13.5px;
  color: #cfc8bc;
  margin: 0 auto 24px;
  max-width: 560px;
}
.share-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}
.btn-gold {
  background: #c9ae82;
  border-color: #c9ae82;
  color: #16141a;
}
.btn-ghost-light {
  background: transparent;
  border-color: rgba(245, 240, 230, 0.35);
  color: #f5f0e6;
}

/* 4 Pillars Grid */
.pillars-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.pillar-box {
  background: var(--bg);
  border: 1px solid var(--line);
  padding: 16px 10px;
  text-align: center;
}
.pillar-box.is-day {
  border: 1.5px solid var(--seal);
  background: #fffdfb;
}
.pillar-label {
  font-size: 11.5px;
  color: var(--muted);
  margin-bottom: 10px;
}
.hanja-chip {
  width: 56px;
  height: 56px;
  margin: 0 auto 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  border-radius: 8px;
  font-family: var(--serif-ko);
  font-size: 26px;
  font-weight: 700;
  line-height: 1;
}
.hanja-chip small {
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 400;
  opacity: 0.9;
  margin-top: 3px;
}
.pillar-ko {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  margin-top: 6px;
}

/* Five Elements Bars */
.el-bars {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}
.el-row {
  display: grid;
  grid-template-columns: 92px 1fr 48px;
  align-items: center;
  gap: 12px;
  font-size: 13px;
}
.el-track {
  height: 10px;
  background: var(--surface);
  overflow: hidden;
  border-radius: 999px;
}
.el-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.6s ease;
}

/* 5-Category Fortune Grid */
.fortune-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}
.fortune-box {
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 22px;
}
.fortune-box.full {
  grid-column: 1 / -1;
}
.fortune-box h3 {
  margin: 0 0 10px;
  font-size: 15.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.fortune-box p {
  margin: 0;
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.8;
}

/* Monthly 12-Grid */
.months-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.month-card {
  border: 1px solid var(--line);
  background: #fcfbf8;
  padding: 14px;
}
.month-card.best {
  border: 1.5px solid var(--seal);
  background: #fff9f7;
}
.month-card.caution {
  border-style: dashed;
}
.month-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.month-num {
  font-weight: 700;
  font-size: 14.5px;
}
.month-score {
  font-family: var(--serif-en);
  font-size: 18px;
  font-weight: 600;
  color: var(--gold);
}
.month-card.best .month-score {
  color: var(--seal);
}
.month-meta {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 6px;
}
.month-desc {
  font-size: 12.5px;
  color: var(--ink-soft);
  line-height: 1.55;
  margin: 0;
}

/* Remedy / Lucky Prescription */
.remedy-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.remedy-pill {
  background: var(--bg);
  border: 1px solid var(--line);
  padding: 14px 12px;
  text-align: center;
}
.remedy-pill span {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 4px;
}
.remedy-pill strong {
  font-size: 13.5px;
  color: var(--ink);
}
.remedy-item-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  padding: 18px 20px;
  background: var(--gold-soft);
  border: 1px solid #dfd2bb;
}

/* Zodiac 12 Grid */
.zodiac-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.zodiac-card {
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 20px 18px;
  transition: border-color 0.15s ease;
}
.zodiac-card.top-zodiac {
  border: 1.5px solid var(--seal);
}
.zodiac-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
}
.zodiac-head h3 {
  margin: 0;
  font-size: 16px;
}
.zodiac-score {
  font-family: var(--serif-en);
  font-size: 20px;
  font-weight: 600;
  color: var(--seal);
}
.zodiac-years {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 8px;
}
.zodiac-tag {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 8px;
  background: var(--surface);
  color: var(--ink);
  margin-bottom: 10px;
}
.zodiac-card.top-zodiac .zodiac-tag {
  background: var(--seal-soft);
  color: var(--seal);
}
.zodiac-card p {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.65;
}
.zodiac-lucky {
  font-size: 11.5px;
  color: var(--gold);
  font-weight: 500;
}

/* AdSense Slot (Clean Editorial Placeholder) */
.ad-slot {
  margin: 26px 0;
  padding: 16px;
  min-height: 96px;
  border: 1px dashed #d6cec0;
  background: rgba(255, 255, 255, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}

/* Editorial SEO Guide & FAQ (Essential for AdSense Approval) */
.guide-section {
  background: var(--panel);
  border-top: 1px solid var(--line);
  padding: 60px 20px;
  margin-top: 40px;
}
.guide-article {
  max-width: 820px;
  margin: 0 auto;
}
.guide-article h2 {
  font-family: var(--serif-ko);
  font-size: 24px;
  margin: 0 0 16px;
}
.guide-article h3 {
  font-size: 17px;
  margin: 30px 0 10px;
  color: var(--ink);
}
.guide-article p,
.guide-article li {
  font-size: 14.5px;
  color: var(--ink-soft);
  line-height: 1.85;
}
.faq-list {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}
.faq-box {
  border: 1px solid var(--line);
  background: var(--bg);
  padding: 18px 20px;
}
.faq-box strong {
  display: block;
  font-size: 14.5px;
  margin-bottom: 6px;
  color: var(--ink);
}
.faq-box p {
  margin: 0;
  font-size: 13.5px;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 36px 20px 52px;
  text-align: center;
  color: var(--muted);
  font-size: 12.5px;
}
.footer-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 18px;
  margin-bottom: 14px;
}
.footer-links a {
  text-decoration: none;
  color: var(--ink-soft);
}
.footer-links a:hover {
  text-decoration: underline;
}

/* Responsive */
@media (max-width: 780px) {
  .form-grid,
  .fortune-grid,
  .months-grid,
  .zodiac-grid {
    grid-template-columns: 1fr;
  }
  .form-grid.cols-2,
  .remedy-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .pillars-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .field.span-2 {
    grid-column: span 1;
  }
  .top-nav {
    display: none;
  }
  .tab-btn {
    font-size: 12.5px;
    padding: 14px 6px;
  }
  .card {
    padding: 22px 18px;
  }
}
