/* Starchoke. One short page, three photographs, no scripts and no motion. */

@font-face {
  font-family: "Archivo";
  src: url("../fonts/archivo-latin-wdth-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}
@font-face {
  font-family: "Public Sans";
  src: url("../fonts/public-sans-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "B612 Mono";
  src: url("../fonts/b612-mono-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Archivo Fallback";
  src: local("Arial");
  size-adjust: 108%;
  ascent-override: 87%;
  descent-override: 21%;
  line-gap-override: 0%;
}
@font-face {
  font-family: "Public Sans Fallback";
  src: local("Arial");
  size-adjust: 104%;
  ascent-override: 91%;
  descent-override: 22%;
  line-gap-override: 0%;
}

:root {
  color-scheme: dark;

  --night-1000: #04060A; --night-950: #070A10; --night-900: #0B0F17; --night-850: #10151F;
  --night-800: #171D29; --night-700: #242C3A; --night-600: #3A4558; --night-550: #566175;
  --night-500: #64718A; --night-400: #808CA3; --night-300: #A9B3C6; --night-200: #CDD3DF;
  --night-100: #E8EBF1;
  --sun-50: #FFF8EC; --sun-100: #FFEFD3; --sun-200: #FFE0A8; --sun-300: #FFCB78;
  --limb-1: #C2521C; --limb-2: #F2B45A; --limb-3: #FFF3DD; --limb-4: #9CCBEA; --limb-5: #3367B5;

  --bg: var(--night-950);
  --bg-rgb: 7, 10, 16;
  --line: var(--night-700);
  --line-strong: var(--night-500);
  --text: var(--night-100);
  --text-muted: var(--night-300);
  --text-faint: var(--night-400);
  --accent: var(--sun-300);
  --link-hover: var(--sun-200);
  --focus: var(--sun-300);
  --button-bg: var(--sun-200);
  --button-bg-hover: var(--sun-50);
  --button-text: var(--night-950);

  --step--2: clamp(0.75rem, 0.7348rem + 0.0647vw, 0.8125rem);
  --step--1: clamp(0.875rem, 0.8598rem + 0.0647vw, 0.9375rem);
  --step-0: clamp(1.0625rem, 1.0322rem + 0.1294vw, 1.1875rem);
  --step-1: clamp(1.25rem, 1.1893rem + 0.2589vw, 1.5rem);
  --step-4: clamp(2rem, 1.6359rem + 1.5534vw, 3.5rem);
  --step-5: clamp(2.5rem, 2.0146rem + 2.0712vw, 4.5rem);
  --figure: clamp(3rem, 2.3932rem + 2.589vw, 5.5rem);

  --display: "Archivo", "Archivo Fallback", Arial, sans-serif;
  --body: "Public Sans", "Public Sans Fallback", Arial, sans-serif;
  --mono: "B612 Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

  --header-h: 64px;
  --m: clamp(1.25rem, 0.25rem + 4vw, 6rem);
  --edge: max(var(--m), calc((100vw - 1600px) / 2));
  --pad: clamp(3.5rem, 9vh, 6.5rem);
}

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

html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: var(--step-0);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

h1, h2, p, figure { margin: 0; }
img { display: block; max-width: 100%; }
::selection { background: var(--sun-300); color: var(--night-950); }

a { color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.skip {
  position: absolute;
  left: var(--edge);
  top: 12px;
  z-index: 30;
  padding: 10px 14px;
  background: var(--button-bg);
  color: var(--button-text);
  font-weight: 600;
  font-size: var(--step--1);
  text-decoration: none;
  transform: translateY(-300%);
}
.skip:focus { transform: none; }

.mono {
  font-family: var(--mono);
  font-size: var(--step--2);
  line-height: 1.4;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ---------- Header ---------- */

.site-header {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 20;
  height: var(--header-h);
  padding: 0 var(--edge);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

/* The name, set as plain text. The second half is a shade quieter so the eye splits the word in the right place. */
.brand {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--text);
  font-family: var(--display);
  font-stretch: 125%;
  font-weight: 600;
  font-size: 1.0625rem;
  line-height: 1;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
}
.brand span { color: var(--text-muted); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  background: var(--button-bg);
  color: var(--button-text);
  font-family: var(--body);
  font-size: var(--step--1);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.005em;
  text-decoration: none;
  text-align: center;
  border: 0;
  border-radius: 0;
}
.btn:hover { background: var(--button-bg-hover); }
.btn-line {
  background: transparent;
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}
.btn-line:hover { background: transparent; color: var(--link-hover); box-shadow: inset 0 0 0 1px var(--accent); }

/* ---------- Type ---------- */

h1, h2 {
  font-family: var(--display);
  font-weight: 600;
  font-stretch: 100%;
  text-wrap: balance;
}
h1 {
  font-size: var(--step-5);
  line-height: 1.04;
  letter-spacing: -0.022em;
}
h2 {
  font-size: var(--step-4);
  line-height: 1.06;
  letter-spacing: -0.02em;
}
.display {
  font-size: var(--step-5);
  line-height: 1;
  letter-spacing: -0.025em;
}

p { text-wrap: pretty; }
.lead {
  margin-top: 20px;
  max-width: 48ch;
  font-size: var(--step-1);
  line-height: 1.45;
  color: var(--night-200);
}
.body {
  margin-top: 20px;
  max-width: 58ch;
  color: var(--text-muted);
}
.actions { margin-top: 28px; }

.fact { margin-top: 28px; }
.fact span { display: block; }
.fact-pre { color: var(--text-muted); }
.fact-figure {
  margin: 6px 0 10px;
  font-family: var(--display);
  font-size: var(--figure);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--sun-200);
}
.fact-rest {
  max-width: 30ch;
  font-size: var(--step-1);
  line-height: 1.45;
}

.routes {
  margin-top: 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* ---------- First screen ---------- */

/* Each photograph is laid over the page with the lighten blend, so its black sky takes the page color
   and no frame edge shows. Where blending is not supported the photograph simply shows as it is. */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: min(100svh, 70rem);
  padding: calc(var(--header-h) + 32px) var(--edge) clamp(2.5rem, 8vh, 6rem);
  display: grid;
  align-items: end;
  background: var(--bg);
  overflow: hidden;
}
.hero-photo {
  position: absolute;
  inset: var(--header-h) 0 0 0;
}
.hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 0%;
  mix-blend-mode: lighten;
}
/* The photograph runs out into the page at the bottom. */
.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 30%;
  background: linear-gradient(rgba(var(--bg-rgb), 0), var(--bg));
  pointer-events: none;
}
.hero-copy {
  position: relative;
  z-index: 1;
  max-width: 54rem;
}
/* A soft patch of night behind the words, so city lights never sit under a letter. */
.hero-copy::before {
  content: "";
  position: absolute;
  inset: -1rem -1.5rem;
  z-index: -1;
  background: rgba(var(--bg-rgb), 0.66);
  box-shadow: 0 0 4.5rem 4.5rem rgba(var(--bg-rgb), 0.66);
}

/* ---------- Bands: words on the left, a photograph on the right ---------- */

.band {
  position: relative;
  padding: var(--pad) var(--edge);
  display: grid;
  row-gap: clamp(3rem, 8vh, 5.5rem);
  background: var(--bg);
  overflow: hidden;
}
.copy {
  position: relative;
  z-index: 1;
  width: 46%;
  max-width: 44rem;
}
.art {
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(var(--edge) + (100% - 2 * var(--edge)) * 0.46);
  right: var(--edge);
}
.art img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  mix-blend-mode: lighten;
}
.art-earth img { object-fit: contain; object-position: 50% 50%; }
.art-sun { right: 0; }
/* The Sun sits a little right of the middle so the fade on the left never reaches it. */
.art-sun img {
  object-fit: cover;
  object-position: 40% 50%;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 30%);
  mask-image: linear-gradient(90deg, transparent 0%, #000 30%);
}

/* ---------- Footer ---------- */

/* The photo credit on one side, the year on the other. */
.site-footer {
  position: relative;
  padding: 28px var(--edge) 32px;
  background: var(--bg);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 32px;
  color: var(--text-faint);
}
.site-footer::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  opacity: 0.6;
  background: linear-gradient(90deg, var(--limb-1), var(--limb-2), var(--limb-3), var(--limb-4), var(--limb-5));
}

/* ---------- Wide windows ---------- */

@media (min-width: 900px) {
  h1, h2 { font-stretch: 112.5%; }
}

/* ---------- Narrow windows: the photograph sits above the words ---------- */

@media (max-width: 899px) {
  .band { display: block; padding: 0 0 var(--pad); }
  .copy { width: auto; max-width: 40rem; margin: 0 var(--edge); }
  .copy + .copy { margin-top: clamp(3rem, 8vh, 4.5rem); }
  .art {
    position: relative;
    inset: auto;
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    max-height: 56vh;
    margin-bottom: 24px;
  }
  .art-earth img { object-fit: cover; }
  .art-sun { aspect-ratio: 2 / 1; }
  .art-sun img { object-position: 50% 50%; -webkit-mask-image: none; mask-image: none; }
}

@media (max-width: 767px) {
  :root { --header-h: 56px; }
  .brand { font-size: 0.9375rem; }
  .lead { margin-top: 16px; }
  .actions { margin-top: 24px; }
  .btn { width: 100%; }
}

/* Tall windows use the upright cut of the first photograph, and keep its band of light clear of the words. */
@media (max-aspect-ratio: 4/5) {
  .hero { padding-top: calc(var(--header-h) + max(7rem, 16vh)); }
  .hero-photo img { object-position: 60% 0%; }
  .hero-copy::before { inset: -0.5rem -1.25rem; box-shadow: 0 0 2.5rem 1.5rem rgba(var(--bg-rgb), 0.66); }
}

@media (forced-colors: active) {
  .btn { border: 1px solid ButtonBorder; }
  .btn-line { box-shadow: none; }
  :focus-visible { outline-color: Highlight; }
  .site-footer::before { background: CanvasText; }
  .hero-copy::before { display: none; }
}

@media print {
  html, body { background: #fff; color: #000; }
  .skip, .hero-photo, .art, .hero::after, .hero-copy::before { display: none !important; }
  .site-header { position: static; }
  .hero { min-height: 0; padding: 24px var(--edge); display: block; background: none; }
  .band { display: block; padding: 24px var(--edge); background: none; }
  .copy { width: auto; max-width: none; margin: 0 0 24px; }
  .brand, .brand span, .lead, .body, .fact-pre, .fact-figure, .site-footer { color: #000; }
  .site-footer { background: none; }
}

/* ---------- Not found ---------- */

.lost {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  padding: calc(var(--header-h) + 32px) var(--edge) var(--pad);
  display: grid;
  align-items: center;
  background: var(--bg);
  overflow: hidden;
}
.lost .text-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--text);
  font-size: var(--step--1);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.3em;
}
.lost .text-link:hover { color: var(--link-hover); }
.lost-credit {
  position: absolute;
  left: var(--edge);
  bottom: 24px;
  z-index: 1;
  color: var(--text-faint);
}
@media (max-width: 899px) {
  .lost { display: block; padding-bottom: 72px; }
  .lost .art { margin: 0 calc(var(--edge) * -1) 20px; width: auto; }
  .lost .copy { margin: 0; }
}
