@font-face {
  font-family: "Sora";
  src: url("/fonts/sora-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Plex Mono";
  src: url("/fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Plex Mono";
  src: url("/fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #0b0d0c;
  --paper: #ece8df;
  --paper-soft: rgba(236, 232, 223, 0.78);
  --muted: #908d85;
  --line: rgba(236, 232, 223, 0.11);
  --cross: rgba(236, 232, 223, 0.4);
  --accent: #f2a93b;
  --sans: "Sora", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: "Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --max: 1320px;
  --gutter: clamp(16px, 3.2vw, 48px);
  --inset: clamp(18px, 3vw, 44px);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --hero-pad: clamp(18px, 4vh, 52px);
  color-scheme: dark;
}

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

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

body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  font-weight: 300;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body::after {
  content: "";
  position: fixed;
  top: -30vh;
  right: -20vw;
  z-index: -1;
  width: 80vw;
  height: 90vh;
  pointer-events: none;
  background: radial-gradient(closest-side, rgba(242, 169, 59, 0.08), transparent);
}

::selection {
  background: var(--accent);
  color: var(--ink);
}

a {
  color: inherit;
}

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

img {
  display: block;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Frame: two rails, full-width rules, a cross where they meet */

.shell {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-rows: auto 1fr auto;
  width: min(var(--max), 100% - 2 * var(--gutter));
  min-height: 100vh;
  min-height: 100svh;
  margin-inline: auto;
}

.shell::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  border-inline: 1px solid var(--line);
  pointer-events: none;
}

.site-header::after,
.services::before,
.site-footer::before {
  content: "";
  position: absolute;
  right: 0;
  left: 0;
  height: 1px;
  background: var(--line);
  box-shadow: 0 0 0 100vmax var(--line);
  clip-path: inset(0 -100vmax);
  pointer-events: none;
}

.site-header::before,
.services::after,
.site-footer::after {
  content: "";
  position: absolute;
  right: -6px;
  left: -6px;
  z-index: 3;
  height: 13px;
  pointer-events: none;
  background:
    linear-gradient(var(--cross), var(--cross)) 0 6px / 13px 1px no-repeat,
    linear-gradient(var(--cross), var(--cross)) 6px 0 / 1px 13px no-repeat,
    linear-gradient(var(--cross), var(--cross)) 100% 6px / 13px 1px no-repeat,
    linear-gradient(var(--cross), var(--cross)) calc(100% - 6px) 0 / 1px 13px no-repeat;
}

.site-header::after {
  bottom: 0;
}

.site-header::before {
  bottom: -6px;
}

.services::before,
.site-footer::before {
  top: 0;
}

.services::after,
.site-footer::after {
  top: -6px;
}

/* Header and footer */

.site-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: clamp(12px, 2.4vh, 22px) var(--inset);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--mono);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-decoration: none;
  text-transform: uppercase;
}

.header-link {
  padding: 6px 12px;
  border: 1px solid var(--line);
  color: var(--paper);
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-decoration: none;
  text-transform: uppercase;
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease);
}

.header-link:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.site-footer {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 24px;
  align-items: center;
  justify-content: space-between;
  padding: clamp(10px, 2.2vh, 20px) var(--inset);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
}

.site-footer a {
  text-decoration: none;
  transition: color 0.2s var(--ease);
}

.site-footer a:hover {
  color: var(--paper);
}

.footer-brand,
.footer-li {
  display: inline-flex;
  align-items: center;
}

.footer-brand {
  gap: 10px;
}

.footer-brand img {
  opacity: 0.85;
}

.footer-li {
  gap: 7px;
}

.footer-li svg {
  display: block;
}

.footer-links,
.footer-links .mail-link {
  display: inline-flex;
  align-items: center;
  white-space: pre;
}

/* Hero: the statement owns the screen */

.main {
  display: grid;
  grid-template-rows: 1fr auto;
  min-height: 0;
}

.hero,
.stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: var(--hero-pad) var(--inset);
  overflow: hidden;
}

.hero > :not(.globe) {
  position: relative;
  z-index: 1;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.pulse {
  position: relative;
  flex: none;
  width: 7px;
  height: 7px;
  background: var(--accent);
}

.pulse::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid var(--accent);
  animation: pulse 2.4s var(--ease) infinite;
}

.caret {
  flex: none;
  width: 0.7em;
  height: 2px;
  margin-left: -4px;
  align-self: flex-end;
  margin-bottom: 0.2em;
  background: var(--accent);
  animation: blink 1.1s steps(1) infinite;
}

.headline {
  margin: clamp(10px, 2.2vh, 26px) 0 0;
  font-size: clamp(2rem, min(11.2vw, 17.5vh), 10.2rem);
  font-weight: 250;
  line-height: 0.98;
  letter-spacing: 0.015em;
}

.headline .line {
  display: block;
  margin: -0.12em 0 -0.16em;
  padding: 0.12em 0.14em 0.16em 0;
  overflow: hidden;
}

.headline .line > * {
  display: inline-block;
  animation: reveal 1.15s var(--ease) both;
}

.headline .line + .line > * {
  animation-delay: 0.14s;
}

.headline em {
  color: var(--accent);
  font-style: normal;
  font-weight: 600;
}

.hero-foot {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: clamp(14px, 2.6vh, 26px);
  margin-top: clamp(16px, 3.4vh, 40px);
}

.lede {
  max-width: 32em;
  margin: 0;
  color: var(--paper-soft);
  font-size: clamp(0.98rem, 2.1vh, 1.2rem);
  line-height: 1.35;
}

.button {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 15px 22px;
  background: var(--accent);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-decoration: none;
  text-transform: uppercase;
  transition: background-color 0.25s var(--ease);
}

.button:hover,
.button:focus-visible {
  background: var(--paper);
}

.button span {
  transition: transform 0.25s var(--ease);
}

.button:hover span {
  transform: translateX(4px);
}

/* Globe: a dotted sphere rising behind the services band */

.globe {
  --g: clamp(300px, min(50vw, 82vh), 780px);
  position: absolute;
  right: calc(var(--inset) - 0.1 * var(--g));
  bottom: 0;
  z-index: 0;
  width: var(--g);
  aspect-ratio: 1;
  translate: 0 46.8%;
  animation: fade 1.6s var(--ease) 0.4s both;
}

.globe-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* Services band */

.services {
  position: relative;
  background: var(--ink);
}

.cells {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
}

.cell {
  padding: clamp(14px, 2.4vh, 26px) clamp(16px, 2vw, 28px) clamp(16px, 2.8vh, 30px);
  border-left: 1px solid var(--line);
}

.cell:first-child {
  padding-left: var(--inset);
  border-left: 0;
}

.cell-num {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.2em;
}

.cell h3 {
  margin: clamp(6px, 1.2vh, 12px) 0 0;
  font-size: clamp(1rem, 2.2vh, 1.25rem);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0;
}

.cell p {
  max-width: 34ch;
  margin: clamp(4px, 0.8vh, 8px) 0 0;
  color: var(--muted);
  font-size: clamp(0.82rem, 1.7vh, 0.92rem);
  line-height: 1.5;
}

/* 404 */

.back {
  margin-top: clamp(26px, 5.5vh, 56px);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.8125rem;
  letter-spacing: 0.04em;
  text-decoration: none;
  transition: color 0.2s var(--ease);
}

.back:hover {
  color: var(--paper);
}

/* Tablets and phones */

@media (max-width: 899px) {
  .cells {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cell:nth-child(3) {
    padding-left: var(--inset);
    border-left: 0;
  }

  .cell:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }
}

@media (max-width: 640px) {
  :root {
    --inset: 20px;
  }

  .shell {
    width: 100%;
  }

  .shell::before,
  .site-header::before,
  .services::after,
  .site-footer::after {
    display: none;
  }

  .headline {
    font-size: clamp(2rem, 11.8vw, 3.8rem);
  }

  .hero {
    justify-content: flex-start;
  }

  .globe {
    --gm: 112vw;
    position: relative;
    right: auto;
    bottom: auto;
    flex: 1 1 0;
    align-self: stretch;
    width: auto;
    min-height: 0;
    aspect-ratio: auto;
    margin: 6px calc(-1 * var(--inset)) calc(-1 * var(--hero-pad));
    overflow: hidden;
    translate: none;
  }

  .globe-canvas {
    top: calc(var(--gm) * -0.05);
    left: 50%;
    width: var(--gm);
    height: var(--gm);
    translate: -50% 0;
  }

  .button {
    padding: 13px 18px;
  }

  .cell {
    padding: 12px 14px 14px;
  }

  .cell p {
    font-size: 0.875rem;
    line-height: 1.38;
  }
}

@media (max-width: 420px) {
  .site-footer {
    font-size: 0.6875rem;
    letter-spacing: 0.02em;
  }
}

@media (max-width: 400px) {
  .footer-links .mail-link {
    display: none;
  }
}

/* Short screens: tighter rhythm, names only in the services band */

@media (min-width: 641px) and (max-height: 700px) {
  :root {
    --hero-pad: clamp(12px, 3vh, 28px);
  }

  .headline {
    font-size: clamp(2rem, min(11.2vw, 15.5vh), 10.2rem);
  }

  .hero-foot {
    margin-top: clamp(12px, 2.6vh, 24px);
    gap: clamp(10px, 2vh, 18px);
  }

  .cell {
    padding-block: clamp(10px, 2vh, 18px) clamp(12px, 2.2vh, 20px);
  }
}

@media (max-height: 600px), (max-width: 640px) and (max-height: 759px) {
  .cell p {
    display: none;
  }
}

@media (max-width: 640px) and (max-height: 700px) {
  .site-header {
    padding-block: 10px;
  }

  :root {
    --hero-pad: 14px;
  }

  .hero-foot {
    gap: 12px;
    margin-top: 14px;
  }

  .lede {
    font-size: 1rem;
  }

  .button {
    padding: 11px 16px;
  }

  .cell {
    padding-block: 10px 12px;
  }

  .cell h3 {
    margin-top: 4px;
    font-size: 1.05rem;
  }

  .site-footer {
    padding-block: 10px;
  }
}

@media (orientation: landscape) and (max-height: 520px) {
  .site-header {
    padding-block: 8px;
  }

  .site-footer {
    padding-block: 6px;
  }

  :root {
    --hero-pad: 10px;
  }

  .headline {
    margin-top: 6px;
    font-size: clamp(2rem, 15vh, 5rem);
  }

  .hero-foot {
    flex-direction: row;
    align-items: center;
    gap: 24px;
    margin-top: 12px;
  }

  .lede {
    max-width: 24ch;
    font-size: 1rem;
  }

  .button {
    padding: 10px 16px;
  }

  .cells {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .cell,
  .cell:nth-child(3) {
    padding: 8px 14px 10px;
    border-top: 0;
    border-left: 1px solid var(--line);
  }

  .cell:first-child {
    padding-left: var(--inset);
    border-left: 0;
  }

  .cell-num {
    display: none;
  }

  .cell h3 {
    margin-top: 0;
    font-size: 1rem;
  }

  .globe {
    --g: min(42vw, 98vh);
  }
}

/* Motion */

.rise {
  animation: rise 0.9s var(--ease) both;
}

.d3 { animation-delay: 0.45s; }
.d4 { animation-delay: 0.6s; }
.d5 { animation-delay: 0.68s; }
.d6 { animation-delay: 0.76s; }
.d7 { animation-delay: 0.84s; }

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes reveal {
  from {
    transform: translateY(105%);
  }
  to {
    transform: none;
  }
}

@keyframes fade {
  from {
    opacity: 0;
  }
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

@keyframes pulse {
  from {
    opacity: 0.9;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(3.2);
  }
}

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