/* =============================================================
   K8sCreation · styles.css
   1. Tokens · 2. Reset · 3. Utilidades · 4. Tipografía
   5. Componentes · 6. Header/Footer · 7. Herramienta (tabs/form/preview)
   8. Secciones de contenido · 9. Cookie banner · 10. Responsive
   11. Reduced-motion
   ============================================================= */

/* =============================================================
   1. Tokens
   ============================================================= */
:root {
  --ink:        #0f172a;
  --ink-soft:   #3b4863;
  --muted:      #667085;
  --line:       #e2e8f0;
  --line-soft:  #edf1f7;
  --bg:         #f7f9fc;
  --surface:    #ffffff;
  --surface-2:  #eef2f9;

  --accent:     #326ce5;   /* azul Kubernetes */
  --accent-2:   #5b8def;
  --accent-ink: #1d4ed8;
  --accent-wash:#e7effd;

  --good:       #16a34a;
  --good-wash:  #e7f8ee;
  --warn:       #d97706;
  --warn-wash:  #fdf1de;
  --bad:        #dc2626;
  --bad-wash:   #fce8e8;

  --code-bg:    #0b1120;
  --code-ink:   #e7edf7;
  --code-key:   #7aa2f7;
  --code-str:   #9ece6a;

  --radius:     14px;
  --radius-sm:  9px;
  --radius-lg:  22px;
  --shadow-sm:  0 1px 2px rgba(15,23,42,.05), 0 2px 8px rgba(15,23,42,.04);
  --shadow-md:  0 6px 22px rgba(15,23,42,.08), 0 2px 8px rgba(15,23,42,.05);
  --shadow-lg:  0 24px 60px rgba(15,44,110,.18), 0 8px 22px rgba(15,23,42,.08);

  --gutter:     clamp(1.1rem, 4vw, 2.4rem);
  --maxw:       1240px;

  --sans:  "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Space Grotesk", var(--sans);
  --mono:  "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --ease-out:  cubic-bezier(0.16, 1, 0.3, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink:        #eef2fb;
    --ink-soft:   #c3ccdf;
    --muted:      #93a0ba;
    --line:       #263049;
    --line-soft:  #1a2338;
    --bg:         #0b1120;
    --surface:    #121a2e;
    --surface-2:  #182238;
    --accent-wash:#182747;
    --good-wash:  #0f2a1c;
    --warn-wash:  #2c220d;
    --bad-wash:   #2c1414;
    --shadow-sm:  0 1px 2px rgba(0,0,0,.3), 0 2px 8px rgba(0,0,0,.24);
    --shadow-md:  0 6px 22px rgba(0,0,0,.35), 0 2px 8px rgba(0,0,0,.24);
    --shadow-lg:  0 24px 60px rgba(0,0,0,.5), 0 8px 22px rgba(0,0,0,.3);
  }
}

/* =============================================================
   2. Reset & base
   ============================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; tab-size: 2; scroll-behavior: smooth; overflow-x: clip; }
body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  overscroll-behavior-y: none;
}
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
a { color: inherit; text-decoration: none; }
p { text-wrap: pretty; }
h1, h2, h3, h4 { text-wrap: balance; line-height: 1.12; letter-spacing: -0.01em; font-family: var(--display); }
code, pre { font-family: var(--mono); }
::selection { background: var(--accent); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* =============================================================
   3. Utilidades
   ============================================================= */
.container { max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.skip-link {
  position: fixed; top: -100px; left: 1rem;
  padding: .6rem 1rem; background: var(--surface); color: var(--ink);
  z-index: 9999; border-radius: 8px; font-weight: 600; box-shadow: var(--shadow-md);
}
.skip-link:focus { top: 1rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.section { padding-block: clamp(2.6rem, 6vw, 4.6rem); }
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .5s var(--ease-out), transform .5s var(--ease-out); }
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { transition: none; } }
.eyebrow { display: inline-flex; align-items: center; gap: .4rem; font-size: .8rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--accent-ink); }
.section-head { max-width: 62ch; margin-bottom: 2rem; }
.section-title { font-size: clamp(1.5rem, 3vw, 2.1rem); margin-top: .4rem; }
.lead { color: var(--ink-soft); font-size: 1.05rem; max-width: 68ch; }
.prose h2 { margin-top: 2.2rem; margin-bottom: .7rem; font-size: 1.4rem; }
.prose h3 { margin-top: 1.6rem; margin-bottom: .5rem; font-size: 1.15rem; }
.prose p { margin-bottom: 1rem; color: var(--ink-soft); }
.prose a { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 2px; }
.prose ul, .prose ol { margin: 0 0 1rem 1.3rem; color: var(--ink-soft); }
.prose li { margin-bottom: .35rem; }

/* =============================================================
   4. Componentes base
   ============================================================= */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; padding: .78rem 1.3rem; border-radius: 999px; font-weight: 600; font-size: .95rem; transition: transform .2s var(--ease-out), box-shadow .2s var(--ease-out), background .2s, border-color .2s, color .2s; white-space: nowrap; }
.btn-primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; box-shadow: 0 6px 18px rgba(50,108,229,.32); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(50,108,229,.4); }
.btn-ghost { background: var(--surface); color: var(--ink); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent-ink); transform: translateY(-2px); }
.btn-sm { padding: .5rem .9rem; font-size: .85rem; }
.btn-lg { padding: 1.05rem 2rem; font-size: 1.08rem; }
.btn[disabled] { opacity: .4; pointer-events: none; }
.pill { display: inline-flex; align-items: center; gap: .45rem; padding: .4rem .85rem; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: .82rem; font-weight: 500; color: var(--ink-soft); box-shadow: var(--shadow-sm); }
.pill svg { width: 15px; height: 15px; color: var(--accent); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }

.ad-slot { min-height: 96px; display: flex; align-items: center; justify-content: center; border: 1px dashed var(--line); border-radius: var(--radius-sm); color: var(--muted); font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; background: var(--surface-2); margin: 2.4rem auto; max-width: 970px; }

/* =============================================================
   5. Header / Footer
   ============================================================= */
.site-header { position: sticky; top: 0; z-index: 60; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.nav { display: flex; align-items: center; justify-content: space-between; height: 66px; gap: 1rem; }
.brand { display: inline-flex; align-items: center; gap: .55rem; font-family: var(--display); font-weight: 700; font-size: 1.12rem; letter-spacing: -0.01em; color: var(--ink); }
.brand .logo { width: 28px; height: 28px; flex: none; }
.nav-links { display: flex; align-items: center; gap: 1.4rem; }
.nav-links a { font-size: .93rem; color: var(--ink-soft); font-weight: 500; transition: color .2s; }
.nav-links a:hover { color: var(--accent-ink); }
.nav-links .btn { padding: .55rem 1.1rem; font-size: .9rem; }
.nav-toggle { display: none; }

.footer { border-top: 1px solid var(--line); padding-block: 2.6rem 1.6rem; background: var(--surface-2); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2rem; margin-bottom: 1.8rem; }
.footer-grid h4 { font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: .7rem; }
.footer-grid a { display: block; font-size: .92rem; color: var(--ink-soft); padding-block: .28rem; }
.footer-grid a:hover { color: var(--accent-ink); }
.footer-bottom { display: flex; flex-wrap: wrap; gap: .6rem 1.2rem; justify-content: space-between; padding-top: 1.4rem; border-top: 1px solid var(--line); font-size: .85rem; color: var(--muted); }
.footer-bottom a { color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }

/* =============================================================
   6. Hero + herramienta
   ============================================================= */
.hero { padding-block: clamp(1.6rem, 4vw, 2.6rem) .6rem; }
.hero-copy { max-width: 78ch; margin-bottom: 1.6rem; }
.h1 { font-size: clamp(1.7rem, 3.6vw, 2.6rem); margin-top: .5rem; }
.hero-trust { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.1rem; }

.studio-shell { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: 1.4rem; align-items: start; }
.resource-tabs { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.2rem; }
.resource-tab { padding: .55rem 1rem; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: .86rem; font-weight: 600; color: var(--ink-soft); transition: all .18s var(--ease-out); }
.resource-tab:hover { border-color: var(--accent); color: var(--accent-ink); }
.resource-tab.active { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; border-color: transparent; box-shadow: 0 4px 14px rgba(50,108,229,.3); }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); padding: 1.4rem; }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; gap: .6rem; flex-wrap: wrap; }
.panel-head h2 { font-size: 1.08rem; }

.form-section-title { font-size: .82rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-top: 1.3rem; margin-bottom: .5rem; padding-top: .9rem; border-top: 1px solid var(--line-soft); }
.form-section-title:first-of-type { border-top: 0; padding-top: 0; margin-top: .4rem; }

.field { margin-bottom: .85rem; }
.field label { display: block; font-size: .82rem; font-weight: 600; color: var(--ink-soft); margin-bottom: .3rem; }
.field input[type="text"], .field input[type="number"], .field select, .field textarea {
  width: 100%; padding: .6rem .75rem; border-radius: var(--radius-sm); border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font-size: .92rem; font-family: var(--sans);
  transition: border-color .18s;
}
.field textarea { font-family: var(--mono); font-size: .84rem; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); }
.field-help { font-size: .78rem; color: var(--muted); margin-top: .3rem; }
.field-note { font-size: .82rem; color: var(--accent-ink); background: var(--accent-wash); border-radius: var(--radius-sm); padding: .6rem .75rem; margin: .4rem 0 1rem; }
.field-checkbox .checkbox-label { display: flex; align-items: center; gap: .55rem; font-size: .88rem; font-weight: 500; color: var(--ink); cursor: pointer; }
.field-checkbox input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--accent); }

.rows-editor { display: flex; flex-direction: column; gap: .55rem; margin-bottom: .6rem; }
.row-item { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)) auto; gap: .5rem; align-items: end; background: var(--surface-2); border: 1px solid var(--line-soft); border-radius: var(--radius-sm); padding: .6rem; }
.row-item-stack { grid-template-columns: 1fr 2fr auto; }
.row-cell label { display: block; font-size: .72rem; color: var(--muted); margin-bottom: .2rem; }
.row-cell input, .row-cell select, .row-cell textarea { width: 100%; padding: .45rem .55rem; border-radius: 7px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-size: .85rem; }
.row-cell textarea { font-family: var(--mono); font-size: .78rem; }
.row-cell-wide { min-width: 0; }
.row-remove { align-self: center; width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--bad); font-size: .8rem; flex: none; }
.row-remove:hover { background: var(--bad-wash); border-color: var(--bad); }
.rows-empty { font-size: .82rem; color: var(--muted); font-style: italic; }

.form-errors { background: var(--bad-wash); border: 1px solid color-mix(in srgb, var(--bad) 40%, transparent); color: var(--bad); border-radius: var(--radius-sm); padding: .8rem 1rem; font-size: .84rem; margin-bottom: 1rem; }
.form-errors ul { margin: .4rem 0 0 1.1rem; }

.preview-panel { position: sticky; top: 82px; }
.preview-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .7rem; gap: .5rem; flex-wrap: wrap; }
.preview-head .fname { font-family: var(--mono); font-size: .82rem; color: var(--ink-soft); display: inline-flex; align-items: center; gap: .4rem; }
.preview-live { display: inline-flex; align-items: center; gap: .35rem; font-size: .74rem; color: var(--good); font-weight: 600; }
.blip { width: 7px; height: 7px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 3px var(--good-wash); }
.preview-code { background: var(--code-bg); color: var(--code-ink); border-radius: var(--radius-sm); padding: 1rem; font-size: .8rem; line-height: 1.55; max-height: 480px; overflow: auto; white-space: pre; }
.preview-foot { display: flex; justify-content: space-between; font-size: .76rem; color: var(--muted); margin-top: .5rem; }
.preview-actions { display: flex; flex-wrap: wrap; gap: .55rem; margin-top: .9rem; }
.preview-actions .btn { flex: 1 1 auto; }

.bundle-panel { margin-top: 1.1rem; padding-top: 1rem; border-top: 1px solid var(--line-soft); }
.bundle-panel h3 { font-size: .86rem; margin-bottom: .5rem; }
.bundle-list { list-style: none; display: flex; flex-direction: column; gap: .4rem; margin-bottom: .7rem; }
.bundle-list li { display: flex; align-items: center; justify-content: space-between; gap: .6rem; background: var(--surface-2); border: 1px solid var(--line-soft); border-radius: var(--radius-sm); padding: .4rem .6rem; font-size: .82rem; }
.bundle-remove { width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--bad); font-size: .72rem; flex: none; }
.bundle-actions { display: flex; gap: .55rem; flex-wrap: wrap; }

.privacy-badge { display: flex; flex-wrap: wrap; align-items: center; gap: .7rem 1.4rem; margin-top: 1.4rem; padding: .9rem 1.1rem; background: var(--good-wash); border: 1px solid color-mix(in srgb, var(--good) 30%, transparent); border-radius: var(--radius); font-size: .86rem; color: var(--ink-soft); }
.privacy-badge strong { color: var(--ink); }
.limits-note { font-size: .82rem; color: var(--muted); margin-top: .5rem; }

/* =============================================================
   7. Secciones de contenido
   ============================================================= */
.steps { display: grid; gap: 1rem; margin-top: 1.2rem; }
.step-row { display: flex; gap: 1rem; padding: 1rem; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.step-row .num { flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--accent-wash); color: var(--accent-ink); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .9rem; }
.step-row h3 { font-size: 1rem; margin-bottom: .25rem; }
.step-row p { color: var(--ink-soft); font-size: .92rem; }

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.1rem; }
.tool-card-mini { padding: 1.2rem; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.tool-card-mini .ico { width: 40px; height: 40px; border-radius: 10px; background: var(--accent-wash); color: var(--accent-ink); display: flex; align-items: center; justify-content: center; margin-bottom: .7rem; }
.tool-card-mini .ico svg { width: 20px; height: 20px; }
.tool-card-mini h3 { font-size: 1.02rem; margin-bottom: .3rem; }
.tool-card-mini p { color: var(--ink-soft); font-size: .9rem; }
.tool-card-mini.soon { opacity: .6; }
.tool-card-mini .soon-badge { display: inline-block; font-size: .68rem; text-transform: uppercase; letter-spacing: .05em; background: var(--surface-2); color: var(--muted); padding: .2rem .5rem; border-radius: 999px; margin-top: .5rem; }

.faq { display: flex; flex-direction: column; gap: .6rem; margin-top: 1.2rem; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .2rem .2rem; }
.faq summary { cursor: pointer; list-style: none; font-weight: 600; font-size: .96rem; padding: .85rem 1rem; display: flex; justify-content: space-between; gap: 1rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--accent-ink); font-size: 1.2rem; flex: none; }
.faq details[open] summary::after { content: "–"; }
.faq .faq-a { padding: 0 1rem 1rem; color: var(--ink-soft); font-size: .92rem; }

.articles-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.1rem; margin-top: 1.2rem; }
.article-card { display: block; padding: 1.2rem; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); transition: transform .2s var(--ease-out), box-shadow .2s var(--ease-out); }
.article-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.article-card .tag { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--accent-ink); }
.article-card h3 { font-size: 1rem; margin: .4rem 0 .4rem; }
.article-card p { color: var(--ink-soft); font-size: .88rem; }

.compare table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.compare th, .compare td { text-align: left; padding: .7rem .8rem; border-bottom: 1px solid var(--line); }
.compare thead th { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; }
.compare .yes { color: var(--good); font-weight: 600; }
.compare .no { color: var(--muted); }

/* =============================================================
   8. Cookie banner
   ============================================================= */
.cookie-banner { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%) translateY(140%); width: min(700px, calc(100% - 2rem)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 1.2rem 1.3rem; z-index: 250; transition: transform .5s var(--ease-out); }
.cookie-banner.show { transform: translateX(-50%) translateY(0); }
.cookie-banner p { font-size: .9rem; color: var(--ink-soft); margin-bottom: 1rem; }
.cookie-banner a { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 2px; }
.cookie-actions { display: flex; gap: .7rem; flex-wrap: wrap; }
.cookie-actions .btn { padding: .7rem 1.3rem; font-size: .9rem; flex: 1 1 auto; }
@media (prefers-reduced-motion: reduce) { .cookie-banner { transition: none; } }
@media (max-width: 480px) { .cookie-actions { flex-direction: column-reverse; } }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); background: var(--ink); color: var(--bg); padding: .6rem 1.1rem; border-radius: 999px; font-size: .85rem; font-weight: 600; opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; z-index: 300; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* =============================================================
   9. Responsive
   ============================================================= */
@media (max-width: 960px) {
  .studio-shell { grid-template-columns: 1fr; }
  .preview-panel { position: static; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .grid-3, .articles-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  .nav-links { position: fixed; inset: 66px 0 auto 0; background: var(--surface); flex-direction: column; align-items: stretch; padding: 1rem var(--gutter) 1.4rem; border-bottom: 1px solid var(--line); box-shadow: var(--shadow-md); transform: translateY(-8px); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
  .nav-links.open { transform: translateY(0); opacity: 1; pointer-events: auto; }
  .nav-links a { padding-block: .6rem; }
  .nav-toggle { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 8px; border: 1px solid var(--line); }
  .footer-grid { grid-template-columns: 1fr; }
  .grid-3, .articles-grid { grid-template-columns: 1fr; }
  .row-item { grid-template-columns: 1fr 1fr auto; }
  .row-item-stack { grid-template-columns: 1fr auto; }
  .row-item-stack .row-cell-wide { grid-column: 1 / -1; }

  /* Herramienta usable sin scroll en móvil: recortar el hero y convertir
     las pestañas de recurso en una tira horizontal en vez de envolver. */
  .hero { padding-block: .6rem .3rem; }
  .hero-copy { margin-bottom: .8rem; }
  .hero-copy .eyebrow { font-size: .72rem; }
  .h1 { font-size: 1.32rem; margin-top: .3rem; }
  .hero-copy .lead { font-size: .88rem; margin-top: .3rem; }
  .hero-trust { display: none; }
  .panel { padding: .9rem; }
  .panel-head { margin-bottom: .6rem; }
  .panel-head h2 { font-size: .95rem; }
  .resource-tabs { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: .4rem; margin-bottom: .8rem; scrollbar-width: thin; }
  .resource-tab { flex: none; padding: .5rem .85rem; font-size: .8rem; }
}
@media (max-width: 539px) {
  .row-item { grid-template-columns: 1fr auto; }
}
