@import url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/variable/pretendardvariable-dynamic-subset.min.css");

:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-2: #eef4f3;
  --ink: #18222e;
  --muted: #5d6a78;
  --line: #e2e8ee;
  --teal: #0d9488;
  --teal-dark: #0f766e;
  --teal-deep: #0c3d39;
  --mint: #e7f6f2;
  --amber: #d97706;
  --rose: #e11d48;
  --green: #4d9e3f;
  --shadow-sm: 0 1px 2px rgba(24, 34, 46, 0.05), 0 2px 8px rgba(24, 34, 46, 0.05);
  --shadow-md: 0 2px 6px rgba(24, 34, 46, 0.05), 0 14px 36px rgba(24, 34, 46, 0.1);
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 10px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Pretendard Variable", Pretendard, "Noto Sans KR", "Segoe UI", Arial, sans-serif;
  line-height: 1.6;
  font-feature-settings: "tnum";
}

a {
  color: inherit;
  text-decoration: none;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(24, 34, 46, 0.08);
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.header-inner {
  width: min(1160px, calc(100% - 32px));
  min-height: 68px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 190px;
}

.brand-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--teal), var(--teal-dark));
  color: #fff;
  font-weight: 800;
  font-size: 18px;
  box-shadow: 0 4px 12px rgba(13, 148, 136, 0.35);
}

.brand strong,
.brand small {
  display: block;
  line-height: 1.3;
}

.brand strong {
  font-size: 17px;
  letter-spacing: -0.01em;
}

.brand small {
  color: var(--muted);
  font-size: 12px;
}

.top-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
}

.top-nav::-webkit-scrollbar {
  display: none;
}

.top-nav a {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  padding: 7px 13px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  transition: background 0.15s ease, color 0.15s ease;
}

.top-nav a:hover,
.top-nav a:focus-visible {
  background: var(--mint);
  color: var(--teal-dark);
  outline: none;
}

/* ---------- Layout bands ---------- */

.intro-band,
.tool-section,
.guide-band,
.article-band,
.page-main {
  padding: 64px 0;
}

.intro-grid,
.calculator-grid,
.guide-grid,
.article-grid,
.page-wrap {
  width: min(1160px, calc(100% - 32px));
  margin: 0 auto;
}

/* ---------- Hero ---------- */

.intro-band {
  position: relative;
  overflow: hidden;
  padding: 76px 0 84px;
  background:
    radial-gradient(900px 420px at 85% -10%, rgba(45, 212, 191, 0.28), transparent 60%),
    radial-gradient(700px 380px at -10% 110%, rgba(16, 185, 129, 0.18), transparent 60%),
    linear-gradient(160deg, #0e3733 0%, #0c3d39 45%, #11524c 100%);
  color: #f2faf8;
}

.intro-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 48px;
  align-items: center;
}

.intro-band .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(94, 234, 212, 0.35);
  background: rgba(94, 234, 212, 0.12);
  color: #99f6e4;
  font-size: 12.5px;
}

.intro-band h1 {
  color: #ffffff;
}

.intro-copy {
  max-width: 620px;
  margin: 20px 0 0;
  color: rgba(226, 244, 240, 0.82);
  font-size: 17.5px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--teal-dark);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: -0.02em;
  line-height: 1.2;
  font-weight: 800;
}

h1 {
  max-width: 760px;
  font-size: clamp(32px, 4.6vw, 56px);
}

h2 {
  font-size: clamp(24px, 3vw, 34px);
}

.quick-panel {
  display: grid;
  gap: 12px;
}

.quick-panel a {
  position: relative;
  display: grid;
  gap: 3px;
  min-height: 78px;
  padding: 18px 48px 18px 20px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.97);
  color: var(--ink);
  box-shadow: var(--shadow-md);
  border-left: 5px solid var(--teal);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.quick-panel a::after {
  content: "→";
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--teal);
  font-size: 18px;
  font-weight: 700;
  transition: transform 0.18s ease;
}

.quick-panel a:hover,
.quick-panel a:focus-visible {
  transform: translateY(-3px);
  box-shadow: 0 6px 14px rgba(12, 61, 57, 0.18), 0 20px 44px rgba(12, 61, 57, 0.22);
  outline: none;
}

.quick-panel a:hover::after {
  transform: translateY(-50%) translateX(3px);
}

.quick-panel a:nth-child(2) {
  border-left-color: var(--amber);
}

.quick-panel a:nth-child(3) {
  border-left-color: var(--rose);
}

.quick-panel a:nth-child(4) {
  border-left-color: var(--green);
}

.quick-panel strong {
  font-size: 16px;
  letter-spacing: -0.01em;
}

.quick-panel span {
  color: var(--muted);
  font-size: 13.5px;
}

/* ---------- Sections ---------- */

.tool-section {
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.tool-section.alt {
  background: var(--surface-2);
}

.section-heading {
  width: min(1160px, calc(100% - 32px));
  margin: 0 auto 32px;
}

.section-heading p:not(.eyebrow) {
  max-width: 720px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 16px;
}

.calculator-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 24px;
  align-items: start;
}

.input-panel,
.result-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.tool-section .input-panel,
.tool-section .result-panel {
  box-shadow: var(--shadow-md);
}

.input-panel {
  padding: 24px;
}

.result-panel {
  position: sticky;
  top: 92px;
  padding: 24px;
}

/* ---------- Form fields ---------- */

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 16px;
}

.event-fieldset {
  grid-column: 1 / -1;
  display: grid;
  gap: 12px;
  margin-top: 8px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #f7fafa;
}

.event-heading {
  display: flex;
  align-items: center;
  gap: 8px;
}

.event-heading h3 {
  margin: 0;
  font-size: 16.5px;
  letter-spacing: -0.01em;
}

.event-fieldset p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.event-row {
  display: grid;
  grid-template-columns: 72px minmax(120px, 1fr) 96px 96px;
  gap: 10px;
  align-items: end;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}

.event-row label {
  grid-template-columns: 1fr;
  gap: 5px;
}

.event-row label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

label {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 7px 8px;
  align-items: center;
  min-width: 0;
}

.field-label {
  grid-column: 1 / -1;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 14px;
  min-width: 0;
  position: relative;
}

/* ---------- Help tooltip ---------- */

.help-tip {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  display: inline-grid;
  place-items: center;
  border: none;
  border-radius: 50%;
  background: #dcebe8;
  color: var(--teal-dark);
  cursor: help;
  font-size: 11.5px;
  font-weight: 800;
  line-height: 1;
  position: relative;
  transition: background 0.15s ease;
}

.help-tip:hover {
  background: #c8e2dc;
}

.help-tip:focus-visible {
  outline: 3px solid rgba(13, 148, 136, 0.25);
  outline-offset: 2px;
}

.help-tip::after {
  content: attr(data-tip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  z-index: 30;
  width: max-content;
  max-width: min(280px, calc(100vw - 48px));
  padding: 11px 13px;
  border-radius: var(--radius-sm);
  background: #122a27;
  box-shadow: 0 12px 28px rgba(12, 61, 57, 0.3);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.5;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 4px);
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.help-tip::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: calc(100% + 5px);
  z-index: 31;
  width: 10px;
  height: 10px;
  background: #122a27;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 4px) rotate(45deg);
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.help-tip:hover::after,
.help-tip:hover::before,
.help-tip:focus::after,
.help-tip:focus::before,
.help-tip.is-open::after,
.help-tip.is-open::before {
  opacity: 1;
  transform: translate(-50%, 0);
}

.help-tip.is-open::before {
  transform: translate(-50%, 0) rotate(45deg);
}

.help-tip:hover::before,
.help-tip:focus::before {
  transform: translate(-50%, 0) rotate(45deg);
}

/* ---------- Inputs ---------- */

input,
select {
  width: 100%;
  min-height: 44px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fafbfc;
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

input {
  padding: 9px 12px;
}

select {
  grid-column: 1 / -1;
  padding: 9px 12px;
  cursor: pointer;
}

input:hover,
select:hover {
  border-color: #c4cfd9;
}

input:focus,
select:focus {
  border-color: var(--teal);
  background: #fff;
  outline: none;
  box-shadow: 0 0 0 4px rgba(13, 148, 136, 0.13);
}

label small {
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
}

/* ---------- Results ---------- */

.result-summary {
  display: grid;
  gap: 4px;
  padding: 20px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--teal-dark), var(--teal-deep));
  box-shadow: 0 10px 24px rgba(12, 61, 57, 0.28);
}

.result-summary span {
  color: rgba(204, 239, 232, 0.85);
  font-size: 13px;
  font-weight: 600;
}

.result-summary strong {
  color: #fff;
  font-size: 30px;
  letter-spacing: -0.02em;
}

.metric-row span,
.detail-list span,
.compare-list span {
  color: var(--muted);
  font-size: 13px;
}

.compare-list,
.detail-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.compare-item,
.detail-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  min-height: 56px;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fbfcfd;
  transition: border-color 0.15s ease;
}

.compare-item.best {
  border-color: rgba(13, 148, 136, 0.5);
  background: var(--mint);
  box-shadow: inset 0 0 0 1px rgba(13, 148, 136, 0.25);
}

.compare-item.best > strong:last-child {
  color: var(--teal-dark);
}

.compare-item strong,
.detail-item strong {
  font-size: 17px;
  letter-spacing: -0.01em;
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.metric-row div {
  min-height: 96px;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, #fbfdfd, #f3f8f7);
}

.metric-row strong {
  color: var(--teal-dark);
  font-size: 25px;
  letter-spacing: -0.02em;
}

.note {
  margin: 18px 0 0;
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid #f1dfb8;
  border-left: 4px solid var(--amber);
  background: #fdf8ec;
  color: #6e5424;
  font-size: 13px;
  line-height: 1.55;
}

/* ---------- Master plan ---------- */

.plan-status {
  margin-bottom: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fbfcfd;
  color: var(--ink);
  font-weight: 800;
  font-size: 15px;
}

.plan-status.good {
  border-color: #b3dcc6;
  background: #eafaf0;
  color: #1e6e44;
}

.plan-status.watch {
  border-color: #ecd9a8;
  background: #fdf6e3;
  color: #8a6416;
}

.plan-summary {
  margin: 0 0 14px;
  padding: 15px 16px;
  border: 1px solid #d9e8e3;
  border-radius: var(--radius-md);
  background: #f4faf8;
  color: #37514a;
  font-size: 14px;
  line-height: 1.65;
}

.scenario-panel,
.event-result,
.plan-timeline {
  margin-top: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fbfcfd;
}

.event-result h3,
.scenario-panel h3,
.plan-timeline h3 {
  margin: 0 0 12px;
  font-size: 16px;
  letter-spacing: -0.01em;
}

.event-result p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.event-chip-list {
  display: grid;
  gap: 8px;
}

.event-chip {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
}

.event-chip span {
  color: var(--muted);
  font-size: 13px;
}

.event-chip strong {
  font-size: 14px;
}

.event-chip.income {
  border-left: 4px solid var(--teal);
}

.event-chip.income strong {
  color: var(--teal-dark);
}

.event-chip.expense {
  border-left: 4px solid var(--rose);
}

.event-chip.expense strong {
  color: var(--rose);
}

.scenario-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.scenario-card {
  display: grid;
  gap: 5px;
  min-height: 126px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
}

.scenario-card span,
.scenario-card small {
  color: var(--muted);
  font-size: 12px;
}

.scenario-card span {
  font-weight: 700;
}

.scenario-card strong {
  color: var(--ink);
  font-size: 19px;
  letter-spacing: -0.01em;
}

.scenario-card em {
  color: var(--teal-dark);
  font-size: 12.5px;
  font-style: normal;
  font-weight: 800;
}

.scenario-card.cautious {
  border-top: 3px solid var(--amber);
}

.scenario-card.base {
  border-top: 3px solid var(--teal);
}

.scenario-card.optimistic {
  border-top: 3px solid var(--green);
}

.timeline-list {
  display: grid;
  gap: 12px;
}

.timeline-row {
  display: grid;
  grid-template-columns: 44px minmax(80px, 1fr) minmax(84px, auto);
  gap: 12px;
  align-items: center;
}

.timeline-row span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.timeline-row strong {
  text-align: right;
  font-size: 14px;
}

.timeline-row strong small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.timeline-track {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #e6ebef;
}

.timeline-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), #34d399);
  transition: width 0.35s ease;
}

/* ---------- Article / guide bands ---------- */

.guide-band {
  border-top: 1px solid var(--line);
}

.article-band {
  border-top: 1px solid var(--line);
  background: var(--surface-2);
}

.article-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.article-card {
  min-height: 230px;
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 24px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.article-card:hover,
.article-card:focus-visible {
  transform: translateY(-4px);
  border-color: rgba(13, 148, 136, 0.45);
  box-shadow: var(--shadow-md);
  outline: none;
}

.article-card span {
  display: inline-flex;
  width: fit-content;
  padding: 4px 11px;
  border-radius: 999px;
  background: var(--mint);
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 800;
}

.article-card h3 {
  margin: 0;
  font-size: 19px;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

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

.guide-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(320px, 1.05fr);
  gap: 40px;
  align-items: start;
}

.guide-grid p:not(.eyebrow) {
  color: var(--muted);
}

.roadmap {
  display: grid;
  gap: 10px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.roadmap li {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 14px;
  align-items: center;
  padding: 15px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.roadmap strong {
  color: var(--teal-dark);
}

.roadmap span {
  color: var(--muted);
  font-size: 14.5px;
}

/* ---------- Footer ---------- */

.site-footer {
  width: min(1160px, calc(100% - 32px));
  margin: 0 auto;
  padding: 36px 0 48px;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.site-footer strong {
  color: var(--ink);
}

.site-footer p {
  max-width: 720px;
  margin: 6px 0 0;
  font-size: 13.5px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-content: flex-start;
  gap: 6px 16px;
}

.footer-links a {
  color: var(--teal-dark);
  font-weight: 700;
  font-size: 14px;
}

.footer-links a:hover {
  text-decoration: underline;
}

/* ---------- Sub pages ---------- */

.page-main {
  background: var(--surface);
}

.page-wrap {
  display: grid;
  grid-template-columns: minmax(0, 760px) minmax(260px, 1fr);
  gap: 40px;
  align-items: start;
}

.article-body {
  display: grid;
  gap: 28px;
}

.article-body h1 {
  font-size: clamp(30px, 4vw, 46px);
}

.article-body h2 {
  margin-top: 8px;
  font-size: 26px;
}

.article-body p,
.article-body li {
  color: #404a55;
  font-size: 16.5px;
}

.article-body ul,
.article-body ol {
  display: grid;
  gap: 10px;
  padding-left: 22px;
  margin: 0;
}

.article-meta {
  color: var(--muted);
  font-size: 14px;
}

.info-box {
  padding: 16px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid #cfe5df;
  border-left: 4px solid var(--teal);
  background: var(--mint);
  color: #2c524c;
}

.side-panel {
  position: sticky;
  top: 92px;
  display: grid;
  gap: 12px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--bg);
}

.side-panel h2 {
  font-size: 20px;
}

.side-panel a {
  color: var(--teal-dark);
  font-weight: 700;
}

.side-panel a:hover {
  text-decoration: underline;
}

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
  .header-inner {
    min-height: auto;
    padding: 12px 0;
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .top-nav {
    width: 100%;
  }

  .intro-band {
    padding: 56px 0 60px;
  }

  .intro-grid,
  .calculator-grid,
  .guide-grid,
  .article-grid,
  .page-wrap {
    grid-template-columns: 1fr;
  }

  .article-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .event-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .result-panel,
  .side-panel {
    position: static;
  }
}

@media (max-width: 620px) {
  .intro-band,
  .tool-section,
  .guide-band,
  .article-band,
  .page-main {
    padding: 40px 0;
  }

  .intro-band {
    padding: 44px 0 48px;
  }

  .field-grid,
  .metric-row,
  .scenario-grid,
  .article-grid {
    grid-template-columns: 1fr;
  }

  .compare-item,
  .detail-item,
  .timeline-row,
  .event-chip {
    grid-template-columns: 1fr;
  }

  .timeline-row strong {
    text-align: left;
  }

  .event-row {
    grid-template-columns: 1fr;
  }

  .roadmap li {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .site-footer {
    flex-direction: column;
  }

  .footer-links {
    justify-content: flex-start;
  }
}
