/* ZEN — firmware setup guide page styles (rides on e24.css + zen.css) */

.fw-page { padding-top: calc(var(--nav-h) + 48px); padding-bottom: clamp(80px, 11vw, 140px); }

/* hero */
.fw-hero { padding: 16px 0 8px; }
.fw-hero .eyebrow-mono {
  font-family: var(--font-mono); font-size: 13px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent); font-weight: 700; display: inline-flex; align-items: center; gap: .5em;
}
.fw-hero .eyebrow-mono::before { content: "//"; }
.fw-hero h1 { font-size: clamp(30px, 4.4vw, 52px); line-height: 1.12; margin: 18px 0 0; letter-spacing: -.01em; word-break: auto-phrase; }
.fw-hero .lead { max-width: 700px; margin-top: 18px; font-size: 17px; line-height: 1.9; }

/* table of contents */
.fw-toc {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px;
  margin: 40px 0 8px;
}
.fw-toc a {
  display: flex; align-items: center; gap: 14px; text-decoration: none;
  background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 16px 18px; transition: border-color .2s var(--ease), transform .2s var(--ease);
}
.fw-toc a:hover { border-color: var(--accent); transform: translateY(-2px); }
.fw-toc .n { font-family: var(--font-mono); font-weight: 700; font-size: 14px; color: #fff; background: var(--accent); width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; flex: none; }
.fw-toc .t { font-weight: 700; font-size: 15px; color: var(--ink); line-height: 1.35; }

/* sections */
.fw-sec { padding: clamp(48px, 7vw, 86px) 0 0; scroll-margin-top: calc(var(--nav-h) + 64px); }
.fw-sec .sec-num { font-family: var(--font-mono); font-size: 13px; color: var(--accent); font-weight: 700; letter-spacing: .08em; display: flex; align-items: center; gap: 12px; }
.fw-sec .sec-num::before { content: ""; width: 34px; height: 5px; border-radius: 3px; background: var(--accent); flex: none; }
.fw-sec h2 { font-size: clamp(26px, 3.4vw, 42px); margin: 12px 0 16px; letter-spacing: -.01em; line-height: 1.12; word-break: auto-phrase; }
.fw-sec h3 { font-size: clamp(19px, 2.2vw, 24px); margin: 36px 0 12px; word-break: auto-phrase; }
.fw-sec > .wrap > p { color: var(--ink-2); font-size: 17px; line-height: 1.9; max-width: 70ch; }
.fw-sec p a, .fw-list a, .fw-steps a { color: var(--accent); font-weight: 700; text-decoration: none; border-bottom: 1px solid color-mix(in oklab, var(--accent) 35%, transparent); }
.fw-sec p a:hover, .fw-list a:hover, .fw-steps a:hover { border-bottom-color: var(--accent); }

.fw-divider { height: 1px; background: var(--line); margin-top: clamp(48px,7vw,86px); }

/* requirement / generic lists */
.fw-list { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 10px; max-width: 70ch; }
.fw-list li {
  display: flex; align-items: flex-start; gap: 12px;
  color: var(--ink-2); font-size: 16px; line-height: 1.7;
}
.fw-list li::before {
  content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent); margin-top: 11px;
}

/* numbered ordered steps (reuse look of faq-steps) */
.fw-steps { list-style: none; padding: 0; margin: 22px 0 0; counter-reset: fwstep; max-width: 72ch; }
.fw-steps > li {
  position: relative; padding: 12px 0 12px 46px; color: var(--ink-2); font-size: 16.5px; line-height: 1.75;
  border-bottom: 1px solid var(--line-2); counter-increment: fwstep;
  word-break: auto-phrase;
}
.fw-steps > li:last-child { border-bottom: none; }
.fw-steps > li::before {
  content: counter(fwstep); position: absolute; left: 0; top: 11px;
  width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: #fff;
  font-family: var(--font-mono); font-size: 13px; font-weight: 700; display: grid; place-items: center;
}

/* code */
.fw-page code {
  font-family: var(--font-code); font-size: .86em; background: var(--paper-3);
  border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; color: var(--ink);
  /* keep short tokens (e.g. zen-firmware) whole; only break a token that alone
     would overflow the line, instead of splitting every chip mid-word */
  word-break: keep-all; overflow-wrap: anywhere;
}

/* Japanese body text: break at natural phrase boundaries (not mid-word) */
.fw-sec > .wrap > p,
.fw-list li,
.fw-fig figcaption,
.fw-panel,
.fw-tcard p { word-break: auto-phrase; }

/* figures (screenshots) */
.fw-fig { margin: 24px 0 0; }
.fw-fig img {
  width: 100%; height: auto; display: block; border-radius: var(--r-md);
  border: 1px solid var(--line); background: #0B0B0D;
}
.fw-fig figcaption { margin-top: 12px; color: var(--ink-3); font-size: 14px; line-height: 1.7; }
.fw-figs { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 720px){ .fw-figs { grid-template-columns: 1fr; } }

/* panels */
.fw-panel {
  margin: 24px 0 0; padding: 20px 22px; border-radius: var(--r-md);
  border: 1px solid var(--line); background: var(--paper-2); color: var(--ink-2); font-size: 15px; line-height: 1.8;
}
.fw-panel.tip { border-left: 3px solid var(--accent); }
.fw-panel.warn { background: var(--accent-soft); border-color: #E8B7A6; }
.fw-panel.warn strong { color: var(--accent-d); }
.fw-panel .ph { display: flex; align-items: center; gap: 9px; font-weight: 700; color: var(--ink); margin-bottom: 6px; }
.fw-panel .ph svg { width: 18px; height: 18px; color: var(--accent); }

/* file chips */
.fw-files { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 10px; max-width: 70ch; }
.fw-files li {
  display: flex; align-items: baseline; gap: 12px;
  background: var(--paper-2); border: 1px solid var(--line); border-radius: 10px; padding: 13px 16px;
}
.fw-files li svg { width: 18px; height: 18px; color: var(--accent); flex: none; position: relative; top: 3px; }
.fw-files code { background: transparent; border: none; padding: 0; font-size: 14px; }
.fw-files .fw-file-text { display: flex; align-items: baseline; gap: 12px; flex: 1; min-width: 0; }
.fw-files .fw-file-desc { color: var(--ink-2); font-size: 13px; margin-left: auto; padding-left: 16px; white-space: nowrap; flex: none; }
.fw-files-label { font-size: 14px; font-weight: 700; color: var(--ink); margin: 24px 0 0; }
@media (max-width: 560px){
  .fw-files li { flex-wrap: wrap; }
  .fw-files .fw-file-text { flex-wrap: wrap; }
  .fw-files .fw-file-desc { margin-left: 30px; padding-left: 0; white-space: normal; }
}

/* trouble cards */
.fw-trouble { display: grid; gap: 14px; margin-top: 18px; }
.fw-tcard { background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--r-md); padding: 22px 24px; }
.fw-tcard h3 { margin: 0 0 8px; font-size: 17px; }
.fw-tcard p { color: var(--ink-2); font-size: 15px; line-height: 1.8; margin: 0; }

/* back link in subnav */
.subnav .back { display: inline-flex; align-items: center; gap: 6px; }
.subnav .back svg { width: 15px; height: 15px; }

/* clickable figures + lightbox */
.fw-fig img { cursor: zoom-in; transition: border-color .2s var(--ease); }
/* scroll fade-in: transition on the .loaded END state, with enough specificity
   to beat `.fw-fig img`; the un-loaded base stays instant so it hides with no flash */
.fw-fig img.fade-img.loaded {
  transition: opacity 1.1s cubic-bezier(.25,.46,.45,.94),
              transform 1.1s cubic-bezier(.25,.46,.45,.94),
              border-color .2s var(--ease);
}
.fw-fig img:hover { border-color: var(--accent); }
.fw-fig figcaption .zoom-tag {
  display: inline-flex; align-items: center; gap: 5px; margin-left: 8px;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .04em; color: var(--accent);
}
.fw-fig figcaption .zoom-tag svg { width: 12px; height: 12px; }

.lightbox {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: clamp(16px, 4vw, 48px);
  background: rgba(20,20,23,.86); backdrop-filter: blur(8px);
  opacity: 0; visibility: hidden; transition: opacity .25s var(--ease), visibility .25s;
}
.lightbox.open { opacity: 1; visibility: visible; }
.lightbox img {
  max-width: 100%; max-height: 100%; border-radius: 10px;
  box-shadow: 0 30px 80px -20px rgba(0,0,0,.7);
  transform: scale(.97); transition: transform .25s var(--ease); cursor: zoom-out;
}
.lightbox.open img { transform: scale(1); }
.lightbox .lb-close {
  position: absolute; top: clamp(14px,3vw,26px); right: clamp(14px,3vw,26px);
  width: 46px; height: 46px; border-radius: 50%; border: none; cursor: pointer;
  background: rgba(255,255,255,.12); color: #fff; display: grid; place-items: center;
  transition: background .2s var(--ease);
}
.lightbox .lb-close:hover { background: rgba(255,255,255,.24); }
.lightbox .lb-close svg { width: 22px; height: 22px; }
.lightbox .lb-cap {
  position: absolute; left: 0; right: 0; bottom: clamp(14px,3vw,24px); text-align: center;
  color: rgba(255,255,255,.82); font-size: 13px; padding: 0 20px; pointer-events: none;
}
