/* Cellidoscope website. Two surfaces: the dark microscope field (hero, dive) and pale slide glass (content).
   Colours are the fluorescence channels the app draws with. */
:root {
  --field: #071a1f;
  --field-2: #0c2a31;
  --field-line: rgba(157, 245, 208, 0.07);
  --glass: #eef5f2;
  --glass-2: #e1ece8;
  --glass-line: rgba(10, 35, 40, 0.1);
  --ink: #0a2328;
  --ink-soft: #3d5b5f;
  --on-field: #e6f4f1;
  --on-field-soft: #93b3b0;
  --gfp: #3ddc97;
  --gfp-deep: #128a5c;
  --cyan: #4cc9f0;
  --dapi: #7c5cff;
  --mcherry: #ff6b6b;
  --sun: #ffc145;

  --display: "Gabarito", ui-rounded, "SF Pro Rounded", system-ui, sans-serif;
  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;

  /* Type scale (perfect fourth, 17px base) */
  --t-small: 0.875rem;
  --t-body: 1.0625rem;
  --t-lead: 1.3125rem;
  --t-h3: 1.5rem;
  --t-h2: clamp(2rem, 1.4rem + 2.6vw, 3.25rem);
  --t-h1: clamp(2.9rem, 1.6rem + 5.6vw, 6.2rem);

  --gutter: clamp(16px, 4vw, 40px);
  --max: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--glass);
  color: var(--ink);
  font: 400 var(--t-body)/1.65 var(--serif);
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
:focus-visible { outline: 3px solid var(--cyan); outline-offset: 3px; border-radius: 6px; }

.skip { position: absolute; left: -9999px; top: 12px; z-index: 100; background: var(--gfp); color: var(--ink); padding: 10px 14px; border-radius: 10px; font-family: var(--display); }
.skip:focus { left: 12px; }

.wrap { width: min(var(--max), 100% - 2 * var(--gutter)); margin-inline: auto; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

h1, h2, h3 { font-family: var(--display); font-weight: 800; letter-spacing: -0.02em; line-height: 1.02; margin: 0; }
h2 { font-size: var(--t-h2); }
h3 { font-size: var(--t-h3); line-height: 1.15; letter-spacing: -0.01em; }
p { margin: 0 0 1em; max-width: 34em; }

/* ---------- Header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  color: var(--on-field);
  transition: background-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}
.site-header .wrap { display: flex; align-items: center; gap: 24px; height: 68px; }
.site-header.on-glass { background: rgba(238, 245, 242, 0.86); color: var(--ink); box-shadow: 0 1px 0 var(--glass-line); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.site-header.on-field { background: rgba(7, 26, 31, 0.72); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.brand { display: inline-flex; align-items: center; gap: 10px; font: 800 1.3rem/1 var(--display); text-decoration: none; letter-spacing: -0.01em; }
.brand img { width: 34px; height: 34px; border-radius: 9px; }
.site-nav { margin-left: auto; display: flex; gap: 26px; font: 600 0.98rem/1 var(--display); }
.site-nav a { text-decoration: none; opacity: 0.78; }
.site-nav a:hover { opacity: 1; }
.availability {
  font: 700 0.92rem/1 var(--display); padding: 11px 16px; border-radius: 999px;
  background: var(--gfp); color: var(--ink); white-space: nowrap; text-decoration: none;
}
.availability .short { display: none; }
figure { margin: 0; }
@media (max-width: 720px) {
  .site-nav { display: none; }
  .availability { margin-left: auto; padding: 10px 13px; font-size: 0.85rem; }
}
@media (max-width: 520px) {
  .availability .long { display: none; }
  .availability .short { display: inline; }
}

/* ---------- Hero ---------- */
.field {
  background:
    radial-gradient(ellipse at 70% 40%, rgba(61, 220, 151, 0.09), transparent 60%),
    linear-gradient(var(--field-line) 1px, transparent 1px) 0 0 / 40px 40px,
    linear-gradient(90deg, var(--field-line) 1px, transparent 1px) 0 0 / 40px 40px,
    var(--field);
  color: var(--on-field);
}
.hero { min-height: 100svh; display: grid; align-items: center; padding: 110px 0 64px; overflow: hidden; }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: clamp(24px, 4vw, 64px); align-items: center; }
.hero h1 { font-size: var(--t-h1); font-weight: 900; letter-spacing: -0.035em; line-height: 0.95; }
.hero h1 span { display: block; }
.hero .lead { font-size: var(--t-lead); line-height: 1.55; color: var(--on-field-soft); margin: 28px 0 32px; max-width: 26em; }
.hero .lead em { color: var(--on-field); }
.hero-meta { display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: center; font: 600 0.98rem/1.3 var(--display); color: var(--on-field-soft); }
.button {
  display: inline-flex; align-items: center; gap: 10px; text-decoration: none;
  font: 800 1.02rem/1 var(--display); padding: 17px 24px; border-radius: 16px;
  background: var(--gfp); color: var(--ink);
  box-shadow: 0 10px 34px -10px rgba(61, 220, 151, 0.7);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.button:hover { transform: translateY(-2px); box-shadow: 0 16px 40px -12px rgba(61, 220, 151, 0.8); }

/* The eyepiece: a round field of view with a soft vignette. */
.eyepiece { position: relative; aspect-ratio: 1; width: min(100%, 600px); justify-self: center; }
.eyepiece::before {
  content: ""; position: absolute; inset: -2%; border-radius: 50%;
  background: radial-gradient(circle, rgba(76, 201, 240, 0.12), transparent 66%);
}
.eyepiece canvas { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 50%; touch-action: manipulation; cursor: crosshair; }
.eyepiece .ring { position: absolute; inset: 0; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(157, 245, 208, 0.16), inset 0 0 80px 24px var(--field); pointer-events: none; }
.focus-in { animation: focus 1.6s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
@keyframes focus { from { filter: blur(14px) saturate(0.4); opacity: 0.2; transform: scale(1.06); } to { filter: none; opacity: 1; transform: none; } }

.tooltip {
  position: absolute; z-index: 3; pointer-events: none; transform: translate(-50%, calc(-100% - 18px));
  background: rgba(7, 26, 31, 0.92); border: 1px solid rgba(157, 245, 208, 0.22); border-radius: 14px;
  padding: 10px 13px 11px; width: max-content; max-width: 240px;
  font: 400 0.92rem/1.4 var(--serif); color: var(--on-field-soft);
  opacity: 0; transition: opacity 0.2s ease;
}
.tooltip.show { opacity: 1; }
.tooltip strong { display: block; font: 700 1rem/1.2 var(--display); color: var(--on-field); margin-bottom: 3px; }

.organelles { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 18px auto 0; max-width: 560px; }
.organelles button {
  font: 600 0.88rem/1 var(--display); color: var(--on-field-soft); cursor: pointer;
  background: rgba(230, 244, 241, 0.06); border: 1px solid rgba(157, 245, 208, 0.14); border-radius: 999px; padding: 9px 13px;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.organelles button:hover, .organelles button[aria-pressed="true"] { background: rgba(61, 220, 151, 0.16); color: var(--on-field); }
.hero figcaption { text-align: center; margin-top: 14px; font-style: italic; color: var(--on-field-soft); }

@media (max-width: 880px) {
  .hero { padding-top: 96px; }
  .hero .wrap { grid-template-columns: 1fr; }
  .hero h1 { font-size: clamp(2.8rem, 13vw, 4rem); }
  .hero .lead { margin: 18px 0 22px; }
  .hero figure { margin-top: 28px; }
  .eyepiece { width: min(100%, 360px); }
}

/* ---------- Dive (scroll-driven zoom) ---------- */
.dive { position: relative; height: 520vh; }
.dive-stage { position: sticky; top: 0; height: 100svh; overflow: hidden; display: grid; place-items: center; }
.dive-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.dive-stage::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(90deg, rgba(7, 26, 31, 0.9) 0, rgba(7, 26, 31, 0.55) 30%, rgba(7, 26, 31, 0) 52%); }
@media (max-width: 900px) { .dive-stage::after { background: linear-gradient(0deg, rgba(7, 26, 31, 0.95) 0, rgba(7, 26, 31, 0.7) 32%, rgba(7, 26, 31, 0) 58%); } }
.dive-copy, .dive-progress { z-index: 2; }
.dive-copy { position: absolute; left: var(--gutter); bottom: clamp(28px, 8vh, 80px); width: min(30em, 100% - 2 * var(--gutter)); }
.readout { display: flex; align-items: baseline; gap: 16px; font-family: var(--display); }
.readout .mag { font-size: clamp(3rem, 2rem + 4vw, 5.8rem); font-weight: 900; letter-spacing: -0.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.readout .scale { display: inline-flex; flex-direction: column; gap: 6px; font: 600 0.95rem/1 var(--display); color: var(--on-field-soft); }
.readout .scale i { display: block; height: 3px; width: 84px; background: var(--on-field); border-radius: 2px; }
.dive-copy h3 { margin: 18px 0 8px; font-size: clamp(1.5rem, 1.2rem + 1vw, 2.1rem); }
.dive-copy p { color: var(--on-field-soft); font-size: var(--t-lead); line-height: 1.5; }
.dive-progress { position: absolute; right: var(--gutter); top: 50%; transform: translateY(-50%); display: grid; gap: 14px; list-style: none; margin: 0; padding: 0; font: 600 0.9rem/1 var(--display); color: var(--on-field-soft); }
.dive-progress li { display: flex; align-items: center; gap: 10px; justify-content: flex-end; opacity: 0.45; transition: opacity 0.3s ease, color 0.3s ease; }
.dive-progress li::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.dive-progress li.on { opacity: 1; color: var(--on-field); }
@media (max-width: 720px) { .dive-progress { display: none; } }

/* Reduced motion: the dive becomes a still sequence. */
.dive-static { display: none; }
@media (prefers-reduced-motion: reduce) {
  .dive { height: auto; }
  .dive-stage { display: none; }
  .dive-static { display: grid; gap: 40px; padding: 96px 0; }
  .dive-static figure { margin: 0; display: grid; grid-template-columns: 200px 1fr; gap: 28px; align-items: center; }
  .dive-static canvas { width: 200px; height: 200px; border-radius: 50%; }
}

/* ---------- Glass sections ---------- */
.glass { background: var(--glass); color: var(--ink); }
.section { padding: clamp(80px, 12vh, 140px) 0; }
.section-head { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 32px; align-items: end; margin-bottom: 56px; }
.section-head p { font-size: var(--t-lead); color: var(--ink-soft); margin: 0; }
@media (max-width: 820px) { .section-head { grid-template-columns: 1fr; margin-bottom: 36px; } }

/* App screens, scrolled sideways while the page scrolls down. */
.screens { position: relative; height: 340vh; }
.screens-sticky { position: sticky; top: 0; height: 100svh; display: flex; flex-direction: column; justify-content: center; overflow: hidden; padding-top: 68px; }
.screens-sticky .section-head { margin-bottom: clamp(20px, 4vh, 40px); }
.screens-sticky h2 { font-size: clamp(1.9rem, 1.2rem + 2vw, 2.9rem); }
.track { display: flex; gap: clamp(20px, 3vw, 44px); padding-left: max(var(--gutter), calc((100vw - var(--max)) / 2)); will-change: transform; }
.shot { flex: 0 0 auto; width: clamp(180px, min(21vw, calc((100svh - 420px) * 0.46)), 290px); margin: 0; }
.device {
  border-radius: 40px; padding: 9px; background: #0d1d21;
  box-shadow: 0 40px 80px -40px rgba(7, 26, 31, 0.55), 0 0 0 1px rgba(10, 35, 40, 0.12);
}
.device img { border-radius: 31px; aspect-ratio: 1206 / 2622; object-fit: cover; width: 100%; background: #000; }
.shot figcaption { margin-top: 18px; font-size: 1.02rem; line-height: 1.45; color: var(--ink-soft); max-width: 17em; }
.shot figcaption strong { display: block; font: 700 1.12rem/1.25 var(--display); color: var(--ink); margin-bottom: 4px; }
.track-end { flex: 0 0 auto; width: clamp(240px, 26vw, 360px); align-self: center; }
.track-end p { font-size: var(--t-lead); color: var(--ink-soft); }
@media (prefers-reduced-motion: reduce) {
  .screens { height: auto; }
  .screens-sticky { position: static; height: auto; padding: 96px 0; }
  .track { overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 24px; }
  .shot { scroll-snap-align: start; }
}
@media (max-width: 720px) {
  .screens { height: 300vh; }
  .shot { width: min(58vw, calc((100svh - 300px) * 0.46)); }
  .screens-sticky .section-head p { display: none; }
}

/* Three ways: an actual sequence in the app, so it is numbered. */
.ways { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(24px, 4vw, 56px); counter-reset: way; list-style: none; padding: 0; margin: 0; }
.ways li { counter-increment: way; border-top: 2px solid var(--ink); padding-top: 20px; }
.ways li::before { content: counter(way); display: block; font: 900 3.4rem/1 var(--display); color: var(--gfp-deep); margin-bottom: 14px; }
.ways p { color: var(--ink-soft); margin: 10px 0 0; }
@media (max-width: 820px) { .ways { grid-template-columns: 1fr; } }

/* Units as microscope slides: a glass strip with a frosted label at one end and a stained sample. */
.slides { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 18px; align-items: start; }
.slide {
  border-radius: 10px; overflow: hidden;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.5));
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset, 0 0 0 1px var(--glass-line), 0 18px 40px -30px rgba(7, 26, 31, 0.5);
}
.slide summary { list-style: none; display: grid; grid-template-columns: 38% 1fr; min-height: 128px; cursor: pointer; }
.slide summary::-webkit-details-marker { display: none; }
.slide .label { background: repeating-linear-gradient(135deg, #f9fbfa 0 6px, #f1f5f3 6px 12px); border-right: 1px solid var(--glass-line); padding: 16px 14px; display: flex; flex-direction: column; justify-content: space-between; gap: 12px; }
.slide .label b { font: 800 1.05rem/1.15 var(--display); }
.slide .label small { font: 600 0.82rem/1.3 var(--display); color: var(--ink-soft); }
.slide .sample { position: relative; display: grid; place-items: center; }
.slide .sample::before {
  content: ""; width: 84px; height: 84px; border-radius: 47% 53% 44% 56% / 52% 46% 54% 48%;
  background: radial-gradient(circle at 38% 36%, color-mix(in srgb, var(--stain) 55%, white), var(--stain) 55%, color-mix(in srgb, var(--stain) 70%, black));
  opacity: 0.85;
  box-shadow: 0 0 28px color-mix(in srgb, var(--stain) 45%, transparent);
  transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.slide[open] .sample::before, .slide summary:hover .sample::before { transform: scale(1.1) rotate(8deg); }
.slide .sample span { position: absolute; bottom: 10px; right: 12px; font: 600 0.82rem/1 var(--display); color: var(--ink-soft); }
.slide[open] .sample span { visibility: hidden; }
.slide .topics { padding: 14px 18px 18px; border-top: 1px solid var(--glass-line); background: rgba(255, 255, 255, 0.55); }
.slide .topics ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 18px; font-size: 0.96rem; line-height: 1.35; }
.slide .topics li { display: flex; gap: 8px; align-items: baseline; }
.slide .topics li::before { content: ""; flex: 0 0 7px; height: 7px; border-radius: 50%; transform: translateY(-1px); }
.slide .topics li[data-level="foundation"]::before { background: var(--gfp); }
.slide .topics li[data-level="core"]::before { background: var(--cyan); }
.slide .topics li[data-level="advanced"]::before { background: var(--dapi); }
.legend { display: flex; flex-wrap: wrap; gap: 20px; margin: 22px 0 0; font: 600 0.95rem/1.3 var(--display); color: var(--ink-soft); }
.legend span::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 8px; background: var(--c); }

/* Pricing */
.plans { display: grid; grid-template-columns: 1.15fr 1fr 1fr; gap: 18px; align-items: stretch; }
.plan { border-radius: 22px; padding: 28px 26px; background: rgba(255, 255, 255, 0.6); box-shadow: 0 0 0 1px var(--glass-line); }
.plan.free { background: var(--field); color: var(--on-field); box-shadow: none; }
.plan.free p { color: var(--on-field-soft); }
.plan h3 { font-size: 1.25rem; }
.price { font: 900 2.6rem/1 var(--display); letter-spacing: -0.03em; margin: 16px 0 6px; }
.price small { font-size: 1rem; font-weight: 600; letter-spacing: 0; color: var(--ink-soft); }
.plan p { color: var(--ink-soft); margin: 0; }
.plan-list { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 14px; }
.plan-list li { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; border-top: 1px solid var(--glass-line); padding-top: 14px; }
.plan-list b { font: 800 1.12rem/1.2 var(--display); }
.plan-list span { font: 700 1.12rem/1.2 var(--display); white-space: nowrap; }
.plan-list em { display: block; font-size: 0.92rem; color: var(--ink-soft); }
.fine { font-size: 0.92rem; color: var(--ink-soft); margin-top: 28px; max-width: 60em; }
@media (max-width: 900px) { .plans { grid-template-columns: 1fr; } }

/* Closing */
.closing { text-align: center; padding: clamp(100px, 16vh, 170px) 0; }
.closing img { width: 96px; height: 96px; border-radius: 22px; margin: 0 auto 28px; box-shadow: 0 0 60px rgba(61, 220, 151, 0.35); }
.closing h2 { max-width: 14em; margin: 0 auto 18px; }
.closing p { margin: 0 auto 30px; color: var(--on-field-soft); font-size: var(--t-lead); }

/* Footer */
.site-footer { background: var(--field); color: var(--on-field-soft); padding: 44px 0 56px; font-size: 0.95rem; border-top: 1px solid rgba(157, 245, 208, 0.1); }
.site-footer .wrap { display: grid; grid-template-columns: 1fr auto; gap: 18px 40px; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 22px; font-family: var(--display); font-weight: 600; }
.site-footer nav a { text-decoration: none; }
.site-footer nav a:hover { color: var(--on-field); }
.site-footer .legal { grid-column: 1 / -1; font-size: 0.82rem; opacity: 0.8; margin: 0; max-width: none; }
@media (max-width: 720px) { .site-footer .wrap { grid-template-columns: 1fr; } }

/* ---------- Document pages (privacy, support) ---------- */
.doc-hero { padding: 140px 0 56px; }
.doc-hero .wrap { max-width: 720px; }
.doc-hero h1 { font-size: clamp(2.6rem, 1.8rem + 3vw, 4.4rem); }
.doc-hero p { color: var(--on-field-soft); font-size: var(--t-lead); margin-top: 18px; }
.doc { padding: 64px 0 110px; }
.doc .wrap { max-width: 720px; }
.doc h2 { font-size: 1.6rem; margin: 48px 0 12px; }
.doc p, .doc li { font-size: 1.12rem; line-height: 1.7; }
.doc ul { padding-left: 1.1em; }
.doc .summary { background: rgba(255, 255, 255, 0.6); border-radius: 18px; padding: 8px 26px 12px; box-shadow: 0 0 0 1px var(--glass-line); }
.doc details { border-top: 1px solid var(--glass-line); padding: 18px 0; }
.doc details:last-of-type { border-bottom: 1px solid var(--glass-line); }
.doc summary { font: 700 1.18rem/1.3 var(--display); cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.doc summary::-webkit-details-marker { display: none; }
.doc summary::after { content: "+"; font-weight: 400; transition: transform 0.25s ease; }
.doc details[open] summary::after { transform: rotate(45deg); }
.doc details p { margin: 12px 0 0; color: var(--ink-soft); }
