/* FlowClone User Guide — styles
   Light theme matched to the desktop app's design tokens. */

:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --border: #e5e7eb;
  --primary: #3b82f6;
  --primary-dark: #1e3a8a;
  --primary-soft: rgba(59, 130, 246, 0.1);
  --text: #111827;
  --muted: #6b7280;
  --warning: #f59e0b;
  --warning-soft: rgba(245, 158, 11, 0.1);
  --danger: #ef4444;
  --danger-soft: rgba(239, 68, 68, 0.08);

  --radius-card: 16px;
  --radius-input: 10px;
  --shadow-soft: 0 8px 24px rgba(15, 23, 42, 0.08);
  --shadow-hero: 0 24px 60px rgba(30, 58, 138, 0.35);

  --sidebar-w: 248px;
  --content-max: 760px;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    monospace;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 24px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a:hover {
  text-decoration: underline;
}

code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--primary-soft);
  color: var(--primary-dark);
  padding: 0.12em 0.4em;
  border-radius: 6px;
}

/* ---------- Hero ---------- */

.hero {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  color: #fff;
  padding: 5rem 1.5rem 5.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at 50% -10%,
    rgba(255, 255, 255, 0.18),
    transparent 55%
  );
  pointer-events: none;
}

.hero__logo {
  width: 84px;
  height: 84px;
  border-radius: 20px;
  box-shadow: var(--shadow-hero);
  margin-bottom: 1.5rem;
}

.hero__title {
  font-size: clamp(2.25rem, 1.5rem + 3vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 0.5rem;
  line-height: 1.1;
}

.hero__tagline {
  font-size: clamp(1rem, 0.9rem + 0.5vw, 1.25rem);
  color: rgba(255, 255, 255, 0.85);
  margin: 0 0 2rem;
}

.hero__actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-input);
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 150ms ease, box-shadow 150ms ease,
    background-color 150ms ease;
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.btn--primary {
  background: #fff;
  color: var(--primary-dark);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}

.btn--primary:hover {
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.24);
}

.btn--ghost {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.4);
}

.btn--ghost:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* ---------- Layout ---------- */

.layout {
  max-width: calc(var(--sidebar-w) + var(--content-max) + 6rem);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  gap: 3rem;
  align-items: start;
}

/* ---------- Sidebar TOC ---------- */

.toc {
  position: sticky;
  top: 24px;
  margin-top: 3rem;
  padding: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-soft);
}

.toc__label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 0 0 0.75rem;
  font-weight: 700;
}

.toc__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.toc__link {
  display: block;
  padding: 0.4rem 0.65rem;
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
  border-left: 2px solid transparent;
  transition: background-color 150ms ease, color 150ms ease;
}

.toc__link:hover {
  background: var(--primary-soft);
  color: var(--primary-dark);
  text-decoration: none;
}

.toc__link.is-active {
  background: var(--primary-soft);
  color: var(--primary-dark);
  border-left-color: var(--primary);
  font-weight: 600;
}

/* ---------- Content ---------- */

.content {
  min-width: 0;
  padding: 3rem 0 4rem;
}

.section + .section {
  margin-top: 2rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-soft);
  padding: 2rem 2.25rem;
}

.section__num {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 0.35rem;
}

.content h2 {
  font-size: 1.6rem;
  font-weight: 750;
  letter-spacing: -0.01em;
  margin: 0 0 1rem;
  scroll-margin-top: 24px;
}

.content h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 1.75rem 0 0.75rem;
}

.content p {
  margin: 0 0 1rem;
}

.content ul,
.content ol {
  margin: 0 0 1rem;
  padding-left: 1.4rem;
}

.content li {
  margin-bottom: 0.4rem;
}

.content li::marker {
  color: var(--muted);
}

.intro {
  font-size: 1.05rem;
  color: var(--muted);
}

.screenshot {
  width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid var(--border);
  margin: 1.25rem 0;
  box-shadow: var(--shadow-soft);
}

/* ---------- Callouts ---------- */

.callout {
  border-radius: var(--radius-input);
  padding: 1rem 1.25rem;
  margin: 1.25rem 0;
  font-size: 0.95rem;
  border: 1px solid transparent;
}

.callout strong {
  font-weight: 700;
}

.callout--warning {
  background: var(--warning-soft);
  border-color: rgba(245, 158, 11, 0.35);
}

.callout--danger {
  background: var(--danger-soft);
  border-color: rgba(239, 68, 68, 0.35);
}

.callout--danger strong {
  color: var(--danger);
}

/* ---------- Table ---------- */

.table-wrap {
  overflow-x: auto;
  margin: 1.25rem 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
}

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.92rem;
}

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

th {
  background: var(--bg);
  font-weight: 700;
  white-space: nowrap;
}

tr:last-child td {
  border-bottom: none;
}

/* ---------- Footer ---------- */

.footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 2.5rem 1.5rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}

.footer__links {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.footer__links a {
  color: var(--text);
  font-weight: 500;
}

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
  .layout {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .toc {
    position: static;
    margin-top: 1.5rem;
    margin-bottom: 0;
  }

  .toc__list {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.4rem;
  }

  .toc__link {
    border-left: none;
    border: 1px solid var(--border);
  }

  .toc__link.is-active {
    border-color: var(--primary);
  }

  .content {
    padding-top: 1.5rem;
  }

  .card {
    padding: 1.5rem 1.25rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
