/* Fonts are served from this site, so no visitor data goes to a font CDN. Licences in fonts/. */
@font-face {
  font-family: "Inter Tight";
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url("fonts/inter-tight-latin.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/ibm-plex-mono-400-latin.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/ibm-plex-mono-500-latin.woff2") format("woff2");
}

:root {
  --bg: #0d0e0c;
  --ink: #efece4;
  --muted: #8f8c83;
  --quiet: #807d75; /* footer text: dimmer than --muted, still 4.7:1 on --bg (WCAG AA) */
  --faint: #1f201d;
  --accent: #ff5b1f;
  --sans: "Inter Tight", "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --pad: clamp(16px, 4vw, 48px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

.mono { font-family: var(--mono); font-size: 13px; letter-spacing: 0.04em; }

/* One screen: header, a row of notes, the slogan, a row of notes, footer. */
.stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-rows: auto 1fr auto 1fr auto;
  grid-template-areas:
    "top    top"
    "n1     n2"
    "core   core"
    "n3     n4"
    "bottom bottom";
  row-gap: 32px;
}

/* faint drafting grid behind every page */
.paper {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  padding: var(--pad);
  background-image:
    linear-gradient(var(--faint) 1px, transparent 1px),
    linear-gradient(90deg, var(--faint) 1px, transparent 1px);
  background-size: 48px 48px;
  background-position: center;
  overflow: hidden;
}
.paper::before {
  /* fade the grid out towards the edges */
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(13, 14, 12, 0.4) 0%, var(--bg) 72%);
  pointer-events: none;
}
.paper > :not(.ring) { position: relative; z-index: 1; }

.top { grid-area: top; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.wordmark { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 15px; letter-spacing: 0.16em; white-space: nowrap; }
.mark { width: 28px; height: 28px; }
/* language switcher */
.top-right { display: flex; align-items: center; gap: 28px; }
.langs { display: flex; border: 1px solid #3a3b36; }
.langs a { color: var(--muted); font-size: 13px; padding: 7px 14px; transition: color .2s, background .2s; }
.langs a + a { border-left: 1px solid #3a3b36; }
.langs a:hover { color: var(--ink); background: #1c1d1a; }
.langs a[aria-current="page"] { color: #120a05; background: var(--accent); font-weight: 500; }

a.wordmark:focus-visible, .back:focus-visible, .langs a:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

/* ---------- slogan ---------- */
.core { grid-area: core; justify-self: center; text-align: center; max-width: 1100px; }
.eyebrow { color: var(--muted); text-transform: uppercase; margin-bottom: 28px; }
/* the name, then what we do right under it; the name gives its gap to the line below */
.stage .eyebrow:has(+ .services) { font-size: 15px; margin-bottom: 8px; }
.services { color: var(--muted); text-transform: uppercase; margin-bottom: 28px; }
/* both lines split at their separator: left part flush right, right part flush left, separator on the centre line */
.split { display: grid; grid-template-columns: 1fr auto 1fr; }
.split > :first-child { text-align: right; }
.split > :last-child { text-align: left; }
.split .sep { white-space: pre; }
.services .sep { padding: 0 1ch; }
h1 {
  font-weight: 600;
  font-size: clamp(42px, 8vw, 120px);
  line-height: 0.98;
  letter-spacing: -0.035em;
}
.yet { color: var(--accent); display: inline-block; opacity: 0; animation: arrive 1.2s 1.2s ease-out forwards; }

/* the promise: "exist" starts as a hollow outline and fills in, then the email arrives */
.promise { margin-top: 36px; font-size: clamp(19px, 2vw, 28px); font-weight: 500; letter-spacing: -0.01em; }
.p1, .p2 { display: inline-block; opacity: 0; animation: arrive 1s ease-out forwards; }
.p1 { animation-delay: 3.8s; }
.p2 { animation-delay: 4.6s; }
.exist {
  color: transparent;
  -webkit-text-stroke: 1px var(--muted);
  animation: exist 1.4s 5.6s ease-out forwards;
}
.mail {
  display: inline-block;
  margin-top: 22px;
  font-size: 15px;
  color: var(--accent);
  opacity: 0;
  animation: arrive 1s 6.8s ease-out forwards;
  transition: color .2s;
}
.mail span { display: inline-block; transition: transform .2s; }
.mail:hover { color: var(--ink); }
.mail:hover span { transform: translateX(4px); }
.mail:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
/* address shown before the mailbox exists: same place and animation, but not a link */
.mail-off { cursor: text; }
.mail-off:hover { color: var(--accent); }

/* ---------- the ring: a solid arc grows over the dotted one but never closes ---------- */
.ring {
  position: absolute;
  top: 50%;
  left: 50%;
  translate: -50% -50%;
  width: min(80vh, 90vw);
  height: auto;
  z-index: 0;
  pointer-events: none;
}
.ring circle { fill: none; transform: rotate(-90deg); transform-origin: center; }
.ring-maybe { stroke: #3a3b36; stroke-width: 0.5; stroke-dasharray: 0.5 1.2; }
.ring-real {
  stroke: var(--accent);
  stroke-width: 0.6;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  animation: become 18s cubic-bezier(.3, .1, .2, 1) infinite;
}

/* ---------- the four notes, like marginalia on an old map ---------- */
.note {
  font-size: clamp(16px, 1.5vw, 20px);
  line-height: 1.35;
  font-weight: 500;
  color: var(--muted);
  max-width: 26ch;
  opacity: 0;
  animation: arrive 1s ease-out forwards;
  transition: color .3s;
}
.note:hover, .note:focus-visible { color: var(--ink); }
.note:focus-visible { outline: 2px solid var(--accent); outline-offset: 6px; }
.note::after { content: " →"; color: var(--accent); opacity: 0; transition: opacity .3s; }
.note:hover::after, .note:focus-visible::after { opacity: 1; }
@media (hover: none) { .note::after { opacity: 0.7; } }
.n1 { grid-area: n1; align-self: start; animation-delay: 2s; }
.n2 { grid-area: n2; align-self: start; justify-self: end; text-align: right; animation-delay: 2.4s; }
.n3 { grid-area: n3; align-self: end; animation-delay: 2.8s; }
.n4 { grid-area: n4; align-self: end; justify-self: end; text-align: right; animation-delay: 3.2s; }

/* phone-only pieces: the tagline under the header, the ring inside the slogan block, short note titles */
.tagline, .ring-core, .note .short { display: none; }

.bottom { grid-area: bottom; display: flex; justify-content: space-between; gap: 16px; color: var(--quiet); }

/* ---------- thought pages ---------- */
.essay {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-rows: auto auto 1fr auto auto;
  grid-template-areas:
    "top   top"
    "n1    n2"
    "body  body"
    "n3    n4"
    "legal legal";
  gap: 48px 32px;
}
/* the corner notes stay on every thought page so all four can be visited in turn */
.essay .note { font-size: clamp(14px, 1.2vw, 17px); animation: none; opacity: 1; }
.essay .note[aria-current="page"] { color: var(--accent); }
.essay .note[aria-current="page"]::after { content: none; }
.back { color: var(--muted); transition: color .2s; }
.back:hover { color: var(--ink); }
.essay-body { grid-area: body; align-self: center; justify-self: center; width: 100%; max-width: 760px; animation: arrive 1s ease-out both; }
.essay-body .eyebrow { color: var(--ink); font-size: 14px; font-weight: 500; margin-bottom: 24px; }
.essay h1 { font-size: clamp(36px, 5.6vw, 72px); line-height: 1.02; margin-bottom: 44px; }
.essay h1 .twist { color: var(--accent); }
.essay-body p { color: var(--muted); font-size: 18px; line-height: 1.6; max-width: 62ch; margin-bottom: 18px; }
.essay-body em { color: var(--ink); font-style: italic; }
.for-us { margin-top: 36px; padding-left: 20px; border-left: 2px solid var(--accent); }
.essay-body .for-us p { color: var(--ink); margin: 0; }
.nowrap { white-space: nowrap; }
.legal { grid-area: legal; justify-self: center; text-align: center; color: var(--quiet); }

/* ---------- 404 ---------- */
.lost { display: grid; grid-template-rows: auto 1fr auto; grid-template-areas: "top" "core" "legal"; gap: 48px; }
.lost .core { align-self: center; }
.lost h1 { font-size: clamp(36px, 6vw, 88px); }
.lost .twist { color: var(--accent); }
.lost .mail { opacity: 1; animation: none; margin-top: 32px; }

/* wide screens: the notes are pinned to the corners of the window, so all four stay in view while reading */
@media (min-width: 1320px) and (min-height: 560px) {
  .essay .note { position: fixed; max-width: 24ch; font-size: 15px; }
  .essay .n1 { top: calc(var(--pad) + 72px); left: var(--pad); }
  .essay .n2 { top: calc(var(--pad) + 72px); right: var(--pad); }
  .essay .n3 { bottom: var(--pad); left: var(--pad); }
  .essay .n4 { bottom: var(--pad); right: var(--pad); }
}

@keyframes arrive {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}
@keyframes exist {
  to { color: var(--ink); -webkit-text-stroke-color: transparent; }
}
@keyframes become {
  0%   { stroke-dashoffset: 100; opacity: 0.85; }
  80%  { stroke-dashoffset: 6;   opacity: 0.85; }
  94%  { stroke-dashoffset: 6;   opacity: 0; }
  100% { stroke-dashoffset: 100; opacity: 0; }
}

/* ---------- small screens: the slogan in its ring, the thoughts as short links below ---------- */
@media (max-width: 720px) {
  .stage {
    /* header, the slogan inside its ring, the four thoughts two by two, the footer */
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: auto 1fr auto 1fr auto auto auto;
    grid-template-areas: "top top" ". ." "core core" ". ." "n1 n2" "n3 n4" "bottom bottom";
    row-gap: 12px;
  }
  .stage .top { flex-direction: column; align-items: center; text-align: center; gap: 8px; }
  .stage .tagline { display: block; color: var(--muted); text-transform: uppercase; font-size: 12px; }
  /* the slogan block sits centred in its own ring; the page-wide ring is for wide screens */
  .stage > .ring { display: none; }
  .ring-core { display: block; z-index: -1; }
  .core { justify-self: center; text-align: center; max-width: 270px; }
  .stage .eyebrow, .stage .services { display: none; }
  .n2, .n4 { justify-self: start; text-align: left; }
  /* the four thoughts as short titles below the ring */
  .note { font-size: 14px; line-height: 1.4; }
  .note .full { display: none; }
  .note .short { display: inline; }
  .ring { width: 88vw; opacity: 0.6; } /* the whole ring stays on screen */
  .promise { margin-top: 24px; }
  .bottom { margin-top: 20px; flex-direction: column; gap: 2px; font-size: 10px; }
  .essay {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto 1fr auto auto auto auto auto;
    grid-template-areas: "top" "body" "n1" "n2" "n3" "n4" "legal";
    row-gap: 22px;
  }
  .essay-body { margin: 26px 0; }
  .essay-body p { font-size: 17px; }
  .wordmark { font-size: 13px; letter-spacing: 0.12em; gap: 10px; }
  .mark { width: 24px; height: 24px; }
  /* front page: the name leads, the slogan follows a step smaller */
  .stage .wordmark { font-size: 20px; letter-spacing: 0.14em; gap: 12px; }
  .stage .mark { width: 34px; height: 34px; }
  .stage h1 { font-size: 30px; }
  .langs a { padding: 6px 10px; font-size: 12px; }
  .back { display: none; }
}

/* touch screens wider than a phone (tablets, phones on their side): the name sits above the ring's centre */
@media (min-width: 721px) and (hover: none) and (pointer: coarse) {
  .stage .top { justify-content: center; }
}

/* short, wide screens (a phone on its side): the slogan scales with the height so it fits beside the corners */
@media (min-width: 721px) and (max-height: 500px) {
  .stage { row-gap: 8px; padding-block: 14px; }
  .stage h1 { font-size: clamp(32px, 11vh, 120px); }
  .stage .eyebrow { margin-bottom: 12px; }
  .promise { margin-top: 16px; }
  .note { font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .yet, .note, .p1, .p2, .mail, .essay-body { animation: none; opacity: 1; }
  .exist { animation: none; color: var(--ink); -webkit-text-stroke: 0; }
  .ring-real { animation: none; stroke-dashoffset: 6; }
}
