/* ===========================================================================
   SolutionsCoding -- 仕組み diagram, static layer (.cd-arc). The story lives
   in coding-arch-motion.css; the replay button + loop-chip path in
   coding-arch.js. This file alone = the finished frame (no JS, reduced
   motion, print).
   Colour roles: orange #B8531A = this page's colour (source-card icons,
   verbs); navy = the AVATAR CODING console, like the site's dark UI; the
   real Avatar Codin logo (blue shield + amber, from the app's
   code-icon.svg) sits on a white app-icon tile -- the one bright spot;
   logo blue = wires, arrowheads, step icons; amber = moving knowledge.
   Desktop >= 1100px: 5 columns (cards | wire | console | wire | steps) + a
   loop row. Below: one column, wires become short down-arrows.
   Type floor (owner rule 2026-10-04): Japanese >= 13px, Latin >= 12px.
   =========================================================================== */
.cd-arc { --arc-blue: #2A52C9; --arc-wire: #4F72D6; --arc-amber: #F0A836; --arc-acc: #B8531A; --arc-acc-tint: #FBEADF; --arc-blue-tint: #E9EEFC; --arc-term: #0A1C30; --arc-ok: #5BD18B; position: relative; isolation: isolate; }
.cd-arc__sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.cd-arc .cd-ico { display: block; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }

/* ---- cards (sources, steps) --------------------------------------------- */
.cd-arc__cap { margin: 0 0 12px; font-size: 13px; font-weight: 700; letter-spacing: 0.12em; color: var(--muted); }
.cd-arc__srcs, .cd-arc__steps { list-style: none; margin: 0; padding: 0; display: grid; }
.cd-arc__srcs { gap: 12px; }
.cd-arc__steps { gap: 14px; }
.cd-arc__srcs li, .cd-arc__steps li { position: relative; display: flex; align-items: center; gap: 10px; padding: 0 14px; background: var(--white); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 1px 2px rgba(16, 42, 67, 0.04), 0 12px 24px -18px rgba(16, 42, 67, 0.32); }
.cd-arc__srcs li { height: 64px; }
.cd-arc__steps li { height: 72px; }
.cd-arc__ico { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 9px; background: var(--arc-acc-tint); color: var(--arc-acc); }
.cd-arc__ico .cd-ico { width: 20px; height: 20px; }
.cd-arc__steps .cd-arc__ico { background: var(--arc-blue-tint); color: var(--arc-blue); }
.cd-arc__t { display: flex; flex-direction: column; gap: 3px; min-width: 0; font-size: 15px; font-weight: 700; line-height: 1.35; color: var(--navy); }
.cd-arc__steps .cd-arc__t { font-size: 16px; }
.cd-arc__t small { font-size: 13px; font-weight: 500; color: var(--muted); }   /* one line down to the 1100px desktop and the 3-up stacked steps */
.cd-arc__steps small { display: flex; align-items: center; gap: 4px; }
.cd-arc__steps small .cd-ico { flex: none; width: 13px; height: 13px; stroke-width: 2.4; color: var(--arc-blue); }
.cd-arc__verb { display: block; text-align: center; font-size: 13px; font-weight: 700; letter-spacing: 0.1em; color: var(--arc-acc); white-space: nowrap; }

/* ---- glossary terms in the source sub-lines (ADR, PR) --------------------
   The page's own pattern (.dc-term in home-prototype.css, behaviour in
   coding-terms.js), sized to the 13px line and styled like the 仕組み
   lead's term: the word is underlined, not the button box. The -6px block
   margins keep the 64px card's lines in place; >= 900px the popover gets
   those 6px back (coding-terms.js only closes positive gaps). Below 900px
   it hangs from the card (the li is position: relative) and the script
   lifts it flush under the button. Its z-index 20 counts in .cd-arc's
   stacking context, so it covers the wires and the console. */
.cd-arc .dc-term-btn { margin-block: -6px; padding-inline: 1px; gap: 3px; border-radius: 3px; box-shadow: none; transition: color var(--dur-3) var(--ease-soft), transform var(--dur-3) var(--ease-out); }
.cd-arc .cd-term-t { text-decoration: underline; text-decoration-color: #9BB0C4; text-decoration-thickness: 1px; text-underline-offset: 3px; transition: text-decoration-color var(--dur-3) var(--ease-soft); }
.cd-arc .dc-term-q { width: 16px; height: 16px; font-size: 12px; font-weight: 700; transition: background-color var(--dur-3) var(--ease-soft); }
@media (hover: hover) and (pointer: fine) {
  .cd-arc .dc-term-btn:hover { color: var(--navy); }
  .cd-arc .dc-term-btn:hover .cd-term-t { text-decoration-color: currentColor; }
  .cd-arc .dc-term-btn:hover .dc-term-q { background-color: var(--navy); }
}
.cd-arc .dc-term-btn:active { transform: translateY(1px); }
.cd-arc .dc-term-btn:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }
.cd-arc .dc-term-pop { letter-spacing: normal; }
@media (min-width: 900px) { .cd-arc .dc-term-pop { margin-top: 6px; } }

/* ---- the console -------------------------------------------------------- */
.cd-arc__hub { position: relative; container-type: inline-size; background: var(--navy); color: var(--white); border-radius: 14px; overflow: hidden; box-shadow: 0 34px 64px -30px rgba(16, 42, 67, 0.75), 0 0 0 1px #0C2238, inset 0 1px 0 rgba(255, 255, 255, 0.08); }
.cd-arc__bar { display: flex; align-items: center; gap: 7px; height: 34px; padding: 0 14px; background: #0C2238; border-bottom: 1px solid rgba(255, 255, 255, 0.07); font: 500 12px/1 ui-monospace, "SF Mono", Menlo, Consolas, monospace; color: rgba(255, 255, 255, 0.58); }
.cd-arc__bar i { width: 9px; height: 9px; border-radius: 50%; background: #34495F; }
.cd-arc__bar span { margin-left: 8px; }
.cd-arc__ready { margin-left: auto; width: 8px; height: 8px; border-radius: 50%; background: var(--arc-ok); box-shadow: 0 0 0 3px rgba(91, 209, 139, 0.18); }
.cd-arc__brand { display: flex; align-items: center; gap: 14px; padding: 18px 20px 14px; }
.cd-arc__tile { flex: none; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 12px; background: var(--white); box-shadow: 0 10px 22px -8px rgba(0, 0, 0, 0.55); }
.cd-arc__logo { display: block; width: 34px; height: 34px; }
.cd-arc__name { margin: 0; font-size: 19px; font-weight: 700; letter-spacing: 0.02em; }
.cd-arc__claim { margin: 2px 0 0; font-size: 13px; color: var(--blue-pale); }
.cd-arc__body { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: 14px; padding: 0 20px 16px; }
.cd-arc__mods { list-style: none; margin: 0; padding: 4px 0; }
.cd-arc__mods li { position: relative; isolation: isolate; display: flex; align-items: center; gap: 9px; height: 26px; font-size: 13px; }
.cd-arc__mods li > .cd-ico:first-child { flex: none; width: 15px; height: 15px; color: var(--arc-amber); }
.cd-arc__mods .cd-arc__ok { flex: none; margin-left: auto; width: 13px; height: 13px; stroke-width: 2.4; color: var(--arc-ok); }
.cd-arc__plus { display: none; }
.cd-arc__log { list-style: none; margin: 0; padding: 10px 12px; background: var(--arc-term); border: 1px solid rgba(255, 255, 255, 0.06); border-radius: 8px; font-size: 13px; }
.cd-arc__log li { display: flex; align-items: center; gap: 6px; height: 25px; white-space: nowrap; color: rgba(255, 255, 255, 0.86); }
.cd-arc__log li i { flex: 1; min-width: 10px; border-bottom: 1px dotted rgba(255, 255, 255, 0.3); transform-origin: left; }
.cd-arc__log li b { font: 700 12px/1 ui-monospace, "SF Mono", Menlo, Consolas, monospace; color: var(--arc-ok); }
.cd-arc__cmd { font: 500 12px/1 ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
.cd-arc__cmd span { color: var(--blue-pale); }
.cd-arc__done { font-weight: 700; color: var(--white) !important; }
.cd-arc__done .cd-ico { flex: none; width: 13px; height: 13px; stroke-width: 2.6; color: var(--arc-ok); }
.cd-arc__llm { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0; padding: 12px 20px 16px; border-top: 1px solid rgba(255, 255, 255, 0.08); font-size: 13px; color: var(--blue-pale); }
.cd-arc__llm span:first-child { margin-right: 4px; }
.cd-arc__llm b { font-weight: 500; color: var(--white); padding: 3px 9px; border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 999px; }
/* narrow console (1100px desktop, tablets, phones): modules over the log */
@container (max-width: 500px) {
  .cd-arc__body { grid-template-columns: minmax(0, 1fr); }
  .cd-arc__mods { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 16px; }
}
/* phones (console < 360px): a module column is ~130px and ゲートキーパー
   wrapped; win ~12px per column. Very narrow (320px screens): one column. */
@container (max-width: 359px) {
  .cd-arc__brand, .cd-arc__body, .cd-arc__llm { padding-left: 16px; padding-right: 16px; }
  .cd-arc__mods { column-gap: 12px; }
  .cd-arc__mods li { gap: 7px; }
}
@container (max-width: 300px) { .cd-arc__mods { grid-template-columns: minmax(0, 1fr); } }

/* ---- wires, loop, chip, replay ----------------------------------------- */
.cd-arc__wire path { fill: none; stroke: var(--arc-wire); stroke-width: 1.5; }
/* one 12-unit dash per path (pathLength 100); the 200 gap keeps the dash
   pattern from repeating onto the path's far end while it waits */
.cd-arc__beams path { fill: none; stroke: var(--arc-amber); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 12 200; stroke-dashoffset: 14; opacity: 0; }
/* decorative: the loop (a clip-path stacking context under motion) must
   never sit on top of the replay button and eat its clicks */
.cd-arc__loop { position: relative; pointer-events: none; }
.cd-arc__loop-label { position: absolute; left: 50%; transform: translateX(-50%); bottom: 8px; padding: 0 10px; background: var(--white); font-size: 13px; font-weight: 700; letter-spacing: 0.1em; color: var(--arc-acc); white-space: nowrap; }
.cd-arc__chip, .cd-arc__drip { display: none; }
.cd-arc__replay { position: relative; z-index: 3; display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border: 0; border-radius: 6px; background: none; font: 700 13px/1 'Zen Kaku Gothic New', 'Noto Sans JP', sans-serif; letter-spacing: 0.06em; color: var(--muted); cursor: pointer; transition: color var(--dur-3) var(--ease-soft), background var(--dur-3) var(--ease-soft); }
.cd-arc__replay[hidden] { display: none; }
.cd-arc__replay .cd-ico { width: 14px; height: 14px; stroke-width: 2.2; }
@media (hover: hover) and (pointer: fine) { .cd-arc__replay:hover { color: var(--navy); background: var(--surface); } }
.cd-arc__replay:active { transform: translateY(1px); }
.cd-arc__replay:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }
.cd-arc__replay::before { content: ""; position: absolute; inset: -9px -4px; }   /* 26px button, 44px tap area */

/* ---- desktop flow (>= 1100px) ------------------------------------------- */
@media (min-width: 1100px) {
  .cd-arc { display: grid; grid-template-columns: minmax(0, 0.8fr) 56px minmax(0, 1.48fr) 56px minmax(0, 0.76fr); grid-template-rows: auto 64px; align-items: center; padding-top: 6px; }
  /* faint dot grid = a drafting canvas behind the machine */
  .cd-arc::before { content: ""; position: absolute; z-index: -1; inset: -28px 0 -8px; background-image: radial-gradient(rgba(16, 42, 67, 0.14) 1px, transparent 1.4px); background-size: 18px 18px; -webkit-mask-image: radial-gradient(ellipse 72% 78% at 50% 46%, #000 38%, transparent 100%); mask-image: radial-gradient(ellipse 72% 78% at 50% 46%, #000 38%, transparent 100%); }
  .cd-arc__in, .cd-arc__out { position: relative; align-self: stretch; display: flex; flex-direction: column; justify-content: center; }
  .cd-arc__in .cd-arc__cap, .cd-arc__out .cd-arc__cap { position: absolute; top: 0; left: 0; margin: 0; white-space: nowrap; }
  .cd-arc__link { position: relative; align-self: center; }
  .cd-arc__link--in { height: 292px; }
  .cd-arc__link--out { height: 244px; }
  .cd-arc__link svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
  .cd-arc__link .cd-arc__verb { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); background: var(--white); padding: 2px 4px; }
  .cd-arc__link--in::after { content: ""; position: absolute; right: -1px; top: 141px; border: 5px solid transparent; border-left: 8px solid var(--arc-blue); border-right: 0; }
  .cd-arc__link--out i { position: absolute; right: -1px; border: 5px solid transparent; border-left: 8px solid var(--arc-blue); border-right: 0; }
  .cd-arc__link--out i:nth-of-type(1) { top: 31px; }
  .cd-arc__link--out i:nth-of-type(2) { top: 117px; }
  .cd-arc__link--out i:nth-of-type(3) { top: 203px; }
  /* the loop starts AT レビュー: dashed, from under its icon (x 32px) down
     into the loop row; the row's bottom line sits 48px into its 64px. */
  .cd-arc__out::after { content: ""; position: absolute; left: 31px; top: calc(50% + 124px); bottom: -48px; border-left: 2px dashed var(--arc-blue); }
  .cd-arc__loop { grid-column: 3 / 6; grid-row: 2; align-self: stretch; display: grid; grid-template-columns: subgrid; }
  .cd-arc__loop-hub, .cd-arc__loop-mid, .cd-arc__loop-out { display: block; position: relative; grid-row: 1; }
  .cd-arc__loop-hub { grid-column: 1; }
  .cd-arc__loop-mid { grid-column: 2; }
  .cd-arc__loop-out { grid-column: 3; }
  .cd-arc__loop-hub::before { content: ""; position: absolute; left: 50%; margin-left: -1px; top: 6px; bottom: 16px; border-left: 2px dashed var(--arc-blue); }
  .cd-arc__loop-hub::after { content: ""; position: absolute; left: 50%; right: 0; bottom: 16px; border-bottom: 2px dashed var(--arc-blue); }
  .cd-arc__loop-mid::after { content: ""; position: absolute; left: 0; right: 0; bottom: 16px; border-bottom: 2px dashed var(--arc-blue); }
  .cd-arc__loop-out::after { content: ""; position: absolute; left: 0; width: 33px; bottom: 16px; border-bottom: 2px dashed var(--arc-blue); }
  .cd-arc__loop-tip { grid-column: 1; grid-row: 1; justify-self: center; align-self: start; width: 0; height: 0; border: 6px solid transparent; border-bottom: 9px solid var(--arc-blue); border-top: 0; margin-top: -2px; }
  .cd-arc__replay { grid-column: 5; grid-row: 2; justify-self: end; align-self: end; margin-bottom: 2px; }
  @supports not (grid-template-columns: subgrid) { .cd-arc__loop { display: none; } }
}

/* ---- stacked flow (< 1100px) -------------------------------------------- */
@media (max-width: 1099px) {
  .cd-arc__srcs { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
  .cd-arc__steps { grid-template-columns: repeat(auto-fit, minmax(222px, 1fr)); }
  .cd-arc__srcs li, .cd-arc__steps li { padding: 0 12px; }   /* 「ゲートで自動チェック」 stays on one line 3-up */
  .cd-arc__link { position: relative; height: 54px; }
  .cd-arc__link svg, .cd-arc__link--out i { display: none; }
  .cd-arc__link::before { content: ""; position: absolute; left: 50%; top: 8px; bottom: 14px; width: 2px; margin-left: -1px; background: var(--arc-blue); }
  .cd-arc__link::after { content: ""; position: absolute; left: 50%; bottom: 7px; margin-left: -5px; border: 5px solid transparent; border-top: 8px solid var(--arc-blue); border-bottom: 0; }
  .cd-arc__link .cd-arc__verb { position: absolute; left: calc(50% + 12px); top: 50%; transform: translateY(-60%); }
  .cd-arc__loop { margin-top: 22px; display: flex; justify-content: center; }
  .cd-arc__loop-hub, .cd-arc__loop-mid, .cd-arc__loop-out, .cd-arc__loop-tip { display: none; }
  .cd-arc__loop-label { position: static; transform: none; display: inline-flex; align-items: center; gap: 8px; border: 2px dashed var(--arc-blue); padding: 8px 16px; border-radius: 999px; }
  .cd-arc__loop-label::before { content: "↻"; font-size: 14px; }
  .cd-arc__replay { display: flex; margin: 12px auto 0; }
}
