/* ========================================
   Supermaster — Shared Styles
   Pure CSS, no dependencies
   ======================================== */

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --stone-50: #fafaf9;
  --stone-100: #f5f5f4;
  --stone-200: #e7e5e4;
  --stone-300: #d6d3d1;
  --stone-400: #a8a29e;
  --stone-500: #78716c;
  --stone-600: #57534e;
  --stone-700: #44403c;
  --stone-800: #292524;
  --stone-900: #1c1917;

  --amber-400: #fbbf24;
  --amber-500: #f59e0b;
  --amber-600: #d97706;

  --emerald-400: #34d399;
  --emerald-500: #10b981;
  --emerald-600: #059669;

  --bg: var(--stone-50);
  --bg-card: var(--stone-100);
  --bg-code: var(--stone-100);
  --text: var(--stone-900);
  --text-secondary: var(--stone-600);
  --text-tertiary: var(--stone-500);
  --border: var(--stone-200);
  --accent: var(--amber-500);
  --accent-hover: var(--amber-600);
  --success: var(--emerald-500);

  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --mono: 'SF Mono', SFMono-Regular, ui-monospace, Menlo, Consolas, monospace;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.04);
  --shadow-md: 0 2px 8px rgba(0,0,0,0.06);
  --radius-sm: 8px;
  --radius-md: 12px;
  --transition: 150ms ease;
  --max-text: 720px;
  --max-wide: 960px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c0a09;
    --bg-card: #1c1917;
    --bg-code: #1c1917;
    --text: #fafaf9;
    --text-secondary: #a8a29e;
    --text-tertiary: #78716c;
    --border: #292524;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.2);
    --shadow-md: 0 2px 8px rgba(0,0,0,0.3);
  }
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

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

/* --- Typography --- */
h1, h2, h3, h4 {
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--text);
}

h1 { font-size: 2rem; font-weight: 700; }
h2 { font-size: 1.5rem; font-weight: 600; }
h3 { font-size: 1.125rem; font-weight: 600; }

@media (min-width: 640px) {
  h1 { font-size: 2.5rem; }
  h2 { font-size: 1.75rem; }
}

@media (min-width: 1024px) {
  h1 { font-size: 3rem; }
  h2 { font-size: 2rem; }
}

p {
  color: var(--text-secondary);
}

/* --- Layout --- */
.container {
  width: 100%;
  max-width: var(--max-text);
  margin: 0 auto;
  padding: 0 20px;
}

.container--wide {
  max-width: var(--max-wide);
}

/* --- Navigation --- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.nav__inner {
  max-width: var(--max-wide);
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

.nav__brand {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.nav__brand:hover {
  color: var(--text);
}

.nav__links {
  display: flex;
  gap: 24px;
  list-style: none;
}

.nav__links a {
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 500;
  transition: color var(--transition);
}

.nav__links a:hover,
.nav__links a[aria-current="page"] {
  color: var(--text);
}

/* Mobile nav */
.nav__toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--text);
}

.nav__toggle svg {
  width: 20px;
  height: 20px;
}

@media (max-width: 639px) {
  .nav__toggle { display: block; }
  .nav__links {
    display: none;
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 12px 20px 16px;
    gap: 12px;
  }
  .nav__links.open { display: flex; }
}

/* --- Hero --- */
.hero {
  padding: 80px 20px 64px;
  text-align: center;
}

@media (min-width: 640px) {
  .hero { padding: 100px 20px 80px; }
}

.hero__badge {
  display: inline-block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-tertiary);
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 4px 12px;
  border-radius: 100px;
  margin-bottom: 24px;
}

.hero h1 {
  max-width: 600px;
  margin: 0 auto 16px;
}

.hero__subtitle {
  font-size: 1.0625rem;
  color: var(--text-secondary);
  max-width: 520px;
  margin: 0 auto 40px;
  line-height: 1.65;
}

@media (min-width: 640px) {
  .hero__subtitle { font-size: 1.125rem; }
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font);
  font-size: 0.9375rem;
  font-weight: 600;
  padding: 12px 28px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}

.btn--primary {
  background: var(--accent);
  color: var(--stone-900);
}

.btn--primary:hover {
  background: var(--accent-hover);
  color: var(--stone-900);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn--secondary {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.btn--secondary:hover {
  background: var(--bg-card);
  color: var(--text);
  border-color: var(--stone-300);
}

.hero__actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* --- Sections --- */
.section {
  padding: 64px 20px;
}

@media (min-width: 640px) {
  .section { padding: 80px 20px; }
}

.section__header {
  text-align: center;
  margin-bottom: 48px;
}

.section__header p {
  margin-top: 8px;
  font-size: 1rem;
}

/* --- Steps (How it works) --- */
.steps {
  display: flex;
  flex-direction: column;
  gap: 40px;
  max-width: var(--max-text);
  margin: 0 auto;
}

.step {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.step__number {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: var(--stone-900);
  font-size: 0.875rem;
  font-weight: 700;
  border-radius: 50%;
}

.step__content h3 {
  margin-bottom: 4px;
}

.step__content p {
  font-size: 0.9375rem;
  color: var(--text-secondary);
}

/* --- Features --- */
.features {
  display: grid;
  gap: 16px;
  max-width: var(--max-wide);
  margin: 0 auto;
}

@media (min-width: 640px) {
  .features { grid-template-columns: 1fr 1fr; }
}

.feature {
  padding: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.feature__label {
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-tertiary);
  margin-bottom: 8px;
}

.feature h3 {
  margin-bottom: 8px;
}

.feature p {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

/* --- Code blocks --- */
.code-block {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  overflow-x: auto;
  margin: 12px 0;
}

.code-block code {
  font-family: var(--mono);
  font-size: 0.875rem;
  line-height: 1.7;
  color: var(--text);
  white-space: pre;
}

.code-block--sm code {
  font-size: 0.8125rem;
}

/* --- Cards --- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 28px;
  box-shadow: var(--shadow-sm);
}

.card + .card {
  margin-top: 16px;
}

.card h3 {
  margin-bottom: 12px;
}

/* --- Timeline --- */
.timeline {
  position: relative;
  max-width: var(--max-text);
  margin: 0 auto;
  padding-left: 32px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 11px;
  top: 4px;
  bottom: 4px;
  width: 2px;
  background: var(--border);
}

.timeline__item {
  position: relative;
  padding-bottom: 40px;
}

.timeline__item:last-child {
  padding-bottom: 0;
}

.timeline__dot {
  position: absolute;
  left: -32px;
  top: 4px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--border);
  z-index: 1;
}

.timeline__dot span {
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--text-tertiary);
}

.timeline__item.active .timeline__dot {
  border-color: var(--accent);
  background: var(--accent);
}

.timeline__item.active .timeline__dot span {
  color: var(--stone-900);
}

.timeline__content h3 {
  margin-bottom: 4px;
}

.timeline__content p {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

.timeline__tag {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-tertiary);
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: 4px;
  margin-top: 8px;
}

/* --- Ordered instruction list --- */
.instructions {
  list-style: none;
  counter-reset: instruction;
}

.instructions li {
  counter-increment: instruction;
  padding: 8px 0;
  padding-left: 28px;
  position: relative;
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

.instructions li::before {
  content: counter(instruction) ".";
  position: absolute;
  left: 0;
  font-weight: 600;
  color: var(--text-tertiary);
  font-size: 0.875rem;
}

.instructions code {
  font-family: var(--mono);
  font-size: 0.8125rem;
  background: var(--bg-code);
  border: 1px solid var(--border);
  padding: 1px 6px;
  border-radius: 4px;
}

/* --- Page header --- */
.page-header {
  padding: 48px 20px 40px;
  text-align: center;
}

@media (min-width: 640px) {
  .page-header { padding: 64px 20px 48px; }
}

.page-header p {
  margin-top: 8px;
  font-size: 1.0625rem;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}

/* --- CTA banner --- */
.cta-banner {
  text-align: center;
  padding: 64px 20px;
}

.cta-banner h2 {
  margin-bottom: 8px;
}

.cta-banner p {
  margin-bottom: 28px;
  font-size: 1rem;
}

/* --- Footer --- */
.footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding: 24px 20px;
  text-align: center;
}

.footer__inner {
  max-width: var(--max-wide);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 0.8125rem;
  color: var(--text-tertiary);
}

.footer__sep {
  color: var(--stone-300);
}

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

.footer a:hover {
  color: var(--text);
}

/* --- Divider --- */
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0;
}

/* --- Utilities --- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

.mt-4 { margin-top: 16px; }
.mt-8 { margin-top: 32px; }
.mb-4 { margin-bottom: 16px; }
.mb-8 { margin-bottom: 32px; }
