/* ─── Zaion Agency · Comunidad ───
   Estilos compartidos por /comunidad/ y sus recursos.
   Tokens y componentes de design/design-system.html (v1.0),
   en su versión de fondo blanco. Las pantallas de código
   conservan el tema oscuro original del sistema. */

:root {
  --orange:         #FF5C00;
  --orange-warm:    #FF7A29;
  --green:          #22C55E;
  --bg:             #ffffff;
  --surface:        #f7f7f7;
  --text:           #0a0a0a;
  --body-text:      #333333;
  --muted:          #666666;
  --border-subtle:  rgba(0,0,0,.08);
  --border-medium:  rgba(0,0,0,.25);
  --display:        'Outfit', sans-serif;
  --body:           'Inter', sans-serif;
  --mono:           ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --ease:           cubic-bezier(.16,1,.3,1);

  /* Tema oscuro del design system, para las pantallas */
  --screen-bg:      #000000;
  --screen-text:    #ffffff;
  --screen-muted:   #888888;
  --screen-border:  rgba(255,255,255,.25);
}

*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 96px; }

body {
  font-family: var(--body);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Dot grid del design system, invertido */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(0,0,0,.06) 1px, transparent 1px);
  background-size: 24px 24px;
}

a { color: inherit; text-decoration: none; }
nav, main, footer { position: relative; z-index: 1; }

.container { max-width: 1100px; margin: 0 auto; padding: 0 2rem; }

.label {
  display: block;
  font-family: var(--body);
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--orange);
  margin-bottom: 1.25rem;
}

.block-tag {
  font-size: .66rem;
  font-weight: 500;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--orange);
}

/* ─── Nav ─── */
.brand-mark { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.brand-wordmark { display: flex; flex-direction: column; line-height: 1; }
.brand-wordmark .name { font-family: var(--display); font-weight: 800; font-size: 1.15rem; letter-spacing: .14em; text-transform: uppercase; }
.brand-wordmark .name .ai { color: var(--orange); }
.brand-wordmark .sub { font-size: .55rem; font-weight: 400; letter-spacing: .45em; color: var(--muted); margin-top: 3px; text-transform: uppercase; }

nav {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 20px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
}

.nav-right { display: flex; align-items: center; gap: 28px; }

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: .75rem;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color .2s;
}
.nav-link:hover, .nav-link[aria-current="page"] { color: var(--text); }

/* ─── Botones (design system) ─── */
.btn-primary, .btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .65rem 1.4rem;
  font-family: var(--body);
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  border-radius: 6px;
  cursor: pointer;
  transition: background .2s, border-color .2s, color .2s, transform .2s var(--ease);
}
.btn-primary { color: #fff; background: var(--orange); border: 1px solid var(--orange); }
.btn-primary:hover { background: var(--orange-warm); border-color: var(--orange-warm); transform: translateY(-1px); }
.btn-ghost { color: var(--text); background: var(--bg); border: 1px solid var(--border-medium); }
.btn-ghost:hover { border-color: var(--text); }

.btn-cta {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  font-size: .75rem;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}

.icon-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border-medium);
  display: grid;
  place-items: center;
  transition: background .25s, border-color .25s, color .25s;
}

/* ─── Status badge (design system) ─── */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .35rem 1rem;
  border-radius: 100px;
  background: rgba(0,0,0,.03);
  border: 1px solid var(--border-subtle);
  font-size: .75rem;
  font-weight: 500;
  letter-spacing: .08em;
}
.status-badge--active { border-color: rgba(255,92,0,.3); }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 6px var(--green); }
.status-dot--orange { background: var(--orange); box-shadow: 0 0 6px var(--orange); }

/* ─── Hero ─── */
.hero { padding: 5rem 0 3.5rem; }

.hero-title {
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(2.8rem, 7vw, 5rem);
  letter-spacing: -.03em;
  line-height: .88;
  text-transform: uppercase;
}
.hero-title .accent { color: var(--orange); }

.hero-lead {
  margin-top: 2rem;
  max-width: 64ch;
  font-size: 1.1rem;
  line-height: 1.65;
  color: var(--muted);
}
.hero-lead strong { color: var(--text); font-weight: 600; }

.chips { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2rem; }

/* ─── Notch card (design system) ─── */
.notch-card, .resource-card, .flow a {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border: 2px solid rgba(0,0,0,.1);
  clip-path: polygon(40px 0%, calc(100% - 40px) 0%, 100% 40px, 100% 100%, calc(100% - 40px) 100%, 40px 100%, 0 100%, 0 0);
  transition: border-color .25s, transform .35s var(--ease);
}
.notch-card::before, .resource-card::before, .flow a::before {
  content: '';
  position: absolute;
  right: -2px;
  top: 38px;
  width: 57px;
  height: 2px;
  background: rgba(0,0,0,.1);
  transform-origin: top right;
  transform: rotate(45deg);
  transition: background .25s;
}
a.resource-card:hover, .flow a:hover { border-color: var(--orange); transform: translateY(-4px); }
a.resource-card:hover::before, .flow a:hover::before { background: var(--orange); }

/* ─── Hub: tarjetas de recursos ─── */
.resources { padding: 1rem 0 7rem; }
.resource-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1.5rem; }

.resource-card { gap: 1rem; min-height: 320px; padding: 2rem 2rem 1.75rem; }
.resource-num { font-size: .72rem; font-weight: 500; letter-spacing: .22em; text-transform: uppercase; color: var(--orange); }
.resource-card h2 { font-family: var(--display); font-weight: 800; font-size: 1.9rem; letter-spacing: -.01em; line-height: 1; text-transform: uppercase; }
.resource-card p { font-size: .9rem; line-height: 1.65; color: var(--muted); }
.resource-meta { display: flex; flex-wrap: wrap; gap: .4rem 1rem; font-size: .66rem; font-weight: 500; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.resource-cta { margin-top: auto; padding-top: .5rem; display: inline-flex; align-items: center; gap: .6rem; font-size: .75rem; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; }
a.resource-card:hover .icon-circle { background: var(--orange); border-color: var(--orange); color: #fff; }

.resource-card--soon { clip-path: none; justify-content: center; border: 1px dashed var(--border-medium); border-radius: 8px; background: transparent; }
.resource-card--soon::before { display: none; }
.resource-card--soon h2 { font-size: 1.1rem; font-weight: 700; letter-spacing: .04em; color: var(--muted); }

/* ─── Guía ─── */
.guide { padding: 0 0 6rem; }

.flow { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-bottom: 5rem; }
.flow a { padding: 1.75rem 2rem 2rem; min-height: 190px; }
.flow-num { font-size: .72rem; font-weight: 500; letter-spacing: .22em; text-transform: uppercase; color: var(--orange); }
.flow h3 { font-family: var(--display); font-weight: 800; font-size: 1.5rem; letter-spacing: -.01em; line-height: 1.05; text-transform: uppercase; margin: 1rem 0 .6rem; }
.flow p { font-size: .9rem; line-height: 1.65; color: var(--muted); max-width: 44ch; }

/* ─── Secciones ─── */
.step { padding-top: 5rem; margin-bottom: 5rem; border-top: 1px solid var(--border-subtle); }
.step:first-of-type { padding-top: 0; border-top: none; }

.step h2 {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(1.9rem, 4.4vw, 3rem);
  letter-spacing: -.02em;
  line-height: .98;
  text-transform: uppercase;
  margin-bottom: 1.75rem;
  max-width: 22ch;
}

.step > p { font-size: 1.05rem; line-height: 1.7; color: var(--body-text); margin-bottom: 1rem; max-width: 86ch; }
.step p strong, .step li strong { font-weight: 600; color: var(--text); }
.step p a, .note a, .closing p a { color: var(--text); text-decoration: underline; text-decoration-color: var(--orange); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.step p a:hover, .note a:hover, .closing p a:hover { color: var(--orange); }

.step code, .note code { font-family: var(--mono); font-size: .86em; padding: .12em .4em; border-radius: 4px; background: var(--surface); border: 1px solid var(--border-subtle); overflow-wrap: anywhere; }

.num-list { list-style: none; counter-reset: n; display: flex; flex-direction: column; gap: .75rem; margin: 1.75rem 0; }
.num-list li { counter-increment: n; position: relative; padding-left: 2.6rem; font-size: 1.05rem; line-height: 1.65; color: var(--body-text); }
.num-list li::before { content: counter(n, decimal-leading-zero); position: absolute; left: 0; top: .3em; font-family: var(--display); font-weight: 800; font-size: .8rem; letter-spacing: .1em; color: var(--orange); }

.dot-list { list-style: none; display: flex; flex-direction: column; gap: .7rem; margin: 1.5rem 0; }
.dot-list li { position: relative; padding-left: 1.5rem; font-size: 1.05rem; line-height: 1.65; color: var(--body-text); }
.dot-list li::before { content: ''; position: absolute; left: 2px; top: .62em; width: 7px; height: 7px; background: var(--orange); transform: rotate(45deg); }

/* ─── Bloque de componente (design system) ─── */
.block, .prompt-card, .cmd-card {
  margin: 1.5rem 0;
  padding: 2rem;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--surface);
}

.block h3, .prompt-card h3, .cmd-card h3 { font-family: var(--display); font-weight: 700; font-size: 1.15rem; letter-spacing: .02em; text-transform: uppercase; line-height: 1.2; }
.block p { margin-top: .5rem; font-size: .9rem; line-height: 1.65; color: var(--muted); }
.block .btn-primary { margin-top: 1.25rem; }

/* Nota: borde del badge "Active Project" */
.note { margin: 1.5rem 0; padding: 1.5rem 2rem; border: 1px solid rgba(255,92,0,.3); border-radius: 8px; background: rgba(255,92,0,.04); font-size: .95rem; line-height: 1.7; color: var(--body-text); }
.note strong { font-weight: 600; color: var(--text); }

/* ─── Pantalla negra: comandos y prompts ─── */
.screen { position: relative; background: var(--screen-bg); border-radius: 6px; overflow: hidden; }
.screen pre { padding: 1.5rem; font-family: var(--mono); font-size: .86rem; line-height: 1.7; color: var(--screen-text); overflow-x: auto; }

.cmd-card h3 { font-size: 1rem; margin-bottom: 1rem; }
.cmd-card .copy-btn { margin-top: 1rem; }

.prompt-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1.5rem; margin-bottom: 1.5rem; }
.prompt-head h3 { margin-top: .6rem; font-size: 1.35rem; font-weight: 800; }
.prompt-desc { margin-top: .5rem; font-size: .9rem; line-height: 1.6; color: var(--muted); max-width: 62ch; }

.prompt-card .screen pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.screen.is-collapsed pre { max-height: 27rem; overflow: hidden; }
.screen.is-collapsed::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 6rem; background: linear-gradient(transparent, var(--screen-bg)); pointer-events: none; }

.more-btn {
  position: absolute;
  right: 1rem;
  bottom: 1rem;
  z-index: 1;
  padding: .4rem .9rem;
  font-family: var(--body);
  font-size: .7rem;
  font-weight: 500;
  letter-spacing: .08em;
  color: var(--screen-text);
  background: var(--screen-bg);
  border: 1px solid var(--screen-border);
  border-radius: 100px;
  cursor: pointer;
  transition: border-color .2s, color .2s;
}
.more-btn:hover { border-color: var(--orange); color: var(--orange); }

.copy-btn { flex-shrink: 0; }
.copy-btn svg { flex-shrink: 0; }
.copy-btn.is-copied, .copy-btn.is-copied:hover { color: #fff; background: var(--orange); border-color: var(--orange); }

/* ─── Lista de actores ─── */
.actor-list { margin: 1.5rem 0; border: 1px solid var(--border-subtle); border-radius: 8px; background: var(--bg); overflow: hidden; }
.actor-row { display: grid; grid-template-columns: 220px 1fr; gap: 1.5rem; padding: 1.4rem 2rem; border-bottom: 1px solid var(--border-subtle); }
.actor-row:last-child { border-bottom: none; }
.actor-row dt { font-family: var(--display); font-weight: 700; font-size: 1rem; letter-spacing: .02em; text-transform: uppercase; }
.actor-row dt span { display: block; margin-top: .35rem; font-family: var(--body); font-weight: 400; font-size: .75rem; letter-spacing: .04em; text-transform: none; color: var(--muted); }
.actor-row dd { font-size: .9rem; line-height: 1.6; color: var(--muted); }
.actor-row dd code { display: inline-block; margin-bottom: .45rem; padding: 0; border: none; background: none; font-size: .86rem; color: var(--text); }

/* ─── Tabla ─── */
.table-wrap { margin: 1.5rem 0; border: 1px solid var(--border-subtle); border-radius: 8px; background: var(--bg); overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th { text-align: left; padding: 1rem 1.25rem; font-size: .66rem; font-weight: 500; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); background: var(--surface); border-bottom: 1px solid var(--border-subtle); white-space: nowrap; }
td { padding: 1rem 1.25rem; line-height: 1.55; color: var(--body-text); border-bottom: 1px solid var(--border-subtle); vertical-align: top; }
tr:last-child td { border-bottom: none; }
td:first-child { font-weight: 600; color: var(--text); }
td code { padding: 0; border: none; background: none; font-size: .82rem; white-space: nowrap; }
tr.is-total td { background: var(--surface); }
tr.is-total td:last-child { color: var(--orange); }

/* ─── Columnas de la matriz ─── */
.col-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 1.5rem 0; }
.col-grid div { padding: 1.25rem 1.5rem; border: 1px solid var(--border-subtle); border-radius: 8px; background: var(--surface); }
.col-grid dt { font-size: .7rem; font-weight: 500; letter-spacing: .18em; text-transform: uppercase; margin-bottom: .5rem; }
.col-grid dd { font-size: .9rem; line-height: 1.6; color: var(--muted); }
.col-grid .is-key { border-color: rgba(255,92,0,.3); background: rgba(255,92,0,.04); }
.col-grid .is-key dt { color: var(--orange); }

/* ─── Reglas ─── */
.rules { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; margin-top: 2rem; }
.rule { padding: 2rem; border: 1px solid var(--border-subtle); border-radius: 8px; background: var(--surface); }
.rule-num { font-family: var(--display); font-weight: 900; font-size: 2rem; letter-spacing: -.03em; color: var(--orange); line-height: .88; }
.rule h3 { font-family: var(--display); font-weight: 700; font-size: 1.05rem; text-transform: uppercase; letter-spacing: .02em; line-height: 1.2; margin: 1.25rem 0 .75rem; }
.rule p { font-size: .9rem; line-height: 1.65; color: var(--muted); }

/* ─── Stack: tarjetas de herramientas ─── */
.tool-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-top: 2rem; }
.tool-card { display: flex; flex-direction: column; gap: 1.1rem; padding: 2rem; border: 1px solid var(--border-subtle); border-radius: 8px; background: var(--bg); scroll-margin-top: 110px; transition: border-color .25s; }
.tool-card:hover { border-color: rgba(255,92,0,.3); }
.tool-card--fav { border-color: rgba(255,92,0,.3); background: rgba(255,92,0,.03); }
.tool-head { display: flex; align-items: center; gap: 1rem; }
.tool-logo { width: 52px; height: 52px; flex-shrink: 0; padding: 8px; border: 1px solid var(--border-subtle); border-radius: 12px; background: #fff; object-fit: contain; }
.tool-head > div { flex: 1; min-width: 0; }
.tool-num { font-size: .66rem; font-weight: 500; letter-spacing: .18em; text-transform: uppercase; color: var(--orange); }
.tool-card h3 { margin-top: .3rem; font-family: var(--display); font-weight: 800; font-size: 1.5rem; letter-spacing: -.01em; line-height: 1; text-transform: uppercase; }
.tool-head .status-badge { flex-shrink: 0; align-self: flex-start; padding: .25rem .7rem; font-size: .66rem; }
.tool-what { font-size: .92rem; line-height: 1.65; color: var(--body-text); }
.tool-use { padding: 1rem 1.25rem; border-left: 2px solid var(--orange); background: var(--surface); border-radius: 0 6px 6px 0; }
.tool-use p { margin-top: .4rem; font-size: .9rem; line-height: 1.65; color: var(--body-text); }
.tool-use a { text-decoration: underline; text-decoration-color: var(--orange); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.tool-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.tool-facts dt { font-size: .62rem; font-weight: 500; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); margin-bottom: .3rem; }
.tool-facts dd { font-size: .85rem; line-height: 1.55; color: var(--text); }
.tool-card .btn-ghost { margin-top: auto; align-self: flex-start; }

.tool-grid--compact { grid-template-columns: repeat(3, 1fr); }
.tool-grid--compact .tool-card { padding: 1.5rem; gap: .9rem; }
.tool-grid--compact .tool-card h3 { font-size: 1.2rem; }
.tool-grid--compact .tool-logo { width: 44px; height: 44px; padding: 7px; }
.tool-grid--compact .tool-facts { grid-template-columns: 1fr; gap: .6rem; }

/* ─── Cierre: corner plus card (design system) ─── */
.closing { position: relative; margin: 6rem 12px 0; padding: 2.5rem 2.25rem; background: var(--bg); border: 1px solid var(--border-subtle); }
.closing .plus { position: absolute; font-size: 1.3rem; font-weight: 300; color: var(--border-medium); line-height: 1; }
.plus--tl { top: -12px; left: -12px; } .plus--tr { top: -12px; right: -12px; }
.plus--bl { bottom: -12px; left: -12px; } .plus--br { bottom: -12px; right: -12px; }
.closing h2 { font-family: var(--display); font-weight: 800; font-size: clamp(1.6rem, 3.4vw, 2.4rem); text-transform: uppercase; letter-spacing: -.02em; line-height: 1; }
.closing h2 .accent { color: var(--orange); }
.closing p { margin-top: 1rem; font-size: .95rem; line-height: 1.7; color: var(--muted); max-width: 64ch; }
.closing .btn-ghost { margin-top: 1.75rem; }

/* ─── Footer ─── */
footer { padding: 3.5rem 0 2.25rem; border-top: 1px solid var(--border-subtle); background: var(--bg); }
.footer-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 3rem; margin-bottom: 3.5rem; flex-wrap: wrap; }
.footer-brand { display: flex; flex-direction: column; gap: 1rem; }
.footer-tagline { font-size: .75rem; color: var(--muted); max-width: 230px; line-height: 1.65; }
.footer-cols { display: flex; gap: 4rem; flex-wrap: wrap; }
.footer-col h4 { font-size: .66rem; font-weight: 500; letter-spacing: .22em; text-transform: uppercase; color: var(--orange); margin-bottom: 1.1rem; }
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: .6rem; }
.footer-col ul a { font-size: .82rem; color: var(--muted); transition: color .2s; }
.footer-col ul a:hover { color: var(--text); }
.footer-bottom { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem; padding-top: 2rem; border-top: 1px solid var(--border-subtle); }
.footer-copy, .footer-legal a { font-size: .66rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.footer-legal { display: flex; gap: 1.5rem; }
.footer-legal a { transition: color .2s; }
.footer-legal a:hover { color: var(--text); }

:focus-visible { outline: 2px solid var(--orange); outline-offset: 3px; }

@media (max-width: 1000px) {
  .tool-grid--compact { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  nav { padding: 16px 20px; }
  .nav-right { gap: 18px; }
  .nav-link--home span { display: none; }
  .container { padding: 0 20px; }
  .hero { padding: 3.5rem 0 2.5rem; }
  .hero-lead { font-size: 1rem; }
  .flow { grid-template-columns: 1fr; margin-bottom: 3.5rem; }
  .flow a { min-height: 0; }
  .step { padding-top: 3.5rem; margin-bottom: 3.5rem; }
  .step > p, .num-list li, .dot-list li { font-size: 1rem; }
  .block, .prompt-card, .cmd-card { padding: 1.25rem; }
  .note { padding: 1.25rem; }
  .screen pre { padding: 1.1rem; font-size: .8rem; }
  .prompt-head { flex-direction: column; gap: 1rem; }
  .actor-row { grid-template-columns: 1fr; gap: .6rem; padding: 1.25rem; }
  .col-grid { grid-template-columns: 1fr; }
  .rules { grid-template-columns: 1fr; }
  .tool-grid, .tool-grid--compact { grid-template-columns: 1fr; }
  .tool-card { padding: 1.4rem; }
  .tool-facts { grid-template-columns: 1fr; gap: .6rem; }
  .closing { padding: 2rem 1.5rem; margin-top: 4rem; }
  .resource-grid { grid-template-columns: 1fr; }
  .footer-top { gap: 2rem; }
  .footer-cols { gap: 2rem; flex-direction: column; }
  .footer-bottom { flex-direction: column; align-items: flex-start; gap: .75rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
