/* ELECTRA Mark VIII: Pastel Cyber-Kawaii theme
   Replaces style.css. Keeps the existing HTML structure and responsive layout. */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --page: #fffaff;
  --surface: #ffffff;
  --surface-lavender: #f5efff;
  --surface-pink: #fff0f7;
  --surface-mint: #eafaf5;
  --ink: #352b49;
  --muted: #70677e;
  --purple: #8657d8;
  --purple-dark: #6840b4;
  --pink: #ef8fbd;
  --mint: #79cdb5;
  --yellow: #ffe9a6;
  --border: #e7d9f7;
  --shadow: 0 8px 24px rgba(101, 70, 150, .10);
}

html { scroll-behavior: smooth; scroll-padding-top: 100px; }

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.7;
  color: var(--ink);
  background:
    radial-gradient(ellipse at 8% 4%, rgba(232, 211, 255, .42), transparent 28rem),
    radial-gradient(ellipse at 94% 30%, rgba(255, 221, 239, .35), transparent 32rem),
    var(--page);
}

a { color: var(--purple-dark); }
a:hover { color: #bd5794; }

.wrap { max-width: 1100px; margin: 0 auto; padding: 0 24px; }

/* Header */
.site-header {
  position: sticky; top: 0;
  background: rgba(255, 250, 255, .90);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 3px 16px rgba(101, 70, 150, .06);
  z-index: 10;
}
.header-inner {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 0;
}
.logo {
  font-weight: 700; font-size: 1.1rem; text-decoration: none;
  color: var(--purple-dark);
}
.site-header nav a {
  display: inline-block; margin-left: 20px; text-decoration: none;
  color: var(--muted); font-size: .92rem; transition: color .2s;
}
.site-header nav a:hover { color: var(--purple); }

/* Hero */
.hero {
  padding: 76px 0 60px; text-align: center;
  background: linear-gradient(135deg, rgba(245,239,255,.82), rgba(255,240,247,.72) 55%, rgba(234,250,245,.7));
  border-bottom: 1px solid #eee2fa;
}
.eyebrow {
  text-transform: uppercase; letter-spacing: 2px; font-size: .8rem;
  color: var(--purple); margin-bottom: 12px;
}
.hero h1 {
  font-size: clamp(2rem, 5vw, 3.2rem); line-height: 1.2;
  margin-bottom: 16px; color: var(--purple-dark);
}
.lead {
  font-size: 1.12rem; color: var(--muted); max-width: 680px;
  margin: 0 auto 24px;
}
.tags {
  display: flex; gap: 8px; justify-content: center; flex-wrap: wrap;
  margin-bottom: 24px;
}
.tag {
  background: var(--surface-lavender); padding: 5px 13px;
  border: 1px solid #e5d6fb; border-radius: 20px;
  font-size: .85rem; color: #62469b;
}
.tag:nth-child(2) { background: var(--surface-pink); border-color: #f8d5e7; color: #a94e7e; }
.tag:nth-child(3) { background: var(--surface-mint); border-color: #c8eee2; color: #287d68; }
.tag:nth-child(4) { background: #fff6d8; border-color: #f6e4a5; color: #88651b; }
.hero-actions {
  display: flex; gap: 12px; justify-content: center;
  margin-bottom: 40px; flex-wrap: wrap;
}
.btn {
  display: inline-block; padding: 12px 24px; border-radius: 999px;
  text-decoration: none; font-weight: 700;
  background: var(--purple); color: #fff;
  border: 1px solid var(--purple); box-shadow: 0 5px 14px rgba(134,87,216,.2);
  transition: transform .18s, background .18s, box-shadow .18s;
}
.btn:hover {
  background: var(--purple-dark); color: #fff;
  transform: translateY(-2px); box-shadow: 0 8px 18px rgba(134,87,216,.25);
}
.btn-ghost {
  background: rgba(255,255,255,.65); color: var(--purple-dark);
  border: 1px solid #d8c5f4; box-shadow: none;
}
.btn-ghost:hover { background: var(--surface-pink); color: #a94e7e; }
.hero-img {
  width: 100%; max-width: 800px; border-radius: 18px;
  box-shadow: var(--shadow); margin: 0 auto; display: block;
  border: 4px solid rgba(255,255,255,.85);
}

/* Sections */
.section { padding: 76px 0; }
.section.alt {
  background: linear-gradient(120deg, rgba(245,239,255,.74), rgba(255,250,255,.85) 65%, rgba(234,250,245,.62));
  border-top: 1px solid #eee4fa; border-bottom: 1px solid #eee4fa;
}
.section h2 {
  font-size: 2rem; line-height: 1.3; margin-bottom: 24px;
  color: var(--purple-dark);
}
.section h3 { color: #6d4bb1; }
.section h4 { color: #7258a2; }
.section p { margin-bottom: 16px; max-width: 760px; }
.kicker { color: var(--muted); }

/* Section numbers and table of contents */
.num {
  display: inline-block; font-size: .76rem; font-weight: 700;
  letter-spacing: 2px; text-transform: uppercase; color: var(--purple);
  background: #eee3ff; border-radius: 999px; padding: 5px 12px; margin-bottom: 10px;
}
.section-index {
  max-width: 1000px; margin: 28px auto 30px; padding: 24px;
  border: 1px solid var(--border); border-radius: 18px;
  background: rgba(255,255,255,.9); box-shadow: var(--shadow);
}
.section-index h2 { margin: 0 0 14px; font-size: 1.2rem; color: var(--purple-dark); }
.section-index ol {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px 24px; padding-left: 28px; margin: 0;
}
.section-index li { padding: 3px 0; color: var(--purple); }
.section-index a { color: var(--ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.section-index a:hover { color: #bd5794; }

/* Stats */
.stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 24px; margin-top: 40px;
}
.stat {
  text-align: center; padding: 24px; background: var(--surface);
  border-radius: 16px; border: 1px solid var(--border); box-shadow: var(--shadow);
}
.stat strong { display: block; font-size: 1.8rem; color: var(--purple-dark); }
.stat span { font-size: .9rem; color: var(--muted); }

/* Cards and panels */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 24px; }
.card, .panel {
  background: rgba(255,255,255,.92); padding: 24px;
  border-radius: 16px; border: 1px solid var(--border);
  box-shadow: 0 5px 18px rgba(101,70,150,.06);
}
.card:nth-child(3n+2) { border-top: 4px solid var(--pink); }
.card:nth-child(3n+3) { border-top: 4px solid var(--mint); }
.card h3, .panel h3 { font-size: 1.08rem; margin-bottom: 8px; }
.card p, .panel p, .panel li { font-size: .95rem; color: var(--muted); }
.card p { margin: 0; }
.panel h4 { margin: 16px 0 8px; }
.panel ul { padding-left: 20px; }
.panel li { margin-bottom: 6px; }

/* Gallery and figures */
.gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.gallery figure { margin: 0; }
.gallery img {
  width: 100%; height: 220px; object-fit: cover; border-radius: 14px;
  display: block; border: 1px solid var(--border);
}
.gallery figcaption, figure.wide figcaption {
  text-align: center; font-size: .88rem; color: var(--muted); margin-top: 10px;
}
figure.wide { margin: 32px 0; }
figure.wide img { width: 100%; border-radius: 16px; display: block; border: 1px solid var(--border); }

/* Tables */
.table-wrap { overflow-x: auto; margin-top: 24px; border-radius: 12px; }
table {
  width: 100%; border-collapse: collapse; background: #fff;
  border-radius: 12px; overflow: hidden; border: 1px solid var(--border);
}
th, td {
  text-align: left; padding: 13px 16px; border-bottom: 1px solid #eee5f7;
  font-size: .95rem;
}
th { background: #eee4ff; color: #50347f; font-weight: 700; }
tbody tr:nth-child(even) { background: #fff8fc; }
tbody tr:hover { background: #f0fbf7; }
tr:last-child td { border-bottom: none; }

/* Build instructions: numbered major steps, nested instructions stay bullets */
.steps { list-style: none; counter-reset: step; max-width: 760px; }
.steps > li {
  counter-increment: step; position: relative; padding: 20px 22px 20px 72px;
  margin-bottom: 20px; background: rgba(255,255,255,.94);
  border: 1px solid var(--border); border-radius: 16px; box-shadow: 0 4px 14px rgba(101,70,150,.06);
}
.steps > li::before {
  content: counter(step); position: absolute; left: 16px; top: 16px;
  width: 40px; height: 40px; background: var(--purple); color: #fff;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-weight: 700; box-shadow: 0 3px 8px rgba(134,87,216,.22);
}
.steps h3 { font-size: 1.1rem; margin-bottom: 6px; color: var(--purple-dark); }
.steps p { margin: 0 0 8px; color: var(--muted); font-size: .95rem; }
.steps > li > ul {
  list-style: disc !important; padding-left: 22px; margin: 10px 0 0;
  counter-reset: none !important;
}
.steps > li > ul > li {
  list-style: disc !important; counter-increment: none !important;
  padding-left: 0; margin: 0 0 6px; color: var(--muted);
}
.steps > li > ul > li::before { content: none !important; display: none !important; }

/* Code */
pre {
  background: #382d4c; color: #fff8ff; padding: 24px;
  border-radius: 14px; overflow-x: auto; font-size: .9rem;
  line-height: 1.6; margin: 20px 0; border: 1px solid #51416b;
}
code { font-family: "SF Mono", "Fira Code", monospace; font-size: .9em; }
p code, li code { background: #f0e8ff; color: #5d3c91; padding: 2px 6px; border-radius: 5px; }

/* Callouts, warnings, highlights, and quotes */
.warn, .highlight {
  border-radius: 14px; padding: 20px 24px; margin: 24px 0;
}
.warn { background: #fff8df; border: 1px solid #f0dfa1; border-left: 5px solid #e6b943; }
.warn h3 { margin-bottom: 8px; font-size: 1.05rem; color: #8c681b; }
.warn p { margin: 0 0 8px; font-size: .95rem; }
.warn p:last-child { margin-bottom: 0; }
.danger { background: #fff0f2; border-color: #f0b7c5; border-left-color: #d95872; }
.danger h3 { color: #a82f4a; }
.highlight { background: #eafaf4; border: 1px solid #bde8d9; border-left: 5px solid #58b99c; }
.highlight h3 { margin-bottom: 8px; font-size: 1.05rem; color: #267a63; }
.highlight p { margin: 0 0 8px; font-size: .95rem; }
.highlight p:last-child { margin-bottom: 0; }
.quote {
  border-left: 4px solid var(--pink); background: #fff3f9;
  padding: 18px 22px; margin: 28px 0; font-style: italic;
  color: #65516f; max-width: 760px; border-radius: 0 12px 12px 0;
}

/* Lists */
.checklist { list-style: none; max-width: 760px; }
.checklist li { position: relative; padding-left: 36px; margin-bottom: 12px; font-size: .97rem; color: var(--ink); }
.checklist li::before { content: "☐"; position: absolute; left: 0; top: -2px; font-size: 1.3rem; color: var(--purple); }
.refs { list-style: none; max-width: 800px; }
.refs li { margin-bottom: 16px; font-size: .95rem; color: var(--muted); }
.refs li strong { color: var(--ink); }
.refs a { color: var(--purple-dark); word-break: break-word; }

/* Parts list and version history */
.part-list { max-width: 820px; }
.part-list h3 { font-size: 1.05rem; margin: 28px 0 10px; }
.part-list ul { padding-left: 22px; }
.part-list li { margin-bottom: 8px; font-size: .94rem; color: var(--muted); line-height: 1.55; }
.part-list li strong { color: var(--ink); }
.version { border-left: 3px solid #d8c5f4; padding-left: 20px; margin-bottom: 28px; }
.version strong { display: block; font-size: 1rem; color: var(--purple-dark); }
.version span { font-size: .82rem; color: #9a8bad; }
.version p { margin: 6px 0 0; font-size: .93rem; color: var(--muted); }

/* Miscellaneous components used by the page */
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; margin-top: 24px; }
.formula {
  background: #382d4c; color: #fff8ff; padding: 20px 24px; border-radius: 12px;
  font-size: 1rem; margin: 20px 0; text-align: center; overflow-x: auto;
}
.chem {
  background: #f5efff; color: #50347f; border: 1px solid var(--border);
  border-radius: 12px; padding: 16px 20px; font-size: .95rem; margin: 16px 0; overflow-x: auto;
}
.step-group { margin-bottom: 32px; }
.step-group h3 { font-size: 1.05rem; margin-bottom: 8px; }
.credit { font-size: .85rem; color: #9a8bad; margin-top: 24px; }
.credit a { color: var(--purple-dark); }
.support { text-align: center; padding: 40px 0; }
.support .btn { font-size: 1.05rem; padding: 16px 32px; }
.site-footer {
  padding: 40px 0; text-align: center; border-top: 1px solid var(--border);
  color: #8c819b; font-size: .9rem;
  background: linear-gradient(110deg, #f5efff, #fff5fa, #effbf7);
}
.site-footer a { color: var(--purple-dark); }
.muted { font-size: .8rem; margin-top: 8px; }

/* Keep keyboard focus visible */
a:focus-visible, button:focus-visible {
  outline: 3px solid #bd91ff; outline-offset: 3px; border-radius: 5px;
}

/* Responsive */
@media (max-width: 700px) {
  .header-inner { flex-direction: column; gap: 12px; }
  .site-header nav { display: flex; justify-content: center; flex-wrap: wrap; gap: 4px 12px; }
  .site-header nav a { margin: 0 2px; }
  .hero { padding: 56px 0 40px; }
  .section { padding: 56px 0; }
  .section h2 { font-size: 1.7rem; }
  .section-index { margin-left: 12px; margin-right: 12px; padding: 18px; }
  .section-index ol { grid-template-columns: 1fr; }
  .steps > li { padding: 16px 16px 16px 62px; }
  .steps > li::before { left: 12px; top: 14px; width: 36px; height: 36px; }
  th, td { padding: 10px 12px; }
}
