/* ===== X-Link Box — product page theme =====
   Layers a marine-teal "telemetry node" identity on top of the shared styles.css.
   Applied only where <body class="xlink-page"> is set. */

.xlink-page {
  --brand:   #2dd4bf;   /* teal accent      */
  --brand-2: #0d9488;
  --grad:    linear-gradient(120deg, #7dd3fc 0%, #2dd4bf 50%, #0d9488 100%);
  --sig:     #38bdf8;   /* telemetry lane   */
  --net:     #f5a623;   /* network lane     */
  --ok:      #34d399;
  --warn:    #eab308;
  --crit:    #f87171;
  --teal-soft: rgba(45, 212, 191, .13);
  --teal-line: rgba(45, 212, 191, .28);
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

/* Retheme the base components that hardcode the cyan brand */
.xlink-page .hero-bg {
  background:
    radial-gradient(60% 55% at 78% 12%, rgba(45,212,191,.15), transparent 60%),
    radial-gradient(55% 50% at 12% 88%, rgba(56,189,248,.12), transparent 60%);
}
.xlink-page .hero-visual span { border-color: rgba(45,212,191,.4); }
.xlink-page .hero-visual::before { box-shadow: 0 0 24px 6px rgba(45,212,191,.55); }
.xlink-page .card:hover {
  border-color: var(--teal-line);
  box-shadow: 0 20px 40px -24px rgba(45,212,191,.5);
}
.xlink-page .card-icon {
  background: linear-gradient(160deg, rgba(45,212,191,.16), rgba(13,148,136,.05));
  border-color: var(--teal-line);
  color: var(--brand);
}
.xlink-page .section-alt::before {
  background: linear-gradient(90deg, transparent, rgba(45,212,191,.5), transparent);
}
/* styles.css leaves .section-title without a line-height, so it inherits body's 1.7 —
   fine on one line, far too loose once a large heading wraps (EN/JA closer especially). */
.xlink-page .section-title { line-height: 1.16; }

/* ===== Hero ===== */
.xlink-hero { padding-bottom: 92px; }
.status-pill {
  display: inline-flex; align-items: center; gap: 8px;
  font: 600 12px/1 var(--mono); letter-spacing: 2px;
  color: var(--ok); margin-bottom: 22px; text-transform: uppercase;
}
.status-pill::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%;
  background: var(--ok); box-shadow: 0 0 10px var(--ok);
  animation: blip 2s ease-in-out infinite;
}
@keyframes blip { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .status-pill::before { animation: none; } }

.xlink-title { font-size: clamp(44px, 8vw, 84px); line-height: 1; letter-spacing: -2px; }
.xlink-title .grad {
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.xlink-sub { font-size: clamp(18px, 2.4vw, 24px); color: var(--text); margin-top: 18px; font-weight: 600; }

/* Protocol / capability tag strip */
.kit-tags { list-style: none; display: flex; flex-wrap: wrap; gap: 9px; margin-top: 30px; }
.kit-tags li {
  font: 500 12.5px/1 var(--mono); letter-spacing: .5px; padding: 8px 14px;
  border-radius: 999px; color: var(--muted);
  background: var(--surface); border: 1px solid var(--border);
}
.kit-tags li.hi { color: var(--brand); border-color: var(--teal-line); background: var(--teal-soft); }

/* ===== Key figures ===== */
.keyfigs {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 18px; margin-top: 44px;
}
.kf {
  padding: 24px 22px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); position: relative; overflow: hidden;
}
.kf::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--grad);
}
.kf b {
  display: block; font: 800 clamp(26px, 3.4vw, 36px)/1.1 var(--font);
  letter-spacing: -1px; font-variant-numeric: tabular-nums;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.kf span { display: block; color: var(--muted); font-size: 14px; margin-top: 8px; }

/* ===== Application scenes ===== */
.scenes { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.scene {
  position: relative; display: flex; flex-direction: column; gap: 14px;
  padding: 28px 26px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border);
  transition: transform .25s, border-color .25s;
}
.scene:hover { transform: translateY(-4px); border-color: var(--teal-line); }
.scene::before {
  content: ""; position: absolute; left: 0; top: 22px; bottom: 22px; width: 4px;
  border-radius: 0 4px 4px 0; background: var(--brand); box-shadow: 0 0 16px var(--brand);
}
.scene--marine::before { background: var(--sig);   box-shadow: 0 0 16px var(--sig); }
.scene--engine::before { background: var(--warn);  box-shadow: 0 0 16px var(--warn); }
.scene--farm::before   { background: var(--ok);    box-shadow: 0 0 16px var(--ok); }
.scene--net::before    { background: var(--net);   box-shadow: 0 0 16px var(--net); }
/* five scenes in a two-column grid: let the last one span the row instead of leaving a hole */
@media (min-width: 901px) { .scenes > :last-child { grid-column: 1 / -1; } }
.scene-head { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; }
.scene-head h3 { font-size: 21px; font-weight: 800; }
.scene-proto {
  flex: none; font: 700 11px/1 var(--mono); letter-spacing: 1.5px; white-space: nowrap;
  color: var(--brand); background: var(--teal-soft); border: 1px solid var(--teal-line);
  padding: 6px 10px; border-radius: 999px;
}
.scene > p { color: var(--muted); font-size: 15.5px; }
.scene-list { list-style: none; display: grid; gap: 10px; }
.scene-list li { color: var(--muted); font-size: 14.8px; padding-left: 20px; position: relative; }
.scene-list li::before {
  content: ""; position: absolute; left: 2px; top: 11px; width: 9px; height: 2px;
  border-radius: 2px; background: var(--brand);
}
.measured {
  margin-top: auto; padding-top: 16px; border-top: 1px dashed var(--border);
  font: 500 13px/1.9 var(--mono); color: var(--muted);
}
.measured b { color: var(--brand); font-weight: 600; }

/* ===== Data path diagram ===== */
.diagram {
  margin-top: 8px; padding: clamp(16px, 3vw, 30px); overflow-x: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
}
.diagram svg { width: 100%; min-width: 620px; height: auto; }
.dg-lbl  { font: 600 10px/1 var(--mono); letter-spacing: 1.5px; fill: var(--muted); text-transform: uppercase; }
.dg-node { font: 700 12.5px/1 var(--font); fill: var(--text); }
.dg-sub  { font: 500 9.5px/1 var(--mono); fill: var(--muted); }
.dg-box  { fill: var(--surface-2); stroke: var(--border); }
.dg-core { fill: rgba(45,212,191,.09); stroke: var(--brand); }
/* marker-end is set as an SVG attribute on the paths: a fragment-only url() in an
   external stylesheet resolves against the CSS file, not the document. */
.dg-flow { stroke: var(--brand); stroke-width: 1.3; fill: none; opacity: .8; }

/* ===== Gauge anatomy / state figures ===== */
.gaugefig {
  margin: 26px 0 0; padding: clamp(14px, 2.5vw, 26px); overflow-x: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
}
.gaugefig + .gaugefig { margin-top: 20px; }
.gaugefig svg { width: 100%; min-width: 560px; height: auto; }
.gaugefig figcaption { margin-top: 16px; font-size: 13.5px; color: var(--muted); line-height: 1.65; }
.gf-track { stroke: var(--border); }
.gf-lead  { stroke: var(--border); stroke-width: 1; fill: none; }
.gf-scale { fill: var(--muted); font-family: var(--mono); font-size: 11px; text-anchor: middle; }
.gf-val   { fill: var(--text); font-size: 30px; font-weight: 800; text-anchor: middle;
            font-variant-numeric: tabular-nums; letter-spacing: -1px; }
.gf-val.sm { font-size: 22px; }
.gf-unit  { fill: var(--muted); font-family: var(--mono); font-size: 11px; text-anchor: middle; }
.gf-lbl   { fill: var(--muted); font-size: 12.5px; text-anchor: middle; font-weight: 600; }
.gf-note text { fill: var(--text); font-size: 13px; font-weight: 700; }
.gf-note .gf-sub { fill: var(--muted); font-size: 11.5px; font-weight: 400; }
/* the danger state pulses on the real device — show it, but never against the user's wishes */
@media (prefers-reduced-motion: no-preference) {
  .gf-pulse { animation: gfpulse 2.4s ease-in-out infinite; }
  @keyframes gfpulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
}

/* ===== Capability grid ===== */
.featgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.feat {
  padding: 26px 26px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border);
  transition: border-color .25s, transform .25s;
}
.feat:hover { border-color: var(--teal-line); transform: translateY(-3px); }
.feat h3 { font-size: 18.5px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.feat h3::before { content: ""; flex: none; width: 4px; height: 16px; border-radius: 2px; background: var(--grad); }
.feat > p { color: var(--muted); font-size: 15px; margin-top: 10px; }

/* ===== Spec tables ===== */
.tablewrap {
  overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface);
}
.tablewrap + .table-title { margin-top: 52px; }
.table-title { font-size: 21px; font-weight: 700; margin-bottom: 18px; }
.table-lead { color: var(--muted); font-size: 16px; max-width: 70ch; margin: -6px 0 20px; }
.spec { border-collapse: collapse; width: 100%; min-width: 560px; font-size: 14.8px; }
.spec th, .spec td { text-align: left; padding: 14px 20px; border-bottom: 1px solid var(--border); }
.spec thead th {
  background: var(--surface-2); font: 600 11px/1 var(--mono); letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--muted);
}
.spec tbody td:first-child { color: var(--muted); white-space: nowrap; width: 1%; }
.spec td.num { font-family: var(--mono); font-variant-numeric: tabular-nums; color: var(--text); }
.spec tbody tr:last-child td { border-bottom: 0; }

.pill {
  display: inline-block; font: 700 11px/1 var(--mono); letter-spacing: 1px;
  padding: 5px 10px; border-radius: 999px; border: 1px solid currentColor; white-space: nowrap;
}
.pill.ok  { color: var(--ok); }
.pill.wip { color: var(--warn); }

/* ===== Engineering note ===== */
.note {
  margin-top: 26px; padding: 18px 22px; font-size: 15px; color: var(--muted);
  background: var(--teal-soft); border-left: 3px solid var(--brand);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.note b { color: var(--text); }

/* ===== Closer / CTA ===== */
.closer { text-align: center; max-width: 760px; margin: 0 auto; }
.closer .section-title { font-size: clamp(30px, 5vw, 48px); }
.closer .section-title .grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.closer-lead { color: var(--muted); font-size: 18px; margin: 20px auto 26px; }
.closer-tags { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-bottom: 34px; }
.closer-tags li {
  padding: 8px 16px; border-radius: 999px; font-size: 14px; color: var(--brand);
  background: var(--teal-soft); border: 1px solid var(--teal-line);
}
.closer-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* ===== Responsive ===== */
@media (max-width: 1000px) {
  .keyfigs { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
  .scenes, .featgrid { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .keyfigs { grid-template-columns: repeat(2, 1fr); }
  .kf { padding: 20px 18px; }
}
