/* Layout: a night harbour. A live aurora over a dark sea, the longship riding the swell and the app surfacing from the water; then a bento of what Jorvik does, a download bay, self-hosting and a footer with the runes. One dark world on purpose: it is Jorvik's own palette. */
:root {
  color-scheme: dark;
  --sky: #04070a;
  --ink: #0e0e10;
  --hull: #141418;
  --deck: #1a1b1e;
  --rope: #2b2d31;
  --foam: #e3e5e8;
  --fog: #949ba4;
  --mist: #c3c8cf;
  --pine: #1a7a35;
  --pine-bright: #22913f;
  --aurora: #43b581;
  --glow: #6bd48c;
  --idle: #faa61a;
  --dnd: #ed4245;
  --offline: #747f8d;
  --font-display: "Bricolage Grotesque", "Figtree", ui-sans-serif, system-ui, sans-serif;
  --font-body: "Figtree", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --font-rune: "Noto Sans Runic", "Segoe UI Historic", serif;
  --step--1: clamp(0.82rem, 0.8rem + 0.1vw, 0.88rem);
  --step-0: clamp(1rem, 0.97rem + 0.15vw, 1.075rem);
  --step-1: clamp(1.18rem, 1.1rem + 0.35vw, 1.38rem);
  --step-2: clamp(1.6rem, 1.3rem + 1.2vw, 2.4rem);
  --step-4: clamp(3rem, 1.9rem + 5vw, 6rem);
  --gutter: max(16px, 4vw);
  --radius: 16px;
  --nav: 64px;
  --sea: clamp(150px, 17vw, 230px);
  --ship: clamp(112px, 14vw, 196px);
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
img { max-width: 100%; }
[hidden] { display: none !important; }
html { background: var(--ink); scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  background: var(--ink);
  color: var(--foam);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: var(--glow); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: #8fe3aa; }
:focus-visible { outline: 2px solid var(--glow); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { font-family: var(--font-display); text-wrap: balance; margin: 0; }
p { margin: 0; }
.wrap { width: min(1240px, 100%); margin-inline: auto; padding-inline: var(--gutter); }

.skip {
  position: absolute; left: 12px; top: -48px; z-index: 50;
  background: var(--pine); color: #fff; padding: 8px 14px; border-radius: 8px; text-decoration: none;
}
.skip:focus { top: calc(env(safe-area-inset-top, 0px) + 12px); }

/* Navigation */
.nav {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  height: var(--nav);
  background: rgba(8, 10, 12, 0.58);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.nav-inner { height: 100%; display: flex; align-items: center; gap: 28px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--foam); text-decoration: none; font-family: var(--font-display); font-weight: 750; font-size: 1.2rem; letter-spacing: -0.01em; }
.brand img { width: 28px; height: 28px; border-radius: 7px; }
.brand:hover { color: #fff; }
.nav-links { display: flex; gap: 22px; margin-inline-start: auto; }
.nav-links a { color: var(--mist); text-decoration: none; font-size: 0.95rem; font-weight: 500; }
.nav-links a:hover { color: #fff; }
.nav .btn { margin-inline-start: 4px; }
.status-link { display: inline-flex; align-items: center; gap: 8px; }
.status-pip { width: 8px; height: 8px; border-radius: 50%; background: var(--offline); }
.status-pip.is-operational { background: var(--aurora); box-shadow: 0 0 0 3px rgba(67, 181, 129, 0.18); }
.status-pip.is-degraded { background: var(--idle); }
.status-pip.is-outage { background: var(--dnd); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border-radius: 12px;
  font: 600 1rem/1 var(--font-body); text-decoration: none; cursor: pointer;
  border: 1px solid transparent;
  transition: background-color 160ms ease, border-color 160ms ease, box-shadow 200ms ease, transform 160ms ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--pine); color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 10px 30px -12px rgba(67, 181, 129, 0.7);
}
.btn-primary:hover { background: var(--pine-bright); color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 14px 38px -12px rgba(67, 181, 129, 0.85); }
.btn-ghost { color: var(--foam); border-color: rgba(255, 255, 255, 0.16); background: rgba(255, 255, 255, 0.03); }
.btn-ghost:hover { color: #fff; border-color: rgba(107, 212, 140, 0.55); background: rgba(67, 181, 129, 0.08); }
.btn-small { min-height: 38px; padding: 0 16px; font-size: 0.92rem; border-radius: 10px; }

/* Hero: sky, sea and ship */
.hero { position: relative; margin-top: calc(var(--nav) * -1); }
.scene {
  position: relative; overflow: hidden;
  padding-top: calc(var(--nav) + clamp(48px, 8vw, 104px));
  background:
    radial-gradient(55% 45% at 74% 44%, rgba(67, 181, 129, 0.26), transparent 70%),
    radial-gradient(35% 30% at 86% 26%, rgba(98, 70, 170, 0.2), transparent 70%),
    linear-gradient(to bottom, var(--sky) 0%, #07100f calc(100% - var(--sea)), #0a1515 calc(100% - var(--sea)), var(--ink) 100%);
}
.aurora { position: absolute; inset: 0; width: 100%; height: 100%; display: block; opacity: 0; transition: opacity 1.4s ease; }
.aurora.is-live { opacity: 1; }
.hero-copy { position: relative; z-index: 2; padding-bottom: clamp(32px, 5vw, 56px); }
.hero-copy > * + * { margin-top: 22px; }
.status {
  display: inline-flex; flex-wrap: wrap; align-items: center; gap: 10px;
  font-size: var(--step--1); color: var(--mist); letter-spacing: 0.02em;
}
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--glow); border: 1px solid rgba(107, 212, 140, 0.45); background: rgba(67, 181, 129, 0.1);
}
.hero h1 {
  font-size: var(--step-4); font-weight: 760; line-height: 0.98; letter-spacing: -0.018em;
  font-variation-settings: "opsz" 96; max-width: 11ch; color: #f4f6f8;
  text-shadow: 0 2px 40px rgba(4, 7, 10, 0.6);
}
.crew {
  background: linear-gradient(100deg, var(--glow) 0%, #b6f5cc 22%, var(--aurora) 48%, #3fb8a8 72%, var(--glow) 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lede { max-width: 54ch; font-size: var(--step-1); line-height: 1.55; color: var(--mist); text-shadow: 0 1px 24px rgba(4, 7, 10, 0.7); }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; }
.fine { font-size: var(--step--1); color: var(--fog); }

.sea { position: relative; z-index: 1; height: var(--sea); }
.ship-drift { position: absolute; left: 67%; top: 0; width: calc(var(--ship) * 0.82); height: var(--ship); transform: translate(-50%, -93%); }
.ship-glow { width: 100%; height: 100%; filter: drop-shadow(0 0 1px rgba(107, 212, 140, 0.55)) drop-shadow(0 0 22px rgba(67, 181, 129, 0.28)); }
.ship {
  width: 100%; height: 100%; transform-origin: 50% 92%;
  background: linear-gradient(to bottom, #050709, #020304);
  -webkit-mask: url("/img/ship.png") center / contain no-repeat;
  mask: url("/img/ship.png") center / contain no-repeat;
}
.wake {
  position: absolute; left: 50%; bottom: -3px; width: 150%; height: 10px; transform: translateX(-50%);
  background: radial-gradient(50% 50% at 50% 50%, rgba(107, 212, 140, 0.32), transparent 70%);
  filter: blur(2px);
}

.window-slot { position: relative; z-index: 3; margin-top: calc(var(--sea) * -0.6); }
.window {
  margin: 0; border-radius: var(--radius); overflow: hidden; background: var(--ink);
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow: 0 50px 120px -40px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(0, 0, 0, 0.5), 0 0 90px -30px rgba(67, 181, 129, 0.45);
  transform: perspective(1600px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform 500ms cubic-bezier(0.2, 0.7, 0.2, 1);
}
.window img { display: block; width: 100%; height: auto; }

@media (prefers-reduced-motion: no-preference) {
  .hero-copy > * { animation: rise 900ms cubic-bezier(0.2, 0.7, 0.2, 1) both; }
  .hero-copy > :nth-child(2) { animation-delay: 90ms; }
  .hero-copy > :nth-child(3) { animation-delay: 180ms; }
  .hero-copy > :nth-child(4) { animation-delay: 260ms; }
  .hero-copy > :nth-child(5) { animation-delay: 320ms; }
  .window-slot { animation: surface 1300ms 200ms cubic-bezier(0.2, 0.7, 0.2, 1) both; }
  .ship { animation: bob 7s ease-in-out infinite; }
  .ship-drift { animation: drift 46s ease-in-out infinite alternate; }
  .crew { animation: shimmer 10s ease-in-out infinite alternate; }
}
@keyframes rise { from { transform: translateY(16px); filter: blur(5px); opacity: 0.35; } }
@keyframes surface { from { transform: translateY(70px); opacity: 0.4; } }
@keyframes bob {
  0%, 100% { transform: translateY(0) rotate(-1.4deg); }
  50% { transform: translateY(3px) rotate(1.6deg); }
}
@keyframes drift { to { left: 76%; } }
@keyframes shimmer { to { background-position: 100% 0; } }

/* Sections */
.section { padding-block: clamp(56px, 7vw, 96px); scroll-margin-top: var(--nav); }
.section-head { display: grid; gap: 14px; max-width: 62ch; margin-bottom: clamp(32px, 5vw, 52px); }
.section-head h2 { font-size: var(--step-2); font-weight: 760; letter-spacing: -0.025em; line-height: 1.08; }
.section-head p { color: var(--mist); font-size: var(--step-1); line-height: 1.5; }
.features { padding-top: clamp(72px, 9vw, 120px); }

/* Feature bento */
.bento { display: grid; gap: 16px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tile {
  display: flex; flex-direction: column; gap: 12px; min-width: 0;
  padding: clamp(20px, 2.4vw, 28px);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent 40%), var(--hull);
  border: 1px solid var(--rope); border-radius: var(--radius);
}
.tile h3 { font-size: var(--step-1); font-weight: 720; letter-spacing: -0.015em; line-height: 1.2; }
.tile > p { color: var(--fog); max-width: 60ch; }
.tile .mock { margin-top: auto; padding-top: 10px; }
.tile-voice { grid-column: span 2; overflow: hidden; }
.tile-voice .shot {
  margin: 8px calc(clamp(20px, 2.4vw, 28px) * -1) calc(clamp(20px, 2.4vw, 28px) * -1) clamp(20px, 3vw, 40px);
  border-top-left-radius: 12px; overflow: hidden;
  border-top: 1px solid rgba(255, 255, 255, 0.08); border-left: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: -20px -10px 60px -30px rgba(67, 181, 129, 0.35);
}
.tile-voice .shot img { display: block; width: 100%; height: auto; }
.tile-everywhere {
  grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); align-items: center; gap: 12px 40px;
}
.everywhere-copy { display: grid; gap: 12px; }
.everywhere-copy p { color: var(--fog); }

.mock { font-size: 0.9rem; }
.mock-channels { display: grid; gap: 2px; padding: 12px; border-radius: 12px; background: var(--ink); border: 1px solid var(--rope); }
.mock-cat { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--fog); padding: 8px 8px 4px; }
.mock-ch { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; color: var(--fog); }
.mock-ch .icon { width: 16px; color: var(--fog); font-family: var(--font-mono); text-align: center; flex: none; }
.mock-ch.is-active { background: #25262a; color: #fff; }
.mock-ch.has-unread { color: #fff; font-weight: 600; }
.mock-ch .unread { width: 8px; height: 8px; border-radius: 50%; background: var(--foam); margin-inline-start: auto; }
.mock-people { display: flex; gap: 6px; padding: 2px 8px 6px 32px; }
.mock-people span {
  width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  font-size: 0.66rem; font-weight: 700; color: #fff;
  box-shadow: 0 0 0 2px var(--ink);
}

.mock-sas { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; padding: 14px 10px; border-radius: 12px; background: var(--ink); border: 1px solid var(--rope); text-align: center; }
.mock-sas span { display: grid; gap: 4px; font-size: 0.64rem; color: var(--fog); }
.mock-sas b { font-size: 1.45rem; font-weight: 400; line-height: 1; }
.mock-note { margin-top: 8px; font-size: 0.8rem; color: var(--fog); }

.mock-preview { padding: 12px 14px; border-radius: 12px; background: var(--ink); border: 1px solid var(--rope); border-inline-start: 3px solid var(--pine); display: grid; gap: 3px; }
.mock-preview .site { font-size: 0.72rem; color: var(--fog); letter-spacing: 0.04em; }
.mock-preview .title { color: var(--glow); font-weight: 600; }
.mock-preview .desc { color: var(--mist); font-size: 0.86rem; }
.mock-reactions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.mock-reactions span { padding: 3px 10px; border-radius: 999px; background: #1e1f22; border: 1px solid var(--rope); font-size: 0.85rem; color: var(--mist); }
.mock-reactions .mine { border-color: rgba(107, 212, 140, 0.5); background: rgba(67, 181, 129, 0.12); color: #fff; }

.mock-presence { list-style: none; margin: 0; padding: 12px; display: grid; gap: 6px; border-radius: 12px; background: var(--ink); border: 1px solid var(--rope); }
.mock-presence li { display: flex; align-items: center; gap: 10px; padding: 4px 6px; color: var(--mist); }
.mock-presence .dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.mock-presence .online { background: var(--aurora); }
.mock-presence .idle { background: var(--idle); }
.mock-presence .dnd { background: var(--dnd); }
.mock-presence .offline { background: transparent; box-shadow: inset 0 0 0 2px var(--offline); }
.mock-presence .note { margin-inline-start: auto; font-size: 0.78rem; color: var(--fog); font-style: italic; }

.platform-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.platform-chips span { padding: 8px 14px; border-radius: 10px; background: var(--ink); border: 1px solid var(--rope); color: var(--mist); font-size: 0.92rem; font-weight: 500; }
.platform-chips .lead { color: #fff; border-color: rgba(107, 212, 140, 0.4); }

/* Download */
.download { background: linear-gradient(180deg, transparent, rgba(67, 181, 129, 0.04) 40%, transparent); }
.platforms { display: grid; gap: 16px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.platform {
  position: relative; display: flex; flex-direction: column; gap: 10px; min-width: 0;
  padding: clamp(20px, 2.4vw, 28px); border-radius: var(--radius);
  background: var(--hull); border: 1px solid var(--rope);
  transition: border-color 200ms ease, box-shadow 200ms ease;
}
.platform h3 { font-size: var(--step-1); font-weight: 720; letter-spacing: -0.015em; }
.platform > p { color: var(--fog); }
.platform .btn { margin-top: auto; align-self: flex-start; }
.platform.is-yours { border-color: rgba(107, 212, 140, 0.6); box-shadow: 0 0 0 1px rgba(67, 181, 129, 0.3), 0 24px 60px -34px rgba(67, 181, 129, 0.7); }
.yours { display: none; position: absolute; top: 16px; right: 16px; }
.platform.is-yours .yours { display: inline-flex; }
.platform-linux { grid-column: 1 / -1; }
.commands { display: grid; gap: 10px; margin-top: 6px; }
.command { display: grid; grid-template-columns: 10.5rem minmax(0, 1fr) auto; align-items: center; gap: 12px; }
.command .label { color: var(--mist); font-weight: 600; font-size: 0.95rem; }
.command .label small { display: block; color: var(--fog); font-weight: 400; font-size: 0.78rem; }
.code {
  min-width: 0; overflow-x: auto; white-space: nowrap;
  padding: 11px 14px; border-radius: 10px; background: var(--sky); border: 1px solid var(--rope);
  font-family: var(--font-mono); font-size: 0.86rem; color: var(--foam);
}
.code .prompt { color: var(--fog); user-select: none; }
.copy {
  min-height: 40px; padding: 0 14px; border-radius: 10px; cursor: pointer;
  font: 600 0.85rem/1 var(--font-body); color: var(--mist);
  background: #1e1f22; border: 1px solid var(--rope);
  transition: color 150ms ease, border-color 150ms ease, background-color 150ms ease;
}
.copy:hover { color: #fff; border-color: #3a3c42; }
.copy.is-done { color: var(--glow); border-color: rgba(107, 212, 140, 0.5); }
.also { color: var(--fog); font-size: 0.92rem; margin-top: 4px; }

/* Self-host */
.selfhost-grid { display: grid; grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr); gap: clamp(28px, 5vw, 64px); align-items: center; }
.selfhost-copy { display: grid; gap: 16px; }
.selfhost-copy h2 { font-size: var(--step-2); font-weight: 760; letter-spacing: -0.025em; line-height: 1.08; }
.selfhost-copy p { color: var(--mist); }
.links { display: flex; flex-wrap: wrap; gap: 10px 22px; font-weight: 600; }
.terminal {
  margin: 0; min-width: 0; border-radius: var(--radius); overflow: hidden;
  background: var(--sky); border: 1px solid var(--rope);
  box-shadow: 0 40px 100px -50px rgba(67, 181, 129, 0.45);
}
.terminal-bar { display: flex; align-items: center; gap: 7px; padding: 12px 16px; border-bottom: 1px solid var(--rope); }
.terminal-bar i { width: 11px; height: 11px; border-radius: 50%; background: #2b2d31; }
.terminal-bar span { margin-inline-start: 10px; font-size: 0.78rem; color: var(--fog); font-family: var(--font-mono); }
.terminal pre { margin: 0; padding: 20px; overflow-x: auto; font-family: var(--font-mono); font-size: 0.86rem; line-height: 1.8; color: var(--foam); }
.terminal .prompt { color: var(--aurora); user-select: none; }
.terminal .comment { color: var(--fog); }

/* Footer */
.footer { border-top: 1px solid var(--rope); padding-block: 48px 56px; background: var(--sky); }
.footer-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 28px 48px; }
.footer .brand { font-size: 1.1rem; }
.footer-grid > div { display: grid; gap: 10px; align-content: start; }
.footer p { color: var(--fog); font-size: 0.92rem; max-width: 62ch; }
.footer nav { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.footer nav a { color: var(--mist); text-decoration: none; font-weight: 500; }
.footer nav a:hover { color: #fff; }
.colophon { display: flex; align-items: center; gap: 14px; }
.runes { font-family: var(--font-rune); font-size: 1.5rem; letter-spacing: 0.18em; color: var(--glow); }

/* Narrow screens */
@media (max-width: 900px) {
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tile-voice { grid-column: 1 / -1; }
  .tile-everywhere { grid-template-columns: minmax(0, 1fr); }
  .platforms { grid-template-columns: minmax(0, 1fr); }
  .selfhost-grid, .footer-grid { grid-template-columns: minmax(0, 1fr); }
  .ship-drift { left: 72%; }
  @keyframes drift { to { left: 80%; } }
}
@media (max-width: 720px) {
  .nav-links { display: none; }
  .nav .btn { margin-inline-start: auto; }
  .hero-copy { padding-bottom: calc(var(--ship) * 0.95); }
  .command { grid-template-columns: minmax(0, 1fr) auto; }
  .command .label { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
  .bento { grid-template-columns: minmax(0, 1fr); }
  .tile-voice .shot { margin-left: 0; border-left: 0; border-top-left-radius: 0; }
}

/* Contributors */
.contribute { padding-top: 0; }
.contribute-card {
  position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px 40px; align-items: center;
  padding: clamp(24px, 4vw, 44px); border-radius: var(--radius); background: var(--hull); border: 1px solid var(--rope);
}
.contribute-card::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(60% 140% at 100% 0%, rgba(67, 181, 129, 0.16), transparent 70%); }
.contribute-copy { position: relative; display: grid; gap: 12px; max-width: 60ch; }
.contribute-copy h2 { font-size: var(--step-2); font-weight: 760; letter-spacing: -0.025em; line-height: 1.08; }
.contribute-copy p { color: var(--mist); font-size: var(--step-1); line-height: 1.5; }
.contribute-actions { position: relative; display: flex; flex-wrap: wrap; gap: 10px; }
@media (max-width: 900px) { .contribute-card { grid-template-columns: minmax(0, 1fr); } }

/* Inner pages (/download, /contact) */
.page-top { position: relative; overflow: hidden; padding-block: clamp(48px, 7vw, 88px) clamp(24px, 3vw, 36px); }
.page-top::before {
  content: ""; position: absolute; inset: -30% -10% 0; pointer-events: none;
  background:
    radial-gradient(55% 60% at 78% 18%, rgba(67, 181, 129, 0.2), transparent 70%),
    radial-gradient(40% 50% at 18% 0%, rgba(120, 90, 230, 0.12), transparent 70%);
}
.page-top .wrap { position: relative; display: grid; gap: 18px; }
.page-top h1 { font-size: clamp(2.4rem, 1.5rem + 3.6vw, 4.4rem); font-weight: 760; letter-spacing: -0.02em; line-height: 1; font-variation-settings: "opsz" 96; color: #f4f6f8; }
.page-top .lede { text-shadow: none; }
.notice {
  display: grid; gap: 4px; max-width: 78ch; padding: 14px 18px; border-radius: 12px;
  background: rgba(67, 181, 129, 0.07); border: 1px solid rgba(107, 212, 140, 0.25); color: var(--mist);
}
.notice strong { color: #fff; }
