:root {
  --bg: #0A0908;
  --bg-radial: #1A1410;
  --panel: rgba(22, 18, 15, 0.75);
  --panel-active: rgba(32, 26, 22, 0.95);
  --panel-light: rgba(40, 32, 26, 0.55);
  --line: rgba(232, 163, 89, 0.16);
  --line-strong: rgba(232, 163, 89, 0.35);
  --text: #F7EFE6;
  --muted: rgba(247, 239, 230, 0.65);
  --faint: rgba(247, 239, 230, 0.35);
  --oak: #E8A359;
  --oak-hover: #F2B475;
  --oak-glow: rgba(232, 163, 89, 0.22);
  --spark: #F2C14E;
  --cream: #FFFDF9;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-xl: 30px;
  --font-sans: "Pretendard", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-display: "Montserrat", "Pretendard", sans-serif;
  --transition: all 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-sans);
  background: radial-gradient(circle at 50% -15%, var(--bg-radial) 0%, var(--bg) 65%), var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 80px;
}

/* Subtle background texture */
.bg-mesh {
  position: fixed;
  inset: 0;
  background-image: radial-gradient(rgba(232, 163, 89, 0.05) 1px, transparent 0);
  background-size: 28px 28px;
  pointer-events: none;
  z-index: 0;
}

.container {
  max-width: 1060px;
  margin: 0 auto;
  padding: 24px 20px 80px;
  position: relative;
  z-index: 1;
}

/* Header & Nav */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
  gap: 16px;
  flex-wrap: wrap;
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  flex-shrink: 0;
}

.brand-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, #B9773C, #8A5226);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(232, 163, 89, 0.25);
  border: 1px solid rgba(242, 193, 78, 0.3);
}

.brand-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand-title span {
  color: var(--oak);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.toggle-btn {
  background: rgba(35, 25, 20, 0.75);
  border: 1px solid rgba(232, 163, 89, 0.25);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  padding: 7px 13px;
  border-radius: 99px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
  backdrop-filter: blur(8px);
  user-select: none;
}

.toggle-btn:hover {
  color: var(--cream);
  border-color: var(--oak);
  background: rgba(232, 163, 89, 0.15);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(232, 163, 89, 0.25);
}

.toggle-btn:active {
  transform: translateY(0);
}

.toggle-btn.active {
  color: #1A120B;
  background: linear-gradient(135deg, #F2C14E, #E8A359);
  border-color: #F2C14E;
  font-weight: 800;
  box-shadow: 0 4px 16px rgba(232, 163, 89, 0.45);
}

.toggle-btn.lang-btn {
  background: rgba(232, 163, 89, 0.12);
  border: 1px solid rgba(232, 163, 89, 0.4);
  color: var(--spark);
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: 0.02em;
  padding: 8px 15px;
}

.toggle-btn.lang-btn:hover {
  background: rgba(232, 163, 89, 0.25);
  border-color: var(--spark);
  color: #FFF;
}

/* Hero Section & Character Stage */
.hero {
  text-align: center;
  margin: 12px 0 32px;
}

.brew-stage {
  width: 110px;
  height: 110px;
  margin: 0 auto 12px;
  position: relative;
  transition: transform 0.3s ease;
}

.brew-stage:hover {
  transform: scale(1.06);
}

.brew-stage svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.45));
}

.speech-bubble {
  display: inline-block;
  background: var(--panel-active);
  border: 1px solid var(--line-strong);
  color: var(--spark);
  font-size: 13px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 99px;
  margin-bottom: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  animation: floatBounce 3s ease-in-out infinite;
}

@keyframes floatBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

.hero h1 {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.3;
  margin-bottom: 8px;
  color: var(--cream);
}

.hero p {
  color: var(--muted);
  font-size: 15px;
}

/* Method Selector Tabs */
.method-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 24px;
}

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

.method-tab {
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 12px 6px;
  border-radius: var(--radius-md);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
}

.method-tab:hover {
  background: var(--panel-active);
  color: var(--text);
  border-color: var(--oak);
}

.method-tab.active {
  background: linear-gradient(145deg, rgba(232, 163, 89, 0.18), rgba(26, 18, 14, 0.8));
  border-color: var(--oak);
  color: var(--oak);
  box-shadow: 0 4px 18px var(--oak-glow);
}

.method-icon {
  font-size: 20px;
}

/* Calculator Main Box */
.calc-card {
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-xl);
  padding: 28px 22px;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(24px);
  margin-bottom: 28px;
}

.calc-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
}

@media (min-width: 720px) {
  .calc-grid {
    grid-template-columns: 1fr 1fr;
    align-items: center;
  }
}

.input-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.input-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
}

.badge-tag {
  font-size: 12px;
  color: var(--oak);
  background: rgba(232, 163, 89, 0.12);
  padding: 2px 8px;
  border-radius: 99px;
}

.input-row {
  position: relative;
  display: flex;
  align-items: center;
}

.calc-input {
  width: 100%;
  background: rgba(12, 9, 7, 0.85);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  padding: 16px 54px 16px 18px;
  font-size: 24px;
  font-weight: 800;
  color: var(--cream);
  outline: none;
  font-variant-numeric: tabular-nums;
  transition: var(--transition);
}

.calc-input:focus {
  border-color: var(--oak);
  box-shadow: 0 0 0 3px var(--oak-glow);
}

.unit-label {
  position: absolute;
  right: 18px;
  font-size: 16px;
  font-weight: 700;
  color: var(--oak);
  pointer-events: none;
}

/* Quick Increment Buttons */
.quick-steppers {
  display: flex;
  gap: 6px;
}

.step-btn {
  flex: 1;
  background: rgba(35, 25, 20, 0.75);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  padding: 8px 4px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.step-btn:hover {
  background: rgba(232, 163, 89, 0.15);
  color: var(--cream);
  border-color: var(--oak);
  transform: translateY(-1px);
}

.step-btn:active {
  transform: translateY(0);
  background: rgba(232, 163, 89, 0.25);
}

/* Ratio & Strength Slider */
.ratio-control-box {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-top: 18px;
}

.ratio-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.ratio-value-badge {
  font-size: 18px;
  font-weight: 800;
  color: var(--spark);
}

.slider-wrap {
  position: relative;
  width: 100%;
}

.custom-range {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.12);
  outline: none;
}

.custom-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--oak);
  border: 2px solid #FFF;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  transition: transform 0.15s ease;
}

.custom-range::-webkit-slider-thumb:hover {
  transform: scale(1.18);
}

.ratio-presets {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}

.ratio-preset-tag {
  cursor: pointer;
}
.ratio-preset-tag:hover {
  color: var(--oak);
}

/* Result Overview Summary */
.summary-banner {
  background: linear-gradient(135deg, rgba(232, 163, 89, 0.15) 0%, rgba(24, 18, 14, 0.8) 100%);
  border: 1.5px solid var(--oak);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-top: 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

@media (min-width: 600px) {
  .summary-banner {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

.summary-main h3 {
  font-size: 14px;
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 4px;
}

.summary-value {
  font-size: 28px;
  font-weight: 900;
  color: var(--spark);
  letter-spacing: -0.02em;
}

.summary-details {
  display: flex;
  gap: 16px;
}

.detail-item {
  display: flex;
  flex-direction: column;
}

.detail-item span:first-child {
  font-size: 12px;
  color: var(--muted);
}

.detail-item span:last-child {
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
}

/* Pouring Steps Breakdown */
.step-guide-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 24px;
  margin-bottom: 28px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.section-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--cream);
  display: flex;
  align-items: center;
  gap: 8px;
}

.timeline {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.stage-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  background: rgba(0, 0, 0, 0.35);
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  transition: var(--transition);
}

.stage-row:hover {
  border-color: var(--oak);
  transform: translateX(3px);
}

.stage-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--line-strong);
  color: var(--spark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14px;
  flex-shrink: 0;
}

.stage-info {
  flex: 1;
}

.stage-name {
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 2px;
}

.stage-desc {
  font-size: 12px;
  color: var(--muted);
}

.stage-amount {
  text-align: right;
  flex-shrink: 0;
}

.stage-water {
  font-size: 16px;
  font-weight: 800;
  color: var(--spark);
}

.stage-time {
  font-size: 12px;
  color: var(--muted);
}

/* Interactive Timer Module */
.timer-widget {
  background: linear-gradient(145deg, #18120E, #110D09);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 18px;
}

.timer-digits {
  font-size: 32px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  color: var(--cream);
  letter-spacing: 0.05em;
}

.timer-btns {
  display: flex;
  gap: 8px;
}

.timer-btn {
  background: rgba(35, 25, 20, 0.85);
  border: 1px solid var(--line);
  color: var(--cream);
  font-size: 16px;
  font-weight: 800;
  padding: 12px 28px;
  border-radius: 99px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  user-select: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.timer-btn:hover {
  border-color: var(--oak);
  background: rgba(232, 163, 89, 0.15);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.timer-btn:active {
  transform: translateY(0);
}

.timer-btn.primary {
  background: linear-gradient(135deg, #F2C14E, #E8A359);
  color: #1A120B;
  border-color: #F2C14E;
  box-shadow: 0 6px 20px rgba(232, 163, 89, 0.4);
}

.timer-btn.primary:hover {
  background: linear-gradient(135deg, #FFD268, #F0B06A);
  box-shadow: 0 8px 26px rgba(232, 163, 89, 0.55);
  transform: translateY(-2px);
}

.timer-btn.running {
  background: linear-gradient(135deg, #E06C54, #C0422B);
  color: #FFFFFF;
  border-color: #E06C54;
  box-shadow: 0 6px 20px rgba(224, 108, 84, 0.4);
}

.timer-btn.running:hover {
  background: linear-gradient(135deg, #EB7E68, #CE4E37);
  box-shadow: 0 8px 26px rgba(224, 108, 84, 0.55);
  transform: translateY(-2px);
}

/* Gear & Affiliate Recommendation Card */
.gear-section {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 24px;
  margin-bottom: 36px;
}

.gear-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-top: 16px;
}

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

.gear-card {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 16px;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.gear-card:hover {
  border-color: var(--oak);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.gear-tag {
  font-size: 11px;
  font-weight: 800;
  color: var(--oak);
  text-transform: uppercase;
  margin-bottom: 8px;
}

.gear-name {
  font-size: 15px;
  font-weight: 800;
  color: var(--cream);
  line-height: 1.4;
  margin-bottom: 6px;
}

.gear-why {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 12px;
}

.gear-link {
  font-size: 12px;
  font-weight: 800;
  color: var(--spark);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* E-E-A-T Guide & FAQ Article (Helpful Content) */
.guide-article {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 32px 24px;
  margin-bottom: 40px;
}

.guide-article h2 {
  font-size: 22px;
  font-weight: 800;
  color: var(--cream);
  margin-bottom: 14px;
  letter-spacing: -0.02em;
}

.guide-article p {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.8;
  margin-bottom: 16px;
}

.guide-table {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0;
  font-size: 14px;
}

.guide-table th, .guide-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

.guide-table th {
  color: var(--oak);
  font-weight: 800;
  background: rgba(0, 0, 0, 0.25);
}

.guide-table td {
  color: var(--text);
}

/* Footer */
.footer {
  text-align: center;
  font-size: 13px;
  color: var(--faint);
  border-top: 1px solid var(--line);
  padding-top: 24px;
}

.footer a {
  color: var(--muted);
  text-decoration: none;
  margin: 0 6px;
}

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

/* --- Degassing Calculator Specific Styles --- */
.roast-selector {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 8px;
}

.roast-btn {
  background: var(--panel-light);
  border: 1px solid var(--line);
  padding: 12px 8px;
  border-radius: var(--radius-md);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: var(--transition);
}

.roast-btn:hover {
  border-color: var(--oak);
  color: var(--text);
}

.roast-btn.active {
  background: linear-gradient(145deg, rgba(232, 163, 89, 0.22), rgba(26, 18, 14, 0.85));
  border-color: var(--oak);
  color: var(--oak);
  box-shadow: 0 4px 18px var(--oak-glow);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 99px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.status-badge.status-early {
  background: rgba(239, 68, 68, 0.15);
  color: #F87171;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.status-badge.status-ready {
  background: rgba(59, 130, 246, 0.15);
  color: #60A5FA;
  border: 1px solid rgba(59, 130, 246, 0.35);
}

.status-badge.status-peak {
  background: rgba(245, 158, 11, 0.2);
  color: #FBBF24;
  border: 1px solid rgba(245, 158, 11, 0.5);
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.25);
  animation: pulseGlow 2s infinite ease-in-out;
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 12px rgba(245, 158, 11, 0.2); }
  50% { box-shadow: 0 0 22px rgba(245, 158, 11, 0.45); }
}

.status-badge.status-fading {
  background: rgba(156, 163, 175, 0.15);
  color: #9CA3AF;
  border: 1px solid rgba(156, 163, 175, 0.3);
}

/* Degassing Timeline Gauge */
.degassing-gauge-wrap {
  margin: 24px 0 16px;
  position: relative;
}

.gauge-track {
  height: 12px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--line);
  border-radius: 99px;
  position: relative;
  overflow: hidden;
}

.gauge-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #F87171 0%, #60A5FA 40%, #FBBF24 70%, #9CA3AF 100%);
  border-radius: 99px;
  transition: width 0.4s ease;
}

.gauge-marker {
  position: absolute;
  top: -4px;
  left: 0%;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #FFF;
  border: 3px solid var(--spark);
  transform: translateX(-50%);
  box-shadow: 0 2px 8px rgba(0,0,0,0.6);
  transition: left 0.4s ease;
}

.gauge-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 11px;
  color: var(--muted);
  font-weight: 700;
}

/* Cross Tool Promotion Banner */
.cross-tool-banner {
  background: linear-gradient(135deg, rgba(232, 163, 89, 0.12), rgba(20, 15, 12, 0.8));
  border: 1px dashed var(--oak);
  border-radius: var(--radius-lg);
  padding: 18px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
}

.cross-tool-banner:hover {
  background: linear-gradient(135deg, rgba(232, 163, 89, 0.2), rgba(26, 18, 14, 0.9));
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.cross-tool-info strong {
  display: block;
  font-size: 15px;
  color: var(--cream);
  margin-bottom: 3px;
}

.cross-tool-info p {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
}

.cross-tool-cta {
  font-size: 13px;
  font-weight: 800;
  color: var(--spark);
  background: rgba(242, 193, 78, 0.12);
  padding: 8px 14px;
  border-radius: 99px;
  white-space: nowrap;
}

/* ── 계산 방식 설명 (2026-10-14) ── */
.explainer { max-width: 860px; margin: 40px auto 24px; padding: 0 20px; color: var(--muted, #cbd5e1); line-height: 1.85; font-size: 15px; }
.explainer h2 { color: var(--cream, #fff); font-size: 22px; margin: 0 0 14px; }
.explainer h3 { color: var(--spark, #f2c14e); font-size: 16px; margin: 24px 0 8px; }
.explainer p, .explainer li { margin: 0 0 10px; }
.explainer ul { padding-left: 20px; }
.explainer .ex-box { background: rgba(0,0,0,0.30); border: 1px solid var(--line, rgba(255,255,255,0.12)); border-radius: 14px; padding: 14px 18px; margin: 12px 0 16px; }
