/*! © 2026 EarthFocus. All rights reserved. */

@font-face {
  font-family: "Lexend";
  src: url("assets/fonts/lexend-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --night: #08131f;
  --text: #e8eef3;
  --muted: #8fa3b5;
  --accent: #5fd0f0;
  /* Fluid sizes for the upright (phone, tablet) layout; the wide layout below
     overrides them. */
  --gutter: clamp(28px, 7vw, 72px);
  /* The lower bound lets «Earth Observation» fit on one line on a 320px phone. */
  --headline: clamp(26px, 8.5vw, 76px);
  --lockup: clamp(210px, 60vw, 420px);
}

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

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  position: relative;
  display: grid;
  /* Keeps the grid from growing wider than the viewport to fit the SVG. */
  grid-template-columns: minmax(0, 1fr);
  align-items: end;
  min-height: 100svh;
  padding: 56px var(--gutter) 48px;
  overflow: hidden;
  /* The page is a single screen, so every gesture can drive the lens. */
  touch-action: none;
  font-family: "Lexend", -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  color: var(--text);
  /* Lighter towards the lens corner, darker under the text. */
  background: linear-gradient(to bottom left, #102a44, var(--night) 45%, #04090f);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

[data-logo] {
  color: #f4f7fa;
}

/* Avoids a flash of the raw logo before the script tags and colours it. */
[data-logo]:not(.is-ready) {
  visibility: hidden;
}

[data-logo] svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

[data-logo] svg path,
[data-logo] svg polygon,
[data-logo] svg rect {
  fill: currentColor;
}

/* Logo colours. Each ring group has a resting (cold) colour and the hot one it
   turns in the lens, a pale sea green; the lockup only ever shows the cold ones. */
.ef-ring-1 { --cold: #9fe7ff; --hot: #eafff8; }
.ef-ring-2 { --cold: #5fd0f0; --hot: #c4f7e6; }
.ef-ring-3 { --cold: #2fb3e0; --hot: #9eeed8; }
.ef-ring-4 { --cold: #2a8fd0; --hot: #86dccf; }
.ef-ring-5 { --cold: #3f6fc0; --hot: #86c4d6; }
.ef-ring-6 { --cold: #5a55a8; --hot: #8fa8d8; }

.ef-core  { color: #ffffff; }
.ef-ring  { color: var(--cold); }
.ef-earth { color: #b8c7d4; }

/* The lens: the oversized emblem behind the content. --core is the core's
   diameter on screen; the script provides --core-ratio (core diameter / emblem
   width) once the SVG is measured, and animates --ping-scale, --ping-opacity
   and --breath here and --heat (0 to 1) on every band. */
.lens {
  --core: max(22vmin, 110px);
  --rest-opacity: 0.65;
  position: absolute;
  top: max(24svh, 170px);
  right: 0;
  width: calc(var(--core) / var(--core-ratio, 0.2));
  translate: 38% -50%;
  pointer-events: none;
}

.lens .ef-core {
  color: #0e2a40;
  opacity: var(--rest-opacity);
}

/* A band (a thin radial slice of a ring group, made by the script) mixes from
   cold to hot as it heats. */
.lens .ef-band {
  color: color-mix(in oklab, var(--cold), var(--hot) calc(var(--heat, 0) * 100%));
  opacity: var(--rest-opacity);
}

/* The Earth in the core (globe.js). The canvas is larger than the core by
   1 / --globe-fill so the atmosphere has room; it replaces the plain core once
   it is drawn. */
.lens .globe {
  position: absolute;
  top: 50%;
  left: 50%;
  width: calc(var(--core) / var(--globe-fill, 1));
  aspect-ratio: 1;
  translate: -50% -50%;
  opacity: 0;
  transition: opacity 1.2s ease;
}

.lens.has-globe .globe {
  opacity: 1;
}

.lens.has-globe .ef-core {
  opacity: 0;
}

/* The ping: a thin ring that starts at the core's edge and rides each pulse
   outwards. */
.lens::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: var(--core);
  aspect-ratio: 1;
  border: 1px solid rgb(158 238 216 / 0.35);
  border-radius: 50%;
  translate: -50% -50%;
  scale: var(--ping-scale, 1);
  opacity: var(--ping-opacity, 0);
}

/* A soft light behind the lens that breathes with its speed and its pulses. */
.lens::after {
  content: "";
  position: absolute;
  inset: -20%;
  z-index: -1;
  background: radial-gradient(closest-side, rgb(44 112 172 / 0.38), transparent);
  opacity: var(--breath, 0);
}

/* One link per language; each language is its own page (see CLAUDE.md). */
.languages {
  position: absolute;
  top: 20px;
  left: var(--gutter);
  display: flex;
  gap: 6px;
  /* Lines the first label up with the gutter despite the links' padding. */
  margin-left: -8px;
  font-size: 13px;
  letter-spacing: 0.14em;
}

.languages a {
  padding: 8px;
  color: var(--muted);
  text-decoration: none;
}

.languages a[aria-current] {
  color: var(--text);
}

main {
  position: relative;
  width: min(100%, 11.5 * var(--headline));
}

.lockup {
  width: var(--lockup);
}

.tagline {
  margin: 32px 0 0;
  font-size: var(--headline);
  font-weight: 200;
  line-height: 1.1;
  letter-spacing: 0.005em;
  text-wrap: balance;
}

.tagline strong {
  display: block;
  font-weight: 600;
  /* Its words stay together on one line. */
  white-space: nowrap;
}

/* French words run longer: a smaller headline keeps it to four lines on a
   phone and clear of the lens on wide screens. */
.tagline:lang(fr) {
  font-size: calc(0.87 * var(--headline));
}

/* The headline starts out of focus and sharpens once, when the script marks the
   page as loaded. A CSS transition (rather than per-frame script) lets the
   browser run it off the main thread, so it stays even on slow phones. */
.js .tagline {
  filter: blur(8px);
  opacity: 0.3;
  transition: filter 1.4s linear, opacity 1.4s linear;
}

.js .is-loaded .tagline {
  filter: blur(0);
  opacity: 1;
}

.contact {
  display: inline-block;
  margin-top: 28px;
  font-size: max(15px, 0.3 * var(--headline));
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--accent);
  text-decoration: none;
}

.languages a:hover,
.languages a:focus-visible,
.contact:hover,
.contact:focus-visible {
  text-decoration: underline;
  text-underline-offset: 5px;
  text-decoration-thickness: 1px;
}

.origin {
  margin: 44px 0 0;
  font-size: max(12px, 0.2 * var(--headline));
  font-weight: 300;
  letter-spacing: 0.14em;
  color: var(--muted);
}

/* Wide screens: content centred on the left, the lens whole on the right with
   its outer rings running off the edges. Sizes follow the shorter side so the
   content also fits a phone held sideways. */
@media (min-width: 700px) and (min-aspect-ratio: 5/4) {
  :root {
    --gutter: 8vw;
    --headline: clamp(26px, min(4.2vw, 8.5vh), 68px);
    --lockup: clamp(180px, min(22vw, 44vh), 340px);
  }

  body {
    align-items: center;
    padding-block: 24px;
  }

  .lens {
    --core: max(21vmin, 90px);
    top: 50%;
    right: 25vw;
    translate: 50% -50%;
  }

  .tagline {
    margin-top: min(32px, 5vh);
  }

  .contact {
    margin-top: min(28px, 4.5vh);
  }

  .origin {
    margin-top: min(44px, 7vh);
  }
}

@media (prefers-reduced-motion: reduce) {
  .js .tagline {
    filter: none;
    opacity: 1;
    transition: none;
  }
}
