@import url("https://fonts.googleapis.com/css2?family=Sora:wght@300;400;500&family=Unbounded:wght@400;500&display=swap");

:root {
  color-scheme: dark;
  --aegean: #03192f;
  --marble: #f7f9fa;
  --focus: #8deaff;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  background: var(--aegean);
}

body {
  min-height: 100svh;
  margin: 0;
  overflow-x: clip;
  color: var(--marble);
  font-family: "Sora", sans-serif;
  font-size: clamp(0.96rem, 1.2vw, 1.06rem);
  font-weight: 300;
  line-height: 1.75;
}

.research-index {
  overflow: hidden;
}

.research-index::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(247, 249, 250, 0.018) 1px, transparent 1px);
  background-size: 100% 4px;
  opacity: 0.16;
}

::selection {
  background: var(--focus);
  color: #01111f;
}

.research-return {
  position: fixed;
  top: clamp(22px, 4vw, 44px);
  left: clamp(22px, 4vw, 52px);
  z-index: 2;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--marble);
  font-family: "Unbounded", sans-serif;
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0;
  text-decoration: none;
  text-transform: uppercase;
  -webkit-tap-highlight-color: transparent;
}

.research-return svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: square;
  stroke-linejoin: miter;
  stroke-width: 1.4;
}

.research-return span {
  border-bottom: 1px solid transparent;
  padding: 5px 0;
}

.research-return:hover span,
.research-return:focus-visible span {
  border-bottom-color: currentColor;
}

.research-return:focus-visible {
  outline: 2px solid var(--marble);
  outline-offset: 6px;
}

.research-stage {
  position: relative;
  min-height: 100svh;
  display: grid;
  place-items: center;
  isolation: isolate;
  overflow: clip;
  background: var(--aegean);
  padding: clamp(90px, 12svh, 124px) clamp(20px, 5vw, 72px) clamp(288px, 36svh, 378px);
}

.research-gateways {
  position: relative;
  z-index: 2;
  width: min(1040px, 88vw);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: center;
  gap: clamp(14px, 2.2vw, 30px);
}

.research-gateway {
  position: relative;
  min-height: clamp(118px, 17svh, 154px);
  display: grid;
  place-items: center;
  padding: 22px 18px;
  border: 1px solid rgba(247, 249, 250, 0.78);
  color: var(--marble);
  font-family: "Unbounded", sans-serif;
  font-size: clamp(0.7rem, 1vw, 0.9rem);
  font-weight: 500;
  line-height: 1.5;
  text-align: center;
  text-decoration: none;
  text-wrap: balance;
  text-transform: uppercase;
  transition: background-color 180ms ease-out, color 180ms ease-out;
  -webkit-tap-highlight-color: transparent;
}

.research-gateway:focus-visible {
  outline: 2px solid var(--marble);
  outline-offset: 6px;
}

.research-gateway--model {
  min-height: clamp(188px, 24svh, 236px);
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 7px;
  padding: 0 4px 12px;
  border: 0;
  background: transparent;
  color: var(--marble);
  overflow: visible;
}

.gateway-model-viewport {
  position: relative;
  width: 100%;
  height: clamp(150px, 20svh, 196px);
  display: block;
  overflow: visible;
}

.gateway-model-canvas {
  position: absolute;
  top: -30%;
  left: -30%;
  width: 160%;
  height: 160%;
  display: block;
  outline: 0;
  pointer-events: none;
}

.research-gateway--ocean .gateway-model-canvas {
  top: -45%;
  left: -45%;
  width: 190%;
  height: 190%;
}

.particle-reveal {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: var(--aegean);
  pointer-events: none;
  opacity: 0;
  transition: opacity 560ms cubic-bezier(0.16, 1, 0.3, 1);
}

.particle-reveal::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 46%, transparent 32%, rgba(3, 25, 47, 0.18) 100%);
}

.particle-reveal.is-active {
  opacity: 1;
}

.particle-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  filter: brightness(1.2) saturate(1.08);
  mix-blend-mode: screen;
  pointer-events: none;
}

.morpheus-video {
  position: absolute;
  left: 50%;
  bottom: 0;
  z-index: 1;
  width: 100%;
  height: auto;
  display: block;
  mix-blend-mode: screen;
  pointer-events: none;
  transform: translateX(-50%);
}

.research-gateway-label {
  position: relative;
  padding-bottom: 5px;
  line-height: 1.2;
}

.research-gateway-label::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 280ms cubic-bezier(0.16, 1, 0.3, 1);
}

.research-gateway--model:hover .research-gateway-label::after,
.research-gateway--model:focus-visible .research-gateway-label::after {
  transform: scaleX(1);
}

.model-status {
  position: absolute;
  left: 50%;
  color: rgba(247, 249, 250, 0.68);
  font-family: "Unbounded", sans-serif;
  font-size: 0.54rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  line-height: 1.4;
  text-transform: uppercase;
  transform: translateX(-50%);
  transition: opacity 240ms ease-out;
}

.cloud-status {
  bottom: 18%;
  white-space: nowrap;
}

.lorenz-status {
  bottom: 15%;
  white-space: nowrap;
}

.ocean-status {
  bottom: 15%;
  white-space: nowrap;
}

.particle-status {
  top: 50%;
  bottom: auto;
  opacity: 0;
  white-space: nowrap;
  transform: translate(-50%, -50%);
}

.morpheus-status {
  bottom: 8%;
  opacity: 0;
}

.is-cloud-ready .cloud-status,
.is-lorenz-ready .lorenz-status,
.is-ocean-ready .ocean-status,
.is-particle-ready .particle-status,
.is-morpheus-ready .morpheus-status {
  opacity: 0;
}

.particle-reveal.is-active:not(.is-particle-ready) .particle-status,
.particle-reveal.is-active.has-model-error .particle-status,
.morpheus-reveal.is-active:not(.is-morpheus-ready) .morpheus-status,
.morpheus-reveal.is-active.has-model-error .morpheus-status,
.cyber-reveal.is-active:not(.is-cyber-ready) .cyber-status,
.cyber-reveal.is-active.has-model-error .cyber-status {
  opacity: 1;
}

.morpheus-reveal {
  position: absolute;
  z-index: 1;
  left: 50%;
  bottom: clamp(2px, 1.4svh, 18px);
  width: min(1180px, 106vw);
  height: min(86svh, 720px);
  background: var(--aegean);
  pointer-events: none;
  opacity: 0;
  transform: translateX(-50%) scale(0.91);
  transform-origin: center bottom;
  transition:
    opacity 520ms cubic-bezier(0.16, 1, 0.3, 1),
    transform 700ms cubic-bezier(0.16, 1, 0.3, 1);
}

.morpheus-reveal.is-active {
  opacity: 1;
  transform: translateX(-50%) scale(1);
  will-change: opacity, transform;
}

.cyber-reveal {
  position: absolute;
  z-index: 1;
  left: 50%;
  bottom: 0;
  width: 100vw;
  height: min(47svh, 470px);
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  transform: translateX(-50%) scale(0.985);
  transform-origin: center bottom;
  transition:
    opacity 480ms cubic-bezier(0.16, 1, 0.3, 1),
    transform 660ms cubic-bezier(0.16, 1, 0.3, 1);
}

.cyber-reveal.is-active {
  opacity: 1;
  transform: translateX(-50%) scale(1);
  will-change: opacity, transform;
}

.cyber-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  filter: brightness(1.22) saturate(1.28);
  outline: 0;
  pointer-events: none;
}

.cyber-status {
  top: 50%;
  bottom: auto;
  opacity: 0;
  white-space: nowrap;
  transform: translate(-50%, -50%);
}

.is-cyber-ready .cyber-status {
  opacity: 0;
}

.research-model-credits {
  position: fixed;
  z-index: 3;
  top: clamp(24px, 3.4vw, 38px);
  right: clamp(18px, 2.6vw, 34px);
  bottom: auto;
  max-width: min(470px, calc(100vw - 36px));
  margin: 0;
  display: flex;
  justify-content: flex-end;
  gap: 5px 14px;
  flex-wrap: wrap;
  color: rgba(247, 249, 250, 0.55);
  font-family: "Sora", sans-serif;
  font-size: 0.61rem;
  line-height: 1.45;
  text-align: right;
}

.research-model-credits a {
  color: inherit;
  text-decoration-color: rgba(247, 249, 250, 0.35);
  text-underline-offset: 0.2em;
}

.research-model-credits a:hover,
.research-model-credits a:focus-visible {
  color: var(--marble);
  text-decoration-color: currentColor;
}

.research-model-credits a:focus-visible {
  outline: 1px solid var(--marble);
  outline-offset: 3px;
}

.research-reader {
  min-height: 100svh;
  padding: clamp(126px, 15svh, 164px) 20px clamp(80px, 10svh, 116px);
}

.research-article {
  width: min(74ch, 100%);
  margin: 0 auto;
}

.research-title {
  margin-bottom: clamp(58px, 8vw, 92px);
}

.research-title h1 {
  max-width: 18ch;
  margin: 0;
  color: var(--marble);
  font-family: "Unbounded", sans-serif;
  font-size: clamp(2.15rem, 6.4vw, 5rem);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.08;
  text-wrap: balance;
}

.research-article h2,
.research-article h3 {
  color: var(--marble);
  font-family: "Unbounded", sans-serif;
  font-weight: 400;
  text-wrap: balance;
}

.research-article h2 {
  margin: clamp(66px, 9vw, 104px) 0 20px;
  font-size: clamp(1.35rem, 3vw, 2.15rem);
  letter-spacing: -0.025em;
  line-height: 1.28;
}

.research-article h3 {
  margin: clamp(52px, 7vw, 82px) 0 18px;
  font-size: clamp(1.05rem, 2.1vw, 1.42rem);
  letter-spacing: -0.015em;
  line-height: 1.4;
}

.research-article p,
.research-article li {
  color: var(--marble);
}

.research-article p {
  margin: 0 0 1.45em;
}

.research-article ol,
.research-article ul {
  margin: 0 0 1.8em;
  padding-left: 1.35em;
}

.research-article li + li {
  margin-top: 0.55em;
}

.research-article a,
.research-footer a {
  color: inherit;
  text-decoration-color: rgba(247, 249, 250, 0.48);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
}

.research-article a:hover,
.research-article a:focus-visible,
.research-footer a:hover,
.research-footer a:focus-visible {
  text-decoration-color: currentColor;
}

.research-article a:focus-visible,
.research-footer a:focus-visible {
  outline: 2px solid var(--marble);
  outline-offset: 4px;
}

.seamless-figure {
  width: min(980px, calc(100vw - 40px));
  margin: clamp(50px, 7vw, 82px) 0 clamp(52px, 7vw, 86px) 50%;
  transform: translateX(-50%);
}

.seamless-figure img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
}

.equation-block {
  max-width: 100%;
  margin: 32px 0;
  overflow-x: auto;
  padding: 10px 0 16px;
  color: var(--marble);
  scrollbar-color: rgba(247, 249, 250, 0.4) transparent;
}

.page-link-grid,
.notion-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 28px 0 clamp(52px, 7vw, 78px);
}

.page-link-grid .page-link,
.notion-columns .page-link {
  min-height: 72px;
  display: grid;
  place-items: center;
  padding: 16px;
  border: 1px solid rgba(247, 249, 250, 0.72);
  color: var(--marble);
  font-family: "Unbounded", sans-serif;
  font-size: clamp(0.7rem, 1.4vw, 0.82rem);
  font-weight: 500;
  line-height: 1.4;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
}

.page-link-grid .page-link:hover,
.page-link-grid .page-link:focus-visible,
.notion-columns .page-link:hover,
.notion-columns .page-link:focus-visible {
  background: var(--marble);
  color: var(--aegean);
}

.research-divider {
  height: 1px;
  margin: clamp(56px, 8vw, 92px) 0 0;
  border: 0;
  background: rgba(247, 249, 250, 0.34);
}

:is(.lorenz-transition-plots, .lorenz-intermittency-plots, .lorenz-stenflo-plots) {
  width: min(980px, calc(100vw - 40px));
  margin: clamp(50px, 7vw, 82px) 0 clamp(52px, 7vw, 86px) 50%;
  transform: translateX(-50%);
  gap: clamp(12px, 1.8vw, 22px);
}

.lorenz-transition-plots {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

:is(.lorenz-intermittency-plots, .lorenz-stenflo-plots) {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

:is(.lorenz-transition-plots, .lorenz-intermittency-plots, .lorenz-stenflo-plots) > div,
:is(.lorenz-transition-plots, .lorenz-intermittency-plots, .lorenz-stenflo-plots) .seamless-figure {
  min-width: 0;
}

:is(.lorenz-transition-plots, .lorenz-intermittency-plots, .lorenz-stenflo-plots) .seamless-figure {
  width: 100%;
  margin: 0;
  transform: none;
}

:is(.research-document--lorenz-63, .research-document--lorenz-stenflo) .seamless-figure img {
  filter: invert(1) hue-rotate(180deg) brightness(1.06) contrast(1.04);
}

.research-footer {
  width: min(920px, calc(100% - 40px));
  min-height: 84px;
  margin: 0 auto;
  padding: 20px 0;
  border-top: 1px solid rgba(247, 249, 250, 0.28);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  color: rgba(247, 249, 250, 0.7);
  font-family: "Unbounded", sans-serif;
  font-size: 0.65rem;
  font-weight: 500;
  line-height: 1.4;
  text-transform: uppercase;
}

* {
  scrollbar-width: thin;
  scrollbar-color: rgba(247, 249, 250, 0.36) var(--aegean);
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--aegean);
}

::-webkit-scrollbar-thumb {
  border: 3px solid var(--aegean);
  background: rgba(247, 249, 250, 0.36);
}

@media (max-width: 700px) {
  .research-stage {
    place-items: start center;
    padding-top: clamp(102px, 14svh, 126px);
    padding-bottom: clamp(220px, 31svh, 300px);
  }

  .research-gateways {
    width: min(330px, 100%);
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .research-gateway--model {
    min-height: 156px;
    gap: 2px;
  }

  .gateway-model-viewport {
    height: 126px;
  }

  .ocean-canvas {
    transform: scale(0.76);
    transform-origin: center;
  }

  .morpheus-reveal {
    bottom: 10px;
    width: 152vw;
    height: min(43svh, 400px);
  }

  .cyber-reveal {
    height: min(29svh, 250px);
  }

  .research-model-credits {
    top: 76px;
    right: 16px;
    bottom: auto;
    left: 16px;
    justify-content: center;
    font-size: 0.56rem;
    text-align: center;
  }

  .research-document .research-return {
    position: absolute;
  }

  .research-reader {
    padding-right: 18px;
    padding-left: 18px;
  }

  .research-title {
    margin-bottom: 50px;
  }

  .research-article h2 {
    margin-top: 58px;
  }

  .seamless-figure {
    width: 100%;
  }

  .page-link-grid,
  .notion-columns {
    grid-template-columns: 1fr;
  }

  :is(.lorenz-transition-plots, .lorenz-intermittency-plots, .lorenz-stenflo-plots) {
    width: 100%;
    margin-right: 0;
    margin-left: 0;
    transform: none;
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .research-footer {
    min-height: 104px;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .research-gateway,
  .research-gateway-label::after,
  .particle-reveal,
  .morpheus-reveal,
  .cyber-reveal {
    transition-duration: 1ms;
  }

  .morpheus-reveal {
    transform: translateX(-50%) scale(1);
  }

  .cyber-reveal {
    transform: translateX(-50%) scale(1);
  }

}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
