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

:root {
  --text: #37352f;
  --text-secondary: #6b7280;
  --bg: #ffffff;
  --code-bg: #f7f6f3;
  --border: #e5e5e5;
  --accent: #e16531;
  --accent-light: #fef3ee;
  --success: #0f766e;
  --success-light: #f0fdfa;
  --warn: #b45309;
  --warn-light: #fffbeb;
  --radius: 6px;
  --max-w: 720px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans SC", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

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

code {
  font-family: "SF Mono", "Fira Code", "Consolas", monospace;
  font-size: 0.875em;
  background: var(--code-bg);
  padding: 2px 6px;
  border-radius: 3px;
}

/* Nav */
nav {
  position: sticky;
  top: 0;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 100;
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text);
}
.logo:hover { text-decoration: none; }
.nav-link {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* Main */
main {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px 80px;
}

/* Hero */
.hero {
  padding: 64px 0 48px;
}
.tag {
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 12px;
}
h1 {
  font-size: 2.25rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}
.subtitle {
  font-size: 1.125rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Sections */
section { padding-top: 48px; }
h2 {
  font-size: 1.375rem;
  font-weight: 600;
  margin-bottom: 16px;
  letter-spacing: -0.01em;
}
h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 24px 0 8px;
}
section > p, .step-content > p {
  color: var(--text);
  margin-bottom: 12px;
}
ul {
  margin: 8px 0 16px 20px;
  color: var(--text);
}
li { margin-bottom: 4px; }

/* Steps */
.step {
  display: flex;
  gap: 24px;
  padding: 40px 0;
}
.step-number {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}
.step-content { flex: 1; min-width: 0; }

/* Code blocks */
.code-block {
  background: var(--code-bg);
  border-radius: var(--radius);
  margin: 12px 0 16px;
  overflow: hidden;
}
.code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 14px;
  font-size: 0.75rem;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
}
.copy-btn {
  font-size: 0.75rem;
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 10px;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.15s;
}
.copy-btn:hover {
  background: #fff;
  color: var(--text);
}
.code-block pre {
  padding: 14px;
  overflow-x: auto;
  font-size: 0.875rem;
  line-height: 1.6;
}
.code-block code {
  background: none;
  padding: 0;
  font-size: 0.875rem;
}
.code-output {
  border-left: 3px solid var(--border);
}
.code-output pre { color: var(--text-secondary); }
.code-comment { color: #9ca3af; }

/* Callout */
.callout {
  display: flex;
  gap: 12px;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--accent-light);
  margin: 16px 0;
  font-size: 0.9375rem;
}
.callout p { margin-bottom: 0; font-size: 0.9375rem; }
.callout-icon { font-size: 1.25rem; flex-shrink: 0; line-height: 1.5; }
.callout-warn { background: var(--warn-light); }
.callout-success { background: var(--success-light); }

/* Login flow */
.login-flow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0;
  flex-wrap: wrap;
}
.flow-item {
  flex: 1;
  min-width: 120px;
  text-align: center;
  padding: 20px 12px;
  background: var(--code-bg);
  border-radius: var(--radius);
}
.flow-icon { font-size: 1.5rem; margin-bottom: 8px; }
.flow-item p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 0;
}
.flow-arrow {
  color: var(--text-secondary);
  font-size: 1.25rem;
  flex-shrink: 0;
}

/* Details / Accordion */
details {
  border-bottom: 1px solid var(--border);
}
details:last-child { border-bottom: none; }
summary {
  padding: 16px 0;
  font-weight: 500;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
summary::before {
  content: "›";
  font-size: 1.25rem;
  color: var(--text-secondary);
  transition: transform 0.2s;
  display: inline-block;
  width: 16px;
}
details[open] summary::before { transform: rotate(90deg); }
summary::-webkit-details-marker { display: none; }
.details-content {
  padding: 0 0 20px 24px;
}
.details-content p { font-size: 0.9375rem; }

/* Footer */
footer {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 32px 24px;
  text-align: center;
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

/* Mobile */
@media (max-width: 640px) {
  h1 { font-size: 1.75rem; }
  .hero { padding: 40px 0 32px; }
  .step { flex-direction: column; gap: 12px; }
  .login-flow { flex-direction: column; }
  .flow-arrow { transform: rotate(90deg); }
}
