/* ═══════════════════════════════════════════════════════════════════════
   home.css — the landing page (site_index.html), 2026-09 refresh

   The hero is the one loud thing on the site: a dark panel that continues
   the header bar, with a system single-line diagram whose M-NET line pulses
   once on load. Everything below it is quiet: tools grouped by where they
   run (browser / PC / learn), all three in the same card style.
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Hero ───────────────────────────────────────────────────────────── */
.hero {
  position: relative;
  background-color: var(--dark);
  /* Blueprint grid that fades out behind the headline. */
  background-image:
    radial-gradient(ellipse 70% 90% at 78% 45%, transparent 0%, var(--dark) 78%),
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 100% 100%, 24px 24px, 24px 24px;
  background-position: 0 0, -1px -1px, -1px -1px;
  color: var(--white);
  overflow: hidden;
}
.hero-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 64px 28px 72px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr);
  gap: 48px;
  align-items: center;
}

.hero-news {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 4px 14px 4px 4px;
  margin-bottom: 22px;
  border: 1px solid var(--ink-line);
  border-radius: 999px;
  background: var(--ink-2);
  color: var(--on-dark);
  font-size: 13.5px;
  text-decoration: none;
  transition: border-color 0.15s, color 0.15s;
}
.hero-news:hover { border-color: var(--red-on-dark); color: var(--white); }
.hero-news-tag {
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--red);
  color: var(--white);
  font-weight: 700;
  font-size: 12.5px;
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.3rem, 4.3vw, 3.4rem);
  line-height: 1.02;
  letter-spacing: -0.015em;
  text-wrap: balance;
  margin-bottom: 20px;
}
.hero-lede {
  font-size: 1.075rem;
  line-height: 1.6;
  color: var(--on-dark);
  max-width: 50ch;
  margin-bottom: 28px;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 26px; }
.hero-btn {
  display: inline-flex;
  align-items: center;
  height: 46px;
  padding: 0 22px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}
.hero-btn--primary { background: var(--red); color: var(--white); }
.hero-btn--primary:hover { background: #a83224; }
.hero-btn--ghost { border: 1px solid #4a4a4a; color: var(--white); }
.hero-btn--ghost:hover { border-color: var(--white); }
.hero-btn:focus-visible,
.hero-news:focus-visible,
.hero-by a:focus-visible { outline: 2px solid var(--red-on-dark); outline-offset: 3px; }
.hero-by { font-size: 13.5px; color: #9a9a9a; }
.hero-by a { color: var(--on-dark); }
.hero-by a:hover { color: var(--white); }

/* ── System diagram ─────────────────────────────────────────────────── */
.hero-diagram { margin: 0; }
.sysdiag { display: block; width: 100%; height: auto; overflow: visible; }
.sysdiag .unit { fill: var(--ink-2); stroke: #4d4d4d; stroke-width: 1.25; }
.sysdiag .fan circle { fill: none; stroke: #4d4d4d; stroke-width: 1.25; }
.sysdiag .fan path { stroke: #3d3d3d; stroke-width: 1.25; }
.sysdiag .fan .hub { fill: #4d4d4d; stroke: none; }
.sysdiag .screen { fill: #262626; stroke: #4d4d4d; stroke-width: 1; }
.sysdiag .screen-bar { stroke: #3a3a3a; stroke-width: 1; }
.sysdiag .screen-text { stroke: #4a4a4a; stroke-width: 3; stroke-linecap: round; }
.sysdiag .touch-btn { fill: #4a4a4a; }
.sysdiag .touch-ripple { fill: none; stroke: #ff8a7a; stroke-width: 1.5; opacity: 0; }
.sysdiag .tile-bg { fill: #333; }
.sysdiag .louver { stroke: #4d4d4d; stroke-width: 1.25; stroke-linecap: round; }
.sysdiag .u-name { fill: #e8e8e8; font: 600 12px var(--font-sans); }
.sysdiag .u-addr { fill: #9a9a9a; font: 500 11px var(--font-mono); }
.sysdiag .pipe path {
  fill: none;
  stroke: var(--copper-line);
  stroke-width: 2;
  stroke-linejoin: round;
  opacity: 0.85;
}
.sysdiag .mnet path {
  fill: none;
  stroke: var(--red-on-dark);
  stroke-width: 1.75;
  stroke-dasharray: 5 4;
  opacity: 0.55;
}
.sysdiag .mnet-pulse path {
  fill: none;
  stroke: #ff8a7a;
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-dasharray: 0.12 1.5;
  stroke-dashoffset: 0.12;
  opacity: 0;
}
/* Finished state (also what reduced-motion users get): every LED is lit. */
.sysdiag .led,
.sysdiag .tile-dot { fill: #5bd68a; }
.sysdiag .led-glow { fill: #5bd68a; opacity: 0.22; }

@media (prefers-reduced-motion: no-preference) {
  .sysdiag .mnet-pulse .p1 { animation: mnet-run 0.7s ease-in 0.5s both; }
  .sysdiag .mnet-pulse .p2 { animation: mnet-run 0.4s linear 1.2s both; }
  .sysdiag .mnet-pulse .p3 { animation: mnet-run 1s linear 1.6s both; }
  .sysdiag .iu .led { animation: led-on 0.35s ease-out var(--d) both; }
  .sysdiag .iu .led-glow { animation: glow-on 0.9s ease-out var(--d) both; }
  /* A finger taps the AE-C400's collective button just before the pulse
     leaves it; each group tile then lights a beat after its unit's LED. */
  .sysdiag .touch-ripple { animation: touch-ripple 0.6s ease-out 0.15s both; }
  .sysdiag .touch-btn { animation: touch-press 0.5s ease-out 0.15s both; }
  .sysdiag .tile .tile-dot { animation: led-on 0.35s ease-out calc(var(--d) + 0.25s) both; }
}
@keyframes touch-ripple {
  0%   { opacity: 0.9; transform: scale(0.15); }
  100% { opacity: 0;   transform: scale(1); }
}
@keyframes touch-press {
  0%, 100% { fill: #4a4a4a; }
  25%      { fill: #ff8a7a; }
}
@keyframes mnet-run {
  0%   { stroke-dashoffset: 0.12; opacity: 1; }
  99%  { stroke-dashoffset: -1;   opacity: 1; }
  100% { stroke-dashoffset: -1;   opacity: 0; }
}
@keyframes led-on {
  from { fill: #3a3a3a; }
  to   { fill: #5bd68a; }
}
@keyframes glow-on {
  0%   { opacity: 0; transform: scale(0.4); }
  45%  { opacity: 0.55; transform: scale(1.5); }
  100% { opacity: 0.22; transform: scale(1); }
}
.sysdiag .led-glow,
.sysdiag .touch-ripple { transform-box: fill-box; transform-origin: center; }

.hero-legend {
  display: flex;
  gap: 22px;
  justify-content: flex-end;
  margin-top: 10px;
  font-size: 12.5px;
  color: #9a9a9a;
}
.lg { display: inline-flex; align-items: center; gap: 8px; }
.lg::before { content: ""; width: 22px; height: 0; border-top: 2px solid; }
.lg--pipe::before { border-color: var(--copper-line); }
.lg--mnet::before { border-top: 2px dashed var(--red-on-dark); }

/* ── Body ───────────────────────────────────────────────────────────── */
.home-body {
  max-width: 1120px;
  margin: 0 auto;
  padding: 56px 28px 16px;
  width: 100%;
}
.home-group { margin-bottom: 40px; scroll-margin-top: calc(var(--header-h) + 16px); }
.home-group-head { margin-bottom: 18px; }
.home-group-head h2 {
  font: 600 1.6rem/1.15 var(--font-display);
  letter-spacing: -0.005em;
  margin-bottom: 4px;
}
.home-group-head p { color: var(--gray); font-size: 0.95rem; }

/* In your browser: the main event, three big cards. */
.bt-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.bt-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 22px 22px 18px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.bt-card:hover { border-color: var(--red); box-shadow: 0 8px 28px rgba(0, 0, 0, 0.08); }
.bt-card:focus-within { border-color: var(--red); }
.bt-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 18px; }
.bt-icon {
  width: 48px; height: 48px;
  display: grid; place-items: center;
  border-radius: 12px;
  background: var(--red-light);
  border: 1px solid var(--red-border);
  color: var(--red);
  transition: background 0.15s, color 0.15s;
}
.bt-card:hover .bt-icon { background: var(--red); border-color: var(--red); color: var(--white); }
.bt-name {
  font: 600 1.3rem/1.2 var(--font-display);
  margin-bottom: 8px;
}
.bt-link { color: var(--dark); text-decoration: none; }
/* The whole card is the link; the "What it solves" button sits above it. */
.bt-link::after { content: ""; position: absolute; inset: 0; border-radius: 14px; }
.bt-link:focus-visible { outline: none; }
.bt-card:has(.bt-link:focus-visible) { outline: 2px solid var(--red); outline-offset: 2px; }
.bt-card:hover .bt-link { color: var(--red); }
.bt-blurb { font-size: 0.925rem; line-height: 1.55; color: var(--gray); flex: 1; margin-bottom: 18px; }
.bt-meta {
  padding-top: 14px;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: #6b6b6b;
}
.bt-meta code {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  padding: 2px 6px;
  margin-left: 3px;
  border-radius: 5px;
  background: var(--page-bg);
  color: var(--dark);
}
.bt-why {
  position: relative;
  z-index: 1;
  padding: 5px 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--white);
  color: var(--gray);
  font: 500 12.5px var(--font-sans);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.bt-why:hover { border-color: var(--dark); color: var(--dark); }
.bt-why:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }

/* On your PC and Learn reuse the browser cards so the three groups read as
   one set: two wide cards for the downloads, four small ones for Learn. */
.bt-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.bt-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.bt-card--compact { padding: 18px 18px 16px; }
.bt-card--compact .bt-top { margin-bottom: 14px; }
.bt-card--compact .bt-icon { width: 40px; height: 40px; border-radius: 10px; }
.bt-card--compact .bt-name { font-size: 1.1rem; margin-bottom: 6px; }
.bt-card--compact .bt-blurb { font-size: 0.9rem; margin-bottom: 0; }

/* ── Responsive ─────────────────────────────────────────────────────── */
@media (max-width: 960px) {
  .hero-inner { grid-template-columns: 1fr; gap: 36px; padding: 44px 20px 48px; }
  .hero-diagram { max-width: 560px; }
  .bt-grid, .bt-grid--4 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .hero-inner { padding: 32px 16px 40px; }
  .hero-legend { justify-content: flex-start; }
  .home-body { padding: 36px 16px 8px; }
  .bt-grid, .bt-grid--2, .bt-grid--4 { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .hero *, .home-body * { transition: none; }
}
