/* GraphRAG Compliance: project layer on top of ../../app.css. Light theme only. */

body { --sig: var(--sig-graphrag); }
/* mesh tint: teal-led, still warm paper */
body::before {
  background:
    radial-gradient(900px 640px at 90% 4%, rgb(15 118 110 / 0.13), transparent 62%),
    radial-gradient(720px 520px at 0% 62%, rgb(255 159 67 / 0.10), transparent 62%),
    radial-gradient(640px 480px at 55% 100%, rgb(42 60 255 / 0.07), transparent 62%);
}
.nav-right .btn .i { width: 14px; height: 14px; }
.hero-title em, .cta-title em { color: var(--sig); }
.cta::before { background: radial-gradient(ellipse at center, rgb(15 118 110 / 0.14), transparent 65%); }
.progress { background: var(--sig); }
.pill-img { width: 1.9em; box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.5), 0 6px 20px -6px rgb(15 118 110 / 0.5); }
.pill-img::before { background-image: linear-gradient(110deg, #0f766e 0%, #2a9d8f 25%, #7fd1c4 50%, #2a9d8f 75%, #0f766e 100%); }

/* ---------- hero: artistic asymmetry ---------- */
.gr-hero {
  position: relative; min-height: 100svh;
  padding: 170px clamp(16px, 5vw, 80px) var(--space-9);
  display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: clamp(24px, 3vw, 56px); align-items: center;
  max-width: 1600px; margin: 0 auto;
}
.gr-hero-copy { position: relative; z-index: 2; }
.gr-hero .hero-title { font-size: clamp(2.6rem, 4.5vw, 4.9rem); }
.gr-hero .hero-sub { max-width: 52ch; }
.graph-card { margin: 0; position: relative; z-index: 1; margin-right: calc(-1 * clamp(0px, 2vw, 32px)); }
.graph-frame {
  position: relative; border: 1px solid var(--border-subtle); border-radius: var(--radius-xl); overflow: hidden;
  background: radial-gradient(circle at 60% 40%, rgb(15 118 110 / 0.09), transparent 65%), rgb(255 255 255 / 0.78);
  backdrop-filter: blur(6px); box-shadow: var(--shadow-lg);
}
.graph { display: block; width: 100%; height: auto; }
.graph line { stroke: color-mix(in oklab, var(--sig) 38%, #c8c5b8); stroke-width: 1.4; }
.graph .hot { fill: none; stroke: var(--sig); stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 0; filter: drop-shadow(0 0 5px rgb(15 118 110 / 0.45)); }
.graph .elabels text { font: 500 9.5px var(--font-mono); letter-spacing: 0.06em; fill: var(--sig); text-anchor: middle; paint-order: stroke; stroke: #fff; stroke-width: 4px; stroke-linejoin: round; }
.graph .node rect { fill: #fff; stroke: var(--border-strong); stroke-width: 1.2; transition: fill var(--motion-base) var(--ease), stroke var(--motion-base) var(--ease); }
.graph .node text { font: 500 12px var(--font-mono); fill: var(--text-primary); text-anchor: middle; dominant-baseline: central; }
.graph .node.on rect { fill: var(--sig); stroke: var(--sig); }
.graph .node.on text { fill: #fff; }
.graph .chip rect { fill: var(--text-primary); }
.graph .chip text { font: 500 12px var(--font-mono); fill: #fff; }
.graph .chip .tick { fill: none; stroke: #7fe3d4; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.graph-hud span { position: absolute; font-size: 11px; color: var(--text-muted); letter-spacing: 0.04em; }
.graph-hud .tl { top: 16px; left: 18px; } .graph-hud .br { bottom: 14px; right: 18px; }
.graph-card figcaption { margin-top: var(--space-3); font-size: 13px; color: var(--text-muted); text-align: right; }

/* ---------- problem ---------- */
.chapter { padding-block: var(--space-10); }
.gr-problem { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 6vw, 112px); align-items: start; }
.problem-copy { position: sticky; top: 120px; }
.lead { font-size: clamp(17px, 1.4vw, 20px); color: var(--text-secondary); max-width: 52ch; margin: var(--space-5) 0 var(--space-6); }
.notes { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--space-3); color: var(--text-secondary); max-width: 48ch; }
.notes li { padding-left: var(--space-5); position: relative; }
.notes li::before { content: ''; position: absolute; left: 0; top: 0.7em; width: 10px; height: 2px; background: var(--sig); }
.notes b { color: var(--text-primary); font-weight: 600; }

.compare { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); }
.dial-card {
  position: relative; background: var(--surface-raised); border: 1px solid var(--border-subtle); border-radius: var(--radius-xl);
  padding: var(--space-6); box-shadow: var(--shadow-sm); transition: box-shadow var(--motion-base) var(--ease-out), border-color var(--motion-base) var(--ease-out), translate var(--motion-slow) var(--ease-out);
}
.dial-strong { margin-top: var(--space-8); border-color: color-mix(in oklab, var(--sig) 40%, var(--border-subtle)); background: linear-gradient(180deg, color-mix(in oklab, var(--sig) 6%, #fff), #fff 60%); }
.dial-wrap { position: relative; max-width: 240px; margin: 0 auto var(--space-5); }
.dial { display: block; width: 100%; transform: rotate(-90deg); }
.dial circle { fill: none; stroke-width: 14; }
.dial-track { stroke: var(--surface-overlay); }
.dial-fill { stroke: var(--text-muted); stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: calc(100 - var(--p)); }
.dial-strong .dial-fill { stroke: var(--sig); }
.dial-read { position: absolute; inset: 0; display: flex; justify-content: center; align-items: center; font-size: clamp(2.4rem, 4vw, 3.6rem); font-weight: 700; letter-spacing: -0.04em; line-height: 1; }
.dial-read span { font-size: 0.5em; color: var(--text-muted); margin-left: 2px; }
.dial-strong .dial-read b { color: var(--sig); }
.dial-card h3 { font-size: 20px; letter-spacing: -0.015em; margin: 0 0 var(--space-2); }
.dial-card p { margin: 0; color: var(--text-secondary); font-size: 15px; }
.claim { grid-column: 1 / -1; margin: var(--space-4) 0 0; font-size: 13px; color: var(--text-muted); max-width: 62ch; border-left: 2px solid var(--sig); padding-left: var(--space-4); }
@media (hover: hover) and (pointer: fine) { .dial-card:hover { translate: 0 -6px; box-shadow: var(--shadow-md); border-color: var(--border-strong); } }

/* ---------- pipeline: sticky split ---------- */
.gr-pipeline { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 6vw, 112px); align-items: start; }
.flow-side { position: sticky; top: 120px; }
.rail { list-style: none; margin: var(--space-7) 0 0; padding: 0; position: relative; display: grid; gap: var(--space-5); }
.rail::before { content: ''; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 2px; background: var(--border-subtle); }
.rail-fill { position: absolute; left: 7px; top: 8px; width: 2px; height: calc(100% - 16px); background: var(--sig); transform-origin: 50% 0; transform: scaleY(0); }
.rail li { position: relative; padding-left: var(--space-7); font-size: 17px; font-weight: 550; color: var(--text-muted); transition: color var(--motion-base) var(--ease); }
.rail li i { position: absolute; left: 0; top: 3px; width: 16px; height: 16px; border-radius: 99px; background: var(--surface-base); border: 2px solid var(--border-strong); transition: background-color var(--motion-base) var(--ease), border-color var(--motion-base) var(--ease), scale var(--motion-base) var(--ease-out); }
.rail li.is-active { color: var(--text-primary); }
.rail li.is-active i, .rail li.is-done i { background: var(--sig); border-color: var(--sig); }
.rail li.is-active i { scale: 1.25; }
.flow-steps { display: grid; gap: var(--space-5); }
.step {
  position: relative; padding: var(--space-7) var(--space-7) var(--space-7); min-height: 340px; display: flex; flex-direction: column; justify-content: flex-end; gap: var(--space-3);
  background: var(--surface-raised); border: 1px solid var(--border-subtle); border-radius: var(--radius-xl); box-shadow: var(--shadow-sm); overflow: hidden;
  transition: border-color var(--motion-base) var(--ease), box-shadow var(--motion-base) var(--ease-out), translate var(--motion-slow) var(--ease-out);
}
.step.is-active { border-color: color-mix(in oklab, var(--sig) 45%, var(--border-subtle)); box-shadow: var(--shadow-md); }
.step-n { position: absolute; top: var(--space-5); right: var(--space-6); font-size: clamp(4rem, 8vw, 7rem); line-height: 1; font-weight: 700; letter-spacing: -0.05em; color: color-mix(in oklab, var(--sig) 14%, #fff); transition: color var(--motion-slow) var(--ease); }
.step.is-active .step-n { color: color-mix(in oklab, var(--sig) 28%, #fff); }
.step h3 { font-size: clamp(1.5rem, 2.2vw, 2.1rem); line-height: 1.1; letter-spacing: -0.025em; margin: 0; position: relative; }
.step p { margin: 0; color: var(--text-secondary); max-width: 46ch; position: relative; }
.tags { display: flex; flex-wrap: wrap; gap: var(--space-2); list-style: none; padding: 0; margin: var(--space-2) 0 0; position: relative; }
.tags li { font: 500 12px var(--font-mono); color: var(--sig); border: 1px solid color-mix(in oklab, var(--sig) 40%, var(--border-subtle)); background: color-mix(in oklab, var(--sig) 6%, #fff); border-radius: var(--radius-full); padding: 4px 10px; }
@media (hover: hover) and (pointer: fine) { .step:hover { translate: 0 -4px; box-shadow: var(--shadow-md); } }

/* ---------- stack ---------- */
.gr-stack { padding-block: var(--space-9); }
.stackline { list-style: none; margin: var(--space-7) 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--space-3) var(--space-6); font-size: clamp(1.6rem, 3.6vw, 3.4rem); font-weight: 650; letter-spacing: -0.035em; line-height: 1.1; }
.stackline li { color: var(--text-primary); transition: color var(--motion-base) var(--ease); position: relative; padding-bottom: 4px; }
.stackline li::after { content: ''; position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: var(--sig); transform: scaleX(0); transform-origin: 0 50%; transition: transform var(--motion-slow) var(--ease-out); }
.stackline li:hover { color: var(--sig); } .stackline li:hover::after { transform: scaleX(1); }
.stackline em { font-style: normal; color: var(--text-muted); }

/* ---------- value ---------- */
.value-rows { margin-top: var(--space-7); border-top: 1px solid var(--border-strong); }
.vrow { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: var(--space-7); align-items: baseline; padding: var(--space-7) 0; border-bottom: 1px solid var(--border-subtle); transition: background-color var(--motion-base) var(--ease); }
.vrow:nth-child(2) { padding-left: clamp(0px, 8vw, 128px); }
.vrow:nth-child(3) { padding-left: clamp(0px, 16vw, 256px); }
.vrow h3 { margin: 0; font-size: clamp(1.7rem, 3vw, 2.8rem); line-height: 1.05; letter-spacing: -0.035em; }
.vrow p { margin: 0; color: var(--text-secondary); max-width: 44ch; }

/* ---------- bento: 4 cols x 3 rows, dense ----------
   a: c1-2 r1-2 | b: c3-4 r1 | c: c3-4 r2 | d: c1-2 r3 | e: c3-4 r3  => 4+2+2+2+2 = 12/12 cells filled */
.bento { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: minmax(230px, auto); grid-auto-flow: dense; gap: var(--space-4); }
.cell {
  --mx: 50%; --my: 50%;
  position: relative; overflow: hidden; padding: var(--space-6); display: flex; flex-direction: column; gap: var(--space-3);
  background: radial-gradient(420px circle at var(--mx) var(--my), rgb(15 118 110 / var(--spot, 0)), transparent 60%), var(--surface-raised);
  border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
  transition: border-color var(--motion-base) var(--ease-out), box-shadow var(--motion-base) var(--ease-out), translate var(--motion-slow) var(--ease-out);
}
.cell:hover { --spot: 0.1; border-color: color-mix(in oklab, var(--sig) 40%, var(--border-strong)); box-shadow: var(--shadow-md); }
@media (hover: hover) and (pointer: fine) { .cell:hover { translate: 0 -4px; } }
.cell h3 { font-size: clamp(1.25rem, 1.7vw, 1.7rem); line-height: 1.12; letter-spacing: -0.02em; margin: 0; max-width: 20ch; }
.cell p { margin: 0; color: var(--text-secondary); font-size: 15px; max-width: 44ch; }
.cell-a { grid-column: 1 / span 2; grid-row: 1 / span 2; }
.cell-b { grid-column: 3 / span 2; grid-row: 1; }
.cell-c { grid-column: 3 / span 2; grid-row: 2; }
.cell-d { grid-column: 1 / span 2; grid-row: 3; }
.cell-e { grid-column: 3 / span 2; grid-row: 3; background-color: color-mix(in oklab, var(--sig) 7%, #fff); }
.stackviz { margin-top: auto; width: 100%; height: auto; }
.stackviz .b { fill: color-mix(in oklab, var(--sig) 8%, #fff); stroke: var(--sig); stroke-width: 1.5; }
.stackviz text { font: 500 14px var(--font-mono); fill: var(--sig); }

/* ---------- misc ---------- */
.chapter-head { margin-bottom: var(--space-8); }
.cta { padding-block: var(--space-10); }

/* ---------- responsive ---------- */
@media (max-width: 1024px) {
  .gr-hero { grid-template-columns: minmax(0, 1fr); padding-top: 168px; min-height: 0; }
  .graph-card { margin: var(--space-6) 0 0; }
  .gr-problem, .gr-pipeline { grid-template-columns: minmax(0, 1fr); }
  .problem-copy, .flow-side { position: static; }
  .rail { display: none; }
  .chapter, .cta { padding-block: var(--space-9); }
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cell-a { grid-column: 1 / span 2; grid-row: auto; min-height: 340px; }
  .cell-b, .cell-c, .cell-d, .cell-e { grid-column: auto; grid-row: auto; }
  .cell-e { grid-column: 1 / span 2; }
  .vrow, .vrow:nth-child(2), .vrow:nth-child(3) { grid-template-columns: minmax(0, 1fr); gap: var(--space-3); padding-left: 0; }
}
@media (max-width: 640px) {
  .gr-hero { padding-top: 156px; }
  .gr-hero .hero-title { font-size: 2.2rem; }
  .compare { grid-template-columns: minmax(0, 1fr); }
  .dial-strong { margin-top: 0; }
  .step { padding: var(--space-6); min-height: 280px; }
  .bento { grid-template-columns: minmax(0, 1fr); }
  .cell-a, .cell-e { grid-column: auto; }
  .nav-right .btn { padding: 8px 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .rail-fill { transform: scaleY(1); }
  .graph .hot { stroke-dashoffset: 0; }
}
