/* Gyesan-gi — Korean Calculator Site Theme */
/* Google Fonts loaded via <link> in HTML head for performance (no render-blocking @import) */

:root {
  /* ── 태극기 (Korean Flag) palette ── */
  --c-primary:       #003DA5;   /* Taeguk blue  */
  --c-primary-dark:  #002d7a;
  --c-primary-light: #e6edf8;
  --c-accent:        #C60C30;   /* Taeguk red   */
  --c-accent-dark:   #9b0a24;
  --c-accent-light:  #fce8ec;
  --c-bg:            #f6f7fb;
  --c-white:         #ffffff;
  --c-text:          #111827;
  --c-text-light:    #4b5280;
  --c-border:        #dce3f0;
  --c-result:        #eef2ff;
  --c-result-border: #b3c0f0;
  --radius:          12px;
  --radius-sm:       8px;
  --shadow-xs:       0 1px 4px rgba(0,61,165,.08);
  --shadow:          0 2px 12px rgba(0,61,165,.11);
  --shadow-md:       0 4px 20px rgba(0,61,165,.14);
  --shadow-lg:       0 8px 32px rgba(0,61,165,.18);
  --font:            'Noto Sans KR', 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  --max-w:           1140px;
  --hdr-h:           58px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; scroll-padding-top: calc(var(--hdr-h) + 12px); }
body {
  font-family: var(--font);
  color: var(--c-text);
  background: var(--c-bg);
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}

/* ── Typography ── */
h1, h2, h3, h4 { font-weight: 700; line-height: 1.3; color: var(--c-text); }
h1 { font-size: clamp(1.45rem, 4vw, 2rem); margin-bottom: .75rem; }
h2 { font-size: clamp(1.1rem, 3vw, 1.4rem); margin: 2.25rem 0 .65rem; }
h3 { font-size: 1.02rem; margin: 1.3rem 0 .4rem; color: var(--c-primary-dark); }
p  { margin-bottom: 1rem; }
a  { color: var(--c-primary); text-decoration: none; }
a:hover { text-decoration: underline; color: var(--c-primary-dark); }
ul, ol { padding-left: 1.5rem; margin-bottom: 1rem; }
li { margin-bottom: .3rem; }
code {
  background: #eef2ff; border-radius: 5px;
  padding: 2px 8px; font-family: 'Courier New', monospace;
  font-size: .92em; color: #2a3fa8; word-break: break-all;
}

/* ── Layout ── */
.wrap { max-width: var(--max-w); margin: 0 auto; padding: 0 1.25rem; }

/* ── Navigation ── */
.site-header {
  background: var(--c-white);
  border-bottom: 2.5px solid var(--c-accent);   /* Taeguk red line */
  position: sticky; top: 0; z-index: 200;
  box-shadow: 0 2px 10px rgba(0,61,165,.09);
  height: var(--hdr-h);
}
.nav {
  max-width: var(--max-w); margin: 0 auto; padding: 0 1.25rem;
  display: flex; align-items: center; gap: .75rem; height: 100%;
}
.brand {
  font-size: 1.15rem; font-weight: 800; color: var(--c-primary);
  text-decoration: none; letter-spacing: -.5px; flex-shrink: 0;
  display: flex; align-items: center; gap: .5rem;
  transition: opacity .15s;
}
.brand span { display: flex; align-items: center; }
.brand-icon { flex-shrink: 0; display: block; border-radius: 6px; }
@keyframes logo-bounce {
  0%,100% { transform: translateY(0) scale(1); }
  40%      { transform: translateY(-3px) scale(1.06); }
  70%      { transform: translateY(1px) scale(.97); }
}
.brand:hover .brand-icon { animation: logo-bounce .45s ease; }
.brand:hover { text-decoration: none; opacity: .88; }
.nav-links { display: flex; gap: .05rem; flex-wrap: wrap; flex: 1; }
.nav-links a {
  padding: .3rem .5rem; border-radius: var(--radius-sm);
  font-size: .83rem; font-weight: 500; color: var(--c-text-light);
  transition: background .14s, color .14s;
  display: flex; align-items: center; gap: .28rem;
}
.nav-links a:hover { background: var(--c-primary-light); color: var(--c-primary); text-decoration: none; }
.nav-links a svg { flex-shrink: 0; transition: transform .18s; }
.nav-links a:hover svg { transform: scale(1.22) rotate(-6deg); }

/* ── Icon animations ── */
@keyframes icon-pop {
  0%   { transform: scale(1)    rotate(0deg);  }
  35%  { transform: scale(1.3)  rotate(-10deg); }
  65%  { transform: scale(1.12) rotate(5deg);  }
  100% { transform: scale(1)    rotate(0deg);  }
}
@keyframes icon-pulse {
  0%,100% { transform: scale(1);    opacity: .7; }
  50%     { transform: scale(1.18); opacity: 1;  }
}
.nav-toggle {
  display: none; background: none; border: 1.5px solid var(--c-border);
  border-radius: var(--radius-sm); padding: .35rem .6rem; cursor: pointer;
  font-size: 1.1rem; color: var(--c-text); margin-left: auto;
}

/* ── Hero ── */
.hero {
  background: linear-gradient(135deg, #001a6e 0%, var(--c-primary) 50%, #1050c8 100%);
  color: #fff; padding: 3.5rem 1.25rem 3rem;
  position: relative; overflow: hidden;
}
.hero::after {
  content: ""; position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}
.hero > * { position: relative; }
/* ── Hero 2-col layout ── */
.hero-wrap {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 2.5rem;
  align-items: center;
}
.hero-content { color: #fff; }
.hero h1 { color: #fff; font-size: clamp(1.55rem, 4.5vw, 2.2rem); margin-bottom: .6rem; }
.hero-dash { opacity: .55; }
.hero-sub { font-size: 1.05rem; opacity: .88; margin-bottom: .55rem; }
.hero-desc { opacity: .8; font-size: .92rem; line-height: 1.7; margin-bottom: 1.25rem; }
.hero-btns { display: flex; flex-wrap: wrap; gap: .65rem; margin-bottom: 1.5rem; }
.btn-hero-primary {
  background: var(--c-accent); color: #fff;
  padding: .62rem 1.4rem; border-radius: 8px;
  font-weight: 700; font-size: .95rem;
  transition: background .18s, transform .15s;
  white-space: nowrap;
}
.btn-hero-primary:hover { background: var(--c-accent-dark); transform: translateY(-2px); text-decoration: none; }
.btn-hero-ghost {
  background: rgba(255,255,255,.13); color: #fff;
  border: 1.5px solid rgba(255,255,255,.45);
  padding: .62rem 1.25rem; border-radius: 8px;
  font-weight: 600; font-size: .95rem;
  display: flex; align-items: center; gap: .35rem;
  transition: background .18s, transform .15s;
  white-space: nowrap;
}
.btn-hero-ghost:hover { background: rgba(255,255,255,.22); transform: translateY(-2px); text-decoration: none; }
.hero-stats { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.hero-stat { display: flex; flex-direction: column; }
.hs-num { font-size: 1.5rem; font-weight: 800; color: #fff; line-height: 1.1; }
.hs-label { font-size: .75rem; opacity: .7; margin-top: .15rem; }

/* ── Physical calculator widget ── */
.hero-widget { display: flex; justify-content: center; align-items: center; }
.calc-widget {
  background: #0d1b3e;
  border-radius: 16px;
  padding: 0;
  width: 300px;
  box-shadow: 0 8px 40px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.07);
  overflow: hidden;
  user-select: none;
}
.calc-widget-hdr {
  background: linear-gradient(90deg, #c60c30 0%, #a50928 100%);
  color: #fff;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-align: center;
  padding: .45rem 1rem;
}
.calc-widget-screen {
  background: #0a1f0a;
  margin: .75rem .75rem .5rem;
  border-radius: 8px;
  padding: .5rem .8rem .55rem;
  min-height: 72px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: inset 0 2px 8px rgba(0,0,0,.7), 0 0 0 1px rgba(74,222,128,.15);
}
.calc-screen-top {
  display: flex; justify-content: space-between; align-items: baseline;
  width: 100%; margin-bottom: .2rem;
}
.calc-mem { font-size: .65rem; color: rgba(74,222,128,.4); font-family: 'Courier New', monospace; flex-shrink: 0; }
.calc-expr {
  font-size: .75rem;
  color: rgba(74,222,128,.55);
  font-family: 'Courier New', monospace;
  text-align: right;
  flex: 1;
  padding-left: .4rem;
  min-height: 1em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.calc-display {
  font-size: 1.7rem;
  font-weight: 700;
  color: #4ade80;
  font-family: 'Courier New', monospace;
  letter-spacing: .02em;
  text-shadow: 0 0 10px rgba(74,222,128,.5);
  word-break: break-all;
  line-height: 1.2;
}
.calc-widget-btns {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: .5rem .75rem .85rem;
}
.cbtn {
  background: linear-gradient(180deg, #2a3a5c 0%, #1c2a46 100%);
  color: #c9d6f0;
  border: none;
  border-radius: 7px;
  padding: .55rem .3rem;
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .12s, transform .1s, box-shadow .1s;
  box-shadow: 0 3px 0 #0b1530, 0 4px 8px rgba(0,0,0,.4);
  font-family: var(--font);
}
.cbtn:hover { background: linear-gradient(180deg, #3a4e72 0%, #2a3a5c 100%); }
.cbtn:active { transform: translateY(2px); box-shadow: 0 1px 0 #0b1530; }
.cbtn-fn  { background: linear-gradient(180deg, #b05a00 0%, #8a4200 100%); color: #fff; box-shadow: 0 3px 0 #3d1a00, 0 4px 8px rgba(0,0,0,.4); }
.cbtn-fn:hover { background: linear-gradient(180deg, #c86600 0%, #a04c00 100%); }
.cbtn-op  { background: linear-gradient(180deg, #8b0f28 0%, #6b0a1e 100%); color: #fff; box-shadow: 0 3px 0 #2d0208, 0 4px 8px rgba(0,0,0,.4); }
.cbtn-op:hover { background: linear-gradient(180deg, #a81232 0%, #870c24 100%); }
.cbtn-eq  { background: linear-gradient(180deg, #15803d 0%, #0f6030 100%); color: #fff; box-shadow: 0 3px 0 #052810, 0 4px 8px rgba(0,0,0,.4); grid-column: span 1; }
.cbtn-eq:hover { background: linear-gradient(180deg, #16a34a 0%, #138038 100%); }
.cbtn-wide { grid-column: span 2; }

/* ── Sections ── */
.section-hubs  { background: var(--c-white);        padding: 2.75rem 0; }
.section-popular { background: var(--c-bg);          padding: 2.75rem 0; }
.section-why   { background: var(--c-primary-light); padding: 2.75rem 0; }

/* ── Hub Cards ── */
.hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem; margin-top: 1.25rem;
}
.hub-card {
  background: var(--c-white); border: 1px solid var(--c-border);
  border-radius: var(--radius); padding: 1.35rem;
  transition: box-shadow .18s, transform .18s;
  border-top: 3px solid var(--c-accent);   /* Taeguk red accent stripe */
}
.hub-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); }
.hub-card:nth-child(even) { border-top-color: var(--c-primary); }
.hub-card h3 { margin: 0 0 .5rem; font-size: .98rem; }
.hub-card h3 a { color: var(--c-primary); display: flex; align-items: center; gap: .38rem; }
.hub-card h3 a svg { flex-shrink: 0; transition: transform .22s; }
.hub-card:hover h3 a svg { animation: icon-pop .38s ease forwards; }
.hub-card p { font-size: .85rem; color: var(--c-text-light); margin: 0 0 .85rem; }
.calc-chips { display: flex; flex-wrap: wrap; gap: .35rem; }
.calc-chip {
  background: var(--c-primary-light); color: var(--c-primary);
  border-radius: 20px; padding: .2rem .65rem; font-size: .78rem;
  font-weight: 600; transition: background .14s, color .14s;
  display: inline-flex; align-items: center; gap: .25rem;
}
.calc-chip svg { flex-shrink: 0; width: 11px; height: 11px; }
.calc-chip:hover { background: var(--c-accent); color: #fff; text-decoration: none; }

/* ── Card Grid ── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 1rem; margin-top: 1rem;
}
.card {
  display: block; background: var(--c-white); border: 1px solid var(--c-border);
  border-radius: var(--radius); padding: 1rem 1.15rem;
  transition: box-shadow .17s, transform .17s; text-decoration: none;
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); text-decoration: none; }
.card h3 {
  font-size: .93rem; color: var(--c-primary); margin: 0 0 .35rem;
  display: flex; align-items: flex-start; gap: .38rem;
}
.card h3 svg { flex-shrink: 0; margin-top: .05rem; transition: transform .22s; }
.card:hover h3 svg { animation: icon-pop .38s ease forwards; }
.card p { font-size: .82rem; color: var(--c-text-light); margin: 0; }

/* ═══════════════════════════════════════════════════
   ARTICLE — two-column layout (main + sticky sidebar)
═══════════════════════════════════════════════════ */
.article { padding: 2rem 0 3.5rem; }

.article-outer {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.25rem;
  display: grid;
  grid-template-columns: 1fr 268px;
  gap: 2.25rem;
  align-items: start;
}

/* Hub / guide: narrower sidebar-less layout */
.article-outer.no-sidebar {
  grid-template-columns: 1fr;
  max-width: 820px;
}

.article-main { min-width: 0; }

/* ── Sidebar TOC ── */
.article-sidebar {
  position: sticky;
  top: calc(var(--hdr-h) + 14px);
  max-height: calc(100vh - var(--hdr-h) - 28px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--c-border) transparent;
}
.article-sidebar::-webkit-scrollbar { width: 4px; }
.article-sidebar::-webkit-scrollbar-thumb { background: var(--c-border); border-radius: 4px; }

.toc {
  background: var(--c-white);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  box-shadow: var(--shadow-xs);
}
.toc h2 {
  font-size: .72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--c-text-light);
  margin: 0 0 .8rem;
  padding-bottom: .6rem;
  border-bottom: 1px solid var(--c-border);
}
.toc ol { list-style: none; padding: 0; margin: 0; }
.toc li { margin: 0; }
.toc a {
  display: block;
  font-size: .83rem;
  color: var(--c-text-light);
  padding: .28rem .55rem;
  border-left: 2px solid transparent;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  transition: background .13s, color .13s, border-color .13s;
  line-height: 1.4;
}
.toc a:hover {
  background: var(--c-primary-light);
  color: var(--c-primary);
  text-decoration: none;
  border-left-color: rgba(26,79,214,.35);
}
.toc a.toc-active {
  color: var(--c-primary);
  font-weight: 700;
  border-left-color: var(--c-primary);
  background: var(--c-primary-light);
}

/* ── Section intro / answer box / breadcrumb ── */
.section-intro { font-size: 1rem; color: var(--c-text-light); margin-bottom: 1.25rem; line-height: 1.85; }
.meta-row {
  display: flex; gap: 1.25rem; flex-wrap: wrap;
  font-size: .8rem; color: var(--c-text-light); margin-bottom: 1.1rem;
}
.meta-row a { display: inline-flex; align-items: center; gap: .22rem; }
.meta-row a svg { flex-shrink: 0; width: 12px; height: 12px; }
.answer-box {
  background: linear-gradient(135deg, var(--c-accent-light) 0%, #fce8ec 100%);
  border-left: 4px solid var(--c-accent);   /* Taeguk red */
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1.1rem 1.35rem; margin: 1.25rem 0;
}
.answer-box p { margin: 0; font-weight: 600; font-size: .98rem; line-height: 1.7; }
.breadcrumb { font-size: .8rem; color: var(--c-text-light); margin-bottom: 1rem; }
.breadcrumb a {
  color: var(--c-primary);
  display: inline-flex; align-items: center; gap: .22rem; vertical-align: middle;
}
.breadcrumb a svg { flex-shrink: 0; width: 13px; height: 13px; }
.breadcrumb span { color: var(--c-text-light); font-weight: 600; }

/* ═══════════════════════════════════════════════════
   CALCULATOR TOOL — Dark Pro Design
═══════════════════════════════════════════════════ */

/* Per-hub CSS variables */
[data-hub="geum-yung"] { --hub-accent:#C60C30; --hub-glow:198,12,48;   --hub-hdr:#1a0510; --hub-val:#fca5a5; --hub-hl:#ff4d6e; }
[data-hub="hwan-yul"]  { --hub-accent:#3b82f6; --hub-glow:59,130,246;  --hub-hdr:#050d1f; --hub-val:#93c5fd; --hub-hl:#60a5fa; }
[data-hub="geongang"]  { --hub-accent:#f43f5e; --hub-glow:244,63,94;   --hub-hdr:#1a0812; --hub-val:#fda4af; --hub-hl:#fb7185; }
[data-hub="yutility"]  { --hub-accent:#a855f7; --hub-glow:168,85,247;  --hub-hdr:#130820; --hub-val:#d8b4fe; --hub-hl:#c084fc; }
[data-hub="su-hak"]    { --hub-accent:#10b981; --hub-glow:16,185,129;  --hub-hdr:#041810; --hub-val:#6ee7b7; --hub-hl:#34d399; }
[data-hub="se-geum"]   { --hub-accent:#f59e0b; --hub-glow:245,158,11;  --hub-hdr:#1a1205; --hub-val:#fde68a; --hub-hl:#fbbf24; }

/* ── Tool section — physical calculator theme ── */
.tool-section {
  background: #0d1b3e;
  border-radius: 18px;
  margin: 1.75rem 0;
  box-shadow: 0 8px 40px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.07);
  overflow: hidden;
  border: none;
}
.tool-section > h2 {
  background: linear-gradient(90deg, #c60c30 0%, #a50928 100%);
  color: #fff;
  margin: 0;
  padding: .7rem 1.4rem;
  font-size: .72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .14em;
  display: flex;
  align-items: center;
  gap: .6rem;
  border-bottom: none;
  border-left: none;
}
.tool-section > h2::before { content: none; }
.tool-badge { color: rgba(255,255,255,.75); font-weight: 900; }
.tool-sep   { color: rgba(255,255,255,.35); }
.tool-cat   { color: rgba(255,255,255,.65); font-weight: 600; }

/* Calculator body */
.calc-tool { padding: 1.4rem 1.6rem 1.6rem; background: #0d1b3e; }
.calc-group { margin-bottom: 1.1rem; }
.calc-group label {
  display: block;
  font-size: .68rem;
  font-weight: 700;
  margin-bottom: .4rem;
  color: rgba(74,222,128,.65);
  text-transform: uppercase;
  letter-spacing: .1em;
  font-family: 'Courier New', monospace;
}
.calc-group input,
.calc-group select,
.calc-group textarea {
  width: 100%;
  padding: .75rem 1rem;
  font-size: 1.05rem;
  font-family: 'Courier New', 'Consolas', monospace;
  border: 1px solid rgba(74,222,128,.2);
  border-radius: 8px;
  background: #0a1f0a;
  color: #4ade80;
  transition: border .15s, box-shadow .15s;
  appearance: none;
  -webkit-appearance: none;
  caret-color: #4ade80;
}
.calc-group select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%234ade80' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}
.calc-group input::placeholder { color: rgba(74,222,128,.3); }
.calc-group input:focus,
.calc-group select:focus,
.calc-group textarea:focus {
  outline: none;
  border-color: rgba(74,222,128,.55);
  box-shadow: 0 0 0 3px rgba(74,222,128,.12), inset 0 0 8px rgba(74,222,128,.06);
}
.calc-group textarea { min-height: 130px; resize: vertical; color: #4ade80; }
.calc-inline { display: grid; grid-template-columns: 1fr 1fr; gap: .85rem; }

/* Calculate button — green = style matching widget */
.calc-btn {
  width: 100%;
  margin-top: .85rem;
  padding: .9rem 1.5rem;
  font-size: 1rem;
  font-weight: 800;
  font-family: var(--font);
  color: #fff;
  background: linear-gradient(180deg, #15803d 0%, #0f6030 100%);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 4px 0 #052810, 0 6px 20px rgba(21,128,61,.45);
  transition: transform .1s, box-shadow .1s;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.calc-btn:hover {
  background: linear-gradient(180deg, #16a34a 0%, #138038 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 0 #052810, 0 10px 28px rgba(21,128,61,.55);
}
.calc-btn:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #052810;
}

/* Results panel — LCD screen style */
.calc-result {
  background: #0a1f0a;
  border: 1px solid rgba(74,222,128,.18);
  border-radius: 10px;
  padding: .35rem 1.25rem .8rem;
  margin-top: 1.1rem;
  box-shadow: inset 0 2px 10px rgba(0,0,0,.6), 0 0 0 1px rgba(74,222,128,.08);
}
.result-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: .6rem 0;
  border-bottom: 1px solid rgba(74,222,128,.1);
  gap: 1rem;
}
.result-row:last-child { border-bottom: none; }
.result-row .label {
  font-size: .68rem;
  color: rgba(74,222,128,.5);
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  font-family: 'Courier New', monospace;
}
.result-row .value {
  font-size: 1.05rem;
  font-weight: 700;
  color: #4ade80;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-family: 'Courier New', 'Consolas', monospace;
  text-shadow: 0 0 8px rgba(74,222,128,.35);
}
.result-highlight {
  font-size: 1.55rem !important;
  font-weight: 900 !important;
  color: #4ade80 !important;
  text-shadow: 0 0 18px rgba(74,222,128,.6) !important;
}

/* Misc calc helpers */
.calc-note {
  font-size: .78rem;
  color: rgba(74,222,128,.45);
  margin-top: .75rem;
  font-style: italic;
  padding: 0 .25rem;
  font-family: 'Courier New', monospace;
}
.calc-options { display: flex; gap: 1rem; flex-wrap: wrap; margin: .5rem 0; }
.calc-options label {
  font-size: .85rem;
  display: flex; align-items: center; gap: .35rem;
  cursor: pointer; font-weight: 500;
  color: rgba(74,222,128,.7);
}
.calc-options input[type="radio"] { accent-color: #4ade80; }
.badge {
  display: inline-block;
  background: var(--hub-accent, var(--c-accent));
  color: #fff;
  border-radius: 5px;
  padding: 2px 8px;
  font-size: .72rem;
  font-weight: 700;
  margin-left: .5rem;
}
.badge-warn { background: #9b0a24; }

/* ── Formula Block ── */
.formula-block {
  background: #0f1f3d;
  border-radius: var(--radius);
  padding: 1.35rem 1.5rem;
  margin: 1.75rem 0;
  color: #e2e8f8;
}
.formula-block h2 {
  font-size: .8rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: .1em;
  color: #7fa0e8; margin: 0 0 .9rem; border: none;
}
.formula-block code {
  display: block;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.1);
  padding: .85rem 1.1rem;
  border-radius: 8px;
  font-size: .95rem;
  color: #a5f3c8;
  margin: .45rem 0;
  white-space: pre-wrap;
  word-break: break-all;
}
.formula-block p {
  font-size: .83rem; color: #8ea6d8; margin: .5rem 0 0;
}

/* ── Citations ── */
.citations {
  background: #fafbff; border: 1px solid var(--c-border);
  border-radius: var(--radius); padding: 1.1rem 1.35rem; margin: 1.75rem 0;
}
.citations h2 { font-size: .95rem; margin-top: 0; }
.citations li { font-size: .83rem; color: var(--c-text-light); }

/* ── FAQ ── */
.faq-item { border-bottom: 1px solid var(--c-border); padding: 1rem 0; }
.faq-item:last-child { border-bottom: none; }
.faq-item h3 {
  font-size: .98rem; color: var(--c-text); margin: 0 0 .5rem;
  padding-left: 1.75rem; position: relative; cursor: pointer;
}
.faq-item h3::before {
  content: "Q";
  position: absolute; left: 0; top: .05rem;
  background: var(--c-accent); color: #fff;
  border-radius: 5px; width: 1.2rem; height: 1.2rem;
  font-size: .68rem; font-weight: 900;
  display: flex; align-items: center; justify-content: center;
  text-align: center;
}
.faq-item p { font-size: .9rem; color: var(--c-text-light); margin: 0; padding-left: 1.75rem; line-height: 1.7; }

/* ── Related ── */
.related { margin-top: 2.25rem; padding-top: 1.5rem; border-top: 1px solid var(--c-border); }
.related h2 { font-size: 1.05rem; margin-top: 0; }

/* ── Footer ── */
.site-footer {
  background: #0c1020; color: #a0a8c0;
  padding: 3rem 0 0;
  font-size: .84rem;
  border-top: 3px solid var(--c-accent);   /* Taeguk red top border */
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.7fr 1fr 1fr 1fr;
  gap: 2.5rem;
  padding-bottom: 2.25rem;
}
/* Brand column */
.footer-logo {
  display: flex; align-items: center; gap: .55rem;
  margin-bottom: .7rem;
}
.footer-logo .brand-icon { width: 34px; height: 34px; }
.footer-logo span {
  font-size: 1.15rem; font-weight: 800; color: #fff;
  letter-spacing: -.4px;
}
.footer-tagline {
  font-size: .84rem; color: #9aa3bd; line-height: 1.75;
  margin-bottom: .85rem;
}
.footer-disc { font-size: .76rem; color: #9aa3bd; line-height: 1.65; max-width: 280px; }
/* Info columns */
.footer-col h4, .footer-col .footer-col-h {
  font-size: .72rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: .12em;
  color: #9aa3bd; margin-bottom: .9rem;
  padding-bottom: .55rem;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { margin-bottom: .5rem; }
.footer-col a {
  color: #7a85a0; font-size: .85rem;
  display: flex; align-items: center; gap: .42rem;
  transition: color .14s;
}
.footer-col a:hover { color: #fff; text-decoration: none; }
.footer-col a svg { flex-shrink: 0; transition: transform .18s; }
.footer-col a:hover svg { transform: scale(1.2) translateY(-1px); }
/* Bottom bar */
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.06);
  padding: 1.1rem 0;
  text-align: center;
}
.footer-bottom p { color: #9aa3bd; font-size: .82rem; margin: 0; }
.footer-bottom a { color: #93adea; text-decoration: underline; }
.footer-bottom a:hover { color: #e8506a; }

/* ── Utility / secondary buttons ── */
.btn-secondary {
  display: inline-block; border: 2px solid var(--c-primary);
  color: var(--c-primary); border-radius: 8px; padding: .5rem 1.25rem;
  font-weight: 700; font-size: .9rem; transition: background .14s, color .14s;
}
.btn-secondary:hover { background: var(--c-primary); color: #fff; text-decoration: none; }

/* ── Utility pages ── */
.utility-page h2 { margin-top: 1.75rem; }
.guide-page .article-outer { max-width: 820px; grid-template-columns: 1fr; }

/* ═══════════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════════ */
@media (max-width: 960px) {
  .article-outer {
    grid-template-columns: 1fr;
  }
  .article-sidebar {
    position: static;
    max-height: none;
    order: -1; /* show TOC above content on mobile */
  }
  .toc {
    /* Collapsible accordion on mobile */
  }
}
@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand-col { grid-column: 1 / -1; }
}
@media (max-width: 700px) {
  .nav-links { display: none; flex-direction: column; width: 100%; padding: .5rem 0; }
  .nav-links.open { display: flex; }
  .nav-toggle { display: block; }
  .hub-grid { grid-template-columns: 1fr; }
  .card-grid { grid-template-columns: 1fr 1fr; }
  .calc-inline { grid-template-columns: 1fr; }
  .hero { padding: 2.25rem 1rem 2rem; }
  .hero-wrap { grid-template-columns: 1fr; }
  .hero-widget { display: none; }
  .result-row { flex-direction: column; gap: .1rem; }
  .result-row .value { font-size: 1.15rem; text-align: left; }
  .tool-section > h2 { font-size: .92rem; padding: .75rem 1.1rem; }
  .calc-tool { padding: 1.1rem 1rem 1rem; }
  .footer-grid { grid-template-columns: 1fr; }
}
@media (max-width: 420px) {
  .card-grid { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════════════
   HOMEPAGE DEEP CONTENT SECTIONS
═══════════════════════════════════════════════════ */

/* Hub card icon — continuous gentle float */
@keyframes icon-float {
  0%, 100% { transform: translateY(0) scale(1); }
  50%       { transform: translateY(-3px) scale(1.05); }
}
.hub-card h3 a svg { animation: icon-float 3.2s ease-in-out infinite; }
.hub-card:hover h3 a svg { animation: icon-pop .38s ease forwards; }

/* Per-calculator thematic icons */
@keyframes ico-breathe {
  0%, 100% { transform: scale(1) translateY(0); filter: drop-shadow(0 0 0px transparent); }
  50%       { transform: scale(1.1) translateY(-2px); filter: drop-shadow(0 3px 6px rgba(0,0,0,.35)); }
}
.ico-calc { animation: ico-breathe 3.6s ease-in-out infinite; flex-shrink: 0; }
.ico-calc-lg { width: 30px; height: 30px; }
.card:hover h3 .ico-calc,
.card:hover h3 .ico-calc-lg { animation: icon-pop .38s ease forwards; }
/* stagger per-position so cards don't pulse in unison */
.card:nth-child(2) .ico-calc  { animation-delay: .45s; }
.card:nth-child(3) .ico-calc  { animation-delay: .9s; }
.card:nth-child(4) .ico-calc  { animation-delay: 1.35s; }
.card:nth-child(5) .ico-calc  { animation-delay: 1.8s; }
.card:nth-child(6) .ico-calc  { animation-delay: 2.25s; }

/* Medium icon (20 px) for hub-card h3 */
.ico-hub-md { width: 20px; height: 20px; }

/* Deep editorial sections */
.section-deep {
  padding: 3rem 0;
}
.section-deep:nth-of-type(odd)  { background: var(--c-white); }
.section-deep:nth-of-type(even) { background: var(--c-bg); }
.section-deep .wrap { max-width: var(--max-w); margin: 0 auto; padding: 0 1.25rem; }
.section-deep h2 {
  font-size: 1.45rem; font-weight: 800; color: var(--c-heading);
  margin: 0 0 .6rem; padding-bottom: .5rem;
  border-bottom: 2.5px solid var(--c-accent);
  display: inline-block;
}
.section-deep h3 {
  font-size: 1.05rem; font-weight: 700; color: var(--c-primary);
  margin: 1.6rem 0 .45rem;
}
.section-lead {
  font-size: 1rem; color: var(--c-text-light);
  line-height: 1.75; margin: .6rem 0 1.25rem;
  border-left: 3px solid var(--c-accent);
  padding-left: .85rem;
}
.section-deep p { line-height: 1.78; color: var(--c-text); margin: 0 0 .85rem; }
.section-deep p:last-child { margin-bottom: 0; }
.section-deep strong { color: var(--c-heading); font-weight: 700; }
.section-deep em { color: var(--c-accent); font-style: normal; font-weight: 600; }

/* CTA links inside deep sections */
.cta-link { margin: 1.75rem 0 .5rem; }
.btn-primary, .btn-secondary {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .65rem 1.3rem; border-radius: var(--radius);
  font-size: .88rem; font-weight: 700; text-decoration: none;
  transition: transform .15s, box-shadow .15s;
}
.btn-primary {
  background: var(--c-accent); color: #fff;
  box-shadow: 0 2px 8px rgba(198,12,48,.25);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 4px 14px rgba(198,12,48,.35); }
.btn-secondary {
  background: var(--c-primary-light); color: var(--c-primary);
  border: 1px solid rgba(0,61,165,.18);
  margin-right: .6rem;
}
.btn-secondary:hover { background: #d0dcf2; transform: translateY(-1px); }
.btn-primary svg, .btn-secondary svg { flex-shrink: 0; }

/* Dense card grid for all-calcs section */
.card-grid-dense {
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: .85rem;
}
.card-compact h3 { font-size: .88rem; gap: .3rem; }
.card-compact h3 svg { width: 20px; height: 20px; }
.card-compact p { font-size: .78rem; }

/* How-to steps */
.section-howto { background: var(--c-primary-light) !important; }
.howto-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem;
  margin: 1.5rem 0 1.25rem;
}
.howto-step {
  background: var(--c-white); border-radius: var(--radius);
  padding: 1.4rem 1.25rem; border: 1px solid var(--c-border);
  border-top: 3px solid var(--c-primary);
  position: relative;
}
.howto-num {
  width: 2rem; height: 2rem; border-radius: 50%;
  background: var(--c-primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: .95rem; margin-bottom: .7rem;
}
.howto-step h3 { margin: 0 0 .5rem; font-size: .96rem; color: var(--c-heading); }
.howto-step p { font-size: .84rem; color: var(--c-text-light); margin: 0; line-height: 1.7; }
.howto-notice {
  background: rgba(0,61,165,.07); border-radius: var(--radius);
  border-left: 3px solid var(--c-primary); padding: .85rem 1.1rem;
}
.howto-notice p { font-size: .85rem; margin: 0; line-height: 1.7; }
.howto-notice a { color: var(--c-accent); font-weight: 600; }

/* FAQ home */
.faq-home { max-width: 860px; margin: 0 auto; }
.section-faq-home { background: var(--c-white) !important; }
.faq-home .faq-item {
  border: 1px solid var(--c-border); border-radius: var(--radius);
  margin-bottom: 1rem; overflow: hidden;
}
.faq-home .faq-item h3 {
  font-size: .96rem; font-weight: 700; padding: 1rem 1.2rem;
  background: var(--c-bg); margin: 0; color: var(--c-heading);
  cursor: pointer; display: flex; align-items: center; gap: .5rem;
}
.faq-home .faq-item h3::before {
  content: 'Q'; font-weight: 900; font-size: .88rem;
  color: var(--c-accent); width: 1.4rem; flex-shrink: 0;
}
.faq-home .faq-item p {
  font-size: .87rem; line-height: 1.78; padding: .9rem 1.2rem;
  margin: 0; color: var(--c-text);
}

/* Trust section */
.section-trust {
  background: linear-gradient(135deg, var(--c-primary) 0%, #002d7a 100%);
  padding: 3rem 0; color: #fff;
}
.section-trust .wrap { max-width: var(--max-w); margin: 0 auto; padding: 0 1.25rem; }
.section-trust h2 {
  color: #fff; font-size: 1.4rem; margin: 0 0 1.5rem;
  text-align: center;
}
.trust-stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem;
  margin-bottom: 2.5rem; text-align: center;
}
.trust-stat { padding: 1rem; background: rgba(255,255,255,.1); border-radius: var(--radius); }
.trust-num {
  font-size: 2rem; font-weight: 900; color: #fff;
  display: block; margin-bottom: .25rem;
}
.trust-label { font-size: .8rem; color: rgba(255,255,255,.75); }
.trust-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem;
  margin-bottom: 2rem;
}
.trust-item {
  background: rgba(255,255,255,.1); border-radius: var(--radius); padding: 1.25rem;
}
.trust-item h3 { font-size: .95rem; color: #fff; margin: 0 0 .5rem; font-weight: 700; }
.trust-item p { font-size: .83rem; color: rgba(255,255,255,.8); line-height: 1.7; margin: 0; }
.trust-guide-cta { display: flex; justify-content: center; gap: 1rem; flex-wrap: wrap; }
.trust-guide-cta .btn-secondary {
  background: rgba(255,255,255,.15); color: #fff;
  border-color: rgba(255,255,255,.3);
}
.trust-guide-cta .btn-secondary:hover { background: rgba(255,255,255,.25); }

/* ── Responsive: homepage sections ── */
@media (max-width: 900px) {
  .howto-grid    { grid-template-columns: 1fr; }
  .trust-stats   { grid-template-columns: repeat(2, 1fr); }
  .trust-grid    { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .section-deep  { padding: 2rem 0; }
  .card-grid-dense { grid-template-columns: 1fr 1fr; }
  .trust-stats   { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 420px) {
  .card-grid-dense { grid-template-columns: 1fr; }
  .trust-stats   { grid-template-columns: 1fr 1fr; }
}

/* ═══════════════════════════════════════════════════
   COLLECTIONS TAB — Homepage Category Browser
═══════════════════════════════════════════════════ */
.section-collections {
  background: #0d1117;
  padding: 3rem 0;
  border-top: 1px solid rgba(255,255,255,.06);
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.section-collections .wrap h2 { color: #e2e8f0; }
.section-collections .wrap p  { color: #5a6678; }

.coll-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  margin: 1.4rem 0 1.6rem;
}
.coll-tab {
  display: inline-flex;
  align-items: center;
  gap: .42rem;
  padding: .58rem 1.15rem;
  background: #161b27;
  border: 1.5px solid #1e293b;
  border-radius: 100px;
  font-size: .85rem;
  font-weight: 700;
  color: #94a3b8;
  cursor: pointer;
  transition: all .16s;
  font-family: var(--font);
  white-space: nowrap;
}
.coll-tab svg { flex-shrink: 0; }
.coll-tab:hover {
  border-color: var(--tab-c, #3b82f6);
  color: var(--tab-c, #3b82f6);
  background: rgba(var(--tab-c-raw,59,130,246), .08);
}
.coll-tab.active {
  background: var(--tab-c, #3b82f6);
  border-color: var(--tab-c, #3b82f6);
  color: #fff;
  box-shadow: 0 4px 16px rgba(0,0,0,.3);
}
.coll-panel       { display: none; }
.coll-panel.active { display: block; }

/* Dark card styles inside collections */
.section-collections .card {
  background: #161b27;
  border-color: #1e293b;
  color: #e2e8f0;
}
.section-collections .card:hover {
  background: #1a2235;
  border-color: #334155;
  box-shadow: 0 6px 24px rgba(0,0,0,.4);
}
.section-collections .card h3 { color: #e2e8f0; }
.section-collections .card p  { color: #9aa6bd; }

/* ── Homepage section visual improvements ── */

/* Section-deep h3 pill style */
.section-deep h3 {
  position: relative;
  padding-left: .9rem;
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--c-heading);
  margin: 1.8rem 0 .55rem;
}
.section-deep h3::before {
  content: '';
  position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 3.5px; height: 1.1em;
  border-radius: 2px;
}
/* Per section h3 accent colors */
.section-finance  h3::before { background: #C60C30; }
.section-currency h3::before { background: #3b82f6; }
.section-health   h3::before { background: #f43f5e; }
.section-utility  h3::before { background: #a855f7; }
.section-math     h3::before { background: #10b981; }
.section-tax      h3::before { background: #f59e0b; }
.section-examples h3::before { background: var(--c-accent); }

/* Styled section lead paragraph */
.section-lead {
  font-size: .97rem;
  color: var(--c-text-light);
  line-height: 1.8;
  margin: .5rem 0 1.2rem;
  background: var(--c-bg);
  border-radius: var(--radius);
  padding: .85rem 1rem .85rem 1.1rem;
  border-left: 3px solid var(--c-accent);
}
.section-finance  .section-lead { border-color: #C60C30; }
.section-currency .section-lead { border-color: #3b82f6; }
.section-health   .section-lead { border-color: #f43f5e; }
.section-utility  .section-lead { border-color: #a855f7; }
.section-math     .section-lead { border-color: #10b981; }
.section-tax      .section-lead { border-color: #f59e0b; }

/* Section background color stripes */
.section-finance  { background: var(--c-white); }
.section-currency { background: #f0f6ff; }
.section-health   { background: var(--c-white); }
.section-utility  { background: #fdf4ff; }
.section-math     { background: var(--c-white); }
.section-tax      { background: #fffbeb; }
.section-examples { background: #f0f6ff; }
.section-howto    { background: var(--c-primary-light) !important; }
.section-faq-home { background: var(--c-white) !important; }

/* Howto tips list */
.tips-list { padding-left: 1.25rem; margin: .8rem 0 0; }
.tips-list li {
  font-size: .88rem;
  line-height: 1.7;
  color: var(--c-text);
  margin-bottom: .5rem;
  padding-left: .25rem;
}
.tips-list li::marker { color: var(--c-primary); font-weight: 700; }
.tips-list strong { color: var(--c-heading); font-weight: 700; }

.howto-tips {
  margin-top: 1.5rem;
  padding: 1.1rem 1.25rem;
  background: var(--c-white);
  border-radius: var(--radius);
  border: 1px solid var(--c-border);
}
.howto-tips h3 {
  font-size: .94rem;
  color: var(--c-heading);
  margin: 0 0 .7rem;
}

/* Trust detail section */
.trust-detail { margin: 2rem 0; }
.trust-detail h3 {
  font-size: .97rem;
  color: rgba(255,255,255,.9);
  font-weight: 700;
  margin: 1.4rem 0 .4rem;
  padding-left: .8rem;
  border-left: 3px solid rgba(255,255,255,.3);
}
.trust-detail p {
  font-size: .84rem;
  color: rgba(255,255,255,.65);
  line-height: 1.75;
  margin: 0;
}

/* Responsive collections */
@media (max-width: 700px) {
  .coll-tabs { gap: .4rem; }
  .coll-tab  { padding: .48rem .9rem; font-size: .8rem; }
  .section-collections { padding: 2rem 0; }
}

/* ── Print ── */
@media print {
  .site-header, .nav, .site-footer, .related, .article-sidebar { display: none; }
  .article-outer { grid-template-columns: 1fr; }
  .article { padding: 0; }
  body { background: #fff; }
}
