.cayley-findings {
  align-items: start;
}

.cayley-proof {
  margin-top: 18px;
  border-top: 1px solid var(--card-divider);
}

.cayley-proof summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 44px;
  padding-block: 8px;
  color: var(--accent-text);
  font-size: 14px;
  font-weight: 600;
  list-style: none;
  cursor: pointer;
}

.cayley-proof summary::-webkit-details-marker { display: none; }
.cayley-proof summary::after { content: "+"; font-size: 20px; line-height: 1; }
.cayley-proof[open] summary::after { content: "−"; }
.cayley-proof summary:hover { text-decoration: underline; }
.cayley-proof summary:focus-visible {
  outline: 2px solid var(--accent-text);
  outline-offset: 3px;
  border-radius: 4px;
}

.cayley-proof ol {
  margin: 5px 0 0;
  padding-left: 20px;
  color: var(--body);
  font-size: 14px;
  line-height: 1.55;
}

.cayley-proof li + li { margin-top: 13px; }
.cayley-proof li::marker { color: var(--accent-text); font-weight: 600; }
.cayley-proof a {
  color: var(--accent-text);
  text-underline-offset: 2px;
}

.room .cayley-proof-atlas {
  margin-top: 14px;
}

.atlas-frame[data-room-atlas-view="timeline"] {
  height: 750px;
}

@media (max-width: 540px) {
  .atlas-frame[data-room-atlas-view="timeline"] { height: 850px; }
}

/* Header: animated Delegate Rooms logo (assets/rooms/logo-animation.js) on this page only, in the same purple as the site logo. */
.site-header .room-brand-logo { display: block; width: 190px; color: var(--accent); }
.site-header .room-brand-logo svg { display: block; width: 100%; height: auto; overflow: visible; }
@media (max-width: 1100px) { .site-header .room-brand-logo { width: 150px; } }
@media (max-width: 480px) { .site-header .room-brand-logo { width: 130px; } }

/* This page sets its body text in Helvetica Neue Regular only (headings and mono stay on the site fonts).
   The one-face family below maps every weight to the Regular face; font-synthesis stops faux bold. */
@font-face { font-family: "Cayley Helvetica"; src: local("Helvetica Neue"), local("HelveticaNeue"); font-weight: 100 900; font-style: normal; }
:root, :root[data-theme] { --font-body: "Cayley Helvetica", "Helvetica Neue", Helvetica, Arial, sans-serif; }
body { font-family: var(--font-body); font-synthesis-weight: none; }

/* Hero title: name and subtitle as one line of text, a little smaller than the shared room title. */
.room-hero h1 { max-width: 1100px; font-size: clamp(32px, 4.4vw, 58px); }

/* Background field of numbers on both sides of the room window (math-field.js).
   Back labels sit on a blurred canvas; strips next to the window add a gradient blur; all edges fade out. */
.room-hero { overflow-x: clip; }
.cayley-stage { position: relative; }
.cayley-stage .room-window { position: relative; z-index: 1; }
.cayley-field { position: absolute; z-index: 0; top: -120px; bottom: -150px; left: calc(50% - 50vw); width: 100vw; pointer-events: none; opacity: .85;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent), linear-gradient(180deg, transparent, #000 20%, #000 80%, transparent);
  -webkit-mask-composite: source-in; mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent), linear-gradient(180deg, transparent, #000 20%, #000 80%, transparent); mask-composite: intersect; }
.cayley-field canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.cayley-field-back { filter: blur(1.6px); }
.cayley-field-blur { position: absolute; top: 0; bottom: 0; width: 220px; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.cayley-field-blur.is-left { -webkit-mask-image: linear-gradient(90deg, transparent, #000); mask-image: linear-gradient(90deg, transparent, #000); }
.cayley-field-blur.is-right { -webkit-mask-image: linear-gradient(270deg, transparent, #000); mask-image: linear-gradient(270deg, transparent, #000); }
@media (max-width: 820px) { .cayley-field { display: none; } }

/* Progress cards: the headline figure sits on its own soft pill (no outline, no rule below), with a light shadow falling left to right. */
.room-card .room-figure { min-height: 76px; align-items: center; padding: 16px 20px; margin-bottom: 20px; border: 0; border-radius: 22px; background: var(--card);
  box-shadow: 10px 12px 30px rgba(74, 60, 140, .10), 3px 4px 10px rgba(74, 60, 140, .05), -2px 0 6px rgba(74, 60, 140, .02); }
:root[data-theme="light"] .room-card .room-figure { background: #fff; }
:root[data-theme="dark"] .room-card .room-figure { background: rgba(255, 255, 255, .05); box-shadow: 10px 12px 30px rgba(0, 0, 0, .35), 3px 4px 10px rgba(0, 0, 0, .2); }

/* Hero: the "a math mystery from 1959" half in a glowing pink-violet italic. */
.room-hero h1 .room-l2-glow { font-style: italic; background: linear-gradient(95deg, #8A4FD8 0%, #B15FD9 55%, #D07AD8 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 14px rgba(177, 95, 217, .28)); padding-right: .08em; }
:root[data-theme="dark"] .room-hero h1 .room-l2-glow { background-image: linear-gradient(95deg, #C3A2FF 0%, #E0A6F2 60%, #F2B8E8 100%); filter: drop-shadow(0 0 16px rgba(224, 166, 242, .35)); }

/* Hero intro: a touch smaller and wider, so it runs in fewer lines under the title. */
.room .room-hero .room-lede { max-width: 820px; font-size: clamp(15px, 1.2vw, 17px); line-height: 1.55; }

/* Section transitions: no hard rules between sections; tinted bands fade in and out of the page colour. */
.room .section { border-bottom: 0; }
:root[data-theme="light"] .room-band { background: linear-gradient(180deg, var(--canvas) 0%, var(--canvas-subtle) 26%, var(--canvas-subtle) 74%, var(--canvas) 100%); }
.room-footer { border-top: 0; background: linear-gradient(90deg, transparent, var(--hairline) 30%, var(--hairline) 70%, transparent) top / 100% 1px no-repeat; }

/* Motion (motion.js): blocks rise in as they scroll into view; cards lift on hover. Off without JS or with reduced motion. */
.has-motion .reveal { opacity: 0; transform: translate3d(0, 28px, 0); transition: opacity .9s cubic-bezier(.2, .7, .2, 1), transform .9s cubic-bezier(.2, .7, .2, 1); transition-delay: var(--reveal-delay, 0s); }
.has-motion .reveal.is-in { opacity: 1; transform: none; }
.has-motion .room-hero h1, .has-motion .room-hero .room-lede, .has-motion .room-hero .room-ctas { will-change: transform, opacity; }
@media (hover: hover) and (pointer: fine) {
  .room-card { transition: transform .5s cubic-bezier(.2, .7, .2, 1), box-shadow .5s cubic-bezier(.2, .7, .2, 1); }
  .room-card:hover { transform: translateY(-4px); box-shadow: 0 1px 2px rgba(18, 6, 26, .04), 0 22px 48px rgba(45, 16, 67, .12); }
}

/* Graph: the diagram and its controls share one soft pill on a light surface; the diagram glows faintly. */
.room .cayley-graph-section .graph-layout { gap: 0; overflow: hidden; border-radius: 28px; background: var(--card);
  box-shadow: 10px 14px 36px rgba(74, 60, 140, .12), 3px 4px 12px rgba(74, 60, 140, .06); }
.room .cayley-graph-section .graph-figure, .room .cayley-graph-section .graph-controls { border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.room .cayley-graph-section .graph-controls { background: linear-gradient(180deg, transparent, var(--hairline) 20%, var(--hairline) 80%, transparent) left / 1px 100% no-repeat; }
.room .cayley-graph-section .graph-surface { background: radial-gradient(70% 60% at 50% 45%, #F1EEFF 0%, #F6F9FF 45%, #FCFDFF 100%); }
.room .cayley-graph-section #plot { filter: drop-shadow(0 0 6px rgba(120, 110, 220, .16)); }
:root[data-theme="dark"] .room .cayley-graph-section .graph-surface { background: radial-gradient(70% 60% at 50% 45%, #241a3d 0%, #18122a 55%, var(--card) 100%); }
:root[data-theme="dark"] .room .cayley-graph-section #plot { color: #1e1633; }
@media (max-width: 820px) { .room .cayley-graph-section .graph-controls { background: linear-gradient(90deg, transparent, var(--hairline) 20%, var(--hairline) 80%, transparent) top / 100% 1px no-repeat; } }


/* Closing card: the same number field in glowing white-blue, strongest at the card's sides,
   blurring and fading out towards the text in the middle. */
.room-final { position: relative; overflow: hidden; isolation: isolate; }
.room-final > :not(.final-field) { position: relative; z-index: 1; }
.final-field { top: 0; bottom: 0; left: 0; width: 100%; z-index: 0; opacity: .9;
  -webkit-mask-image: linear-gradient(90deg, #000 0%, rgba(0, 0, 0, .85) 6%, rgba(0, 0, 0, .4) 12%, rgba(0, 0, 0, .12) 18%, transparent 24%, transparent 76%, rgba(0, 0, 0, .12) 82%, rgba(0, 0, 0, .4) 88%, rgba(0, 0, 0, .85) 94%, #000 100%);
  mask-image: linear-gradient(90deg, #000 0%, rgba(0, 0, 0, .85) 6%, rgba(0, 0, 0, .4) 12%, rgba(0, 0, 0, .12) 18%, transparent 24%, transparent 76%, rgba(0, 0, 0, .12) 82%, rgba(0, 0, 0, .4) 88%, rgba(0, 0, 0, .85) 94%, #000 100%); }
.final-field .cayley-field-front { filter: drop-shadow(0 0 3px rgba(174, 220, 255, .75)) drop-shadow(0 0 10px rgba(140, 200, 255, .35)); }
.final-field .cayley-field-back { filter: blur(1.8px) drop-shadow(0 0 6px rgba(174, 220, 255, .4)); }
.final-field-blur { position: absolute; inset: 0; -webkit-backdrop-filter: blur(9px); backdrop-filter: blur(9px);
  -webkit-mask-image: linear-gradient(90deg, transparent 3%, #000 15%, #000 85%, transparent 97%); mask-image: linear-gradient(90deg, transparent 3%, #000 15%, #000 85%, transparent 97%); }
@media (max-width: 820px) { .final-field { display: block; opacity: .55; } }

/* Subtitle glow kept low in both themes; title lines ~2% closer. */
.room-hero h1 .room-l2-glow { filter: drop-shadow(0 0 6px rgba(177, 95, 217, .10)); }
:root[data-theme="dark"] .room-hero h1 .room-l2-glow { filter: drop-shadow(0 0 6px rgba(224, 166, 242, .14)); }
.room .room-hero h1 { line-height: 1.03; }

/* Card figures look drawn on paper: their outline breathes very gently (SVG filter #paper-ink in index.html). */
.paper-ink-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.room-figure .figure-ink { font-style: normal; }
/* Hand-drawn look (motion.js): the figure is written left to right when its card appears, then its line "boils",
   stepping between three wobble filters a few times a second, like redrawn animation frames. */
.room-figure .figure-ink { display: inline-block; }
.room-figure[data-boil="0"] .figure-ink { filter: url(#paper-ink-0); }
.room-figure[data-boil="1"] .figure-ink { filter: url(#paper-ink-1); }
.room-figure[data-boil="2"] .figure-ink { filter: url(#paper-ink-2); }
.has-motion .room-figure .figure-ink { -webkit-mask-image: linear-gradient(90deg, #000 45%, transparent 55%); mask-image: linear-gradient(90deg, #000 45%, transparent 55%);
  -webkit-mask-size: 300% 100%; mask-size: 300% 100%; -webkit-mask-position: 100% 0; mask-position: 100% 0; }
.has-motion .room-figure.is-written .figure-ink { animation: figure-write 1.5s cubic-bezier(.45, .05, .35, 1) forwards; }
@keyframes figure-write { to { -webkit-mask-position: 0 0; mask-position: 0 0; } }

/* Closing buttons with a sliding fill (motion.js adds .has-glider and the .cta-glider span). */
.room .room-final .room-ctas.has-glider { position: relative; }
.room .cta-glider { position: absolute; top: 0; left: 0; z-index: 0; border-radius: 999px; pointer-events: none;
  background: linear-gradient(180deg, rgba(214, 242, 255, .96), rgba(143, 211, 255, .88)); border: 1px solid rgba(255, 255, 255, .6);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .75), 0 6px 18px rgba(110, 190, 255, .30), 0 0 28px rgba(174, 229, 255, .28);
 }
.room .cta-glider.is-ready { transition: transform .5s cubic-bezier(.3, .7, .2, 1), width .5s cubic-bezier(.3, .7, .2, 1); }
.room .room-final .room-ctas.has-glider .btn { position: relative; z-index: 1; background: transparent; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none;
  border: 1px solid rgba(174, 229, 255, .34); color: #EFFAFF; transition: color .35s ease, border-color .35s ease, background-color .35s ease; }
.room .room-final .room-ctas.has-glider[data-active="primary"] .btn-primary,
.room .room-final .room-ctas.has-glider[data-active="ghost"] .btn-ghost { border-color: transparent; color: #12061A; }
.room .room-final .room-ctas.has-glider[data-active="ghost"] .btn-primary,
.room .room-final .room-ctas.has-glider[data-active="primary"] .btn-ghost { background-color: rgba(174, 229, 255, .10); }
@media (prefers-reduced-motion: reduce) { .room .cta-glider { transition: none; } }

/* Hero buttons share the sliding fill; on the light page the inactive one keeps the light-blue glass look. */
.room .room-hero .room-ctas.has-glider { position: relative; }
.room .room-hero .room-ctas.has-glider .btn { position: relative; z-index: 1; background: transparent; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none;
  border: 1px solid rgba(60, 140, 210, .30); color: #12061A; transition: color .35s ease, border-color .35s ease, background-color .35s ease; }
.room .room-hero .room-ctas.has-glider[data-active="primary"] .btn-primary,
.room .room-hero .room-ctas.has-glider[data-active="ghost"] .btn-ghost { border-color: transparent; }
.room .room-hero .room-ctas.has-glider[data-active="ghost"] .btn-primary,
.room .room-hero .room-ctas.has-glider[data-active="primary"] .btn-ghost { background-color: rgba(174, 229, 255, .20); }
:root[data-theme="dark"] .room .room-hero .room-ctas.has-glider .btn { border-color: rgba(174, 229, 255, .34); color: #EFFAFF; }
:root[data-theme="dark"] .room .room-hero .room-ctas.has-glider[data-active="primary"] .btn-primary,
:root[data-theme="dark"] .room .room-hero .room-ctas.has-glider[data-active="ghost"] .btn-ghost { border-color: transparent; color: #12061A; }

/* Room owner: Alexander Chervov's photo in the avatar circle (cropped and upscaled, 320px). */
.room-avatar.has-photo { overflow: hidden; background: none; }
.room-avatar.has-photo img { display: block; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; object-position: 46% 38%; }
