/* Palette (2026-09-01): Roaster Flame / Warm Amber / Deep Espresso, chosen
   by the user over the three AI-neutral-avoiding directions that were
   pitched (see the "roastlink-palettes" design artifact) -- deliberately
   dark-first as the site's one fixed look (no light/dark toggle, that's a
   separate later TODO), replacing the earlier cream+sienna palette that
   read as generically AI-generated. */
:root {
  --color-bg: #121212;           /* Deep Espresso */
  --color-surface: #1e1e1e;      /* Carbon Grey -- code blocks, cards, setup-guide areas */
  --color-text: #e0e0e0;         /* Soft Chalk */
  --color-text-muted: #9a9a9a;
  --color-accent: #ff6b35;       /* Roaster Flame -- primary buttons, chart/link accents */
  --color-accent-hover: #ff8659;
  --color-secondary: #ffb703;    /* Warm Amber -- status tags (Beta badge, version, live status) */
  --color-warning: #ff5449;
  --color-warning-bg: rgba(255, 84, 73, 0.12);
  --color-border: #2e2e2e;
  --max-width: 880px;
  /* Name the OS's own CJK font first: relying on whatever Pretendard/Noto
     build a visitor happens to have installed gave unpredictable weights. */
  --font-body: -apple-system, "Segoe UI", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Courier New", "Malgun Gothic", monospace;
}

/* Malgun Gothic lacks many Chinese characters, so zh pages get their own. */
:root:lang(zh) {
  --font-body: -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Courier New", "Microsoft YaHei", monospace;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  /* .hero-screenshot intentionally bleeds past .page-content on wide
     screens; on very narrow ones the bleed can exceed the viewport, so
     clip it here rather than let the whole page gain a horizontal
     scrollbar over a few px of image overflow. */
  overflow-x: hidden;
  font-family: var(--font-body);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
}

/* Form controls don't inherit the page font by default. */
button,
input,
textarea {
  font-family: inherit;
}

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

.site-header {
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
}
.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}
.brand {
  text-decoration: none;
  color: var(--color-accent);
  font-weight: 700;
  font-size: 1.25rem;
}
.main-nav {
  display: flex;
  gap: 16px;
  flex: 1;
  flex-wrap: wrap;
}
.main-nav a {
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: 0.95rem;
}
.main-nav a.active,
.main-nav a:hover {
  color: var(--color-accent);
}
.lang-switch {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  white-space: nowrap;
}
.lang-switch a {
  color: var(--color-text-muted);
  text-decoration: none;
}
.lang-switch a.active {
  color: var(--color-accent);
  font-weight: 600;
}

.page-content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 40px 20px;
  min-height: 60vh;
}
.page-content h1 {
  margin-top: 0;
}
.placeholder {
  color: var(--color-text-muted);
  font-style: italic;
}

.site-footer {
  border-top: 1px solid var(--color-border);
  padding: 20px;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.85rem;
}

.btn {
  display: inline-block;
  padding: 10px 20px;
  background: var(--color-accent);
  color: #fff;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
}
.btn:hover {
  background: var(--color-accent-hover);
  color: #fff;
}
.btn-secondary {
  background: transparent;
  color: var(--color-accent);
  border: 1px solid var(--color-accent);
}
.btn-secondary:hover {
  background: var(--color-surface);
  color: var(--color-accent-hover);
  border-color: var(--color-accent-hover);
}

/* Content typography */
.page-content h2 {
  margin-top: 2.2em;
  padding-top: 0.4em;
  border-top: 1px solid var(--color-border);
}
.page-content code {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.9em;
}
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  margin-left: 8px;
  vertical-align: middle;
}
.badge-beta {
  background: rgba(255, 183, 3, 0.14);
  border-color: rgba(255, 183, 3, 0.4);
  color: var(--color-secondary);
}

/* Step-number badge (guide page headings only, e.g. "1단계"/"Step 1"/"第1步") */
.step-badge {
  display: inline-block;
  background: var(--color-accent);
  color: #fff;
  padding: 2px 12px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 700;
  margin-right: 10px;
  vertical-align: middle;
}

.download-count {
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

/* Callout boxes */
.callout {
  border-left: 4px solid var(--color-accent);
  background: var(--color-surface);
  padding: 12px 16px;
  margin: 20px 0;
  border-radius: 4px;
}
.callout strong {
  color: var(--color-accent);
}
.callout-warning {
  border-left-color: var(--color-warning);
  background: var(--color-warning-bg);
}
.callout-warning strong {
  color: var(--color-warning);
}

/* Hero (home page) */
.hero {
  text-align: center;
  padding: 32px 0 48px;
}
.hero h1 {
  font-size: 2.1rem;
  margin-bottom: 8px;
}
.hero p.tagline {
  color: var(--color-text-muted);
  font-size: 1.1rem;
  margin-top: 0;
}
.hero .actions {
  margin-top: 24px;
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
.hero-screenshot {
  /* ~1.2x the feature-list width, bled symmetrically past .page-content.
     Width and margin are both percentages of the same containing block,
     which keeps the bleed exactly symmetric -- a vw-based version was
     used before, but 100vw includes the scrollbar width in most browsers,
     which made the image sit visibly off-center. */
  width: 120%;
  margin: 8px 0 32px -10%;
}
.hero-screenshot img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
  border: 1px solid var(--color-border);
}
.feature-list {
  list-style: none;
  padding: 0;
  margin: 32px 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}
.feature-list li {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 16px;
}
.feature-list li strong {
  display: block;
  margin-bottom: 4px;
}

/* Guide table of contents / steps */
.guide-toc {
  list-style: none;
  padding: 0;
}
.guide-toc li {
  margin-bottom: 10px;
}
.guide-toc a {
  font-size: 1.05rem;
  text-decoration: none;
  font-weight: 600;
}
.guide-toc p {
  margin: 2px 0 0;
  color: var(--color-text-muted);
  font-size: 0.9rem;
}
.step-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 40px;
  padding-top: 16px;
  border-top: 1px solid var(--color-border);
}

/* Command tables (guide pages) */
.cmd-table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
}
.cmd-table th,
.cmd-table td {
  border: 1px solid var(--color-border);
  padding: 8px 12px;
  text-align: left;
  font-size: 0.92rem;
}
.cmd-table th {
  background: var(--color-surface);
}

/* FAQ -- numbered, boxed items (no emoji; counter-based numbering works
   the same regardless of page language, so content fragments never need
   to hardcode a number). */
.faq-list {
  counter-reset: faq-counter;
}
.faq-item {
  counter-increment: faq-counter;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface);
  padding: 16px 20px;
  margin-bottom: 16px;
}
.faq-item h3 {
  margin: 0 0 6px;
}
.faq-item h3::before {
  content: counter(faq-counter) ". ";
  color: var(--color-accent);
  font-weight: 700;
}
.faq-item p {
  margin: 0;
}

/* Guide page: sticky, scroll-spied table of contents (Notion-style) */
.guide-layout {
  display: flex;
  gap: 40px;
  align-items: flex-start;
}
.guide-body {
  flex: 1;
  min-width: 0;
}
.guide-body section {
  padding-top: 8px;
  scroll-margin-top: 20px;
}
.guide-toc-sticky {
  position: sticky;
  top: 20px;
  width: 190px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.88rem;
}
.guide-toc-sticky a {
  color: var(--color-text-muted);
  text-decoration: none;
  padding: 5px 0 5px 12px;
  border-left: 2px solid var(--color-border);
}
.guide-toc-sticky a.active {
  color: var(--color-accent);
  border-left-color: var(--color-accent);
  font-weight: 600;
}
@media (max-width: 900px) {
  .guide-toc-sticky {
    display: none;
  }
}

/* Feedback widget -- fixed, always visible on every page.
   Sized ~1.2x the original box (width/padding/font-size), plus a taller
   textarea (5 rows, not 3) since the Korean placeholder sentence was
   long enough to need internal scrolling to read at the old size. */
.feedback-widget {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 320px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 18px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  z-index: 1000;
}
.feedback-form label {
  display: block;
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 10px;
}
.feedback-form textarea {
  width: 100%;
  resize: vertical;
  font-family: inherit;
  font-size: 0.95rem;
  padding: 10px;
  background: var(--color-bg);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  margin-bottom: 10px;
}
.feedback-form textarea::placeholder {
  color: var(--color-text-muted);
}
.feedback-form .btn {
  width: 100%;
  text-align: center;
  padding: 10px 16px;
  font-size: 1rem;
}
.feedback-status {
  margin: 8px 0 0;
  font-size: 0.88rem;
  color: var(--color-text-muted);
}
@media (max-width: 640px) {
  .feedback-widget {
    width: calc(100% - 32px);
    right: 16px;
    bottom: 16px;
  }
}
