:root {
  --purple: #7c3aed;
  --pink: #ec4899;
  --orange: #f97316;
  --ink: #1e1b2e;
  --muted: #6b7280;
  --bg: #faf9fc;
  --card-bg: #ffffff;
  --border: #ece9f5;
  --radius: 18px;
  --gradient: linear-gradient(135deg, #7c3aed 0%, #ec4899 55%, #f97316 100%);
  --shadow: 0 10px 30px rgba(124, 58, 237, 0.12);
  font-size: 16px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard", "Malgun Gothic", "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

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

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 249, 252, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.brand {
  font-weight: 800;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

@media (min-width: 480px) {
  .brand {
    font-size: 1.15rem;
  }
}

.brand .emoji { font-size: 1.3rem; }

.main-nav {
  display: flex;
  gap: 2px;
}

.main-nav a {
  padding: 8px 10px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}

@media (min-width: 480px) {
  .main-nav {
    gap: 4px;
  }
  .main-nav a {
    padding: 8px 14px;
    font-size: 0.92rem;
  }
}

.main-nav a:hover, .main-nav a.active {
  background: #f3effc;
  color: var(--purple);
}

/* Hero */
.hero {
  background: var(--gradient);
  padding: 56px 0 72px;
  color: #fff;
  text-align: center;
}

.hero h1 {
  font-size: clamp(1.7rem, 4.5vw, 2.6rem);
  margin: 0 0 12px;
  font-weight: 800;
}

.hero p {
  font-size: clamp(0.95rem, 2vw, 1.1rem);
  opacity: 0.92;
  max-width: 560px;
  margin: 0 auto;
}

/* Calculator card */
.calc-wrap {
  margin-top: -44px;
  margin-bottom: 48px;
}

.calc-card {
  background: var(--card-bg);
  border-radius: 24px;
  box-shadow: 0 20px 50px rgba(60, 20, 90, 0.18);
  padding: 32px 24px;
}

.calc-label {
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 6px;
  display: block;
}

.calc-sub {
  color: var(--muted);
  font-size: 0.88rem;
  margin-bottom: 20px;
}

.slider-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 8px;
}

input[type="range"] {
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: #eee3fb;
  appearance: none;
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--gradient);
  border: 3px solid #fff;
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.5);
  cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--gradient);
  border: 3px solid #fff;
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.5);
  cursor: pointer;
}

.minute-input {
  width: 92px;
  padding: 10px 10px;
  border-radius: 12px;
  border: 2px solid var(--border);
  font-size: 1.05rem;
  font-weight: 700;
  text-align: center;
  color: var(--purple);
}

.minute-input:focus { outline: none; border-color: var(--purple); }

.quick-presets {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.preset-btn {
  padding: 6px 14px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}

.preset-btn:hover, .preset-btn.active {
  border-color: var(--purple);
  color: var(--purple);
  background: #f6f0fe;
}

/* Result section */
#result-card {
  background: var(--card-bg);
  border-radius: 24px;
  padding: 28px 22px 34px;
}

.result-headline {
  text-align: center;
  margin-bottom: 26px;
}

.result-headline .big-num {
  font-size: clamp(2.4rem, 8vw, 3.6rem);
  font-weight: 900;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1.1;
}

.result-headline .headline-sub {
  color: var(--muted);
  font-weight: 600;
  margin-top: 4px;
  font-size: 0.95rem;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

@media (min-width: 720px) {
  .result-grid { grid-template-columns: repeat(3, 1fr); }
}

.stat-card {
  border-radius: 18px;
  padding: 18px 16px;
  background: #f9f7fd;
  border: 1px solid var(--border);
}

.stat-card .icon { font-size: 1.6rem; margin-bottom: 8px; display: block; }
.stat-card .value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 2px;
}
.stat-card .label {
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 600;
  line-height: 1.4;
}
.stat-card .humor {
  margin-top: 8px;
  font-size: 0.78rem;
  color: var(--purple);
  font-weight: 700;
  background: #f0e6fd;
  padding: 4px 8px;
  border-radius: 8px;
  display: inline-block;
}

.watermark {
  text-align: center;
  margin-top: 22px;
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.share-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 22px;
  flex-wrap: wrap;
}

.btn {
  border: none;
  border-radius: 999px;
  padding: 12px 22px;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
}

.btn-primary {
  background: var(--gradient);
  color: #fff;
  box-shadow: 0 8px 20px rgba(124, 58, 237, 0.3);
}

.btn-secondary {
  background: #fff;
  color: var(--purple);
  border: 2px solid #eadffb;
}

.btn:active { transform: scale(0.98); }

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink);
  color: #fff;
  padding: 12px 20px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
  z-index: 100;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Generic section */
.section {
  padding: 48px 0;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.section-sub {
  color: var(--muted);
  margin-bottom: 24px;
}

/* Article list */
.article-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 640px) {
  .article-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 960px) {
  .article-grid { grid-template-columns: repeat(3, 1fr); }
}

.article-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.article-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.article-card .tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--pink);
  background: #fde7f1;
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 10px;
}

.article-card h3 {
  font-size: 1.08rem;
  margin: 0 0 8px;
}

.article-card p {
  font-size: 0.88rem;
  color: var(--muted);
  margin: 0;
}

/* Article single page */
.article-body {
  max-width: 720px;
  margin: 0 auto;
  padding: 40px 20px 70px;
}

.article-body .eyebrow {
  color: var(--pink);
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: 10px;
}

.article-body h1 {
  font-size: clamp(1.5rem, 4vw, 2.1rem);
  margin: 0 0 16px;
}

.article-body .meta {
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 30px;
}

.article-body h2 {
  font-size: 1.28rem;
  margin: 34px 0 12px;
}

.article-body h3 {
  font-size: 1.08rem;
  margin: 24px 0 8px;
}

.article-body p, .article-body li {
  color: #34303f;
  font-size: 1rem;
  margin-bottom: 14px;
}

.article-body ul, .article-body ol {
  padding-left: 22px;
}

.cta-box {
  background: var(--gradient);
  border-radius: 18px;
  padding: 26px 22px;
  color: #fff;
  text-align: center;
  margin: 36px 0;
}

.cta-box h3 { margin: 0 0 8px; font-size: 1.15rem; }
.cta-box p { color: rgba(255,255,255,0.9); margin: 0 0 16px; font-size: 0.92rem; }
.cta-box .btn-primary { background: #fff; color: var(--purple); box-shadow: none; }

.related-links {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.related-links h4 { font-size: 1rem; margin-bottom: 12px; }
.related-links ul { list-style: none; padding: 0; margin: 0; }
.related-links li { margin-bottom: 8px; }
.related-links a { color: var(--purple); font-weight: 600; }
.related-links a:hover { text-decoration: underline; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 36px 0;
  margin-top: 40px;
}

.site-footer .container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  text-align: center;
}

.footer-links {
  display: flex;
  gap: 18px;
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 600;
}

.footer-links a:hover { color: var(--purple); }

.copyright {
  font-size: 0.8rem;
  color: #9b96a8;
}

.simple-hero {
  padding: 44px 0 34px;
  text-align: center;
  background: var(--gradient);
  color: #fff;
}

.simple-hero h1 { font-size: clamp(1.5rem, 4vw, 2.2rem); margin: 0 0 8px; }
.simple-hero p { opacity: 0.9; font-size: 0.95rem; }
