/* The landing page: "Cells". The living cell in the middle, smaller cells
   around it on strands, and one at a time grows while a question and Stem's
   answer show below. Dark only. Design: docs/design/website-cells.html.
   Scoped to body.cells so the other pages keep site.css as it is. The page's
   CSP allows no inline styles, so every position is a class here. */
/* Source Serif 4 with its optical-size axis, as in the design (large headings
   use the display cut). Only this page loads it. */
@font-face { font-family: "Source Serif 4 Cells"; src: url("/assets/fonts/source-serif-4-latin-opsz-wght.woff2") format("woff2"); font-weight: 200 900; font-style: normal; font-display: swap; }
body.cells {
  color-scheme: dark;
  --bg: #151012;
  --text: #f4ecec;
  --muted: #a2969a;
  --line: #382d31;
  --accent: #f0609f;
  --btn: #f4ecec;
  --btn-text: #151012;
  --cserif: "Source Serif 4 Cells", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --csans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --edge: clamp(1.25rem, 3.2vw, 2.75rem);
  display: flex; flex-direction: column; min-height: 100vh;
  background: var(--bg); color: var(--text); font-family: var(--cserif);
  padding: 0 var(--edge); overflow-x: clip;
}
.cells a { color: inherit; }
.cells :focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 6px; }

.cells .ctop { display: flex; justify-content: flex-end; gap: 1.6rem; padding-block: 1.4rem 0; font-family: var(--csans); font-size: 0.92rem; }
.cells .ctop a { text-decoration: none; color: var(--muted); padding: 0.85rem 0; transition: color .2s; white-space: nowrap; }
.cells .ctop a:hover { color: var(--text); }

.cells .cellpage { flex: 1; width: 100%; max-width: 80rem; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 30rem) minmax(0, 1fr); align-items: center; gap: clamp(1.5rem, 4vw, 4rem); padding-block: clamp(1.5rem, 5vh, 3.5rem) 1rem; }
.cells h1 { font-size: clamp(2rem, 1.2rem + 2.6vw, 3.4rem); font-weight: 600; line-height: 1.08; letter-spacing: -0.025em; margin: 0 0 0.8em; text-wrap: balance; }
.cells .ccopy p { font-size: clamp(1.1rem, 1rem + 0.4vw, 1.28rem); line-height: 1.5; color: var(--muted); margin: 0; max-width: 31rem; text-wrap: pretty; }
.cells .cta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.1rem; margin-top: 2rem; font-family: var(--csans); }
.cells .cbtn { display: inline-flex; align-items: center; gap: 0.5rem; min-height: 48px; background: var(--btn); color: var(--btn-text); border-radius: 999px; padding: 0 1.4rem; font-size: 1rem; font-weight: 500; text-decoration: none; }
.cells .cbtn i { font-style: normal; transition: transform .2s ease; }
.cells .cbtn:hover i { transform: translateX(3px); }
.cells .cta span { font-size: 0.92rem; color: var(--muted); }

/* The big cell: a flat SVG, replaced by the 3D canvas when WebGL works (cells.js). */
.cells .cell { position: relative; width: 100%; aspect-ratio: 1; }
.cells .cell .breathe { position: absolute; inset: 0; animation: c-breathe 5s ease-in-out infinite; }
.cells .cell svg { width: 100%; height: 100%; display: block; overflow: visible; }
.cells .cell canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.cells .cell.is-3d svg { visibility: hidden; }
.cells .cell.is-3d::before { content: ""; position: absolute; inset: 4%; border-radius: 50%; background: radial-gradient(closest-side, rgba(242, 139, 182, 0.28) 55%, rgba(242, 139, 182, 0) 100%); }
.cells .cell .glow { animation: c-glow 5s ease-in-out infinite; }
.cells .cell .nucleus { animation: c-drift 9s ease-in-out infinite; transform-origin: 50% 50%; transform-box: fill-box; }
@keyframes c-breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.035); } }
@keyframes c-glow { 0%, 100% { opacity: 0.5; } 50% { opacity: 0.95; } }
@keyframes c-drift { 0%, 100% { transform: translate(0, 0); } 35% { transform: translate(2.5%, -2%); } 70% { transform: translate(-2%, 2%); } }

/* The network */
.cells .visual { display: flex; flex-direction: column; gap: 0.75rem; min-width: 0; }
.cells .net { position: relative; width: 100%; aspect-ratio: 1000/800; }
.cells .net > svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.cells .strand { fill: none; stroke: var(--accent); stroke-opacity: 0.22; stroke-width: 1.4; stroke-linecap: round; }
.cells .strand.hot { animation: c-hot 27.5s ease-in-out infinite; animation-delay: calc(var(--i) * 5.5s - 0.9s); }
@keyframes c-hot { 0% { stroke-opacity: 0.22; stroke-width: 1.4; } 3%, 17% { stroke-opacity: 0.75; stroke-width: 2.2; } 20%, 100% { stroke-opacity: 0.22; stroke-width: 1.4; } }
.cells .sig { fill: var(--accent); opacity: 0; filter: drop-shadow(0 0 5px color-mix(in srgb, var(--accent) 80%, transparent)); }
.cells .sig.soft { fill: #f4a6c8; }
.cells .net .cell { position: absolute; left: 50%; top: 50%; width: 30%; transform: translate(-50%, -50%); z-index: 2; }
.cells .sat, .cells .q { position: absolute; border-radius: 50%; }
.cells .sat, .cells .q .img { background: url("/assets/cell.png") center / contain no-repeat; filter: drop-shadow(0 0 8px rgba(240, 106, 169, 0.35)); }
.cells .sat { width: var(--s); aspect-ratio: 1; margin: calc(var(--s) / -2) 0 0 calc(var(--s) / -2); animation: c-bob 7s ease-in-out infinite, c-spin 48s linear infinite; }
.cells .sat:nth-child(even) { animation-direction: normal, reverse; }
@keyframes c-bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -6px; } }
@keyframes c-spin { to { rotate: 360deg; } }
.cells .qs { position: absolute; inset: 0; }
.cells .q { width: 18%; aspect-ratio: 1; margin: -9% 0 0 -9%; z-index: 3; scale: 0.3333; animation: c-grow 27.5s cubic-bezier(.3, .7, .3, 1) infinite; animation-delay: calc(var(--i) * 5.5s); }
.cells .q .img { position: absolute; inset: 0; }
@keyframes c-grow { 0% { scale: 0.3333; } 3%, 16.5% { scale: 1; } 19.5%, 100% { scale: 0.3333; } }
@keyframes c-txt { 0%, 3.5% { opacity: 0; } 5.5%, 15.5% { opacity: 1; } 18%, 100% { opacity: 0; } }

/* Positions and timing (inline styles in the design file). */
.cells .i0 { --i: 0; } .cells .i1 { --i: 1; } .cells .i2 { --i: 2; } .cells .i3 { --i: 3; } .cells .i4 { --i: 4; }
.cells .q.i0 { left: 25%; top: 23.8%; }
.cells .q.i1 { left: 76%; top: 77.5%; }
.cells .q.i2 { left: 78%; top: 21.9%; }
.cells .q.i3 { left: 23.5%; top: 76.2%; }
.cells .q.i4 { left: 87%; top: 50%; }
.cells .s0 { left: 12%; top: 41.2%; --s: 4.4%; animation-delay: 0s; }
.cells .s1 { left: 38%; top: 10%; --s: 3.2%; animation-delay: -1.3s; }
.cells .s2 { left: 64%; top: 11.9%; --s: 4%; animation-delay: -2.6s; }
.cells .s3 { left: 93%; top: 31.2%; --s: 2.8%; animation-delay: -3.9s; }
.cells .s4 { left: 56%; top: 91.2%; --s: 3.6%; animation-delay: -5.2s; }
.cells .s5 { left: 9.5%; top: 65%; --s: 3%; animation-delay: -6.5s; }
.cells .s6 { left: 42%; top: 87.5%; --s: 2.4%; animation-delay: -7.8s; }
.cells .s7 { left: 90%; top: 70%; --s: 3.4%; animation-delay: -9.1s; }

/* The question and Stem's answer */
.cells .caps { position: relative; list-style: none; margin: 0 auto; padding: 0; width: min(100%, 30rem); height: 5.5rem; }
.cells .cap { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; gap: 0.35rem; opacity: 0; animation: c-txt 27.5s ease-in-out infinite; animation-delay: calc(var(--i) * 5.5s); }
.cells .cap p { margin: 0; display: flex; align-items: baseline; gap: 0.75rem; font-size: 1.12rem; line-height: 1.3; color: var(--text); }
.cells .cap small { flex: none; width: 2.75rem; font-family: var(--csans); font-size: 0.72rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.cells .cap small.stem { color: var(--accent); }

.cells .cfoot { display: flex; flex-wrap: wrap; align-items: center; gap: 0 1.6rem; padding-block: 1rem; font-family: var(--csans); font-size: 0.85rem; color: var(--muted); }
.cells .cfoot span { margin-right: auto; }
.cells .cfoot a { text-decoration: none; padding: 0.75rem 0; transition: color .2s; }
.cells .cfoot a:hover { color: var(--text); }

@media (max-width: 900px) {
  /* Room at the bottom for the host's required badge (Netlify Free), so it never
     covers "Coming soon" or the footer on a phone. The badge itself stays visible. */
  body.cells { padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px)); }
  .cells .cellpage { grid-template-columns: 1fr; }
  .cells .visual { order: -1; }
  .cells .cap p { font-size: 1rem; }
  .cells .q { width: 24%; margin: -12% 0 0 -12%; }
}
@media (prefers-reduced-motion: reduce) {
  .cells .cell .breathe, .cells .cell .glow, .cells .cell .nucleus, .cells .strand.hot, .cells .sat, .cells .q, .cells .cap { animation: none; }
  .cells .cap:first-child { opacity: 1; }
  .cells .net > svg .sig { display: none; }
  .cells .q:first-child { scale: 1; }
  .cells .q:first-child .img { opacity: 0.75; }
}
