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

:root {
  --black: #0a0a0a;
  --white: #ffffff;
  --gray-50: #fafafa;
  --gray-100: #f5f5f5;
  --gray-200: #e5e5e5;
  --gray-400: #a3a3a3;
  --gray-500: #737373;
  --gray-600: #525252;
  --gray-700: #404040;
  --gray-800: #262626;

  --yellow: #f5e6a3;
  --purple: #d4c4e8;
  --green: #c8e6a0;
  --blue: #b8d4f0;
  --pink: #f0c4d4;

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", "Fira Code", "SF Mono", monospace;

  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 6px;

  --max-w: 1200px;
  --section-gap: 120px;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--gray-700);
  background: var(--gray-50);
}

a {
  color: inherit;
  text-decoration: none;
}

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

/* ── Typography ──────────────────────────────────────── */
h1, h2, h3, h4 {
  color: var(--black);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(2.8rem, 6vw, 4.5rem); }
h2 { font-size: clamp(2rem, 4vw, 3rem); }
h3 { font-size: 1.25rem; }
h4 { font-size: 1rem; font-weight: 600; }

p {
  max-width: 60ch;
}

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

section {
  padding: var(--section-gap) 0;
}

/* ── Navigation ──────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 250, 250, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--gray-200);
}

.nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.nav-logo {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--black);
  letter-spacing: -0.03em;
}

.nav-logo span {
  color: var(--gray-400);
  font-weight: 800;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
}

.nav-links a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--gray-600);
  transition: color 0.2s;
}

.nav-links a:hover {
  color: var(--black);
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border: 1.5px solid var(--gray-800);
  border-radius: 100px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--black);
  transition: all 0.2s;
}

.nav-cta:hover {
  background: var(--black);
  color: var(--white);
}

.nav-cta svg {
  width: 16px;
  height: 16px;
}

.mobile-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.mobile-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--black);
  margin: 5px 0;
  transition: 0.3s;
}

/* ── Hero ────────────────────────────────────────────── */
.hero {
  padding: 80px 0 100px;
  overflow: hidden;
}

.hero .container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.hero-text h1 {
  margin-bottom: 24px;
}

.hero-text p {
  font-size: 1.1rem;
  color: var(--gray-600);
  margin-bottom: 40px;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  gap: 12px;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  background: var(--black);
  color: var(--white);
  border: none;
  border-radius: 100px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font);
}

.btn-primary:hover {
  background: var(--gray-800);
  transform: translateY(-1px);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  background: transparent;
  color: var(--black);
  border: 1.5px solid var(--gray-200);
  border-radius: 100px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font);
}

.btn-secondary:hover {
  border-color: var(--gray-400);
}

/* Hero cards (right side) */
.hero-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.hero-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 28px;
  border: 1px solid var(--gray-200);
  transition: transform 0.3s, box-shadow 0.3s;
}

.hero-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.06);
}

.hero-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  font-size: 1.4rem;
}

.hero-card-icon.yellow { background: var(--yellow); }
.hero-card-icon.purple { background: var(--purple); }
.hero-card-icon.green { background: var(--green); }
.hero-card-icon.blue { background: var(--blue); }

.hero-card h3 {
  margin-bottom: 8px;
  font-size: 1.05rem;
}

.hero-card p {
  font-size: 0.85rem;
  color: var(--gray-500);
  line-height: 1.5;
}

/* ── Section Headers ─────────────────────────────────── */
.section-header {
  margin-bottom: 60px;
}

.section-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gray-600);
  margin-bottom: 20px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.section-header h2 {
  margin-bottom: 16px;
}

.section-header p {
  font-size: 1.05rem;
  color: var(--gray-500);
}

/* ── Steps ───────────────────────────────────────────── */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.steps-grid-2col {
  grid-template-columns: 1fr 1fr;
}

.step-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 32px;
  position: relative;
  transition: transform 0.3s, box-shadow 0.3s;
}

.step-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.05);
}

.step-number {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--black);
  margin-bottom: 20px;
}

.step-number.n1 { background: var(--yellow); }
.step-number.n2 { background: var(--purple); }
.step-number.n3 { background: var(--green); }
.step-number.n4 { background: var(--blue); }
.step-number.n5 { background: var(--pink); }
.step-number.n6 { background: var(--yellow); }

.step-card h3 {
  margin-bottom: 10px;
}

.step-card p {
  font-size: 0.9rem;
  color: var(--gray-500);
  line-height: 1.6;
}

/* ── Code Blocks ─────────────────────────────────────── */
.code-block {
  background: var(--gray-800);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin: 16px 0;
}

.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.code-dots {
  display: flex;
  gap: 6px;
}

.code-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.code-dots span:nth-child(1) { background: #ff5f57; }
.code-dots span:nth-child(2) { background: #febc2e; }
.code-dots span:nth-child(3) { background: #28c840; }

.code-label {
  font-size: 0.75rem;
  color: var(--gray-400);
  font-family: var(--mono);
}

.code-block pre {
  padding: 20px;
  overflow-x: auto;
}

.code-block code {
  font-family: var(--mono);
  font-size: 0.85rem;
  line-height: 1.7;
  color: #e5e5e5;
}

.code-comment { color: #6a737d; }
.code-string { color: #a5d6ff; }
.code-key { color: #d2a8ff; }
.code-value { color: #7ee787; }

/* ── Config Section ──────────────────────────────────── */
.config-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
}

.config-options {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.config-option {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 24px;
  transition: border-color 0.2s;
}

.config-option:hover {
  border-color: var(--gray-400);
}

.config-option h4 {
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.config-option p {
  font-size: 0.85rem;
  color: var(--gray-500);
}

.config-tag {
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 100px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.config-tag.required {
  background: #fee2e2;
  color: #dc2626;
}

.config-tag.optional {
  background: #e0f2fe;
  color: #0284c7;
}

/* ── Feature Cards (IG Auth) ────────────────────────── */
.auth-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.auth-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 32px;
  position: relative;
  overflow: hidden;
}

.auth-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
}

.auth-card.simple::before { background: var(--green); }
.auth-card.secure::before { background: var(--purple); }

.auth-card-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 16px;
}

.auth-card.simple .auth-card-badge {
  background: #dcfce7;
  color: #16a34a;
}

.auth-card.secure .auth-card-badge {
  background: #f3e8ff;
  color: #9333ea;
}

.auth-card h3 {
  margin-bottom: 10px;
}

.auth-card p {
  font-size: 0.9rem;
  color: var(--gray-500);
  margin-bottom: 16px;
}

/* ── Flow Diagram ────────────────────────────────────── */
.flow {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 48px;
}

.flow-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  flex-wrap: wrap;
}

.flow-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
}

.flow-icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
}

.flow-step span {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--gray-600);
}

.flow-arrow {
  font-size: 1.5rem;
  color: var(--gray-300);
  padding: 0 20px;
  margin-bottom: 20px;
}

/* ── Secrets Table ───────────────────────────────────── */
.table-wrapper {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  overflow: hidden;
}

.table-wrapper table {
  width: 100%;
  border-collapse: collapse;
}

.table-wrapper th {
  text-align: left;
  padding: 14px 24px;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gray-500);
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
}

.table-wrapper td {
  padding: 16px 24px;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--gray-100);
  color: var(--gray-600);
}

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

.table-wrapper code {
  font-family: var(--mono);
  font-size: 0.82rem;
  padding: 3px 8px;
  background: var(--gray-100);
  border-radius: 4px;
  color: var(--black);
  font-weight: 500;
}

/* ── Troubleshooting ─────────────────────────────────── */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.faq-item {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.faq-item summary {
  padding: 20px 24px;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--black);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.faq-item summary::after {
  content: "+";
  font-size: 1.2rem;
  color: var(--gray-400);
  transition: transform 0.2s;
}

.faq-item[open] summary::after {
  transform: rotate(45deg);
}

.faq-item .faq-body {
  padding: 0 24px 20px;
  font-size: 0.9rem;
  color: var(--gray-500);
  line-height: 1.7;
}

/* ── Footer ──────────────────────────────────────────── */
.footer {
  padding: 48px 0;
  border-top: 1px solid var(--gray-200);
}

.footer .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-text {
  font-size: 0.85rem;
  color: var(--gray-400);
}

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

.footer-links a {
  font-size: 0.85rem;
  color: var(--gray-500);
  transition: color 0.2s;
}

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

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 900px) {
  :root {
    --section-gap: 80px;
  }

  .hero .container {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .hero-cards {
    grid-template-columns: 1fr 1fr;
  }

  .config-layout {
    grid-template-columns: 1fr;
  }

  .auth-grid {
    grid-template-columns: 1fr;
  }

  .flow-steps {
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 0;
  }

  .flow-arrow {
    transform: none;
    padding: 0 12px;
    margin-bottom: 20px;
    font-size: 1.2rem;
  }

  .flow-icon {
    width: 48px;
    height: 48px;
  }

  .flow-icon svg {
    width: 22px;
    height: 22px;
  }

  .flow-step span {
    font-size: 0.72rem;
  }

  /* Table: stack rows on mobile */
  .table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .table-wrapper th,
  .table-wrapper td {
    padding: 12px 16px;
    font-size: 0.82rem;
  }

  .table-wrapper code {
    font-size: 0.72rem;
    padding: 2px 6px;
  }
}

@media (max-width: 640px) {
  .nav-links {
    display: none;
  }

  .mobile-toggle {
    display: block;
  }

  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    padding: 24px;
    gap: 16px;
    z-index: 50;
  }

  .hero-cards {
    grid-template-columns: 1fr 1fr;
  }

  .hero-card {
    padding: 20px;
  }

  .hero-card-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    margin-bottom: 12px;
  }

  .hero-card-icon svg {
    width: 20px;
    height: 20px;
  }

  .hero-card h3 {
    font-size: 0.95rem;
  }

  .hero-card p {
    font-size: 0.78rem;
  }

  .hero-actions {
    flex-wrap: wrap;
  }

  .btn-primary,
  .btn-secondary {
    padding: 12px 24px;
    font-size: 0.88rem;
    white-space: nowrap;
  }

  .steps-grid,
  .steps-grid-2col {
    grid-template-columns: 1fr;
  }

  .flow {
    padding: 20px;
  }

  .flow-steps {
    justify-content: space-between;
  }

  .flow-arrow {
    padding: 0 6px;
    font-size: 1rem;
  }

  .flow-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
  }

  .flow-step span {
    font-size: 0.65rem;
  }

  /* Secrets table: hide description on small screens */
  .table-wrapper th:nth-child(3),
  .table-wrapper td:nth-child(3) {
    display: none;
  }

  .footer .container {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }

  .code-block pre {
    padding: 16px;
  }

  .code-block code {
    font-size: 0.78rem;
  }
}
