/* Home page (theme picker) only. The test pages use rig.css. */
:root {
  --bg: #f6f5f2; --panel: #ffffff; --ink: #18171c; --muted: #6d6a75; --line: #e4e1db; --grid: rgba(24, 23, 28, .045);
  --red: #e13336; --red-soft: #fdeceb; --ok: #1f9d63; --ok-soft: #dff3e8; --chip: #1d1b22;
  --sans: "Space Grotesk", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  min-height: 100vh; display: flex; flex-direction: column; color: var(--ink); font: 15px/1.5 var(--sans);
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, transparent 0%, var(--bg) 75%),
    linear-gradient(var(--grid) 1px, transparent 1px) 0 0 / 28px 28px,
    linear-gradient(90deg, var(--grid) 1px, transparent 1px) 0 0 / 28px 28px,
    var(--bg);
}
main, .bar, footer { width: 100%; max-width: 1120px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }
main { flex: 1; }
a { color: var(--red); }

/* top bar */
.bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 22px; padding-bottom: 22px; }
.mark img { height: 44px; width: auto; display: block; }
.link { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border: 1px solid var(--line);
        border-radius: 999px; background: var(--panel); font: 500 .75rem var(--mono); letter-spacing: .04em;
        text-transform: uppercase; color: var(--muted); }
.led { width: 8px; height: 8px; border-radius: 50%; background: #b8b4ad; flex: none; }
.link.ok .led, .state .led { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); animation: pulse 2.4s ease-in-out infinite; }
.link.bad .led { background: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px transparent; } }

/* hero */
.hero { padding: 40px 0 36px; }
.eyebrow { font: 600 .78rem var(--mono); color: var(--red); letter-spacing: .12em; text-transform: uppercase; }
.hero h1 { font-size: clamp(2.6rem, 6vw, 4rem); font-weight: 700; letter-spacing: -.03em; line-height: 1.05; margin: 10px 0 12px; }
.lede { max-width: 560px; color: var(--muted); font-size: 1.05rem; }
.steps { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 32px;
         border: 1px solid var(--line); border-radius: 14px; background: var(--panel); overflow: hidden; }
.steps li { padding: 16px 18px; font-size: .9rem; display: flex; gap: 12px; align-items: baseline; }
.steps li + li { border-left: 1px dashed var(--line); }
.steps span { font: 600 .8rem var(--mono); color: var(--red); }

/* notice when Web Serial is missing */
.notice { background: var(--red-soft); border: 1px solid #f5c6c4; border-radius: 12px; padding: 12px 16px; margin-bottom: 24px; }
.notice[hidden] { display: none; }

/* edition sections */
.edition { margin-bottom: 40px; }
.edition h2 { display: flex; align-items: center; gap: 14px; margin-bottom: 18px;
              font: 600 .85rem var(--mono); letter-spacing: .08em; color: var(--muted); }   /* no uppercase: keeps "e-YRC" */
.edition h2::before { content: ""; width: 10px; height: 10px; background: var(--red); transform: rotate(45deg); flex: none; }
.edition h2::after { content: ""; flex: 1; height: 1px; background: repeating-linear-gradient(90deg, var(--line) 0 6px, transparent 6px 10px); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; }

/* theme card: a hardware module */
.module { position: relative; display: flex; flex-direction: column; gap: 18px; padding: 22px 26px; overflow: hidden;
          text-decoration: none; color: inherit; background: var(--panel); border: 1px solid var(--line); border-radius: 16px;
          box-shadow: 0 1px 2px rgba(24, 23, 28, .04), 0 10px 30px -12px rgba(24, 23, 28, .12);
          transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease; }
.module::before { /* faint circuit trace in the corner */
  content: ""; position: absolute; right: -10px; bottom: -10px; width: 170px; height: 120px; opacity: .07; pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 170 120' fill='none' stroke='%2318171c' stroke-width='3'%3E%3Cpath d='M10 110h50l20-20h40l20-20h30M60 110V80l20-20h30M120 90v30M150 70V30'/%3E%3Ccircle cx='110' cy='60' r='5'/%3E%3Ccircle cx='150' cy='25' r='5'/%3E%3Ccircle cx='10' cy='110' r='5'/%3E%3C/g%3E%3C/svg%3E") no-repeat right bottom / contain; }
.module::after { /* scan line on hover */
  content: ""; position: absolute; left: 0; right: 0; top: -40%; height: 40%; pointer-events: none; opacity: 0;
  background: linear-gradient(180deg, transparent, rgba(225, 51, 54, .06), transparent); }
.module:hover, .module:focus-visible { transform: translateY(-3px); border-color: #f0b4b3; outline: none;
  box-shadow: 0 0 0 4px var(--red-soft), 0 18px 40px -16px rgba(225, 51, 54, .35); }
.module:hover::after { opacity: 1; animation: scan 1.6s ease-in-out infinite; }
@keyframes scan { to { top: 100%; } }

.corner { position: absolute; width: 14px; height: 14px; border-color: var(--red); border-style: solid; transition: all .2s ease; }
.corner.tl { top: 8px; left: 8px; border-width: 2px 0 0 2px; border-top-left-radius: 6px; }
.corner.br { bottom: 8px; right: 8px; border-width: 0 2px 2px 0; border-bottom-right-radius: 6px; }
.module:hover .corner { width: 22px; height: 22px; }

.module-head { display: flex; justify-content: space-between; align-items: center; font: 500 .72rem var(--mono);
               letter-spacing: .05em; color: var(--muted); padding-left: 10px; }
.state { display: inline-flex; align-items: center; gap: 7px; text-transform: uppercase; color: var(--ok); }

.module-body { display: flex; align-items: center; gap: 18px; }
.ic { position: relative; width: 58px; height: 58px; margin: 0 6px; flex: none; border-radius: 8px; background: var(--chip);
      display: grid; place-items: center; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08); }
.ic::before, .ic::after { /* pins */
  content: ""; position: absolute; top: 9px; bottom: 9px; width: 6px;
  background: repeating-linear-gradient(180deg, #b9b4ad 0 4px, transparent 4px 10px); }
.ic::before { left: -6px; } .ic::after { right: -6px; }
.ic span { font: 600 1rem var(--mono); color: #fff; letter-spacing: .04em; }
.ic span::before { /* pin-1 dot */
  content: ""; position: absolute; top: 7px; left: 7px; width: 5px; height: 5px; border-radius: 50%; background: var(--red); }
.module h3 { font-size: 1.35rem; font-weight: 600; letter-spacing: -.01em; }
.task { color: var(--muted); font-size: .9rem; }

.parts { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }
.parts li { font: 500 .74rem var(--mono); padding: 4px 9px; border-radius: 6px; background: #f3f1ed; border: 1px solid var(--line); }
.about { color: var(--muted); font-size: .9rem; }

.module-foot { display: flex; justify-content: space-between; align-items: center; padding-top: 14px;
               border-top: 1px dashed var(--line); font: 500 .74rem var(--mono); color: var(--muted); letter-spacing: .04em; }
.go { font: 600 .9rem var(--sans); color: var(--red); letter-spacing: 0; }
.go b { display: inline-block; transition: transform .2s ease; }
.module:hover .go b { transform: translateX(4px); }

/* footer */
footer { padding-bottom: 24px; }
.foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 18px;
        border-top: 1px solid var(--line); font: 500 .74rem var(--mono); color: var(--muted); letter-spacing: .04em; }

@media (max-width: 720px) {
  .steps { grid-template-columns: 1fr; }
  .steps li + li { border-left: 0; border-top: 1px dashed var(--line); }
  .hero { padding-top: 20px; }
}
@media (max-width: 480px) {
  main, .bar, footer { padding-left: 16px; padding-right: 16px; }
  .mark img { height: 34px; }
  .grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
