.flow-page { overflow: clip; }
.flow-hero { position: relative; display: grid; min-height: clamp(300px, 39svh, 420px); align-content: center; justify-items: center; gap: 0; padding: 44px var(--page-gutter) 39px; text-align: center; isolation: isolate; }
.flow-hero::before { position: absolute; z-index: -1; inset: 0; background: radial-gradient(ellipse 61% 92% at 50% 2%, rgba(172, 101, 37, .16), transparent 72%); content: ""; }
.flow-kicker, .flow-index { margin: 0; color: #d2a95f; font-family: 'DM Mono', monospace; font-size: 12px; letter-spacing: .17em; text-transform: uppercase; }
.flow-kicker { margin-bottom: 23px; }
.flow-hero h1 { margin: 0; font-size: clamp(58px, 8vw, 104px); font-weight: 500; letter-spacing: -.08em; line-height: .88; }
.flow-hero h1 em, .flow-closing h2 em { display: block; margin-top: .08em; color: #d7bd92; font-family: 'Playfair Display', Georgia, serif; font-weight: 500; }
.flow-hero > p:last-child { max-width: 625px; margin: 24px auto 0; color: #b6aea2; font-size: 15px; line-height: 1.8; }
.flow-experience { width: min(1440px, calc(100% - var(--page-gutter) - var(--page-gutter))); margin: 0 auto; }
.flow-controls { display: flex; align-items: center; justify-content: space-between; gap: 22px; padding: 15px 0 18px; border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.flow-tabs { display: flex; align-items: center; gap: 4px; }
.flow-tabs [role="tab"] { position: relative; min-height: 38px; padding: 0 15px; border: 1px solid transparent; background: transparent; color: #8d877d; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; transition: color .22s ease, border-color .22s ease, background-color .22s ease; }
.flow-tabs [role="tab"]:hover { color: var(--ivory); }
.flow-tabs [role="tab"][aria-selected="true"] { border-color: rgba(224,174,92,.3); background: rgba(115,78,32,.12); color: #ead6ae; }
.flow-tabs [role="tab"][aria-selected="true"]::after { position: absolute; right: 14px; bottom: -1px; left: 14px; height: 1px; background: var(--gold); content: ''; }
.flow-status { display: inline-flex; align-items: center; gap: 9px; margin: 0; color: #8d877d; font-family: 'DM Mono', monospace; font-size: 11px; letter-spacing: .08em; text-align: right; text-transform: uppercase; }
.flow-status span { width: 5px; height: 5px; flex: 0 0 5px; border-radius: 50%; background: #b18c53; box-shadow: 0 0 8px rgba(225,173,88,.35); }
.flow-policy { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); margin: 30px 0 0; border-top: 1px solid rgba(224,174,92,.25); border-bottom: 1px solid rgba(224,174,92,.12); }
.flow-policy > div { min-width: 0; min-height: 82px; padding: 15px 16px 13px; border-right: 1px solid rgba(244,238,221,.075); border-bottom: 1px solid rgba(244,238,221,.075); }
.flow-policy > div:nth-child(4n) { border-right: 0; }
.flow-policy dt { color: #947a53; font-family: 'DM Mono', monospace; font-size: 11px; letter-spacing: .1em; line-height: 1.45; }
.flow-policy dd { margin: 9px 0 0; color: #e6d4b4; font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.flow-closing { display: grid; justify-items: center; padding: 82px var(--page-gutter) 88px; border-top: 1px solid rgba(214,157,83,.13); background: radial-gradient(ellipse 52% 76% at 50% 0%, rgba(116,69,30,.095), transparent 78%); text-align: center; }
.flow-closing h2 { margin: 16px 0 0; font-size: clamp(42px,6.3vw,74px); font-weight: 500; letter-spacing: -.07em; line-height: .94; }
.flow-closing > p:not(.flow-index) { max-width: 610px; margin: 20px 0 0; color: var(--muted); font-size: 14px; line-height: 1.8; }
.flow-closing-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 23px; margin-top: 25px; }
.flow-closing-links a { padding: 8px 2px; border-bottom: 1px solid rgba(224,174,92,.26); color: #d8c193; font-size: 13px; transition: color .2s ease, border-color .2s ease; }
.flow-closing-links a:hover { border-color: var(--amber); color: var(--amber); }

/* Flow diagrams: one tab per flow. Ribbons draw in, nodes rise, then Flow dots travel. */
.flow-experience { padding: 0 var(--page-gutter); }
.flow-controls { flex-wrap: wrap; }
.flow-legend { display: inline-flex; align-items: center; gap: 8px; margin: 0; color: #c9c1b4; font-family: 'DM Mono', monospace; font-size: 12px; letter-spacing: .06em; }
.flow-legend .dot--ivory { margin-left: 14px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }
.dot--gold { background: #f0c070; box-shadow: 0 0 8px rgba(240, 192, 112, .7); }
.dot--ivory { background: #efe6d2; box-shadow: 0 0 8px rgba(239, 230, 210, .6); }
.flow-panel { padding: 44px 0 10px; }
.flow-panel[hidden] { display: none; }
.flow-panel-heading { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 420px); align-items: end; gap: 10px 40px; }
.flow-panel-heading .flow-index { grid-column: 1 / -1; }
.flow-panel-heading h2 { margin: 0; font-size: clamp(36px, 4.4vw, 60px); font-weight: 500; letter-spacing: -.055em; line-height: 1; }
.flow-panel-heading h2 em { display: block; color: #d7bd92; font-family: 'Playfair Display', Georgia, serif; font-weight: 500; }
.flow-panel-heading > p:last-child { margin: 0; color: #c9c1b4; font-size: 16px; line-height: 1.7; }
.flow-canvas { position: relative; width: 100%; max-width: 1120px; margin: 40px auto 10px; aspect-ratio: 1000 / 560; }
.flow-diagram { position: absolute; inset: 0; }
.flow-diagram svg { width: 100%; height: 100%; overflow: visible; }
/* Sankey bands: crisp filled shapes, width follows the allocation. */
.band { stroke: rgba(245, 196, 107, .35); stroke-width: 1; transition: opacity .3s ease; }
.band--ivory { fill: rgba(239, 230, 210, .08); stroke: rgba(239, 230, 210, .25); }
.line { fill: none; stroke: rgba(228, 173, 79, .32); stroke-width: 10; stroke-linejoin: round; transition: opacity .3s ease; }
.line--conceptual { stroke-dasharray: 2 9; stroke-linecap: round; stroke-width: 4; }
.principal-line { fill: none; stroke: rgba(239, 230, 210, .55); stroke-width: 1.4; stroke-dasharray: 5 6; }
.principal-label { fill: #d9cfbb; font-family: 'DM Mono', monospace; font-size: 13px; letter-spacing: .08em; text-anchor: middle; text-transform: uppercase; }
.is-tracing .band, .is-tracing .line, .is-tracing .principal-line { opacity: .25; }
.is-tracing .is-lit { opacity: 1; }
circle.dot--gold { fill: #ffd78a; }
circle.dot--ivory { fill: #f4ecdb; }
/* Cards: one consistent component for every point in a flow. */
.flow-cards { position: absolute; inset: 0; }
.flow-card { position: absolute; display: flex; box-sizing: border-box; flex-direction: column; justify-content: center; gap: 4px; padding: 0 14px; border: 1px solid rgba(228, 173, 79, .38); border-radius: 10px; background: linear-gradient(180deg, #17140f, #0e0d0b); color: var(--ivory); cursor: pointer; text-align: left; box-shadow: 0 10px 30px rgba(0, 0, 0, .35); transition: border-color .25s ease, box-shadow .25s ease, opacity .3s ease; }
.flow-card small { color: #c39556; font-family: 'DM Mono', monospace; font-size: 10px; letter-spacing: .12em; }
.flow-card strong { font-size: 14px; font-weight: 500; line-height: 1.25; }
.flow-card strong i { color: #a39d92; font-style: normal; font-weight: 400; }
.flow-card .share { color: #a39d92; font-size: 12px; }
.flow-card .share b { margin-right: 4px; color: var(--amber); font-family: 'DM Mono', monospace; font-size: 18px; font-weight: 500; }
.flow-card--target { border-color: rgba(245, 196, 107, .55); }
.flow-card--conceptual { border-style: dashed; background: rgba(14, 13, 11, .6); }
.flow-card--guards { flex-direction: row; align-items: center; gap: 12px; padding: 0 12px; }
.flow-card--guards small, .flow-card--guards strong { display: none; }
.guard-chips { display: grid; flex: 1; align-self: stretch; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; padding: 8px 0; }
.guard-chip { display: grid; place-items: center; padding: 4px 6px; border: 1px solid rgba(228, 173, 79, .25); border-radius: 6px; color: #c9c1b4; font-size: 11px; line-height: 1.2; text-align: center; transition: border-color .15s ease, color .15s ease, background .15s ease, box-shadow .15s ease; }
.guard-chip.is-checking { border-color: var(--amber); background: rgba(245, 196, 107, .14); color: #fff3d6; box-shadow: 0 0 16px rgba(245, 196, 107, .35); }
.flow-card:hover, .flow-card:focus-visible, .flow-card.is-lit, .flow-card[aria-pressed="true"] { border-color: var(--amber); box-shadow: 0 0 0 1px rgba(245, 196, 107, .25), 0 10px 30px rgba(0, 0, 0, .35); }
.flow-card:focus-visible { outline: 1px solid var(--amber); outline-offset: 3px; }
.is-tracing .flow-card:not(.is-lit) { opacity: .45; }
/* Entry animation, replayed on each tab switch. */
@keyframes reveal-band { from { opacity: 0; clip-path: inset(0 100% 0 0); } to { opacity: 1; clip-path: inset(0 0 0 0); } }
@keyframes rise-in { from { opacity: 0; translate: 0 10px; } to { opacity: 1; translate: 0 0; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.is-entered .band, .is-entered .line { animation: fade-in .7s ease calc(300ms + var(--order) * 110ms) both; }
.is-entered .principal-line, .is-entered .principal-label { animation: fade-in .8s ease 1s both; }
.is-entered .flow-card { animation: rise-in .55s cubic-bezier(.2, .7, .2, 1) calc(var(--order) * 80ms) both; }
.is-entered .flow-card .share { animation: fade-in .6s ease 1.1s both; }
.flow-steps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; max-width: 1100px; margin: 30px auto 0; padding: 0; list-style: none; counter-reset: step; }
.flow-steps li { position: relative; padding: 18px 0 0 46px; border-top: 1px solid var(--line); counter-increment: step; }
.flow-steps li::before { position: absolute; top: 18px; left: 0; color: var(--gold); font-family: 'DM Mono', monospace; font-size: 13px; content: '0' counter(step); }
.flow-steps b { display: block; font-size: 19px; font-weight: 500; letter-spacing: -.02em; }
.flow-steps span { display: block; margin-top: 8px; color: #c9c1b4; font-size: 15px; line-height: 1.7; }
.flow-detail { max-width: 1100px; margin: 28px auto 0; padding: 14px 16px; border-left: 1px solid var(--gold); background: rgba(12, 12, 10, .6); color: #c9c1b4; font-size: 14px; line-height: 1.6; box-sizing: border-box; }
.flow-detail small { display: block; margin-bottom: 4px; color: var(--amber); font-family: 'DM Mono', monospace; font-size: 11px; letter-spacing: .12em; }
html:not(.js) .flow-canvas, html:not(.js) .flow-detail { display: none; }
.flow-rules { padding: 70px var(--page-gutter) 20px; }
.flow-rules h2 { margin: 12px 0 0; font-size: clamp(32px, 4vw, 52px); font-weight: 500; letter-spacing: -.05em; }
.flow-footnote { max-width: 760px; margin: 22px 0 0; color: #a39d92; font-size: 14px; line-height: 1.7; }

@media (max-width: 980px) {
  .flow-policy { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .flow-policy > div:nth-child(4n) { border-right: 1px solid rgba(244,238,221,.075); }
  .flow-policy > div:nth-child(3n) { border-right: 0; }
}
@media (max-width: 760px) {
  .flow-hero { min-height: 300px; padding: 43px var(--page-gutter) 35px; }
  .flow-hero h1 { font-size: clamp(52px, 9.5vw, 72px); }
  .flow-controls { align-items: flex-start; flex-direction: column; gap: 8px; padding: 10px 0 12px; }
  .flow-tabs { display: grid; width: 100%; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px; }
  .flow-tabs [role="tab"] { min-width: 0; min-height: 36px; padding: 0 6px; font-size: 11px; letter-spacing: .06em; }
  .flow-status { display: none; }
  .flow-panel-heading { grid-template-columns: 1fr; }
  .flow-canvas { width: 100%; aspect-ratio: 560 / 1000; margin: 28px auto 10px; }
  .flow-card { padding: 0 8px; border-radius: 8px; gap: 2px; }
  .flow-card small { display: none; }
  .flow-card strong { font-size: 12px; }
  .flow-card .share { font-size: 10px; }
  .flow-card .share b { display: block; font-size: 15px; }
  .flow-card .share-note, .flow-card strong i { display: none; }
  .flow-card--guards { padding: 8px; }
  .guard-chips { grid-template-columns: 1fr; grid-auto-rows: 1fr; height: 100%; }
  .guard-chip { display: grid; place-items: center; padding: 2px 4px; font-size: 10px; }
  .principal-label { font-size: 16px; }
  .flow-steps { grid-template-columns: 1fr; gap: 18px; }
  .flow-detail { display: none; }
  .flow-policy { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .flow-policy > div:nth-child(3n) { border-right: 1px solid rgba(244,238,221,.075); }
  .flow-policy > div:nth-child(2n) { border-right: 0; }
  .flow-closing { padding: 62px var(--page-gutter) 68px; }
}
@media (prefers-reduced-motion: reduce) {
  .is-entered .band, .is-entered .line, .is-entered .flow-card, .is-entered .flow-card .share, .is-entered .principal-line, .is-entered .principal-label { animation: none !important; }
  .band, .line, .flow-card, .flow-card .share, .guard-chip, .flow-tabs [role="tab"], .flow-closing-links a { transition: none !important; }
}
