/* Layout: a night sky. Text sits above a full-bleed world map that fades up out of the dark; sections below are a single reading column with paired cards. One committed dark look: the lamps only read against night. */
:root {
  --night: #0a0e18;      /* page ground */
  --dusk: #121a2c;       /* raised surfaces */
  --mist: #253049;       /* land dots, rules */
  --paper: #ece6d6;      /* text, warm like lamplight on paper */
  --dim: #929bb2;        /* secondary text */
  --flame: #ffb547;      /* gas-lamp amber: the one accent */
  --ember: #ff7a3d;      /* hot core of a flame */
  --sky: #a9c8ff;        /* people in censored countries */

  --display: "Gloock", "Bodoni 72", Didot, Georgia, serif;
  --body: "Schibsted Grotesk", "Helvetica Neue", Arial, sans-serif;
  --mono: "Spline Sans Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --step-0: 1rem;
  --step-1: 1.2rem;
  --step-2: 1.6rem;
  --step-3: clamp(2rem, 4vw, 2.6rem);
  --step-4: clamp(2.6rem, 7.2vw, 5.4rem);

  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--night);
  color: var(--paper);
  font: 400 var(--step-0)/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  height: env(safe-area-inset-top, 0px);
  background: var(--night);
  z-index: 10;
}

a { color: var(--flame); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--paper); }
:focus-visible { outline: 2px solid var(--flame); outline-offset: 3px; border-radius: 2px; }
code { font-family: var(--mono); font-size: .88em; white-space: nowrap; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.skip {
  position: absolute; left: -999px; top: 8px;
  background: var(--flame); color: var(--night); padding: 8px 12px; z-index: 20;
}
.skip:focus { left: max(16px, env(safe-area-inset-left, 0px)); }

/* Shared gutter: every band holds its content inside the same width. */
.top, .hero-text, .how, .install, .before, .foot {
  width: 100%;
  max-width: 1120px;
  margin-inline: auto;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
}

/* Header */
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding-block: calc(18px + env(safe-area-inset-top, 0px)) 18px;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--paper); text-decoration: none;
  font-family: var(--display); font-size: 1.35rem; letter-spacing: .01em;
}
.brand-mark { width: 26px; height: 26px; color: var(--paper); flex: none; }
.top nav { display: flex; gap: 22px; font-size: .95rem; }
.top nav a { color: var(--dim); text-decoration: none; }
.top nav a:hover { color: var(--paper); }
@media (max-width: 640px) { .top nav { display: none; } }

/* Hero */
.hero { position: relative; }
.hero-text { padding-block: clamp(28px, 6vw, 72px) 0; position: relative; z-index: 2; pointer-events: none; }
.hero-text a, .hero-text p { pointer-events: auto; }
.eyebrow {
  margin: 0 0 18px; color: var(--flame);
  font-size: .8rem; font-weight: 500; letter-spacing: .14em; text-transform: uppercase;
}
h1, h2, h3 { text-wrap: balance; }
h1 {
  font-family: var(--display); font-weight: 400;
  font-size: var(--step-4); line-height: 1.02; letter-spacing: -.01em;
  margin: 0; max-width: 13ch;
}
.lit {
  color: var(--flame);
  text-shadow: 0 0 18px rgba(255, 181, 71, .55), 0 0 48px rgba(255, 122, 61, .35);
  animation: kindle 1.8s ease-out .2s both;
}
@keyframes kindle {
  0% { color: var(--paper); text-shadow: none; }
  35% { color: #fff3d6; text-shadow: 0 0 30px rgba(255, 210, 120, .9); }
  100% { color: var(--flame); text-shadow: 0 0 18px rgba(255, 181, 71, .55), 0 0 48px rgba(255, 122, 61, .35); }
}
.lede {
  font-size: var(--step-1); line-height: 1.55; color: var(--paper);
  max-width: 52ch; margin: 22px 0 0;
  text-shadow: 0 0 14px var(--night), 0 0 28px var(--night);
}
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; margin-top: 30px; }
.button {
  display: inline-block; padding: 12px 22px; border-radius: 999px;
  background: var(--flame); color: var(--night); font-weight: 700; text-decoration: none;
  box-shadow: 0 0 0 0 rgba(255, 181, 71, .5), 0 8px 30px -8px rgba(255, 122, 61, .7);
  transition: box-shadow .25s ease, transform .25s ease;
}
.button:hover { color: var(--night); transform: translateY(-1px); box-shadow: 0 0 0 6px rgba(255, 181, 71, .15), 0 10px 36px -8px rgba(255, 122, 61, .8); }
.quiet { color: var(--dim); text-decoration: none; text-shadow: 0 0 10px var(--night), 0 0 20px var(--night); }
.quiet:hover { color: var(--paper); }

.hero-text > * { animation: rise .9s cubic-bezier(.2, .7, .2, 1) both; }
.hero-text > :nth-child(2) { animation-delay: .08s; }
.hero-text > :nth-child(3) { animation-delay: .18s; }
.hero-text > :nth-child(4) { animation-delay: .28s; }
/* Rises from a visible state, so a first frame or a link preview still shows the words. */
@keyframes rise { from { transform: translateY(14px); } to { transform: none; } }

/* The night map */
.night {
  position: relative; z-index: 1;
  /* Rises up behind the headline, so the live map is in the first view. */
  margin: clamp(-200px, -11vw, 8px) 0 0;
  /* Fades up out of the dark at the top, and back into it at the bottom. */
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 16%, #000 84%, transparent 100%);
          mask-image: linear-gradient(to bottom, transparent 0, #000 16%, #000 84%, transparent 100%);
}
.night canvas { display: block; width: 100%; aspect-ratio: 360 / 134; max-width: 100%; transition: opacity .6s ease; }
.live {
  position: absolute; left: max(20px, env(safe-area-inset-left, 0px)); bottom: 18%;
  display: flex; align-items: center; gap: 10px;
  font-size: .92rem; color: var(--paper); max-width: min(46ch, 70%);
  text-shadow: 0 1px 12px var(--night);
}
.live-dot {
  width: 8px; height: 8px; border-radius: 50%; flex: none;
  background: var(--flame); box-shadow: 0 0 10px var(--flame);
  animation: breathe 2.4s ease-in-out infinite;
}
@keyframes breathe { 50% { opacity: .45; } }
.live b { color: var(--flame); font-weight: 500; font-variant-numeric: tabular-nums; }
.night.stale canvas { opacity: .35; }
.night.stale .live-dot { animation: none; background: var(--dim); box-shadow: none; }
.ticker {
  position: absolute; right: max(20px, env(safe-area-inset-right, 0px)); bottom: 18%;
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 6px; justify-items: end;
  font-size: .82rem; color: var(--dim);
}
.ticker li { animation: tick-in .6s ease-out both; text-shadow: 0 1px 10px var(--night); }
.ticker li b { color: var(--paper); font-weight: 500; }
.ticker li.out { animation: tick-out .8s ease-in both; }
@keyframes tick-in { from { opacity: 0; transform: translateY(6px); } }
@keyframes tick-out { to { opacity: 0; } }
.legend {
  position: absolute; left: max(20px, env(safe-area-inset-left, 0px)); bottom: calc(18% - 30px);
  display: flex; gap: 18px; margin: 0; padding: 0; list-style: none;
  font-size: .76rem; color: var(--dim);
}
.legend li { display: inline-flex; align-items: center; gap: 7px; }
.legend i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.k-lamp { background: var(--flame); box-shadow: 0 0 8px var(--flame); }
.k-user { background: var(--sky); box-shadow: 0 0 6px var(--sky); }
@media (max-width: 760px) {
  /* Zoomed in and centred on Europe and Asia, where most lamps are, so the
     map isn't a thin strip on a phone. The figure clips the overflow. */
  .night { margin-top: 12px; overflow: hidden; }
  .night canvas { width: 185%; max-width: none; margin-left: -68%; }
  .night { -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 12%, #000 100%); mask-image: linear-gradient(to bottom, transparent 0, #000 12%, #000 100%); }
  .live, .legend, .ticker { position: static; max-width: none; margin: 10px max(20px, env(safe-area-inset-left, 0px)) 0; }
  .ticker { justify-items: start; margin-top: 8px; }
}

/* Sections */
section.how, section.install, section.before { padding-block: clamp(56px, 9vw, 104px) 0; }
.section-head { max-width: 62ch; margin-bottom: 36px; }
h2 {
  font-family: var(--display); font-weight: 400; font-size: var(--step-3);
  line-height: 1.08; margin: 0 0 14px;
}
.section-head p { margin: 0; color: var(--dim); font-size: 1.06rem; }
h3 { font-size: var(--step-1); font-weight: 700; margin: 0 0 8px; line-height: 1.3; }
p { text-wrap: pretty; }

.ways { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 20px; }
.way {
  background: linear-gradient(180deg, var(--dusk), rgba(18, 26, 44, .35));
  border: 1px solid var(--mist); border-radius: 14px;
  padding: 26px 26px 20px; min-width: 0;
}
.way p { margin: 0; color: var(--dim); }
.way-art { width: 120px; height: 60px; margin-bottom: 14px; display: block; }
.a-lamp { fill: var(--flame); }
.a-glow { fill: var(--flame); opacity: .14; }
.a-path { fill: none; stroke: var(--flame); stroke-width: 1.4; stroke-dasharray: 3 5; opacity: .75; animation: flow 1.6s linear infinite; }
.a-user { fill: var(--sky); }
.a-relay { fill: none; stroke: var(--dim); stroke-width: 1.4; }
@keyframes flow { to { stroke-dashoffset: -16; } }
.note { color: var(--dim); margin: 22px 0 0; font-size: .95rem; }

/* Install */
.tabs { display: flex; flex-wrap: wrap; gap: 6px; border-bottom: 1px solid var(--mist); margin-bottom: 22px; }
.tabs button {
  appearance: none; background: none; border: 0; cursor: pointer;
  color: var(--dim); font: 500 1rem var(--body);
  padding: 10px 16px 12px; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs button:hover { color: var(--paper); }
.tabs button[aria-selected="true"] { color: var(--paper); border-bottom-color: var(--flame); }
.panel { max-width: 860px; }
.panel > p { color: var(--dim); margin: 0 0 14px; max-width: 64ch; }
.panel .small { font-size: .95rem; margin-top: 16px; }
.cmd {
  position: relative; display: flex; align-items: stretch;
  background: #05080f; border: 1px solid var(--mist); border-radius: 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .03), 0 18px 40px -24px rgba(255, 140, 50, .35);
}
.cmd pre { margin: 0; padding: 18px 20px; overflow-x: auto; flex: 1; min-width: 0; }
.cmd code { font-size: .92rem; line-height: 1.7; color: var(--paper); white-space: pre; }
.copy {
  flex: none; align-self: flex-start; margin: 10px 10px 0 0;
  appearance: none; cursor: pointer; border: 1px solid var(--mist); border-radius: 8px;
  background: var(--dusk); color: var(--paper); font: 500 .82rem var(--body);
  padding: 7px 12px; min-width: 70px;
}
.copy:hover { border-color: var(--flame); }
.copy.done { color: var(--night); background: var(--flame); border-color: var(--flame); }
.after { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 12px 24px; margin: 22px 0 0; }
.after div { min-width: 0; }
.after dt { font-size: .76rem; letter-spacing: .1em; text-transform: uppercase; color: var(--dim); margin-bottom: 4px; }
.after dd { margin: 0; overflow-x: auto; }
.after code { white-space: nowrap; color: var(--paper); }

.settings { margin-top: 48px; max-width: 860px; }
.settings > p { color: var(--dim); margin: 0 0 10px; }
.how-to-set { color: var(--dim); margin: 0 0 18px; padding-left: 1.2rem; display: grid; gap: 8px; max-width: 72ch; }
.how-to-set b { color: var(--paper); font-weight: 500; }
.how-to-set li { min-width: 0; }
.how-to-set li > code { white-space: normal; overflow-wrap: anywhere; }
.how-to-set .cmd { margin-top: 8px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--mist); border-radius: 12px; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; vertical-align: top; padding: 13px 16px; border-bottom: 1px solid var(--mist); }
tr:last-child th, tr:last-child td { border-bottom: 0; }
th { font-weight: 400; white-space: nowrap; width: 1%; }
th code { color: var(--flame); }
td { color: var(--dim); }

/* Before you start */
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 34px 40px; }
.facts article { min-width: 0; border-top: 1px solid var(--mist); padding-top: 18px; }
.facts p { margin: 0; color: var(--dim); }

/* Footer */
.foot {
  margin-top: clamp(72px, 10vw, 120px);
  padding-block: 28px calc(36px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--mist);
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 14px 28px;
  color: var(--dim); font-size: .92rem;
}
.foot p { margin: 0; display: flex; align-items: center; gap: 10px; }
.foot p > span { display: block; }
.foot .brand-mark { width: 20px; height: 20px; color: var(--dim); }
.foot-links { gap: 20px !important; }
.foot-links a { color: var(--dim); }
.foot-links a:hover { color: var(--paper); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
