:root {
  --bg-0: #0b0f14;
  --bg-1: #121821;
  --bg-2: #19212d;
  --fg-1: #eef2f6;
  --fg-2: #9aa7b8;
  --line: #273140;
  --accent: #d9503a;
  --accent-fg: #f07662;
  --accent-soft: rgba(217, 80, 58, 0.14);
  --ok: #3fb950;
  --warn: #d29922;
  --sheet: #ffffff;
  --font-sans: "Pretendard Variable", Pretendard, system-ui, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
  --font-mono: ui-monospace, Consolas, monospace;
  --r-sm: 6px;
  --r-md: 10px;
  --t-fast: 180ms;
  --t-med: 220ms;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--bg-0);
  color: var(--fg-1);
  font: 15px/1.65 var(--font-sans);
  word-break: keep-all;
  overflow-wrap: break-word;
  overflow-x: clip;
}

a {
  color: inherit;
  text-underline-offset: 3px;
  text-decoration-color: var(--line);
}

a:hover {
  color: var(--accent-fg);
  text-decoration-color: var(--accent-fg);
}

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

code,
pre,
.cmd,
.metric-value,
.metric-delta,
.deck-counter,
.version-pill,
.step-num {
  font-variant-numeric: tabular-nums;
}

code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--bg-2);
  color: var(--fg-1);
  border: 1px solid var(--line);
  padding: 1px 6px;
  border-radius: var(--r-sm);
  white-space: nowrap;
}

pre {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  color: var(--fg-1);
  overflow-x: auto;
  max-width: 100%;
}

pre code {
  border: 0;
  background: transparent;
  padding: 0;
  font-size: inherit;
  white-space: pre;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  background: var(--bg-2);
  color: var(--fg-1);
  border: 1px solid var(--accent);
  padding: 8px 16px;
  border-radius: var(--r-sm);
  z-index: 200;
}

.skip-link:focus {
  left: 16px;
}

.wrap {
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */
.top-bar {
  position: sticky;
  top: 0;
  z-index: 90;
  background: rgba(11, 15, 20, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.top-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 56px;
  padding-top: 8px;
  padding-bottom: 8px;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.01em;
}

.brand img {
  display: block;
  width: 28px;
  height: auto;
  border-radius: var(--r-sm);
}

.version-pill {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-fg);
  background: var(--accent-soft);
  border: 1px solid rgba(217, 80, 58, 0.4);
  padding: 2px 8px;
  border-radius: var(--r-sm);
}

.top-nav {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 14px;
  color: var(--fg-2);
}

.top-nav a {
  text-decoration: none;
  padding: 4px 2px;
}

.top-nav a:hover {
  color: var(--fg-1);
}

.top-nav .nav-ext {
  color: var(--fg-1);
  border: 1px solid var(--line);
  background: var(--bg-1);
  padding: 4px 10px;
  border-radius: var(--r-sm);
}

.top-nav .nav-ext:hover {
  border-color: var(--accent);
}

/* Hero */
.hero {
  padding: 48px 0 56px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 40px;
  align-items: center;
}

.hero-copy,
.hero-deck-col {
  min-width: 0;
}

.kicker {
  margin: 0 0 12px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-fg);
  letter-spacing: 0.01em;
}

h1 {
  margin: 0 0 16px;
  font-size: clamp(28px, 3.2vw, 40px);
  line-height: 1.24;
  letter-spacing: -0.025em;
  color: var(--fg-1);
}

.lead {
  margin: 0 0 24px;
  font-size: 16px;
  line-height: 1.7;
  color: var(--fg-2);
}

/* Install Tabs */
.install-box {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
}

.tablist-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 12px 0 4px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-2);
}

.tablist {
  position: relative;
  display: flex;
  align-items: stretch;
  gap: 4px;
  min-width: 0;
  overflow-x: auto;
}

.tab-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--fg-2);
  font: 600 13px/1 var(--font-sans);
  padding: 12px 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: color var(--t-fast) var(--ease);
}

.tab-btn:hover,
.tab-btn[aria-selected="true"] {
  color: var(--fg-1);
}

.tab-indicator {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  width: 72px;
  background: var(--accent);
  transform: translateX(0);
  transition: transform var(--t-fast) var(--ease), width var(--t-fast) var(--ease);
  pointer-events: none;
}

.copy-btn {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--bg-1);
  color: var(--fg-1);
  font: 600 12px/1 var(--font-sans);
  padding: 7px 12px;
  border-radius: var(--r-sm);
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease);
}

.copy-btn:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.tab-panels {
  padding: 16px;
}

.tab-panel pre {
  background: var(--bg-0);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 12px 14px;
}

.install-note {
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--fg-2);
}

.sr-status {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Hero 3-Sheet A4 Deck */
.deck-shell {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 16px;
}

.deck-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1.08;
  margin: 0 auto;
  overflow: hidden;
  border-radius: var(--r-sm);
}

.deck-card {
  appearance: none;
  position: absolute;
  top: 4%;
  left: 6%;
  width: 66%;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--sheet);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
  cursor: pointer;
  transform-origin: center center;
  transition: transform 200ms var(--ease), opacity 200ms var(--ease), border-color 200ms var(--ease);
}

.deck-card img {
  display: block;
  width: 100%;
  height: auto;
}

.deck-card[data-pos="0"] {
  z-index: 30;
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
  border-color: var(--accent);
}

.deck-card[data-pos="1"] {
  z-index: 20;
  opacity: 0.9;
  transform: translate3d(20%, 3%, 0) scale(0.93);
}

.deck-card[data-pos="2"] {
  z-index: 10;
  opacity: 0.76;
  transform: translate3d(38%, 6%, 0) scale(0.86);
}

.deck-card:hover:not([data-pos="0"]) {
  opacity: 0.96;
}

.deck-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}

.deck-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.deck-label {
  font-weight: 600;
  font-size: 14px;
  color: var(--fg-1);
}

.deck-counter {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg-2);
}

.deck-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.deck-nav-btn {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--fg-1);
  font: 600 12px/1 var(--font-sans);
  padding: 7px 10px;
  border-radius: var(--r-sm);
  cursor: pointer;
}

.deck-nav-btn:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.deck-dots {
  display: flex;
  align-items: center;
  gap: 6px;
}

.deck-dot {
  appearance: none;
  width: 8px;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: 99px;
  background: var(--line);
  cursor: pointer;
  transition: width var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease);
}

.deck-dot.is-active {
  width: 20px;
  background: var(--accent);
}

/* Sections */
.section {
  padding: 48px 0;
  border-top: 1px solid var(--line);
}

.section-head {
  margin-bottom: 24px;
}

h2 {
  margin: 0 0 6px;
  font-size: 22px;
  line-height: 1.3;
  letter-spacing: -0.015em;
  color: var(--fg-1);
}

.section-sub {
  margin: 0;
  font-size: 14px;
  color: var(--fg-2);
}

/* Telemetry & Benchmarks */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.metric-card {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.metric-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.metric-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--fg-2);
}

.metric-delta {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
}

.metric-delta.ok {
  color: var(--ok);
}

.metric-delta.accent {
  color: var(--accent-fg);
}

.metric-value {
  font-family: var(--font-mono);
  font-size: 17px;
  font-weight: 700;
  color: var(--fg-1);
}

.bar-track {
  width: 100%;
  height: 6px;
  background: var(--bg-0);
  border: 1px solid var(--line);
  border-radius: 99px;
  overflow: hidden;
}

.bar-fill {
  width: var(--fill-pct, 100%);
  height: 100%;
  border-radius: 99px;
  transform-origin: left center;
  transform: scaleX(1);
}

.bar-fill.is-ok {
  background: var(--ok);
}

.bar-fill.is-accent {
  background: var(--accent);
}

html.js-motion .bar-fill:not(.is-settled) {
  transform: scaleX(0);
}

html.js-motion .bar-fill.is-settled {
  transform: scaleX(1);
  transition: transform 220ms var(--ease);
}

.metric-foot {
  margin: 0;
  font-size: 12px;
  color: var(--fg-2);
}

/* Capabilities */
.caps-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.cap-card {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cap-wide {
  grid-column: 1 / -1;
}

.cap-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.cap-card h3 {
  margin: 0;
  font-size: 16px;
  color: var(--fg-1);
}

.tag-pill {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-fg);
  background: var(--accent-soft);
  border: 1px solid rgba(217, 80, 58, 0.35);
  padding: 2px 7px;
  border-radius: var(--r-sm);
}

.cap-card p {
  margin: 0;
  font-size: 14px;
  color: var(--fg-2);
}

.cmd {
  margin-top: auto;
  padding-top: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg-1);
}

/* Examples Gallery (7 cards) */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.example-card {
  appearance: none;
  text-align: left;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  cursor: pointer;
  transition: border-color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}

.example-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.sheet-frame {
  display: block;
  width: 100%;
  background: var(--sheet);
  border: 1px solid var(--line);
  border-radius: 2px;
  overflow: hidden;
}

.sheet-frame img {
  display: block;
  width: 100%;
  height: auto;
}

.example-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.example-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--fg-1);
}

.example-file {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg-2);
}

/* Workflow Steps */
.workflow-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.workflow-step {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 16px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  min-width: 0;
}

.step-num {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-fg);
  background: var(--accent-soft);
  border: 1px solid rgba(217, 80, 58, 0.35);
  padding: 4px 8px;
  border-radius: var(--r-sm);
  flex-shrink: 0;
}

.step-body {
  min-width: 0;
  flex: 1;
}

.step-body h3 {
  margin: 0 0 6px;
  font-size: 15px;
  color: var(--fg-1);
}

.step-body p {
  margin: 0 0 10px;
  font-size: 14px;
  color: var(--fg-2);
}

.step-body pre {
  background: var(--bg-0);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  font-size: 12.5px;
}

/* Requirements Table */
.table-wrap {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th {
  font-weight: 600;
  color: var(--fg-1);
  background: var(--bg-2);
}

tbody tr:last-child td {
  border-bottom: 0;
}

td {
  color: var(--fg-2);
}

/* Limits & License */
.two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 32px;
}

.two-col > * {
  min-width: 0;
}

.bullet-list {
  margin: 12px 0 0;
  padding-left: 20px;
  color: var(--fg-2);
}

.bullet-list li {
  margin: 6px 0;
}

.note {
  margin: 12px 0 0;
  font-size: 13px;
  color: var(--fg-2);
}

.en-copy {
  margin: 8px 0 0;
  color: var(--fg-2);
  font-size: 15px;
  line-height: 1.7;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 28px 0 40px;
  font-size: 13px;
  color: var(--fg-2);
}

.footer-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Modal Lightbox */
.modal {
  margin: auto;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--bg-1);
  color: var(--fg-1);
  width: min(760px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.72);
}

.modal::backdrop {
  background: rgba(11, 15, 20, 0.82);
}

.modal-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px;
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.modal-head h2 {
  margin: 0 0 4px;
  font-size: 18px;
}

.modal-desc {
  margin: 0;
  font-size: 13px;
  color: var(--fg-2);
}

.modal-close {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--fg-1);
  font: 600 13px/1 var(--font-sans);
  padding: 8px 12px;
  border-radius: var(--r-sm);
  cursor: pointer;
  flex-shrink: 0;
}

.modal-close:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.modal-preview {
  background: var(--bg-0);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 12px;
  display: flex;
  justify-content: center;
  overflow: auto;
  max-height: 62vh;
}

.modal-preview img {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 58vh;
  height: auto;
  background: var(--sheet);
  border: 1px solid var(--line);
}

.modal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.modal-ext {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--accent);
  background: var(--accent-soft);
  color: var(--fg-1);
  text-decoration: none;
  font-weight: 600;
  font-size: 13px;
  padding: 8px 14px;
  border-radius: var(--r-sm);
}

.modal-ext:hover {
  background: var(--accent);
  color: #ffffff;
}

/* One-shot Scroll Reveal */
html.js-motion [data-reveal] {
  opacity: 0;
  transform: translate3d(0, 10px, 0);
  transition: opacity var(--t-med) var(--ease), transform var(--t-med) var(--ease);
  transition-delay: var(--reveal-delay, 0ms);
}

html.js-motion [data-reveal].is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

html.is-flat [data-reveal],
html.is-flat .bar-fill {
  opacity: 1 !important;
  transform: none !important;
  transition: none !important;
}

html.is-flat .bar-fill {
  transform: scaleX(1) !important;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
  }

  .bar-fill {
    transform: scaleX(1) !important;
  }
}

/* Responsive Breakpoints (1440 / 1280 / 390) */
@media (max-width: 1080px) {
  .metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 820px) {
  .hero-grid,
  .caps-grid,
  .workflow-list,
  .two-col {
    grid-template-columns: 1fr;
  }

  .hero {
    padding: 32px 0 40px;
  }

  .hero-grid {
    gap: 28px;
  }

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

@media (max-width: 520px) {
  .wrap {
    padding: 0 16px;
  }

  .metrics-grid {
    grid-template-columns: 1fr;
  }

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

  .top-nav {
    gap: 10px;
    font-size: 13px;
  }

  .deck-stage {
    aspect-ratio: 1 / 1.15;
  }

  pre {
    font-size: 12px;
    padding: 10px 12px;
  }

  th,
  td {
    padding: 10px 12px;
  }
}
