/* SubSync 홈페이지 — 브랜드 토큰: SubSync-Brand/guide/tokens.css */
:root {
  --ss-primary: #6366F1;
  --ss-secondary: #A855F7;
  --ss-accent: #22D3EE;
  --ss-dark: #0F172A;
  --ss-light: #F8FAFC;
  --ss-gradient: linear-gradient(135deg, #22D3EE, #6366F1 48%, #A855F7);
  --font: Inter, Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Segoe UI", "Malgun Gothic", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --radius: 14px;
}

/* 어두운 화면 (기본) */
:root, [data-theme="dark"] {
  color-scheme: dark;
  --bg: #070B18;
  --bg-soft: #0A1020;
  --card: #0D1326;
  --card-2: #111833;
  --line: rgba(148, 163, 184, .14);
  --line-strong: rgba(148, 163, 184, .24);
  --text: #F8FAFC;
  --soft: #CBD5E1;
  --muted: #8B97AD;
  --eyebrow: #22D3EE;
  --kicker: #A5B4FC;
  --word-sync: #A5A0FF;
  --grad-text: linear-gradient(100deg, #A5B4FC, #A78BFA 55%, #C4B5FD);
  --chip-on: #1E2550;
  --code-bg: #0A0F1F;
  --shadow: 0 30px 80px -30px rgba(79, 70, 229, .45);
}

/* 밝은 화면 */
[data-theme="light"] {
  color-scheme: light;
  --bg: #F8FAFC;
  --bg-soft: #F1F5F9;
  --card: #FFFFFF;
  --card-2: #F5F6FF;
  --line: rgba(15, 23, 42, .09);
  --line-strong: rgba(15, 23, 42, .16);
  --text: #0F172A;
  --soft: #334155;
  --muted: #5B6578;
  --eyebrow: #4F46E5;
  --kicker: #4F46E5;
  --word-sync: #5140ED;
  --grad-text: linear-gradient(100deg, #4F46E5, #7C3AED 60%, #9333EA);
  --chip-on: #E0E7FF;
  --code-bg: #0F172A;
  --shadow: 0 30px 70px -35px rgba(79, 70, 229, .35);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  word-break: keep-all;
  overflow-x: hidden;
  transition: background-color .3s, color .3s;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -.03em; line-height: 1.22; }
p { margin: 0; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--ss-primary); outline-offset: 3px; border-radius: 6px; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 24px; }

/* 공통 */
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 12px; font-weight: 700; letter-spacing: .18em;
  color: var(--eyebrow); margin-bottom: 18px;
}
.eyebrow.center { display: block; text-align: center; }
.eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ss-accent); box-shadow: 0 0 12px var(--ss-accent); }
.grad-text { background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; }

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  height: 52px; padding: 0 24px; border-radius: 10px;
  font-weight: 600; font-size: 15px; white-space: nowrap;
  transition: transform .2s, box-shadow .2s, background-color .2s, border-color .2s;
}
.btn-sm { height: 40px; padding: 0 16px; font-size: 14px; }
.btn-primary {
  background: linear-gradient(135deg, #6366F1, #7C5CF5);
  color: #fff;
  box-shadow: 0 10px 30px -10px rgba(99, 102, 241, .8), inset 0 1px 0 rgba(255, 255, 255, .2);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 36px -12px rgba(99, 102, 241, .9); }
.btn-ghost { border: 1px solid var(--line-strong); background: transparent; }
.btn-ghost:hover { border-color: var(--ss-primary); }
.btn-link { color: var(--soft); font-size: 15px; font-weight: 500; }
.btn-link:hover { color: var(--text); }
.cta-row { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.cta-row.center { justify-content: center; }

/* 상단 메뉴 */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s;
}
.nav.scrolled { border-bottom-color: var(--line); }
.nav-inner { display: flex; align-items: center; height: 76px; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 8px; }
.brand-mark { width: 30px; height: 32px; }
.wordmark { font-family: Arial, Helvetica, sans-serif; font-weight: 700; font-size: 22px; letter-spacing: -.04em; }
.wordmark span { color: var(--word-sync); }
.brand.small .brand-mark { width: 24px; height: 26px; }
.brand.small .wordmark { font-size: 18px; }
.nav-links { margin-left: auto; display: flex; gap: 32px; font-size: 14px; color: var(--soft); }
.nav-links a:hover { color: var(--text); }
.nav-actions { display: flex; align-items: center; gap: 14px; }
.theme-toggle {
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--line); background: transparent; cursor: pointer;
  display: grid; place-items: center;
}
.theme-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.theme-toggle .i-moon { display: none; }
[data-theme="light"] .theme-toggle .i-sun { display: none; }
[data-theme="light"] .theme-toggle .i-moon { display: block; }

/* 히어로 */
.hero { position: relative; padding: 72px 0 110px; overflow: hidden; }
.glow { position: absolute; border-radius: 50%; filter: blur(90px); pointer-events: none; opacity: .55; }
.glow-a { width: 520px; height: 520px; right: -120px; top: -60px; background: radial-gradient(circle, rgba(99, 102, 241, .45), transparent 70%); }
.glow-b { width: 420px; height: 420px; left: -160px; bottom: -120px; background: radial-gradient(circle, rgba(34, 211, 238, .18), transparent 70%); }
[data-theme="light"] .glow { opacity: .35; }
.hero-grid { position: relative; display: grid; grid-template-columns: 1fr 1.02fr; gap: 56px; align-items: center; }
.hero h1 { font-size: clamp(40px, 5.6vw, 64px); font-weight: 800; letter-spacing: -.045em; margin-bottom: 26px; }
.lead { color: var(--soft); font-size: 17px; line-height: 1.75; margin-bottom: 40px; }
.tagline { margin-top: 48px; font-size: 11px; letter-spacing: .32em; color: var(--muted); }

/* 플레이어 예시 */
.player {
  background: linear-gradient(180deg, var(--card-2), var(--card));
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  box-shadow: var(--shadow);
  overflow: hidden;
  transform: perspective(1400px) rotateY(-4deg) rotateX(2deg);
  transition: transform .6s;
}
.player:hover { transform: none; }
.player-bar { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px 0; font-size: 13px; }
.player-title { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ss-accent); box-shadow: 0 0 10px var(--ss-accent); }
.player-note { color: var(--muted); font-size: 12px; }
.player-sub { display: flex; align-items: center; gap: 10px; padding: 14px 20px; font-size: 12px; }
.badge-live { background: #E11D48; color: #fff; font-weight: 700; font-size: 11px; letter-spacing: .08em; padding: 3px 8px; border-radius: 6px; }
.route { color: var(--muted); }
.cc {
  margin-left: auto; cursor: pointer;
  border: 1px solid var(--line-strong); background: var(--chip-on); border-radius: 6px;
  padding: 4px 10px; font-size: 12px; font-weight: 600;
}
.cc[aria-pressed="false"] { background: transparent; color: var(--muted); }

.screen {
  position: relative; margin: 0 20px; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden;
  background:
    radial-gradient(120% 90% at 85% 100%, rgba(124, 58, 237, .65), transparent 60%),
    radial-gradient(90% 80% at 0% 0%, rgba(13, 148, 136, .45), transparent 60%),
    linear-gradient(135deg, #0B2A33, #1A1446 60%, #2B1458);
  display: grid; place-items: center;
}
.screen-caption { position: absolute; top: 18px; left: 0; right: 0; text-align: center; font-size: 10px; letter-spacing: .3em; color: rgba(255, 255, 255, .6); }
.screen-mark { width: 26%; aspect-ratio: 130 / 136; filter: drop-shadow(0 16px 30px rgba(99, 102, 241, .55)); animation: float 6s ease-in-out infinite; }
.screen-orbit { position: absolute; width: 62%; aspect-ratio: 1.6; border: 1px solid rgba(255, 255, 255, .14); border-radius: 50%; transform: rotate(-18deg); }
.screen-orbit.two { width: 46%; transform: rotate(24deg); border-color: rgba(34, 211, 238, .16); }
.subtitle {
  position: absolute; left: 50%; bottom: 7%; transform: translateX(-50%);
  max-width: 88%; width: max-content;
  background: rgba(2, 6, 23, .82); color: #fff;
  font-size: clamp(12px, 1.25vw, 15px); font-weight: 600; line-height: 1.45; text-align: center;
  padding: 7px 14px; border-radius: 6px;
  transition: opacity .35s, transform .35s;
}
.subtitle.hide { opacity: 0; transform: translateX(-50%) translateY(6px); }
.subtitle.off { display: none; }
@keyframes float { 50% { transform: translateY(-8px); } }

.player-controls { display: flex; align-items: center; gap: 12px; padding: 14px 20px; font-size: 11px; color: var(--muted); }
.play { color: var(--text); font-size: 11px; }
.wave { flex: 1; height: 22px; display: flex; align-items: center; gap: 2px; }
.wave i { flex: 1; min-width: 1px; border-radius: 2px; background: linear-gradient(180deg, #22D3EE, #6366F1); height: 20%; transition: height .18s; }
.wave i.past { opacity: .95; }
.wave i:not(.past) { opacity: .35; }
.time { font-variant-numeric: tabular-nums; color: var(--soft); }
.mini { white-space: nowrap; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; padding: 0 20px 18px; }
.chip {
  cursor: pointer; border: 1px solid var(--line-strong); background: transparent;
  padding: 6px 12px; border-radius: 7px; font-size: 12px; color: var(--soft);
  transition: background-color .2s, border-color .2s, color .2s;
}
.chip:hover { border-color: var(--ss-primary); }
.chip[aria-pressed="true"] { background: var(--chip-on); border-color: var(--ss-primary); color: var(--text); font-weight: 600; }
.source { border-top: 1px solid var(--line); padding: 16px 20px 20px; }
.source-label { font-size: 10px; letter-spacing: .14em; color: var(--muted); margin-bottom: 6px; display: flex; align-items: center; gap: 10px; }
.partial { letter-spacing: 0; color: var(--eyebrow); opacity: 0; transition: opacity .2s; }
.partial.on { opacity: 1; }
.source-text { font-size: 13px; font-weight: 500; min-height: 1.6em; }

/* 띠 */
.strip { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 26px 24px; text-align: center; }
.strip p { font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.strip ul { list-style: none; margin: 0; padding: 0; display: flex; justify-content: center; gap: 28px 56px; flex-wrap: wrap; font-size: 12px; font-weight: 700; letter-spacing: .2em; }
.strip .spark { color: var(--ss-secondary); letter-spacing: 0; }

/* 섹션 */
.section { padding: 110px 0; }
.section h2 { font-size: clamp(30px, 3.6vw, 42px); font-weight: 800; }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 32px; margin-bottom: 56px; }
.section-aside { color: var(--soft); font-size: 14px; text-align: right; line-height: 1.7; }
.section-text { color: var(--soft); font-size: 15px; margin-top: 26px; line-height: 1.75; }

.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.card {
  background: linear-gradient(180deg, var(--card-2), var(--card));
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 36px 30px 30px; display: flex; flex-direction: column;
  transition: border-color .3s, transform .3s;
}
.card:hover { border-color: rgba(99, 102, 241, .45); translate: 0 -3px; }
.card-kicker { font-size: 11px; letter-spacing: .2em; font-weight: 700; color: var(--kicker); margin-bottom: 24px; }
.card h3 { font-size: 24px; font-weight: 800; margin-bottom: 18px; }
.card-desc { color: var(--soft); font-size: 14px; line-height: 1.75; margin-bottom: 28px; }
.card-link { margin-top: auto; padding-top: 24px; color: var(--kicker); font-size: 13px; font-weight: 600; }
.card-link:hover { text-decoration: underline; }

.sub-stack { display: grid; gap: 10px; }
.sub-row {
  display: flex; align-items: center; gap: 14px;
  border: 1px solid var(--line-strong); background: var(--bg-soft);
  border-radius: 8px; padding: 11px 14px; font-size: 13px; font-weight: 500;
}
.sub-row.in { margin-left: 22px; }
.tag { font-size: 10px; font-weight: 700; letter-spacing: .08em; color: var(--eyebrow); min-width: 18px; }

.flow { display: grid; grid-template-columns: auto 1fr auto 1fr auto; align-items: center; gap: 0; }
.node { border: 1px solid var(--line-strong); background: var(--bg-soft); border-radius: 8px; padding: 10px 12px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.node.hub {
  border-color: rgba(99, 102, 241, .6);
  background: linear-gradient(135deg, rgba(99, 102, 241, .22), rgba(168, 85, 247, .18));
  text-align: center; display: grid; gap: 2px;
}
.node.hub small { font-weight: 500; font-size: 10px; color: var(--muted); white-space: nowrap; }
.pipe { position: relative; height: 1px; background: var(--line-strong); min-width: 16px; overflow: hidden; }
.pipe i { position: absolute; top: -1px; left: -30%; width: 30%; height: 3px; background: linear-gradient(90deg, transparent, var(--ss-accent)); animation: flow 2.2s linear infinite; }
.flow .pipe:nth-child(4) i { animation-delay: 1.1s; }
@keyframes flow { to { left: 100%; } }
.fan { display: grid; gap: 6px; }
.fan span { border: 1px solid var(--line-strong); border-radius: 999px; padding: 4px 10px; font-size: 11px; white-space: nowrap; color: var(--soft); }

.features { list-style: none; margin: 20px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.features li { border: 1px solid var(--line); border-radius: var(--radius); padding: 26px 24px; background: color-mix(in srgb, var(--card) 60%, transparent); }
.f-icon {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(135deg, rgba(34, 211, 238, .16), rgba(99, 102, 241, .22));
  color: var(--kicker); font-size: 14px; font-weight: 700; margin-bottom: 16px;
}
.features h4 { font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.features p { font-size: 13.5px; color: var(--muted); line-height: 1.7; }

/* 2단 섹션 */
.split { border-top: 1px solid var(--line); }
.split-grid { display: grid; grid-template-columns: 1fr 1.05fr; gap: 64px; align-items: start; }
.code {
  margin: 36px 0 0; padding: 20px 22px; border-radius: 12px;
  background: var(--code-bg); border: 1px solid var(--line);
  color: #E2E8F0; font-family: var(--mono); font-size: 12.5px; line-height: 1.7;
  overflow-x: auto;
}
.code .c { color: #64748B; }
.code .k { color: #C4B5FD; }
.code .a { color: #67E8F9; }
.code .s { color: #86EFAC; }
.code .f { color: #93C5FD; }

.steps { list-style: none; margin: 0; padding: 0; }
.steps li { display: flex; gap: 22px; padding: 28px 0; border-bottom: 1px solid var(--line); }
.steps li:first-child { padding-top: 6px; }
.num { font-size: 13px; font-weight: 700; color: var(--kicker); padding-top: 3px; font-variant-numeric: tabular-nums; }
.steps h4 { font-size: 18px; font-weight: 700; margin-bottom: 6px; }
.steps p { color: var(--muted); font-size: 14px; line-height: 1.7; }

.faq details { border-bottom: 1px solid var(--line); padding: 22px 0; }
.faq details:first-child { padding-top: 4px; }
.faq summary { cursor: pointer; list-style: none; font-weight: 700; font-size: 16px; display: flex; gap: 12px; align-items: baseline; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before { content: "▸"; color: var(--kicker); font-size: 13px; transition: transform .2s; display: inline-block; }
.faq details[open] summary::before { transform: rotate(90deg); }
.faq details p { color: var(--muted); font-size: 14px; line-height: 1.75; margin: 12px 0 0 25px; }

/* 마무리 */
.final { position: relative; text-align: center; padding: 120px 24px 130px; border-top: 1px solid var(--line); overflow: hidden; }
.glow-c { width: 700px; height: 400px; left: 50%; bottom: -260px; transform: translateX(-50%); background: radial-gradient(circle, rgba(99, 102, 241, .45), transparent 70%); }
.final-mark { position: relative; width: 64px; height: 68px; margin-bottom: 28px; filter: drop-shadow(0 12px 28px rgba(99, 102, 241, .5)); }
.final h2 { position: relative; font-size: clamp(32px, 4vw, 46px); font-weight: 800; margin-bottom: 40px; }
.final .cta-row { position: relative; }

.footer { border-top: 1px solid var(--line); padding: 34px 0; }
.footer-inner { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
.footer-line { font-size: 12px; color: var(--muted); }
.footer-links { margin-left: auto; display: flex; gap: 22px; font-size: 13px; color: var(--soft); }
.footer-links a:hover { color: var(--text); }
.copy { font-size: 12px; color: var(--muted); }

/* 나타나기 */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; }
.reveal.visible { opacity: 1; transform: none; }

/* 반응형 */
@media (max-width: 980px) {
  .hero-grid, .split-grid { grid-template-columns: 1fr; gap: 48px; }
  .player { transform: none; }
  .cards { grid-template-columns: 1fr; }
  .features { grid-template-columns: 1fr 1fr; }
  .nav-links { display: none; }
  .nav-actions { margin-left: auto; }
}
@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  .nav-inner { height: 64px; }
  .hero { padding: 40px 0 72px; }
  .br-desk, .lead br, .card-desc br, .section-aside br, .section-text br { display: none; }
  .lead { font-size: 16px; }
  .section { padding: 76px 0; }
  .section-head { flex-direction: column; align-items: flex-start; }
  .section-aside { text-align: left; }
  .features { grid-template-columns: 1fr; }
  .card { padding: 28px 20px 24px; }
  .flow { grid-template-columns: 1fr; justify-items: center; gap: 10px; }
  .pipe { width: 1px; height: 18px; min-width: 0; }
  .pipe i { display: none; }
  .fan { grid-auto-flow: column; }
  .strip ul { gap: 10px 20px; font-size: 11px; }
  .strip .spark { display: none; }
  .player-bar, .player-sub, .player-controls, .source { padding-left: 14px; padding-right: 14px; }
  .chips { padding: 0 14px 16px; }
  .screen { margin: 0 14px; }
  .mini { display: none; }
  .nav .btn-sm { padding: 0 12px; font-size: 13px; }
  .footer-links { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}

/* 격자 칸이 코드 블록 너비만큼 늘어나지 않도록 */
.hero-grid > *, .split-grid > *, .cards > * { min-width: 0; }
