/* =========================================================
   Orbit — 디자인 토큰
   원본 앱(Desktop/gpt player)의 토스풍 라이트 테마를 웹으로 옮기고,
   다크 모드는 로고의 네이비 팔레트에서 파생시켰다.
   --series-* 는 색각이상 검증을 통과한 조합이며 순서 자체가 안전장치다.
   ========================================================= */
:root {
  color-scheme: light;

  --bg:            #f2f4f6;
  --surface:       #ffffff;
  --chip:          #f2f4f6;
  --border:        #eef0f3;

  --text:          #16181d;
  --muted:         #8b909c;
  --faint:         #b6bac3;

  --accent:        #3182f6;
  --accent-weak:   #eaf1fe;
  --good:          #12b886;
  --good-weak:     #e6f7f0;
  --danger:        #f0475b;
  --danger-weak:   #fdecef;
  --warn:          #b06f00;
  --warn-weak:     #fff4e0;

  --grad:          linear-gradient(118deg, #4d7cfe 0%, #3dffc0 100%);

  --shadow:        0 1px 3px rgba(20, 22, 28, .05);
  --shadow-lift:   0 4px 16px rgba(20, 22, 28, .08);

  --series-1: #2a78d6;
  --series-2: #eb6834;
  --series-3: #1baf7a;
  --series-4: #eda100;
  --series-5: #e87ba4;
  --series-6: #008300;
  --series-7: #4a3aa7;
  --series-8: #e34948;
  --series-rest: #c3c7cf;

  --r-card: 20px;
  --r-md: 14px;
  --r-sm: 11px;
}

@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;

    --bg:          #0e1230;
    --surface:     #171c3d;
    --chip:        #1f2549;
    --border:      #242a52;

    --text:        #f3f5fb;
    --muted:       #9aa1bd;
    --faint:       #6b7398;

    --accent:      #6d9dff;
    --accent-weak: #1c2551;
    --good:        #3dd9a4;
    --good-weak:   #10312a;
    --danger:      #ff7285;
    --danger-weak: #34172161;
    --warn:        #e0b866;
    --warn-weak:   #2e2513;

    --shadow:      0 1px 3px rgba(0, 0, 0, .3);
    --shadow-lift: 0 4px 16px rgba(0, 0, 0, .45);

    --series-1: #3987e5;
    --series-2: #d95926;
    --series-3: #199e70;
    --series-4: #c98500;
    --series-5: #d55181;
    --series-6: #008300;
    --series-7: #9085e9;
    --series-8: #e66767;
    --series-rest: #4a5378;
  }
}

*, *::before, *::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo",
    "Pretendard Variable", Pretendard, "Segoe UI", Roboto, "Malgun Gothic", sans-serif;
  font-size: 15.5px;
  line-height: 1.55;
  letter-spacing: -0.012em;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-underline-offset: 3px; }
button { font-family: inherit; cursor: pointer; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

.wrap { max-width: 660px; margin-inline: auto; padding-inline: 16px; }
.num { font-variant-numeric: tabular-nums; }

/* ---------------- header ---------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
}

.header-top {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 56px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
  text-decoration: none;
}

.brand svg { display: block; border-radius: 7px; flex: none; }

/* 칩 형태의 가로 스크롤 내비 — 원본 앱의 chipbtn 스타일 */
.site-nav {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 0 16px 10px;
  margin-inline: -16px;
  scroll-padding-inline: 16px;
  mask-image: linear-gradient(90deg, #000 calc(100% - 24px), transparent);
}

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

/* 페이지 배경과 칩 배경이 같은 색이라, 내비 칩은 카드와 같은 흰 배경을 쓴다 */
.site-nav a {
  flex: none;
  padding: 8px 14px;
  border-radius: 11px;
  background: var(--surface);
  box-shadow: var(--shadow);
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: background .15s, color .15s;
}

.site-nav a:hover { color: var(--text); }

.site-nav a[aria-current="page"] {
  background: var(--accent-weak);
  color: var(--accent);
}

/* ---------------- type ---------------- */
main { padding-block: 20px 44px; }

.eyebrow {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .04em;
  color: var(--accent);
  margin: 0 0 6px;
}

h1 {
  font-size: clamp(25px, 6vw, 31px);
  line-height: 1.22;
  letter-spacing: -0.035em;
  font-weight: 800;
  margin: 0 0 8px;
  text-wrap: balance;
}

h2 {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.025em;
  margin: 30px 2px 10px;
}

.lead {
  font-size: 15px;
  color: var(--muted);
  margin: 0 0 20px;
  max-width: 46ch;
  text-wrap: pretty;
}

.section-label {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 26px 2px 10px;
}

/* ---------------- card ---------------- */
/* .panel 은 입력 폼과 결과 블록이 쓰는 같은 카드다 */
.card, .panel {
  background: var(--surface);
  border-radius: var(--r-card);
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 12px;
}

.card:last-child { margin-bottom: 0; }
.divider { height: 1px; background: var(--border); margin: 16px 0; }

/* ---------------- home tool list ---------------- */
.hero-note {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface);
  border-radius: 999px;
  padding: 6px 13px 6px 10px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}

.hero-note .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--good);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--good) 20%, transparent);
}

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

.tool-list a {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: var(--surface);
  border-radius: var(--r-card);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
  transition: transform .15s, box-shadow .15s;
}

.tool-list a:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.tool-list a:active { transform: translateY(0); }
.tool-list a:hover .chev { transform: translateX(3px); color: var(--accent); }

.tool-icon {
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border-radius: 13px;
  background: var(--accent-weak);
  color: var(--accent);
}

.tool-icon svg { width: 21px; height: 21px; }

.tool-name { display: block; font-weight: 700; font-size: 15.5px; letter-spacing: -0.02em; }
.tool-desc { display: block; font-size: 13px; color: var(--muted); margin-top: 2px; line-height: 1.4; }

.chev { color: var(--faint); transition: transform .15s, color .15s; }
.chev svg { width: 17px; height: 17px; display: block; }

/* ---------------- form ---------------- */
.field { margin-bottom: 16px; }
.field:last-child { margin-bottom: 0; }

.field > label, .field > .label {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 7px;
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .grid-2 { grid-template-columns: 1fr; gap: 0; } .grid-2 > .field { margin-bottom: 16px; } }

input[type="text"], input[type="number"], input[type="date"], select, textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid transparent;
  border-radius: 12px;
  color: var(--text);
  padding: 13px;
  font: inherit;
  font-size: 16px;              /* iOS 자동 확대 방지 */
  font-variant-numeric: tabular-nums;
  transition: border-color .15s, background .15s;
}

textarea {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.6;
  min-height: 118px;
  resize: vertical;
  white-space: pre;
  overflow-x: auto;
}

textarea::placeholder { color: var(--faint); }

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface);
}

select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
                    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 19px) 52%, calc(100% - 14px) 52%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 34px;
}

.input-affix { position: relative; }
.input-affix input { padding-right: 46px; }

.input-affix .affix {
  position: absolute;
  right: 14px; top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  color: var(--muted);
  font-weight: 600;
  pointer-events: none;
}

.hint { font-size: 12.5px; color: var(--muted); margin-top: 7px; line-height: 1.45; }

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .87em;
  background: var(--chip);
  border-radius: 5px;
  padding: 1px 5px;
}

/* 칩 버튼 */
.quick { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 9px; }

.quick button {
  background: var(--chip);
  border: none;
  border-radius: 10px;
  padding: 8px 13px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  transition: background .15s, color .15s;
}

.quick button:hover { background: var(--accent-weak); color: var(--accent); }

/* 세그먼트 */
.segmented {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 4px;
  padding: 4px;
  background: var(--chip);
  border-radius: 13px;
}

.segmented.stack { grid-auto-flow: row; }

.segmented label {
  text-align: center;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--muted);
  padding: 9px 6px;
  border-radius: 10px;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, color .15s, box-shadow .15s;
}

.segmented input { position: absolute; opacity: 0; pointer-events: none; }

.segmented label:has(input:checked) {
  background: var(--surface);
  color: var(--accent);
  box-shadow: var(--shadow);
}

.segmented label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 1px; }

/* ---------------- result ---------------- */
.result { margin-top: 12px; }

.headline {
  background: var(--surface);
  border-radius: var(--r-card);
  padding: 24px 20px;
  text-align: center;
  box-shadow: var(--shadow);
  margin-bottom: 12px;
}

.headline .label { font-size: 13px; font-weight: 700; color: var(--muted); }

.headline .value {
  font-size: clamp(30px, 8vw, 40px);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.12;
  margin-top: 5px;
  font-variant-numeric: tabular-nums;
}

.headline .value .unit { font-size: .48em; font-weight: 700; margin-left: 2px; }
.headline .sub { font-size: 13px; color: var(--muted); margin-top: 7px; font-variant-numeric: tabular-nums; }

.headline.is-warn .value { color: var(--danger); }

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(140px, 100%), 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.stat {
  background: var(--surface);
  border-radius: var(--r-md);
  padding: 14px 16px;
  box-shadow: var(--shadow);
}

.stat .k { font-size: 12px; color: var(--muted); font-weight: 600; }
.stat .v { font-size: 18px; font-weight: 800; letter-spacing: -0.03em; margin-top: 3px; font-variant-numeric: tabular-nums; }

/* ---------------- chart ---------------- */
.viz-title { font-size: 13px; font-weight: 700; color: var(--muted); margin-bottom: 12px; }

.stack-bar {
  display: flex;
  width: 100%;
  height: 26px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--chip);
  gap: 2px;
}

.stack-seg { min-width: 2px; transition: flex-basis .35s cubic-bezier(.4, 0, .2, 1); }
.stack-seg:first-child { border-radius: 8px 0 0 8px; }
.stack-seg:last-child { border-radius: 0 8px 8px 0; }

.legend { display: flex; flex-wrap: wrap; gap: 7px 15px; margin-top: 13px; font-size: 12.5px; color: var(--muted); }
.legend-item { display: inline-flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; font-weight: 600; }
.legend-swatch { width: 9px; height: 9px; border-radius: 3px; flex: none; }

/* ---------------- 도넛 ---------------- */
.donut-wrap { display: flex; justify-content: center; }
.donut { width: 168px; height: 168px; }
.donut-value { font-size: 27px; font-weight: 800; letter-spacing: -.03em; fill: var(--text); }
.donut-label { font-size: 12px; font-weight: 600; fill: var(--muted); }

/* 도넛 + 범례 나란히 */
.donut-row { display: flex; align-items: center; gap: 22px; }
.donut-row .legend { margin-top: 0; flex-direction: column; gap: 9px; flex: 1; }
@media (max-width: 460px) { .donut-row { flex-direction: column; gap: 16px; } .donut-row .legend { width: 100%; } }

/* ---------------- 선 그래프 ---------------- */
.linechart-wrap { position: relative; }
.linechart { width: 100%; height: auto; display: block; overflow: visible; touch-action: pan-y; }
.linechart .axis { font-size: 13px; fill: var(--faint); font-weight: 600; }
.linechart .crosshair { transition: opacity .12s; }

.chart-tip {
  position: absolute;
  top: -4px;
  transform: translate(-50%, -100%);
  background: var(--text);
  color: var(--surface);
  border-radius: 10px;
  padding: 8px 11px;
  font-size: 12px;
  line-height: 1.5;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .12s;
  z-index: 2;
}

.chart-tip.on { opacity: 1; }
.chart-tip b { display: block; font-weight: 700; margin-bottom: 2px; }
.chart-tip span { display: flex; align-items: center; gap: 5px; font-variant-numeric: tabular-nums; }
.chart-tip i { width: 7px; height: 7px; border-radius: 2px; flex: none; }

/* ---------------- 블록 스트립 ---------------- */
.blocks { display: flex; flex-wrap: wrap; gap: 4px; }

.blocks .blk {
  width: 15px; height: 26px;
  border-radius: 4px;
  background: var(--chip);
  transition: background .3s;
}

/* ---------------- 진행 막대 ---------------- */
.progress { height: 10px; border-radius: 999px; background: var(--chip); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: 999px; background: var(--accent); transition: width .4s cubic-bezier(.4,0,.2,1); }

.milestones { display: flex; justify-content: space-between; margin-top: 9px; font-size: 11.5px; color: var(--faint); font-weight: 600; }
.milestones b { color: var(--accent); font-weight: 700; }

/* ---------------- 히어로 ---------------- */
.hero-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-card);
  background: linear-gradient(140deg, #0e1230 0%, #1b2452 100%);
  color: #fff;
  padding: 26px 22px 24px;
  margin-bottom: 14px;
}

.hero-card::after {
  content: "";
  position: absolute;
  right: -70px; top: -90px;
  width: 260px; height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(61, 255, 192, .22), transparent 68%);
}

.hero-card h1 { color: #fff; margin-bottom: 10px; position: relative; }
.hero-card h1 em { font-style: normal; background: linear-gradient(118deg, #4d7cfe, #3dffc0); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-card .lead { color: #b9c0dd; margin: 0; position: relative; font-size: 14.5px; }

.hero-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 18px; position: relative; }

.hero-tags span {
  font-size: 12.5px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .09);
  color: #dfe4f7;
}

/* ---------------- table ---------------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

table { width: 100%; border-collapse: collapse; font-size: 13.5px; font-variant-numeric: tabular-nums; }

th, td { padding: 11px 6px; text-align: right; border-top: 1px solid var(--border); }
th:first-child, td:first-child { text-align: left; }

thead th { font-size: 12px; font-weight: 700; color: var(--muted); border-top: none; white-space: nowrap; }
tbody tr:first-child td { border-top: 1px solid var(--border); }
tbody td { color: var(--muted); }
tbody td:first-child { color: var(--text); font-weight: 600; }
tfoot td { font-weight: 800; color: var(--text); }

td .swatch { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 8px; vertical-align: 1px; }

/* ---------------- callout ---------------- */
.callout {
  display: flex;
  gap: 11px;
  padding: 15px 16px;
  border-radius: var(--r-md);
  font-size: 13.5px;
  line-height: 1.55;
  background: var(--accent-weak);
  color: var(--muted);
  margin-bottom: 12px;
}

.callout svg { width: 17px; height: 17px; flex: none; margin-top: 1px; color: var(--accent); }
.callout strong { color: var(--text); font-weight: 700; }
.callout.warn { background: var(--danger-weak); }
.callout.warn svg { color: var(--danger); }

/* ---------------- FAQ ---------------- */
.faq { background: var(--surface); border-radius: var(--r-card); box-shadow: var(--shadow); padding: 4px 20px; }

.faq details + details { border-top: 1px solid var(--border); }

.faq summary {
  cursor: pointer;
  list-style: none;
  padding: 15px 26px 15px 0;
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: -0.02em;
  position: relative;
}

.faq summary::-webkit-details-marker { display: none; }

.faq summary::after {
  content: "";
  position: absolute;
  right: 4px; top: 21px;
  width: 7px; height: 7px;
  border-right: 2px solid var(--faint);
  border-bottom: 2px solid var(--faint);
  transform: rotate(45deg);
  transition: transform .2s;
}

.faq details[open] summary::after { transform: rotate(-135deg); top: 24px; }

.faq details > *:not(summary) {
  margin: 0;
  padding-bottom: 16px;
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.6;
}

.faq details ul { padding-left: 18px; }
.faq details li { margin-bottom: 5px; }
.faq strong { color: var(--text); font-weight: 700; }

/* ---------------- 다음으로 (둘러보기 유도) ---------------- */
.next-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 520px) { .next-grid { grid-template-columns: 1fr; } }

.next-grid a {
  display: block;
  background: var(--surface);
  border-radius: var(--r-md);
  padding: 15px 16px;
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
  transition: transform .15s, box-shadow .15s;
}

.next-grid a:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.next-grid .n { font-weight: 700; font-size: 14.5px; letter-spacing: -0.02em; }
.next-grid .d { font-size: 12.5px; color: var(--muted); margin-top: 3px; line-height: 1.4; }

.next-grid .n::after {
  content: "→";
  color: var(--faint);
  margin-left: 5px;
  transition: margin .15s;
}

.next-grid a:hover .n::after { margin-left: 9px; color: var(--accent); }

/* ---------------- ads ---------------- */
.ad-slot { margin: 28px 0; text-align: center; }
.ad-slot .adsbygoogle { display: block; }
.ad-label { font-size: 10.5px; letter-spacing: .08em; color: var(--faint); margin-bottom: 6px; }

.ad-placeholder {
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--shadow);
  color: var(--faint);
  font-size: 12px;
  padding: 38px 14px;
}

/* ---------------- footer ---------------- */
.site-footer { padding-block: 24px 40px; font-size: 12.5px; color: var(--faint); }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: baseline; }
.site-footer nav { display: flex; gap: 14px; flex-wrap: wrap; }
.site-footer a { color: var(--muted); text-decoration: none; font-weight: 600; }
.site-footer a:hover { color: var(--text); }
.site-footer .copy { margin-left: auto; }
@media (max-width: 520px) { .site-footer .copy { margin-left: 0; width: 100%; } }

.note { font-size: 12px; line-height: 1.6; color: var(--faint); margin-top: 20px; padding: 0 2px; }

@media (prefers-reduced-motion: reduce) {
  * { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
