/*
 * Celestigram.app Showcase Stylesheet
 *
 * Dracula palette and Markdown styles: see licenses/dracula-license.txt (MIT).
 *   dracula/obsidian @ 778162814d4c4abe18d951008907ac1fc8b7d89f
 * Saffron Ink palette and Markdown styles: see licenses/saffron-ink-license.txt (MIT).
 */

/* ── Theme Tokens ─────────────────────────────────────────────────────────── */

:root,
:root.saffron-ink {
  --background: #eddfb7;
  --foreground: #000000;
  --heading-color: #004a9f;
  --surface: #fff8e7;
  --muted: #e5d5a7;
  --muted-foreground: #4f5a63;
  --primary: #8a6d24;
  --primary-foreground: #ffffff;
  --accent: #decc96;
  --border: #b6a36d;
  --subtle: #e5d5a7;
  --highlight: #126b2d;
  --hover-accent: #d73a49;
  --selection-bg: #ffd400;
  --selection-fg: #000000;
  --frame-shadow: 0 18px 44px rgba(68, 52, 16, 0.14), 0 2px 8px rgba(68, 52, 16, 0.08);
  --radius-control: 0px;
  --radius-card: 2px;
  color-scheme: light;
}

:root.dracula {
  --background: #282a36;
  --foreground: #f8f8f2;
  --heading-color: #bd93f9;
  --surface: #20212b;
  --muted: #343746;
  --muted-foreground: #b0b8d1;
  --primary: #50fa7b;
  --primary-foreground: #282a36;
  --accent: #44475a;
  --border: #626780;
  --subtle: #20212b;
  --highlight: #50fa7b;
  --hover-accent: #ff79c6;
  --selection-bg: #44475a;
  --selection-fg: #f8f8f2;
  --frame-shadow: 0 22px 54px rgba(0, 0, 0, 0.48), 0 4px 12px rgba(0, 0, 0, 0.3);
  --radius-control: 6px;
  --radius-card: 10px;
  color-scheme: dark;
}

/* ── Reset & Base ─────────────────────────────────────────────────────────── */

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

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

body {
  margin: 0;
  padding: 0;
  background-color: var(--background);
  color: var(--foreground);
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard Variable",
    "Noto Sans KR", "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.72;
  word-break: keep-all;
  overflow-wrap: break-word;
  transition: background-color 0.2s ease, color 0.2s ease;
}

::selection {
  background: var(--selection-bg);
  color: var(--selection-fg);
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--heading-color);
  text-decoration: none;
}

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

code {
  font-family: "SFMono-Regular", ui-monospace, Menlo, Monaco, Consolas, monospace;
  font-size: 0.9em;
  padding: 0.12em 0.38em;
  background-color: var(--subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
}

/* ── Layout Container ─────────────────────────────────────────────────────── */

.container {
  width: 100%;
  max-width: 1120px;
  margin-inline: auto;
  padding-inline: 24px;
}

/* ── Header ───────────────────────────────────────────────────────────────── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background-color: var(--background);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  color: var(--foreground);
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  background-color: var(--primary);
  color: var(--primary-foreground);
  font-size: 0.85rem;
  font-weight: 800;
  border-radius: var(--radius-control);
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 22px;
  font-size: 0.92rem;
}

.header-nav a {
  color: var(--muted-foreground);
  font-weight: 500;
}

.header-nav a:hover {
  color: var(--foreground);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  background-color: var(--muted);
  color: var(--foreground);
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.theme-toggle:hover {
  background-color: var(--accent);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--heading-color);
  outline-offset: 2px;
}

.theme-swatch {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background-color: var(--primary);
  flex-shrink: 0;
}

/* ── Sections & Typography ────────────────────────────────────────────────── */

section {
  padding-block: 76px;
}

section + section {
  border-top: 1px solid var(--border);
}

.eyebrow {
  display: inline-block;
  margin-bottom: 12px;
  padding: 3px 10px;
  background-color: var(--muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  color: var(--muted-foreground);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin-top: 0;
  color: var(--heading-color);
  line-height: 1.3;
  letter-spacing: -0.015em;
}

h1 {
  font-size: clamp(2rem, 4.2vw, 3.1rem);
  font-weight: 800;
  margin-bottom: 18px;
}

h2 {
  font-size: clamp(1.5rem, 2.8vw, 2.1rem);
  font-weight: 700;
  margin-bottom: 14px;
}

h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 10px;
}

p {
  margin-top: 0;
  margin-bottom: 16px;
}

.lead {
  font-size: clamp(1.05rem, 1.8vw, 1.2rem);
  color: var(--muted-foreground);
  max-width: 720px;
}

/* ── Hero ─────────────────────────────────────────────────────────────────── */

.hero {
  padding-top: 72px;
  padding-bottom: 84px;
}

.hero-copy {
  max-width: 780px;
  margin-bottom: 40px;
}

.hero-points {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
  padding: 0;
  list-style: none;
}

.hero-points li {
  padding: 6px 12px;
  background-color: var(--muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  font-size: 0.88rem;
  font-weight: 500;
}

/* ── Screenshot Frame (Clean, No Duplicate Window Chrome) ─────────────────── */

.shot-frame {
  margin: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  overflow: hidden;
  background-color: var(--surface);
  box-shadow: var(--frame-shadow);
}

.shot-frame img {
  width: 100%;
  display: block;
}

.shot-caption {
  padding: 12px 16px;
  background-color: var(--muted);
  border-top: 1px solid var(--border);
  color: var(--muted-foreground);
  font-size: 0.86rem;
}

/* ── Principle Cards ──────────────────────────────────────────────────────── */

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-top: 32px;
}

.info-card {
  padding: 24px;
  background-color: var(--muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
}

.info-card p:last-child {
  margin-bottom: 0;
  color: var(--muted-foreground);
}

/* ── Feature Showcase Rows ────────────────────────────────────────────────── */

.feature-list {
  display: flex;
  flex-direction: column;
  gap: 64px;
  margin-top: 40px;
}

.feature-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr);
  gap: 36px;
  align-items: center;
}

.feature-row--reverse .feature-text {
  order: 2;
}

.feature-row--reverse .feature-media {
  order: 1;
}

.feature-bullets {
  margin: 16px 0 0;
  padding-left: 20px;
  color: var(--muted-foreground);
}

.feature-bullets li {
  margin-bottom: 8px;
}

.feature-bullets li::marker {
  color: var(--highlight);
}

/* ── Theme Experience Section ─────────────────────────────────────────────── */

.theme-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  gap: 36px;
  align-items: center;
  margin-top: 32px;
}

.theme-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 22px 0 24px;
}

.theme-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  background-color: var(--muted);
  color: var(--foreground);
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
}

.theme-pill[aria-pressed="true"] {
  background-color: var(--primary);
  color: var(--primary-foreground);
  border-color: var(--primary);
}

.theme-pill:focus-visible {
  outline: 2px solid var(--heading-color);
  outline-offset: 2px;
}

.swatch-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid currentColor;
}

.swatch-dot--saffron {
  background-color: #eddfb7;
}

.swatch-dot--dracula {
  background-color: #282a36;
}

/* ── Workflow Steps ───────────────────────────────────────────────────────── */

.workflow-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-top: 32px;
  counter-reset: step;
}

.workflow-step {
  padding: 24px;
  background-color: var(--muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
}

.step-num {
  display: inline-block;
  margin-bottom: 12px;
  font-family: "SFMono-Regular", ui-monospace, Menlo, monospace;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--highlight);
}

.workflow-step p:last-child {
  margin-bottom: 0;
  color: var(--muted-foreground);
}

/* ── Footer ───────────────────────────────────────────────────────────────── */

.site-footer {
  padding-block: 40px;
  border-top: 1px solid var(--border);
  color: var(--muted-foreground);
  font-size: 0.88rem;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
}

/* ── Responsive ───────────────────────────────────────────────────────────── */

@media (max-width: 960px) {
  .card-grid,
  .workflow-grid,
  .feature-row,
  .theme-panel {
    grid-template-columns: 1fr;
  }

  .feature-row--reverse .feature-text,
  .feature-row--reverse .feature-media {
    order: initial;
  }
}

@media (max-width: 640px) {
  .container {
    padding-inline: 16px;
  }

  .header-nav {
    display: none;
  }

  section {
    padding-block: 52px;
  }

  .hero {
    padding-top: 44px;
    padding-bottom: 56px;
  }

  .feature-list {
    gap: 44px;
  }
}
