/* ── Tokens ────────────────────────────────────────── */
:root {
  --c-bg:        #ffffff;
  --c-bg-alt:    #f7f8fa;
  --c-text:      #1d1d1f;
  --c-text-muted:#5c5c6a;
  --c-accent:    #2d5be3;
  --c-accent-hover:#1b44b8;
  --c-border:    #e0e1e6;
  --c-success:   #17854a;
  --c-error:     #c93b3b;
  --radius:      8px;
  --container:   720px;
  --font:        -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ── Reset ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  color: var(--c-text);
  background: var(--c-bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--c-accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

/* ── Container ─────────────────────────────────────── */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ── Nav ───────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--c-border);
  z-index: 100;
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}
.nav-logo {
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}
.nav-links {
  display: flex;
  list-style: none;
  gap: 1.5rem;
}
.nav-links a {
  color: var(--c-text-muted);
  font-size: 0.9rem;
  transition: color .15s;
}
.nav-links a:hover {
  color: var(--c-text);
  text-decoration: none;
}

/* ── Sections ──────────────────────────────────────── */
.section {
  padding: 4.5rem 0;
}
.section-alt {
  background: var(--c-bg-alt);
}
.section h2 {
  font-size: 1.65rem;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}
.section p {
  color: var(--c-text-muted);
  margin-bottom: 1rem;
}
.section-intro {
  margin-bottom: 2rem;
}

/* ── Hero ──────────────────────────────────────────── */
.hero {
  padding: 6rem 0 4.5rem;
  text-align: center;
}
.hero h1 {
  font-size: clamp(1.75rem, 4vw, 2.6rem);
  letter-spacing: -0.025em;
  line-height: 1.25;
  margin-bottom: 1.25rem;
}
.hero-sub {
  max-width: 520px;
  margin: 0 auto 2rem;
  color: var(--c-text-muted);
  font-size: 1.05rem;
}
.hero-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ── Buttons ───────────────────────────────────────── */
.btn {
  display: inline-block;
  padding: 0.65rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: background .15s, opacity .15s;
  text-align: center;
}
.btn:hover { text-decoration: none; }
.btn-primary {
  background: var(--c-accent);
  color: #fff;
}
.btn-primary:hover {
  background: var(--c-accent-hover);
}
.btn-primary:disabled {
  opacity: .45;
  cursor: not-allowed;
}
.btn-outline {
  background: transparent;
  color: var(--c-accent);
  border: 1.5px solid var(--c-accent);
}
.btn-outline:hover {
  background: var(--c-accent);
  color: #fff;
}

/* ── Export tool ────────────────────────────────────── */
.export-tool {
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 2rem;
}
.export-step { margin-bottom: 2rem; }
.export-step:last-child { margin-bottom: 0; }
.export-step h3 {
  font-size: 1.1rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--c-accent);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  flex-shrink: 0;
}

.form-group {
  margin-bottom: 1rem;
}
.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
  color: var(--c-text);
}
.form-group input,
.form-group select {
  width: 100%;
  padding: 0.6rem 0.75rem;
  font-size: 0.95rem;
  border: 1.5px solid var(--c-border);
  border-radius: var(--radius);
  background: var(--c-bg);
  color: var(--c-text);
  font-family: var(--font);
  transition: border-color .15s;
}
.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--c-accent);
}

/* Collections checkboxes */
.collections-list {
  margin-bottom: 1rem;
  max-height: 280px;
  overflow-y: auto;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 0.5rem 0;
}
.collection-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 1rem;
}
.collection-item:hover {
  background: var(--c-bg-alt);
}
.collection-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--c-accent);
  flex-shrink: 0;
}
.collection-item label {
  cursor: pointer;
  font-size: 0.95rem;
}
.select-all-row {
  padding: 0.5rem 1rem;
  border-bottom: 1px solid var(--c-border);
  margin-bottom: 0.25rem;
  font-weight: 600;
  font-size: 0.85rem;
}

/* Messages */
.msg {
  margin-top: 0.75rem;
  font-size: 0.9rem;
  min-height: 1.4em;
}
.msg.error { color: var(--c-error); }
.msg.success { color: var(--c-success); }

/* Progress */
.progress-area {
  text-align: center;
  padding: 1rem 0;
}
.progress-bar-track {
  width: 100%;
  height: 6px;
  background: var(--c-border);
  border-radius: 3px;
  margin-top: 1rem;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--c-accent);
  border-radius: 3px;
  transition: width .25s ease;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--c-border);
  border-top-color: var(--c-accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  margin: 0 auto 1rem;
}
@keyframes spin { to { transform: rotate(360deg); } }

.download-area { text-align: center; }
.download-done {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--c-success) !important;
  margin-bottom: 1.25rem;
}
.download-area .btn { margin: 0 0.5rem; }

/* ── Timeline ──────────────────────────────────────── */
.timeline {
  list-style: none;
  position: relative;
  padding-left: 2rem;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 4px;
  bottom: 4px;
  width: 2px;
  background: var(--c-border);
}
.timeline-item {
  position: relative;
  padding: 0 0 2rem 1.5rem;
}
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
  content: "";
  position: absolute;
  left: -2rem;
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--c-accent);
  border: 2px solid var(--c-bg);
  box-shadow: 0 0 0 2px var(--c-accent);
}
.timeline-date {
  display: block;
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 0.15rem;
}
.timeline-text {
  color: var(--c-text-muted);
  font-size: 0.95rem;
}

/* ── FAQ ───────────────────────────────────────────── */
.faq-item {
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
  background: var(--c-bg);
}
.faq-item summary {
  padding: 1rem 1.25rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.faq-item summary::after {
  content: "+";
  font-size: 1.3rem;
  font-weight: 400;
  color: var(--c-text-muted);
  transition: transform .2s;
}
.faq-item[open] summary::after {
  content: "−";
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-body {
  padding: 0 1.25rem 1rem;
}
.faq-body p {
  font-size: 0.95rem;
}

/* ── Contact ───────────────────────────────────────── */
.contact-email {
  font-size: 1.2rem;
  font-weight: 600;
}
.contact-email a { color: var(--c-accent); }
.contact-name {
  font-size: 0.9rem;
  color: var(--c-text-muted) !important;
}

/* ── Footer ────────────────────────────────────────── */
.footer {
  padding: 2rem 0;
  border-top: 1px solid var(--c-border);
  text-align: center;
}
.footer p {
  font-size: 0.85rem;
  color: var(--c-text-muted);
}

/* ── Utility ───────────────────────────────────────── */
.hidden { display: none !important; }

/* ── API docs page ─────────────────────────────────── */
.hero-sm { padding: 4rem 0 2.5rem; }
.hero-sm h1 { font-size: clamp(1.5rem, 3.5vw, 2.2rem); }

.api-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0 1.5rem;
}
.api-table th,
.api-table td {
  text-align: left;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--c-border);
  font-size: 0.95rem;
}
.api-table th {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--c-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.endpoint {
  margin-bottom: 2.5rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--c-border);
}
.endpoint:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}
.endpoint h3 {
  font-size: 1.05rem;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.endpoint h4 {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--c-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 1rem 0 0.4rem;
}

.method {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  font-family: var(--font);
}
.method.post { background: #e8f0fe; color: #1a56db; }
.method.get  { background: #e6f4ea; color: #137333; }

pre {
  background: #f3f4f6;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  overflow-x: auto;
  font-size: 0.88rem;
  line-height: 1.6;
}
code {
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.88em;
}
p code {
  background: #f3f4f6;
  padding: 0.15em 0.35em;
  border-radius: 4px;
}

.flow-steps {
  padding-left: 1.25rem;
  margin: 1rem 0;
}
.flow-steps li {
  margin-bottom: 1rem;
  line-height: 1.6;
}
.flow-steps li strong {
  display: block;
  color: var(--c-text);
}
.flow-steps li code {
  font-size: 0.85em;
}

/* ── Responsive ────────────────────────────────────── */
@media (max-width: 600px) {
  .nav-links { gap: 1rem; }
  .nav-links a { font-size: 0.8rem; }
  .hero { padding: 4rem 0 3rem; }
  .section { padding: 3rem 0; }
  .export-tool { padding: 1.25rem; }
}
