/* ============================================================
   Kopi Tools — kopitools.link
   Paleta derivada de assets/kopi-mascot.png (cian eléctrico,
   violeta, magenta sobre azul-marino casi negro).
   ============================================================ */

:root {
  --bg: #070a14;
  --bg-alt: #0b0f20;
  --surface: #10142a;
  --surface-2: #161b38;
  --border: rgba(148, 163, 184, 0.14);
  --border-strong: rgba(148, 163, 184, 0.28);
  --text: #f1f5f9;
  --text-muted: #a3adc2;
  --text-faint: #6b7490;

  --cyan: #22d3ee;
  --cyan-strong: #67e8f9;
  --violet: #a855f7;
  --violet-strong: #c084fc;
  --magenta: #fb7185;

  --gradient-brand: linear-gradient(135deg, var(--cyan) 0%, var(--violet) 55%, var(--magenta) 100%);
  --gradient-radial: radial-gradient(circle at 30% 20%, rgba(34, 211, 238, 0.18), transparent 45%),
                     radial-gradient(circle at 80% 0%, rgba(168, 85, 247, 0.16), transparent 40%),
                     radial-gradient(circle at 60% 80%, rgba(251, 113, 133, 0.10), transparent 45%);

  --shadow-glow: 0 0 0 1px var(--border), 0 20px 60px -20px rgba(34, 211, 238, 0.25);
  --radius: 16px;
  --radius-sm: 10px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

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

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

section { padding: 96px 0; position: relative; }
section + section { border-top: 1px solid var(--border); }

.eyebrow {
  display: inline-block;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cyan-strong);
  background: rgba(34, 211, 238, 0.1);
  border: 1px solid rgba(34, 211, 238, 0.25);
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 18px;
}

h1, h2, h3 { line-height: 1.15; margin: 0 0 16px; font-weight: 800; letter-spacing: -0.01em; }
h2 { font-size: clamp(26px, 3.4vw, 36px); }
h3 { font-size: 19px; }
p { color: var(--text-muted); margin: 0 0 16px; }

.section-head { max-width: 640px; margin: 0 auto 52px; text-align: center; }
.section-head p { font-size: 16px; }

.gradient-text {
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ── Nav ─────────────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(10px);
  background: rgba(7, 10, 20, 0.82);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  max-width: 1120px;
  margin: 0 auto;
}
.nav-brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 15px; }
.nav-logo {
  width: 32px; height: 32px; background: #fff; border-radius: 8px;
  padding: 3px; object-fit: contain; flex-shrink: 0;
}
.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-links a { color: var(--text-muted); font-size: 14px; font-weight: 500; }
.nav-links a:hover { color: var(--text); text-decoration: none; }
.nav-cta { display: flex; align-items: center; gap: 10px; }
.nav-toggle { display: none; }

@media (max-width: 760px) {
  .nav-links { display: none; }
  .nav-toggle {
    display: inline-flex; background: none; border: 1px solid var(--border-strong);
    color: var(--text); border-radius: 8px; padding: 8px 10px; cursor: pointer;
  }
}

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 20px; border-radius: 10px; font-size: 14.5px; font-weight: 700;
  border: 1px solid transparent; cursor: pointer; white-space: nowrap;
  transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease;
}
.btn:hover { text-decoration: none; }
.btn-primary {
  background: var(--gradient-brand); color: #04060c;
  box-shadow: 0 10px 30px -10px rgba(34, 211, 238, 0.5);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 14px 34px -10px rgba(168, 85, 247, 0.55); }
.btn-secondary {
  background: var(--surface-2); color: var(--text); border-color: var(--border-strong);
}
.btn-secondary:hover { border-color: var(--cyan); }
.btn-disabled {
  background: var(--surface); color: var(--text-faint); border-color: var(--border);
  cursor: default; opacity: 0.75;
}
.btn-disabled:hover { transform: none; text-decoration: none; }
.btn-sm { padding: 8px 14px; font-size: 13px; }

/* ── Hero ────────────────────────────────────────────────── */
.hero {
  padding: 88px 0 80px;
  background: var(--gradient-radial), var(--bg);
  border-top: none;
}
.hero-grid {
  display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 56px; align-items: center;
}
.hero h1 { font-size: clamp(40px, 6vw, 64px); }
.hero-sub { font-size: 20px; color: var(--text); font-weight: 600; margin-bottom: 14px; }
.hero-desc { font-size: 16.5px; max-width: 480px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 8px; }
.hero-visual { position: relative; display: flex; justify-content: center; align-items: center; }
.hero-visual::before {
  content: ""; position: absolute; inset: -10%;
  background: var(--gradient-brand); filter: blur(90px); opacity: 0.25; border-radius: 50%;
  z-index: 0;
}
.hero-visual img {
  position: relative; z-index: 1; width: 100%; height: auto; max-width: 420px;
  aspect-ratio: 1 / 1; object-fit: cover;
  border-radius: 28px; box-shadow: var(--shadow-glow);
}

@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-visual { order: -1; }
  .hero-visual img { max-width: 280px; }
}

/* ── Feature / ecosystem / architecture cards ───────────────── */
.grid { display: grid; gap: 20px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 860px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px; transition: border-color .15s ease, transform .15s ease;
}
.card:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.card-icon { font-size: 26px; margin-bottom: 14px; }
.card h3 { margin-bottom: 8px; }
.card p { margin: 0; font-size: 14.5px; }

.card-app { border-top: 3px solid var(--cyan); }
.card-app:nth-child(2) { border-top-color: var(--violet); }
.card-app:nth-child(3) { border-top-color: var(--magenta); }
.card-app .tag {
  display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; color: var(--text-faint); background: var(--surface-2);
  border: 1px solid var(--border); padding: 3px 9px; border-radius: 999px; margin-bottom: 10px;
}

/* ── Architecture ────────────────────────────────────────── */
.arch-layout { display: grid; grid-template-columns: 1fr 320px; gap: 40px; align-items: start; }
@media (max-width: 860px) { .arch-layout { grid-template-columns: 1fr; } }

.stack-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 640px) { .stack-grid { grid-template-columns: repeat(2, 1fr); } }
.stack-item {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 14px 12px; text-align: center; font-size: 12.5px; font-weight: 600; color: var(--text-muted);
}
.stack-item span { display: block; font-size: 20px; margin-bottom: 6px; }

.stat-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 28px; text-align: center;
}
.stat-card .stat-num {
  font-size: 40px; font-weight: 800; background: var(--gradient-brand);
  -webkit-background-clip: text; background-clip: text; color: transparent; line-height: 1;
  margin-bottom: 8px;
}
.stat-card p { font-size: 13.5px; margin: 0; }
.stat-stack { display: flex; flex-direction: column; gap: 16px; }

.claude-note {
  margin-top: 28px; padding: 20px 22px; border-radius: var(--radius);
  background: var(--surface); border: 1px dashed var(--border-strong);
  font-size: 14.5px; color: var(--text-muted);
}
.claude-note strong { color: var(--text); }

/* ── About ───────────────────────────────────────────────── */
.about-grid { display: grid; grid-template-columns: 280px 1fr; gap: 48px; align-items: center; }
@media (max-width: 760px) { .about-grid { grid-template-columns: 1fr; text-align: center; } }
.about-photo {
  position: relative; width: 220px; height: 220px; margin: 0 auto;
}
.about-photo img {
  width: 220px; height: 220px; border-radius: 50%; object-fit: cover;
  border: 3px solid transparent;
  background: linear-gradient(var(--bg), var(--bg)) padding-box, var(--gradient-brand) border-box;
}
.badge-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 18px 0 22px; }
@media (max-width: 760px) { .badge-row { justify-content: center; } }
.badge {
  font-size: 12.5px; font-weight: 700; color: var(--text);
  background: var(--surface-2); border: 1px solid var(--border-strong);
  padding: 6px 12px; border-radius: 999px;
}
.about-links { display: flex; gap: 14px; flex-wrap: wrap; }
@media (max-width: 760px) { .about-links { justify-content: center; } }
.fun-fact {
  margin-top: 18px; font-size: 14px; color: var(--text-faint); font-style: italic;
}

/* ── Privacy ─────────────────────────────────────────────── */
.privacy-box {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 32px; max-width: 720px; margin: 0 auto;
}
.privacy-points { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 20px 0 24px; }
@media (max-width: 640px) { .privacy-points { grid-template-columns: 1fr; } }
.privacy-point { font-size: 13.5px; color: var(--text-muted); }
.privacy-point span { display: block; font-size: 20px; margin-bottom: 6px; }
.legal-links { display: flex; gap: 10px 18px; flex-wrap: wrap; margin-top: 18px; }
.legal-links a { font-size: 13.5px; }

/* ── Footer ──────────────────────────────────────────────── */
footer {
  padding: 40px 0; border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px;
}
footer .container { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; width: 100%; }
.footer-brand { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--text-faint); }
.footer-links { display: flex; gap: 20px; flex-wrap: wrap; }
.footer-links a { font-size: 13.5px; color: var(--text-muted); }

/* ── Conocimiento ────────────────────────────────────────── */
.card-tema { padding: 0; overflow: hidden; display: block; }
.card-tema img { width: 100%; height: 150px; object-fit: cover; display: block; }
.card-tema-body { padding: 22px 24px; }
.card-tema-body .card-icon { margin-bottom: 10px; }
.card-tema-body h3 { margin-bottom: 6px; }
.card-tema-body p { margin: 0; font-size: 14px; }

.tema-header { padding: 28px 0 0; }
.tema-cover {
  width: 100%; max-height: 340px; object-fit: cover; border-radius: var(--radius);
  margin-bottom: 32px; border: 1px solid var(--border);
}
#tema-detail-section { padding-top: 24px; }
#tema-detail h1 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.subtopic-list { display: flex; flex-direction: column; gap: 14px; }
.subtopic-accordion {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 4px 22px;
}
.subtopic-accordion summary {
  cursor: pointer; padding: 16px 0; font-weight: 700; font-size: 16px;
  color: var(--text); list-style: none;
}
.subtopic-accordion summary::-webkit-details-marker { display: none; }
.subtopic-accordion summary::before { content: '▸ '; color: var(--cyan-strong); }
.subtopic-accordion[open] summary::before { content: '▾ '; }
.subtopic-body { padding: 0 0 20px; }

.resource-list { display: flex; flex-direction: column; gap: 16px; margin-top: 8px; }
.resource-item {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 16px 18px;
}
.resource-item h4 { margin: 0 0 10px; font-size: 14.5px; color: var(--text); }
.resource-item audio, .resource-item video, .resource-item img { width: 100%; border-radius: var(--radius-sm); }
.resource-richtext { font-size: 14.5px; color: var(--text-muted); }
.resource-richtext p:last-child { margin-bottom: 0; }
.resource-richtext a { color: var(--cyan-strong); }
.resource-embed { position: relative; width: 100%; padding-top: 56.25%; /* 16:9 */ }
.resource-embed iframe {
  position: absolute; inset: 0; width: 100%; height: 100%; border: 0; border-radius: var(--radius-sm);
}

/* ── Utilities ───────────────────────────────────────────── */
.center { text-align: center; }
.mt-0 { margin-top: 0; }
.text-faint { color: var(--text-faint); }
