/* ============================================================================
   Community (community.html). Page-local styles. Tokens/components: forge.css.
   Anchors: hero centre-low, who 4/8 lead, table split (signature), inside
   7/5 trail, flow full-width line, close centre.
   ========================================================================== */

/* glass renders: the owner's objects on black. Dark: screen away the black.
   Light: invert + rotate hue back, multiply away the white, so the object reads as ink on paper. */
.plate { position: relative; margin: 0; }
.plate img { width: 100%; height: auto; -webkit-mask-image: radial-gradient(closest-side, #000 62%, transparent 100%); mask-image: radial-gradient(closest-side, #000 62%, transparent 100%); }
:root:not([data-theme="light"]) .plate img, :root:not([data-theme="light"]) .cm-close__art { mix-blend-mode: screen; }
:root[data-theme="light"] .plate img, :root[data-theme="light"] .cm-close__art { filter: invert(1) hue-rotate(180deg) saturate(1.3); mix-blend-mode: multiply; }

/* ---------------------------------------------------------------- hero -- */
.cm-hero { position: relative; min-height: 100vh; min-height: 100svh; display: grid; align-items: end; overflow: hidden; isolation: isolate; }
.cm-hero__film { position: absolute; inset: -40% 0 28%; z-index: 0; will-change: transform; }
.cm-hero__film .vid { position: absolute; inset: 0; background: var(--bg); }
.cm-hero__film .vid > img, .cm-hero__film .vid > video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 40%; }
/* band scrim: only the lower band where the copy sits */
.cm-hero::before { content: ""; position: absolute; inset: 0 0 auto; height: 160px; z-index: 1; pointer-events: none; background: linear-gradient(180deg, rgb(8 7 15 / 0.7), rgb(8 7 15 / 0)); }
:root[data-theme="light"] .cm-hero::before { background: linear-gradient(180deg, rgb(243 241 248 / 0.75), rgb(243 241 248 / 0)); }
.cm-hero__band { position: absolute; inset: auto 0 0; height: 66%; z-index: 1; pointer-events: none;
  background: linear-gradient(0deg, var(--bg) 0%, rgb(8 7 15 / 0.9) 30%, rgb(8 7 15 / 0.55) 62%, rgb(8 7 15 / 0) 100%); }
:root[data-theme="light"] .cm-hero__band { background: linear-gradient(0deg, var(--bg) 0%, rgb(243 241 248 / 0.92) 30%, rgb(243 241 248 / 0.6) 62%, rgb(243 241 248 / 0) 100%); }
.cm-hero__copy { position: relative; z-index: 2; display: grid; justify-items: center; text-align: center; padding-bottom: clamp(3rem, 9vh, 6.5rem); }
.cm-hero__copy .d-hero { max-width: 16ch; }
.cm-hero__copy .lede { margin-top: var(--s-5); max-width: 44ch; margin-inline: auto; }
.cm-hero__copy .btn-row { margin-top: var(--s-6); justify-content: center; }
.cm-hero__price { margin-top: var(--s-5); color: var(--ink-3); }
.cm-hero__price b { color: var(--ink); font-weight: 600; }

/* ----------------------------------------------------------- who it's for -- */
.cm-who { padding-block: var(--section) calc(var(--section) * 0.8); }
.cm-who__grid { display: grid; grid-template-columns: 4fr 8fr; gap: var(--s-8); align-items: start; }
/* four glass seats around a lit table: a dark well in both themes */
.cm-who__film { position: relative; margin-top: var(--s-5); max-width: 340px; aspect-ratio: 4 / 3; border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--line); box-shadow: var(--e2), var(--edge); background: #0b0a14; }
.cm-who__film .vid { position: absolute; inset: 0; background: transparent; }
.cm-who__film .vid > img, .cm-who__film .vid > video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 54% 60%; }
.cm-who__main .d-1 { max-width: 17ch; }
.cm-who__main .d-1 em { color: var(--ink-2); }
.cm-who__roles { margin-top: var(--s-7); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-6); border-top: 1px solid var(--line); padding-top: var(--s-5); }
.cm-who__roles p { color: var(--ink-2); font-size: var(--t-sm); max-width: 30ch; }
.cm-who__roles b { display: block; margin-bottom: 6px; color: var(--ink); font-size: var(--t-base); font-weight: 600; letter-spacing: -0.012em; }
.cm-who__roles a { color: var(--accent-text); font-weight: 600; }

/* ---------------------------------------------------- signature: table -- */
.cm-table { padding-block: var(--section); }
.cm-table__grid { display: grid; grid-template-columns: 5fr 7fr; gap: var(--s-8); align-items: center; }
.cm-table__intro .body { margin-top: var(--s-5); max-width: 40ch; }

/* round 3: the seat card is a real card from the shared system: surface, edge, depth, and a top
   rule in the chosen seat's own split colour (data colour, so it follows the seat). */
.seatcard { position: relative; margin-top: var(--s-7); padding: var(--s-5) clamp(1.25rem, 0.9rem + 1vw, 1.75rem) var(--s-4); min-height: 15.5rem;
  border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--e2), var(--edge); overflow: hidden; isolation: isolate; }
.seatcard::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: var(--c, var(--seg-creator)); transition: background-color var(--d-3) var(--ease-out); }
.seatcard::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; background: radial-gradient(80% 60% at 0% 0%, color-mix(in oklab, var(--c, var(--seg-creator)) 12%, transparent), transparent 70%); transition: background var(--d-3) var(--ease-out); }
.seatcard__role { display: flex; align-items: center; gap: 10px; font-family: var(--f-display); font-weight: 600; font-size: var(--t-xl); letter-spacing: -0.025em; color: var(--ink); }
.seatcard__role i { width: 12px; height: 12px; border-radius: 4px; background: var(--c, var(--seg-creator)); transition: background-color var(--d-3) var(--ease-out); }
.seatcard__line { margin-top: 6px; color: var(--ink-2); }
.seatcard__rows { margin: var(--s-5) 0 0; display: grid; gap: 0; border-top: 1px solid var(--line); }
.seatcard__rows > div { display: grid; grid-template-columns: 8.5rem 1fr; gap: var(--s-4); padding: 12px 0; border-bottom: 1px solid var(--line); }
.seatcard__rows > div:last-child { border-bottom: 0; padding-bottom: 4px; }
.seatcard__rows dt { font-family: var(--f-mono); font-size: var(--t-xs); letter-spacing: var(--track-label); text-transform: uppercase; color: var(--ink-3); padding-top: 3px; }
.seatcard__rows dd { margin: 0; color: var(--ink-2); font-size: var(--t-sm); }
.seatcard__rows dd b { font-family: var(--f-display); font-weight: 600; font-size: var(--t-xl); letter-spacing: -0.03em; color: var(--ink); font-variant-numeric: tabular-nums; }
.seatcard__rows dd small { display: block; margin-top: 2px; color: var(--ink-3); font-size: 0.8125rem; }
.seatcard.is-swap > * { animation: seat-in var(--d-3) var(--ease-out); }
@keyframes seat-in { from { opacity: 0; transform: translateY(6px); } }

.cm-table__try { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: var(--s-5); }
.seg-btns { display: inline-flex; padding: 3px; border-radius: var(--r-sm); border: 1px solid var(--line-2); }
.seg-btns button { height: 36px; min-width: 52px; padding: 0 12px; border: 0; border-radius: 7px; background: none; font-size: var(--t-sm); font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; transition: background-color var(--d-1) var(--ease-out), color var(--d-1) var(--ease-out); }
.seg-btns button:hover { color: var(--ink); }
.seg-btns button.is-on { background: var(--ink); color: var(--bg); }

.table { position: relative; width: min(600px, 100%); aspect-ratio: 1; margin-inline: auto; }
.table__svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.table__felt { fill: var(--surface); stroke: var(--line); stroke-width: 1; }
.table__track { fill: none; stroke: var(--line); stroke-width: 26; }
.table__spin { transform-origin: 200px 200px; transition: transform 900ms var(--ease-out); }
.table__rim { fill: none; stroke: var(--line-2); stroke-width: 1; stroke-dasharray: 2 5; }
.arc { fill: none; stroke-width: 26; stroke: var(--c); transition: stroke-dasharray 640ms var(--ease-out), stroke-dashoffset 640ms var(--ease-out), opacity var(--d-3) var(--ease-out); }
.arc[data-arc="creator"], .seat[data-seat="creator"] { --c: var(--seg-creator); }
.arc[data-arc="monetized"], .seat[data-seat="monetized"] { --c: var(--seg-monetized); }
.arc[data-arc="scout"], .seat[data-seat="scout"] { --c: var(--seg-scout); }
.arc[data-arc="forgeos"], .seat[data-seat="forgeos"] { --c: var(--seg-forgeos); }
.table[data-on] .arc { opacity: 0.26; }
.table[data-on="creator"] .arc[data-arc="creator"], .table[data-on="monetized"] .arc[data-arc="monetized"],
.table[data-on="scout"] .arc[data-arc="scout"], .table[data-on="forgeos"] .arc[data-arc="forgeos"] { opacity: 1; }

.table__centre { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; text-align: center; pointer-events: none; }
.table__pct { display: flex; align-items: flex-start; font-family: var(--f-display); font-weight: 600; font-size: clamp(4rem, 2rem + 7vw, 8rem); line-height: 0.9; letter-spacing: -0.035em; color: var(--ink); font-variant-numeric: tabular-nums; }
.table__pct i { font-style: normal; font-weight: 520; font-size: 0.42em; margin: 0.12em 0 0 0.06em; color: var(--ink-3); letter-spacing: 0; }
.table__who { margin-top: 10px; font-family: var(--f-mono); font-size: var(--t-xs); letter-spacing: var(--track-label); text-transform: uppercase; color: var(--ink-3); }
.table__centre.is-swap > * { animation: seat-in var(--d-3) var(--ease-out); }

/* chairs: fixed at the four sides of the table, overlapping the rim like chairs pulled in */
.seats { position: absolute; inset: 0; }
.seat { position: absolute; display: inline-flex; align-items: center; gap: 9px; min-height: 46px; padding: 0 16px 0 12px; border-radius: var(--r-md); border: 1px solid var(--line-2);
  background: var(--glass-strong); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); box-shadow: var(--e2), var(--edge);
  font-size: var(--t-sm); font-weight: 600; color: var(--ink); white-space: nowrap; -webkit-tap-highlight-color: transparent;
  transition: transform var(--d-3) var(--ease-out), opacity var(--d-3) var(--ease-out), border-color var(--d-2) var(--ease-out), box-shadow var(--d-3) var(--ease-out); }
.seat i { width: 12px; height: 12px; border-radius: 4px; background: var(--c); flex: none; }
.seat[data-seat="creator"]   { left: 50%; top: 4.5%;  --base: translate(-50%, -50%); }
.seat[data-seat="monetized"] { right: 0;  top: 50%;   --base: translate(0, -50%); }
.seat[data-seat="scout"]     { left: 50%; top: 95.5%; --base: translate(-50%, -50%); }
.seat[data-seat="forgeos"]   { left: 0;   top: 50%;   --base: translate(0, -50%); }
.seat { transform: var(--base); }
.table[data-on] .seat { opacity: 0.5; }
.table[data-on] .seat.is-on { opacity: 1; border-color: color-mix(in oklab, var(--c) 70%, transparent); transform: var(--base) translateY(-6px); box-shadow: var(--e3), var(--edge); }
@media (hover: hover) and (pointer: fine) { .table[data-on] .seat:hover { opacity: 1; } }
.seat:active { transform: var(--base) scale(0.97); }

/* --------------------------------------------------------------- inside -- */
.cm-inside { padding-block: var(--section); }
.cm-inside__grid { display: grid; grid-template-columns: 7fr 5fr; gap: var(--s-8); align-items: center; }
.cm-inside__main .d-2 { max-width: 16ch; }
.ledger { margin-top: var(--s-7); border-top: 1px solid var(--line); }
.ledger li { display: grid; grid-template-columns: 44px 1fr auto; gap: var(--s-5); align-items: start; padding: var(--s-5) 0; border-bottom: 1px solid var(--line); }
.ledger__ico { display: grid; place-items: center; width: 44px; height: 44px; border-radius: var(--r-sm); background: var(--accent-soft); color: var(--accent-text); }
.ledger p { margin-top: 6px; color: var(--ink-2); font-size: var(--t-sm); max-width: 50ch; }
.ledger__where { align-self: center; font-family: var(--f-mono); font-size: var(--t-xs); letter-spacing: var(--track-label); text-transform: uppercase; color: var(--ink-3); }
.ledger__where--link { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; color: var(--accent-text); text-decoration: none; }
.ledger__where--link .i { width: 14px; height: 14px; }
.ledger__where--link:hover { text-decoration: underline; }
/* the owner's studio photo: a creator's desk with a call on the monitor */
.cm-inside__photo { justify-self: end; width: min(560px, 100%); margin: 0; aspect-ratio: 4 / 5; border-radius: var(--r-xl); overflow: hidden; border: 1px solid var(--line); box-shadow: var(--e3), var(--edge); background: #0b0a14; }
.cm-inside__photo img { width: 100%; height: 100%; object-fit: cover; object-position: 62% 50%; }

/* ---------------------------------------------------------------- flow -- */
.cm-flow { padding-block: var(--section); --draw: 0; }
.cm-flow__title { max-width: 20ch; }
.flow { position: relative; margin-top: var(--s-8); display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s-6); }
.flow::before, .flow::after { content: ""; position: absolute; left: 10px; right: 0; top: 10px; height: 2px; margin-top: -1px; border-radius: 2px; }
.flow::before { background: var(--line-2); }
.flow::after { background: var(--accent-text); transform-origin: 0 50%; transform: scaleX(var(--draw)); }
.flow__node { position: relative; padding-top: 44px; }
.flow__dot { position: absolute; left: 0; top: 0; width: 22px; height: 22px; border-radius: 50%; background: var(--bg-dusk); border: 2px solid var(--line-2); z-index: 1; transition: border-color var(--d-3) var(--ease-out), background-color var(--d-3) var(--ease-out), transform var(--d-3) var(--ease-out); }
.flow__node.is-lit .flow__dot { border-color: var(--accent-text); background: var(--accent); transform: scale(1.1); }
.flow__node h3 { color: var(--ink-3); transition: color var(--d-3) var(--ease-out); }
.flow__node.is-lit h3 { color: var(--ink); }
.flow__node p { margin-top: 8px; color: var(--ink-2); font-size: var(--t-sm); max-width: 28ch; }
.cm-flow__more { display: flex; flex-wrap: wrap; gap: var(--s-3) var(--s-6); margin-top: var(--s-7); }
.cm-flow__more a { color: var(--accent-text); font-weight: 600; }

/* --------------------------------------------------------------- close -- */
.cm-film .film__copy .d-2 { max-width: 14ch; }
/* the call sits on the left 70%, fading out under the copy, so the text never lands on a face */
.cm-film .film__media { right: 30%; -webkit-mask-image: linear-gradient(270deg, transparent 0%, #000 30%); mask-image: linear-gradient(270deg, transparent 0%, #000 30%); }
.cm-film .film__media > img, .cm-film .film__media > video { object-position: 50% 42%; }
.cm-film__note { margin-top: var(--s-4); font-family: var(--f-mono); font-size: 0.6875rem; letter-spacing: 0.06em; text-transform: uppercase; color: #aba6c2; }
.cm-film .film__scrim { background: linear-gradient(0deg, rgb(7 6 13 / 0.94) 0%, rgb(7 6 13 / 0.6) 40%, rgb(7 6 13 / 0) 72%), linear-gradient(270deg, rgb(7 6 13 / 0.9) 0%, rgb(7 6 13 / 0.62) 36%, rgb(7 6 13 / 0) 62%); }
.cm-close { position: relative; min-height: 76vh; min-height: 76svh; display: grid; place-items: center; overflow: hidden; isolation: isolate; text-align: center; padding-block: var(--section); }
.cm-close__art { position: absolute; left: 50%; top: 50%; width: min(1240px, 170vw); max-width: none; height: auto; transform: translate(-50%, -50%); z-index: 0; opacity: 0.9; pointer-events: none;
  -webkit-mask-image: radial-gradient(closest-side, #000 50%, transparent 100%); mask-image: radial-gradient(closest-side, #000 50%, transparent 100%); }
:root[data-theme="light"] .cm-close__art { opacity: 0.55; }
.cm-close__inner { position: relative; z-index: 1; display: grid; justify-items: center; }
/* a soft pool behind the type only, so the network never fights the headline */
.cm-close__inner::before { content: ""; position: absolute; inset: -18% -10%; z-index: -1; background: radial-gradient(closest-side, color-mix(in oklab, var(--bg) 82%, transparent), transparent); pointer-events: none; }
.cm-close .lede { margin: var(--s-5) auto 0; max-width: 38ch; }
.cm-close .btn-row { margin-top: var(--s-6); justify-content: center; }

/* ---------------------------------------------------------------- phone -- */
@media (max-width: 980px) {
  .cm-who__grid, .cm-table__grid, .cm-inside__grid { grid-template-columns: 1fr; gap: var(--s-7); }
  .cm-who__side { display: flex; align-items: center; justify-content: space-between; }
  .cm-who__film { margin: 0; width: 46%; max-width: 240px; }
  .cm-table .table { order: 2; }
  .cm-table__intro { display: contents; }
  .cm-table__intro > .d-1, .cm-table__intro > .body { order: 1; }
  .seatcard { order: 3; margin-top: 0; }
  .cm-table__try { order: 4; margin-top: 0; }
  .cm-table__grid { gap: var(--s-5); }
  .cm-table .table { margin-block: var(--s-5); }
  .cm-inside__photo { justify-self: center; width: min(520px, 100%); aspect-ratio: 16 / 10; order: -1; }
}
@media (max-width: 760px) {
  .cm-film .film__media { right: 0; -webkit-mask-image: none; mask-image: none; }
  .cm-film .film__media > img, .cm-film .film__media > video { object-position: 50% 20%; }
  .cm-film .film__copy { justify-items: start; text-align: left; }
  .cm-hero__copy .d-hero { font-size: clamp(2.5rem, 11.4vw, 3.4rem); }
  .cm-hero__copy .lede { font-size: var(--t-base); }
  .cm-hero__copy .btn--lg { --h: 50px; padding: 0 1.1em; font-size: var(--t-sm); }
  .cm-hero__band { height: 78%; }
  .cm-hero__film .vid > img, .cm-hero__film .vid > video { object-position: 38% 30%; }
  .cm-who__roles { grid-template-columns: 1fr; gap: var(--s-5); }
  .seat { min-height: 44px; padding: 0 12px 0 10px; font-size: 0.8125rem; gap: 7px; }
  .seat[data-seat="monetized"] span { max-width: 6.5em; white-space: normal; line-height: 1.15; }
  .seatcard__rows > div { grid-template-columns: 1fr; gap: 4px; }
  .ledger li { grid-template-columns: 40px 1fr; gap: var(--s-4); }
  .ledger__ico { width: 40px; height: 40px; }
  .ledger__where { grid-column: 2; }
  .flow { grid-template-columns: 1fr; gap: var(--s-6); }
  .flow::before, .flow::after { left: 10px; right: auto; top: 10px; bottom: 10px; width: 2px; height: auto; margin: 0 0 0 -1px; }
  .flow::after { transform-origin: 50% 0; transform: scaleY(var(--draw)); }
  .flow__node { padding: 0 0 0 44px; }
  .cm-close__art { width: 190vw; opacity: 0.6; }
  .cm-close__inner::before { inset: -10% -20%; background: radial-gradient(closest-side, color-mix(in oklab, var(--bg) 92%, transparent) 60%, transparent); }
}

/* -------------------------------------------------------- reduced motion */
@media (prefers-reduced-motion: reduce) {
  .cm-hero__film { will-change: auto; }
  .seat, .arc, .flow__dot, .table__spin { transition-duration: 1ms; }
  .table[data-on] .seat.is-on { transform: var(--base); }
  .seatcard.is-swap > *, .table__centre.is-swap > * { animation: none; }
  .cm-flow { --draw: 1; }
}
