:root {
  --bg: #EDF1EF;
  --ink: #14211F;
  --dim: #5E6B68;
  --rule: rgba(20, 33, 31, 0.16);
  --accent: #FF5A1F;
  --scrim: 237, 241, 239;
  --gutter: clamp(16px, 5vw, 64px);
  --serif: 'Instrument Serif', Georgia, 'Times New Roman', serif;
  --mono: 'IBM Plex Mono', ui-monospace, Menlo, Consolas, monospace;
}

:root[data-theme="night"] {
  --bg: #071214;
  --ink: #DCEBEA;
  --dim: #87A09F;
  --rule: rgba(220, 235, 234, 0.16);
  --accent: #FF7A45;
  --scrim: 7, 18, 20;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.45;
  transition: background-color 1.2s, color 1.2s;
}

a { color: inherit; text-decoration: none; }

.label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
  margin: 0;
}

/* the sea */

.sea { position: fixed; inset: 0; z-index: 0; }

.sea canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  transition: opacity 1.2s;
}

.sea [data-sea="night"] { opacity: 0; }
:root[data-theme="night"] .sea [data-sea="day"]   { opacity: 0; }
:root[data-theme="night"] .sea [data-sea="night"] { opacity: 1; }

/* calm the water behind the text */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(var(--scrim), 0.82) 0, rgba(var(--scrim), 0.55) min(560px, 55vw), rgba(var(--scrim), 0) min(860px, 85vw));
}

/* header */

.bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 3;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px var(--gutter);
}

.mark {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.logo { width: 44px; height: auto; transition: filter 1.2s; }
:root[data-theme="night"] .logo { filter: invert(1); }

.bar-right { display: flex; align-items: center; gap: 20px; }

nav { display: flex; gap: 20px; flex-wrap: wrap; justify-content: flex-end; }

nav a {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--dim);
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
}

nav a:hover { color: var(--ink); }
nav a.active { color: var(--ink); border-bottom-color: var(--accent); }

.mode-toggle {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--rule);
  border-radius: 50%;
  background: rgba(var(--scrim), 0.6);
  color: var(--ink);
  cursor: pointer;
}

.mode-toggle:hover, .mode-toggle:focus-visible { border-color: var(--ink); outline: none; }
.mode-toggle .icon-sun { display: none; }
:root[data-theme="night"] .mode-toggle .icon-sun  { display: block; }
:root[data-theme="night"] .mode-toggle .icon-moon { display: none; }

/* views */

main { position: relative; z-index: 1; pointer-events: none; }

.view {
  min-height: 100vh;
  padding: 120px var(--gutter) 96px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 22px;
  max-width: 720px;
}

.view a { pointer-events: auto; }
.view[hidden] { display: none; }

/* one long page: the nav scrolls to each view, and each view's
   content rises into place as the camera reaches its depth */
html.scroll-layout { scroll-behavior: smooth; }
/* text scrolls up under the header, so fade it out there */
.scroll-layout .bar::before {
  content: '';
  position: absolute;
  inset: 0 0 -28px;
  z-index: -1;
  background: linear-gradient(rgba(var(--scrim), 0.94) 55%, rgba(var(--scrim), 0));
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
}
.scroll-layout.scrolled .bar::before { opacity: 1; }
.scroll-layout .view { scroll-margin-top: 0; }
.scroll-layout .view > * { transition: opacity 0.9s ease, transform 0.9s ease; }
.scroll-layout .view:not(.in-view) > * { opacity: 0; transform: translateY(18px); }
.scroll-layout .view.in-view > :nth-child(2) { transition-delay: 0.08s; }
.scroll-layout .view.in-view > :nth-child(3) { transition-delay: 0.16s; }
.scroll-layout .view.in-view > :nth-child(4) { transition-delay: 0.24s; }

/* a quiet cue on the landing that there is more below */
.scroll-cue {
  position: fixed;
  left: var(--gutter);
  bottom: 18px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: opacity 0.6s;
}
.scroll-cue::before {
  content: '';
  width: 1px;
  height: 28px;
  background: currentColor;
  opacity: 0.5;
  animation: cue 2.4s ease-in-out infinite;
  transform-origin: top;
}
@keyframes cue { 0%, 100% { transform: scaleY(0.3); } 50% { transform: scaleY(1); } }
html:not([data-page="home"]) .scroll-cue { opacity: 0; }

h1 {
  font-weight: 400;
  font-size: clamp(44px, 7.5vw, 104px);
  line-height: 0.98;
  letter-spacing: -0.01em;
  margin: 0;
}

.intro { font-size: clamp(20px, 2vw, 24px); max-width: 30ch; margin: 0; }

.manifesto, .team { justify-content: flex-start; }

.manifesto ol, .team ul { list-style: none; margin: 0; padding: 0; }

.statement {
  display: grid;
  grid-template-columns: 2.4em 1fr;
  gap: 12px;
  padding: 14px 0;
  border-top: 1px solid var(--rule);
  font-size: clamp(20px, 2.1vw, 26px);
  line-height: 1.25;
}

.statement-index { font-family: var(--mono); font-size: 11px; color: var(--accent); padding-top: 0.6em; }

.epigraph { margin: 24px 0 0; padding: 0 0 0 calc(2.4em + 12px); }
.epigraph p { margin: 0; }
.epigraph-latin { font-style: italic; font-size: 22px; }
.epigraph-english { color: var(--dim); }
.epigraph-source { font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--dim); margin-top: 8px !important; }

.member {
  display: grid;
  grid-template-columns: 11em 1fr;
  column-gap: 16px;
  padding: 16px 0;
  border-top: 1px solid var(--rule);
}

.member-role { grid-row: span 2; font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); padding-top: 0.5em; }
.member-name { font-size: 28px; line-height: 1.1; }
.member-bio { color: var(--dim); }

.contact { display: flex; flex-direction: column; gap: 4px; margin: 0; }
.contact a { font-size: clamp(28px, 4vw, 48px); font-style: italic; border-bottom: 1px solid var(--accent); align-self: flex-start; }

/* live conditions */

.conditions {
  position: fixed;
  right: var(--gutter);
  bottom: 16px;
  z-index: 3;
}

.chip {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--ink);
  background: rgba(var(--scrim), 0.72);
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 7px 14px;
  cursor: pointer;
}

.chip:hover, .chip:focus-visible { border-color: var(--ink); outline: none; }

.panel {
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  width: min(280px, calc(100vw - 32px));
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 14px;
  padding: 14px 16px;
  font-family: var(--mono);
  font-size: 12px;
  background: rgba(var(--scrim), 0.94);
  border: 1px solid var(--rule);
  border-radius: 6px;
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
}

.panel .k { color: var(--dim); }
.panel .src { grid-column: 1 / -1; color: var(--dim); }
.panel .note { margin-top: 6px; font-size: 10px; }

.conditions:hover .panel,
.conditions:focus-within .panel,
.conditions.open .panel { opacity: 1; transform: none; pointer-events: auto; }

@media (max-width: 600px) {
  .bar { align-items: flex-start; }
  .bar-right { flex-direction: column-reverse; align-items: flex-end; gap: 10px; }
  nav { gap: 12px; }
  .member { grid-template-columns: 1fr; }
  .member-role { grid-row: auto; }
  body::after { background: rgba(var(--scrim), 0.55); }
}

@media (prefers-reduced-motion: reduce) {
  html, body, .sea canvas, .logo, .panel { transition: none; }
  html.scroll-layout { scroll-behavior: auto; }
  .scroll-layout .view > * { transition: none; }
  .scroll-layout .view:not(.in-view) > * { opacity: 1; transform: none; }
  .scroll-cue::before { animation: none; }
}
