/* ==========================================================================
   CastFi — castfi.castplan.net
   Design language mirrors the app: warm-black "listening room" surfaces,
   monochrome type ramp, brand gradient taken from the launcher icon.
   ========================================================================== */

:root {
  --bg:        #08080A;
  --canvas:    #0A0A0B;
  --surface:   #111114;
  --elevated:  #16161A;
  --overlay:   #202026;
  --line:      rgba(255,255,255,.08);
  --line-soft: rgba(255,255,255,.05);

  --text:  rgba(255,255,255,.96);
  --text2: rgba(255,255,255,.64);
  --text3: rgba(255,255,255,.42);
  --text4: rgba(255,255,255,.26);

  --brand-1: #7B67F2;
  --brand-2: #4889E5;
  --brand-3: #16ABD8;
  --brand: linear-gradient(135deg, var(--brand-1) 0%, var(--brand-2) 52%, var(--brand-3) 100%);

  --gold: #E3B341;   /* high-resolution / DSD */
  --teal: #3FC7B4;   /* lossless */

  --radius-s: 10px;
  --radius:   16px;
  --radius-l: 24px;

  --wrap: 1120px;
  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont,
          "Segoe UI", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
}

/* ---- reset ------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.7;
  letter-spacing: -.01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg { max-width: 100%; }
a { color: inherit; }

/* language switching — both languages live in the DOM, one is shown */
html[data-lang="ko"] [data-l="en"],
html[data-lang="en"] [data-l="ko"] { display: none !important; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

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

/* ---- navigation -------------------------------------------------------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(8,8,10,.72);
  backdrop-filter: saturate(160%) blur(18px);
  -webkit-backdrop-filter: saturate(160%) blur(18px);
  border-bottom: 1px solid var(--line-soft);
}
.nav__in { display: flex; align-items: center; gap: 20px; height: 62px; }
.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; font-weight: 700; letter-spacing: -.02em; }
.brand img { width: 28px; height: 28px; border-radius: 8px; display: block; }
.brand span { font-size: 17px; }
.nav__links { display: flex; align-items: center; gap: 22px; margin-left: auto; }
.nav__links a { color: var(--text2); text-decoration: none; font-size: 14px; font-weight: 500; transition: color .18s; }
.nav__links a:hover { color: var(--text); }

.lang {
  display: inline-flex; padding: 3px; gap: 2px;
  background: var(--elevated); border: 1px solid var(--line); border-radius: 999px;
}
.lang button {
  appearance: none; border: 0; background: transparent; cursor: pointer;
  color: var(--text3); font: inherit; font-size: 12px; font-weight: 600;
  padding: 4px 11px; border-radius: 999px; transition: background .18s, color .18s;
}
.lang button:hover { color: var(--text2); }
html[data-lang="ko"] .lang button[value="ko"],
html[data-lang="en"] .lang button[value="en"] { background: var(--overlay); color: var(--text); }

@media (max-width: 720px) {
  .nav__links a { display: none; }
  .nav__links a.keep { display: inline; }
}

/* ---- buttons ----------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 13px 22px; border-radius: 12px; border: 1px solid transparent;
  font-size: 15px; font-weight: 600; letter-spacing: -.01em;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: transform .16s ease, opacity .16s ease, background .16s ease, border-color .16s ease;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--brand); color: #fff; box-shadow: 0 8px 28px -12px rgba(72,137,229,.8); }
.btn--primary:hover { opacity: .92; }
.btn--ghost { background: var(--elevated); border-color: var(--line); color: var(--text); }
.btn--ghost:hover { background: var(--overlay); border-color: rgba(255,255,255,.14); }
.btn--sm { padding: 9px 16px; font-size: 14px; }
.btn[aria-disabled="true"] { opacity: .55; cursor: default; pointer-events: none; }

/* ---- hero -------------------------------------------------------------- */
.hero { position: relative; padding: 96px 0 72px; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: -30% -20% auto -20%; height: 720px; z-index: 0;
  background:
    radial-gradient(54% 48% at 20% 6%,  rgba(123,103,242,.34), transparent 66%),
    radial-gradient(48% 44% at 84% 16%, rgba(22,171,216,.28), transparent 68%);
  filter: blur(20px); pointer-events: none;
}
.hero__in { position: relative; z-index: 1; display: grid; grid-template-columns: 1.08fr .92fr; gap: 56px; align-items: center; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  color: var(--text3); background: var(--elevated);
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; margin: 0 0 22px;
}
.eyebrow i { width: 6px; height: 6px; border-radius: 50%; background: var(--teal); display: block; }

h1 {
  margin: 0 0 20px; font-size: clamp(34px, 5.1vw, 56px); line-height: 1.14;
  font-weight: 800; letter-spacing: -.035em;
}
h1 em { font-style: normal; background: var(--brand); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.lede { margin: 0 0 32px; font-size: clamp(16px, 1.7vw, 18.5px); color: var(--text2); max-width: 46ch; line-height: 1.72; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.hero__note { margin: 20px 0 0; font-size: 13px; color: var(--text3); }

@media (max-width: 900px) {
  .hero { padding: 64px 0 48px; }
  .hero__in { grid-template-columns: 1fr; gap: 44px; }
  .hero__art { order: -1; }
}

/* ---- hero device shot -------------------------------------------------- */
.hero__art { display: flex; justify-content: center; }
.phone {
  width: 362px; max-width: 82vw;
  background: var(--canvas);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 34px; padding: 9px;
  box-shadow: 0 40px 90px -30px rgba(0,0,0,.9), 0 0 0 1px rgba(255,255,255,.03) inset;
}
.phone__shot { display: block; width: 100%; height: auto; border-radius: 26px; }

/* 상태 칩 — 신호 경로 패널에서 쓴다 */
.tag {
  font-size: 10px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  padding: 4px 8px; border-radius: 6px; border: 1px solid currentColor; line-height: 1;
}
.tag--gold { color: var(--gold); }
.tag--teal { color: var(--teal); }
.tag--dim  { color: var(--text3); }

/* ---- sections ---------------------------------------------------------- */
section { padding: 84px 0; }
section + section { border-top: 1px solid var(--line-soft); }
.head { max-width: 62ch; margin-bottom: 44px; }
.head h2 { margin: 0 0 14px; font-size: clamp(26px, 3.3vw, 36px); font-weight: 800; letter-spacing: -.03em; line-height: 1.22; }
.head p { margin: 0; color: var(--text2); font-size: 16.5px; }
.kicker { display: block; font-size: 12.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--brand-3); margin-bottom: 14px; }

/* ---- feature grid ------------------------------------------------------ */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 900px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .grid { grid-template-columns: 1fr; } }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l);
  padding: 28px 26px; transition: border-color .2s, background .2s, transform .2s;
}
.card:hover { border-color: rgba(255,255,255,.14); background: var(--elevated); transform: translateY(-2px); }
.card h3 { margin: 0 0 10px; font-size: 17px; font-weight: 700; letter-spacing: -.02em; }
.card p { margin: 0; font-size: 14.5px; color: var(--text2); line-height: 1.68; }
.card__icon {
  width: 40px; height: 40px; border-radius: 11px; margin-bottom: 18px;
  display: grid; place-items: center;
  background: var(--overlay); border: 1px solid var(--line); color: var(--text2);
}
.card__icon svg { width: 20px; height: 20px; display: block; }

/* ---- steps ------------------------------------------------------------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; counter-reset: s; }
@media (max-width: 820px) { .steps { grid-template-columns: 1fr; } }
.step { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 28px 26px; position: relative; }
.step::before {
  counter-increment: s; content: counter(s, decimal-leading-zero);
  display: block; font-size: 13px; font-weight: 800; letter-spacing: .08em;
  background: var(--brand); -webkit-background-clip: text; background-clip: text; color: transparent;
  margin-bottom: 14px;
}
.step h3 { margin: 0 0 9px; font-size: 16.5px; font-weight: 700; letter-spacing: -.02em; }
.step p { margin: 0; font-size: 14.5px; color: var(--text2); }

/* ---- split ------------------------------------------------------------- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; gap: 36px; } }
.list { list-style: none; margin: 26px 0 0; padding: 0; }
.list li { position: relative; padding-left: 26px; margin-bottom: 13px; color: var(--text2); font-size: 15px; }
.list li::before { content: "✓"; position: absolute; left: 0; top: 0; color: var(--teal); font-weight: 700; }
.list li b { color: var(--text); font-weight: 600; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 30px; }
.panel h3 { margin: 0 0 18px; font-size: 15px; font-weight: 700; letter-spacing: -.01em; }
.chain { display: flex; flex-direction: column; gap: 10px; }
.link {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  background: var(--elevated); border: 1px solid var(--line); border-radius: 12px; padding: 13px 16px;
}
.link small { color: var(--text3); font-size: 12px; letter-spacing: .02em; }
.link span { font-size: 14px; font-weight: 600; }
.arrow { text-align: center; color: var(--text4); font-size: 13px; line-height: 1; }

/* ---- faq --------------------------------------------------------------- */
.faq { border-top: 1px solid var(--line-soft); }
.faq details { border-bottom: 1px solid var(--line-soft); }
.faq summary {
  list-style: none; cursor: pointer; padding: 22px 40px 22px 0; position: relative;
  font-size: 16px; font-weight: 600; letter-spacing: -.015em;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  color: var(--text3); font-size: 20px; font-weight: 400; transition: transform .2s, color .2s;
}
.faq details[open] summary::after { content: "−"; color: var(--text); }
.faq summary:hover { color: #fff; }
.faq .answer { padding: 0 40px 24px 0; color: var(--text2); font-size: 15px; margin: 0; }
.faq .answer p { margin: 0 0 10px; }
.faq .answer p:last-child { margin-bottom: 0; }

/* ---- cta band ---------------------------------------------------------- */
.band {
  background: var(--surface); border: 1px solid var(--line); border-radius: 28px;
  padding: 56px 48px; text-align: center; position: relative; overflow: hidden;
}
.band::before {
  content: ""; position: absolute; inset: -60% -10% auto -10%; height: 340px;
  background: radial-gradient(50% 60% at 50% 0%, rgba(72,137,229,.22), transparent 70%);
  pointer-events: none;
}
.band > * { position: relative; }
.band h2 { margin: 0 0 14px; font-size: clamp(24px, 3vw, 32px); font-weight: 800; letter-spacing: -.03em; }
.band p { margin: 0 auto 28px; color: var(--text2); max-width: 52ch; }
.band .hero__cta { justify-content: center; }
@media (max-width: 620px) { .band { padding: 40px 24px; } }

/* ---- footer ------------------------------------------------------------ */
footer { border-top: 1px solid var(--line-soft); padding: 56px 0 64px; }
.foot { display: flex; flex-wrap: wrap; gap: 32px; justify-content: space-between; align-items: flex-start; }
.foot__links { display: flex; flex-wrap: wrap; gap: 26px; }
.foot__links a { color: var(--text2); text-decoration: none; font-size: 14px; transition: color .18s; }
.foot__links a:hover { color: var(--text); }
.foot__legal { margin: 28px 0 0; color: var(--text4); font-size: 12.5px; line-height: 1.7; max-width: 74ch; }
.foot__legal a { color: var(--text3); }

/* ---- document pages ---------------------------------------------------- */
.doc { padding: 64px 0 88px; }
.doc__head { max-width: 76ch; margin-bottom: 44px; padding-bottom: 32px; border-bottom: 1px solid var(--line-soft); }
.doc__head h1 { font-size: clamp(30px, 4vw, 42px); margin-bottom: 14px; }
.doc__head p { margin: 0; color: var(--text2); }
.doc__meta { margin-top: 18px !important; font-size: 13px; color: var(--text3) !important; }

.prose { max-width: 76ch; }
.prose h2 {
  margin: 52px 0 16px; font-size: 21px; font-weight: 750; letter-spacing: -.025em;
  padding-top: 22px; border-top: 1px solid var(--line-soft);
}
.prose h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.prose h3 { margin: 30px 0 10px; font-size: 16.5px; font-weight: 700; letter-spacing: -.02em; }
.prose p { margin: 0 0 15px; color: var(--text2); font-size: 15.5px; }
.prose ul, .prose ol { margin: 0 0 18px; padding-left: 22px; color: var(--text2); font-size: 15.5px; }
.prose li { margin-bottom: 9px; }
.prose li::marker { color: var(--text4); }
.prose strong, .prose b { color: var(--text); font-weight: 650; }
.prose a { color: var(--brand-3); text-decoration-color: rgba(22,171,216,.4); text-underline-offset: 3px; }
.prose code {
  background: var(--elevated); border: 1px solid var(--line); border-radius: 6px;
  padding: 1px 6px; font-size: .88em; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--text);
}
.prose hr { border: 0; border-top: 1px solid var(--line-soft); margin: 44px 0; }

.note {
  background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--brand-2);
  border-radius: 12px; padding: 18px 22px; margin: 0 0 22px;
}
.note p { margin: 0; font-size: 14.5px; }
.note p + p { margin-top: 10px; }

.tbl-wrap { overflow-x: auto; margin: 0 0 24px; border: 1px solid var(--line); border-radius: 14px; }
table { border-collapse: collapse; width: 100%; min-width: 520px; font-size: 14.5px; }
th, td { text-align: left; padding: 13px 16px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
th { color: var(--text); font-weight: 650; background: var(--elevated); font-size: 13.5px; letter-spacing: .01em; white-space: nowrap; }
td { color: var(--text2); }
tr:last-child td { border-bottom: 0; }
td code { white-space: nowrap; }

/* ---- support page cards ------------------------------------------------ */
.contact { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; margin: 0 0 8px; }
@media (max-width: 760px) { .contact { grid-template-columns: 1fr; } }
.contact .card p { margin-bottom: 16px; }
.contact .card a.btn { margin-top: 4px; }

/* ---- shared type helpers (used by split sections) ---------------------- */
.h2 { margin: 0 0 14px; font-size: clamp(26px, 3.3vw, 36px); font-weight: 800; letter-spacing: -.03em; line-height: 1.22; }
.sub { margin: 0; color: var(--text2); font-size: 16.5px; }
.sub--s { margin: 0 0 18px; font-size: 15px; }
.mt-28 { margin-top: 28px; }
.link span[data-l] { display: block; }
.mt-56 { margin-top: 56px; }

/* On a phone the device shot must not push the headline below the fold. */
@media (max-width: 640px) {
  .hero { padding: 40px 0 44px; }
  .hero__in { gap: 32px; }
  .phone { width: 248px; max-width: 68vw; border-radius: 28px; padding: 7px; }
  .phone__shot { border-radius: 22px; }
  section { padding: 62px 0; }
  .doc { padding: 44px 0 64px; }
}

.hero__note a { color: var(--text2); text-underline-offset: 3px; }
.hero__note a:hover { color: var(--text); }
