:root {
  --black: #000;
  --ice: #5ec8f2;          /* Freljord blue */
  --ice-pale: #c6ecff;
  --glacier: #164b6e;
  --deep: #07141c;
  --text: #e9f3f8;
  --muted: #8aa1ae;
  --line: #12212b;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, sans-serif;
  --shard: polygon(0 0, calc(100% - 22px) 0, 100% 22px, 100% 100%, 22px 100%, 0 calc(100% - 22px));
}

* { box-sizing: border-box; }

html { background: var(--black); }
body {
  margin: 0;
  color: var(--text);
  font: 18px/1.7 var(--sans);
  overflow-x: hidden;
}

a { color: var(--ice); text-underline-offset: 3px; }
a:hover { color: var(--ice-pale); }
:focus-visible { outline: 2px solid var(--ice); outline-offset: 4px; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; z-index: 10; background: var(--deep); padding: 8px 12px; }


main, footer, nav { max-width: 1240px; margin: 0 auto; padding: 0 32px; }

/* sticky top bar */
header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(0, 0, 0, .72);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
nav { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 28px; padding-top: 18px; padding-bottom: 18px; font-size: 15px; }
nav .brand { color: var(--text); font-weight: 700; margin-right: auto; }
nav a { position: relative; color: var(--muted); text-decoration: none; padding: 4px 0; }
nav a:hover, nav a[aria-current] { color: var(--ice); }
nav a[aria-current]::after { content: ""; position: absolute; left: 0; right: 0; bottom: -19px; height: 2px; background: var(--ice); box-shadow: 0 0 12px var(--ice); }
section[id] { scroll-margin-top: 64px; }

/* ambient frost on the wide-screen margins: aurora glow + two layers of drifting snow, masked away from the text column */
body::before, body::after {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  -webkit-mask-image: linear-gradient(90deg, #000 0, #000 8%, transparent 30%, transparent 70%, #000 92%, #000 100%);
          mask-image: linear-gradient(90deg, #000 0, #000 8%, transparent 30%, transparent 70%, #000 92%, #000 100%);
}
body::before {
  background:
    radial-gradient(40% 60% at 0% 30%, rgba(22, 75, 110, .45), transparent 70%),
    radial-gradient(35% 55% at 100% 75%, rgba(94, 200, 242, .16), transparent 70%),
    radial-gradient(1.5px 1.5px at 30px 40px, var(--ice-pale), transparent),
    radial-gradient(1px 1px at 140px 90px, var(--ice), transparent),
    radial-gradient(2px 2px at 210px 200px, var(--ice-pale), transparent),
    radial-gradient(1px 1px at 80px 230px, var(--ice-pale), transparent);
  background-size: 100% 100%, 100% 100%, 260px 260px, 260px 260px, 260px 260px, 260px 260px;
  animation: snow 26s linear infinite;
}
body::after {
  opacity: .5;
  background:
    radial-gradient(1px 1px at 60px 20px, var(--ice-pale), transparent),
    radial-gradient(1px 1px at 170px 140px, var(--ice), transparent),
    radial-gradient(1.5px 1.5px at 20px 160px, var(--ice-pale), transparent);
  background-size: 190px 190px;
  animation: snow2 40s linear infinite;
}
@keyframes snow { to { background-position: 0 0, 0 0, 40px 260px, 40px 260px, 40px 260px, 40px 260px; } }
@keyframes snow2 { to { background-position: -30px 190px; } }

/* hero */
.hero { min-height: min(88vh, 860px); display: grid; grid-template-columns: 1.15fr .85fr; align-items: center; gap: 40px; }
.hero h1 {
  font-size: clamp(3rem, 8.5vw, 6.6rem);
  font-weight: 800;
  font-stretch: condensed;
  line-height: .95;
  letter-spacing: -.035em;
  margin: 0 0 28px;
  background: linear-gradient(100deg, var(--text) 30%, var(--ice-pale) 50%, var(--text) 70%);
  background-size: 250% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: frost 7s ease-in-out infinite;
}
@keyframes frost { 0%, 100% { background-position: 100% 0; } 50% { background-position: 0 0; } }
.hero p { color: var(--muted); max-width: 34em; font-size: 1.15rem; margin: 0 0 12px; }
.hero .name { color: var(--ice); font-size: 1.1rem; font-weight: 600; margin-bottom: 18px; }

/* chapters */
.chapter { padding: 120px 0 40px; }

/* ice-shard divider between main sections */
.chapter, .contact { position: relative; }
.chapter::before, .contact::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--glacier) 20%, var(--ice) 50%, var(--glacier) 80%, transparent);
}
.chapter::after, .contact::after {
  content: ""; position: absolute; top: -7px; left: calc(50% - 7px); width: 12px; height: 12px;
  background: #000; border: 1px solid var(--ice); transform: rotate(45deg);
  box-shadow: 0 0 14px rgba(94, 200, 242, .6);
}
.chapter > h2 {
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  font-weight: 800; font-stretch: condensed; letter-spacing: -.03em; line-height: 1;
  margin: 0 0 16px; max-width: 16em;
}
.chapter > .lede { color: var(--muted); max-width: 40em; font-size: 1.1rem; margin: 0 0 56px; }

.story { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; margin-bottom: 96px; }
.story.flip > .art { order: -1; }
.story h3 { font-size: 1.6rem; line-height: 1.2; margin: 0 0 6px; font-weight: 700; }
.story .when { color: var(--ice); font-size: .95rem; margin: 0 0 18px; }
.story p { color: var(--muted); margin: 0 0 14px; max-width: 36em; }
.story ul { color: var(--muted); padding-left: 20px; margin: 0 0 14px; }
.story li { margin-bottom: 6px; }
.story strong { color: var(--text); font-weight: 600; }

.art {
  clip-path: var(--shard);
  background: radial-gradient(120% 90% at 30% 20%, #0b2333 0%, var(--deep) 45%, #000 100%);
  border: 1px solid var(--glacier);
  aspect-ratio: 1 / 1;
  display: grid; place-items: center;
}
.art svg { width: 86%; height: auto; overflow: visible; }

.story .stack { display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 0; margin: 18px 0 0; list-style: none; font-size: .9rem; color: var(--ice-pale); }

/* cloud + transformation */
.pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; background: var(--glacier); clip-path: var(--shard); }
.pillars > div { background: #000; padding: 32px 28px; }
.pillars h3 { margin: 0 0 10px; font-size: 1.25rem; color: var(--ice-pale); }
.pillars p { margin: 0; color: var(--muted); font-size: 1rem; }

/* 42 path */
.path { list-style: none; padding: 0; margin: 0 0 64px; counter-reset: step; display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0 28px; }
.path li { position: relative; padding: 22px 0 22px 0; border-top: 2px solid var(--line); counter-increment: step; }
.path li.done { border-top-color: var(--glacier); }
.path li.now { border-top-color: var(--ice); }
.path li::before { content: counter(step); display: block; font-size: 2.4rem; font-weight: 800; color: var(--glacier); line-height: 1; margin-bottom: 8px; }
.path li.now::before { color: var(--ice); }
.path h3 { margin: 0 0 6px; font-size: 1.1rem; }
.path p { margin: 0; color: var(--muted); font-size: .98rem; }
.path .now-tag { color: var(--ice); font-size: .9rem; }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 32px; }
.facts h3 { margin: 0 0 8px; font-size: 1.1rem; color: var(--ice-pale); }
.facts p, .facts ul { margin: 0; color: var(--muted); padding-left: 0; list-style: none; }

.contact { padding: 140px 0 120px; }
.contact h2 { font-size: clamp(2.4rem, 6vw, 4.4rem); font-weight: 800; font-stretch: condensed; letter-spacing: -.03em; line-height: 1; margin: 0 0 20px; }
.contact p { color: var(--muted); font-size: 1.15rem; }
.contact .links { display: flex; flex-wrap: wrap; gap: 28px; font-size: 1.2rem; margin-top: 28px; }

footer { border-top: 1px solid var(--line); padding: 32px; font-size: 14px; color: var(--muted); display: flex; gap: 24px; flex-wrap: wrap; }
footer a { color: var(--muted); }

/* scroll progress along the bottom edge of the top bar (driven by reveal.js) */
.progress {
  position: absolute; left: 0; right: 0; bottom: -1px; height: 2px;
  background: linear-gradient(90deg, var(--glacier), var(--ice) 70%, var(--ice-pale));
  box-shadow: 0 0 10px rgba(94, 200, 242, .7);
  transform-origin: left; transform: scaleX(0);
  display: none;
}
.js .progress { display: block; }

/* tech stack: layered architecture diagram, narrowest on top, widest at the base */
.layers { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.layer {
  display: grid; grid-template-columns: 230px 1fr; gap: 12px 32px; align-items: start;
  padding: 22px 28px;
  background: linear-gradient(90deg, rgba(22, 75, 110, .35), rgba(0, 0, 0, .6) 70%);
  border: 1px solid var(--glacier); border-left: 4px solid var(--tone);
  clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 16px, 100% 100%, 0 100%);
}
.layer:nth-child(1) { --tone: var(--ice-pale); margin: 0 12%; }
.layer:nth-child(2) { --tone: #9adcf7; margin: 0 8%; }
.layer:nth-child(3) { --tone: var(--ice); margin: 0 4%; }
.layer:nth-child(4) { --tone: #2f8fc4; margin: 0; }
.layer:nth-child(5) { --tone: var(--muted); margin-top: 22px; background: transparent; border-style: dashed; border-left-style: solid; }
.layer h3 { margin: 0; font-size: 1.15rem; color: var(--tone); }
.layer ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px 32px; }
.layer li { color: var(--muted); font-size: .95rem; line-height: 1.5; }
.layer li strong { display: block; color: var(--text); font-size: 1.05rem; }
.js .layer.reveal { transform: translateX(-60px); }
.js .layer.reveal:nth-child(even) { transform: translateX(60px); }
.js .layer.reveal.in { transform: none; }
@media (max-width: 820px) {
  .layer { grid-template-columns: 1fr; padding: 18px 20px; }
  .layer:nth-child(n) { margin-left: 0; margin-right: 0; }
}

/* legal pages */
.legal { max-width: 760px; padding-bottom: 80px; }
.legal h1 { font-size: 2.6rem; font-weight: 800; font-stretch: condensed; margin: 48px 0 24px; }
.legal h2 { font-size: 1.15rem; color: var(--ice-pale); margin: 36px 0 8px; }
.legal p { color: var(--muted); }
.meta { color: var(--muted); font-size: .9rem; }
.todo { background: #3a2d0c; color: #ffd27a; padding: 0 4px; }

/* ---------- scroll reveal (class "js" set by reveal.js, so no-JS shows everything) ---------- */
.js .reveal { opacity: 0; transform: translateY(48px) scale(.97); transition: opacity .9s cubic-bezier(.2,.7,.2,1), transform .9s cubic-bezier(.2,.7,.2,1); }
.js .reveal.in { opacity: 1; transform: none; }
.js .art.reveal { transform: translateY(48px) rotate(-2deg) scale(.92); }
.js .art.reveal.in { transform: none; }
.js .path li.reveal:nth-child(2) { transition-delay: .08s; }
.js .path li.reveal:nth-child(3) { transition-delay: .16s; }
.js .path li.reveal:nth-child(4) { transition-delay: .24s; }
.js .path li.reveal:nth-child(5) { transition-delay: .32s; }

/* ---------- illustrations ---------- */
svg text { font: 600 11px var(--sans); fill: var(--ice-pale); }
svg .dim { fill: var(--muted); font-weight: 400; }

/* hero: cells becoming a network */
.cell { fill: rgba(94, 200, 242, .1); stroke: var(--ice); stroke-width: 1.5; transform-box: fill-box; transform-origin: center; animation: breathe 4s ease-in-out infinite; }
.nucleus { fill: var(--ice); transform-box: fill-box; transform-origin: center; animation: breathe 4s ease-in-out infinite reverse; }
.node { fill: var(--ice-pale); }
.link { stroke: var(--ice); stroke-width: 1.4; stroke-dasharray: 3 9; fill: none; animation: flow 1.6s linear infinite; opacity: .8; }
.link.slow { animation-duration: 2.6s; }
@keyframes breathe { 50% { transform: scale(1.08); } }
@keyframes flow { to { stroke-dashoffset: -24; } }

/* petri dish */
.dish { fill: none; stroke: var(--glacier); stroke-width: 3; }
.dish-rim { fill: none; stroke: var(--ice); stroke-width: 1; opacity: .5; }
.grow { fill: rgba(94, 200, 242, .18); stroke: var(--ice); stroke-width: 1.2; transform-box: fill-box; transform-origin: center; animation: grow 6s ease-in-out infinite; }
@keyframes grow { 0%, 10% { transform: scale(0); opacity: 0; } 35%, 80% { transform: scale(1); opacity: 1; } 100% { transform: scale(1.1); opacity: 0; } }

/* DNA helix */
.rung { transform-box: fill-box; transform-origin: center; animation: twist 3s ease-in-out infinite; }
.rung line { stroke: var(--glacier); stroke-width: 2; }
.rung .a { fill: var(--ice); }
.rung .b { fill: var(--ice-pale); }
@keyframes twist { 0%, 100% { transform: scaleX(1); } 50% { transform: scaleX(-1); } }
.bits { fill: var(--ice); font-size: 10px; opacity: .55; animation: drift 5s linear infinite; }
@keyframes drift { from { transform: translateY(0); opacity: 0; } 20% { opacity: .6; } to { transform: translateY(-60px); opacity: 0; } }

/* openstack */
.box { fill: #04111a; stroke: var(--glacier); stroke-width: 1.5; }
.box.key { stroke: var(--ice); }
.bus { stroke: var(--ice); stroke-width: 3; opacity: .7; }
.packet { stroke: var(--ice-pale); stroke-width: 2.4; stroke-dasharray: 6 26; fill: none; animation: flow 1.2s linear infinite; }
.auth { stroke: var(--ice); stroke-width: 1.2; stroke-dasharray: 2 5; fill: none; animation: flow 2.4s linear infinite reverse; }
.lock { fill: none; stroke: var(--ice-pale); stroke-width: 1.6; }

/* ray tracer */
.floor { stroke: var(--glacier); stroke-width: 2; fill: none; }
.floor.faint { stroke-width: 1; opacity: .5; }
.shadow { fill: #000; opacity: .85; }
.plane { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 4; }
.cam { fill: none; stroke: var(--ice-pale); stroke-width: 1.6; }
.sun { fill: var(--ice-pale); filter: drop-shadow(0 0 8px var(--ice)); animation: breathe 3s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.ray { fill: none; stroke: var(--ice); stroke-width: 1.6; stroke-dasharray: 200; stroke-dashoffset: 200; animation: trace 4s ease-out infinite; }
.sray { fill: none; stroke: var(--ice-pale); stroke-width: 1; stroke-dasharray: 3 6; opacity: 0; animation: sray 4s linear infinite; }
.px { fill: #04111a; stroke: var(--glacier); animation: pixel 4s steps(1) infinite; }
.floorpx { animation-name: pixel-dim; }
@keyframes trace { 0% { stroke-dashoffset: 200; opacity: 1; } 30%, 75% { stroke-dashoffset: 0; opacity: 1; } 100% { stroke-dashoffset: 0; opacity: 0; } }
@keyframes sray { 0%, 30% { opacity: 0; stroke-dashoffset: 0; } 40%, 75% { opacity: .9; } 100% { opacity: 0; stroke-dashoffset: -36; } }
@keyframes pixel { 0% { fill: #04111a; } 30% { fill: var(--ice); } 90% { fill: #04111a; } }
@keyframes pixel-dim { 0% { fill: #04111a; } 30% { fill: var(--glacier); } 90% { fill: #04111a; } }

/* data bars */
.bar { fill: var(--glacier); transform-box: fill-box; transform-origin: bottom; animation: rise 4s cubic-bezier(.2,.7,.2,1) infinite; }
.bar.hi { fill: var(--ice); }
.trend { fill: none; stroke: var(--ice-pale); stroke-width: 2; stroke-dasharray: 400; animation: draw 4s ease-in-out infinite; }
@keyframes rise { 0% { transform: scaleY(0); } 40%, 85% { transform: scaleY(1); } 100% { transform: scaleY(0); } }
@keyframes draw { 0%, 20% { stroke-dashoffset: 400; } 60%, 85% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: -400; } }

/* ---------- responsive + motion prefs ---------- */
@media (max-width: 820px) {
  main, footer, nav { padding-left: 20px; padding-right: 20px; }
  nav { gap: 4px 18px; font-size: 14px; padding-top: 12px; padding-bottom: 12px; }
  nav .brand { flex-basis: 100%; }
  nav a[aria-current]::after { bottom: -2px; }
  .hero, .story { grid-template-columns: 1fr; gap: 32px; }
  .story.flip > .art { order: 0; }
  .hero { min-height: auto; padding: 40px 0; }
  .hero .art { max-width: 360px; }
  .pillars { grid-template-columns: 1fr; }
  .chapter { padding-top: 80px; }
  .story { margin-bottom: 64px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; transform: none; }
  .hero h1 { color: var(--text); background: none; }
}
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

/* staggered delays for the illustrations (no inline styles: CSP blocks them) */
.d1 { animation-delay: .4s; } .d2 { animation-delay: .8s; } .d3 { animation-delay: 1.2s; } .d4 { animation-delay: 1.6s; }
.d5 { animation-delay: 2s; } .d6 { animation-delay: 2.4s; } .d7 { animation-delay: 2.8s; }
.helix > g:nth-child(2) .rung { animation-delay: -.25s; }  .helix > g:nth-child(3) .rung { animation-delay: -.5s; }
.helix > g:nth-child(4) .rung { animation-delay: -.75s; }  .helix > g:nth-child(5) .rung { animation-delay: -1s; }
.helix > g:nth-child(6) .rung { animation-delay: -1.25s; } .helix > g:nth-child(7) .rung { animation-delay: -1.5s; }
.helix > g:nth-child(8) .rung { animation-delay: -1.75s; } .helix > g:nth-child(9) .rung { animation-delay: -2s; }
.helix > g:nth-child(10) .rung { animation-delay: -2.25s; } .helix > g:nth-child(11) .rung { animation-delay: -2.5s; }
