/* Shared styles for every page. Colour comes only from tokens, which each
   page sets for itself (see the <style> block at the top of each page). */

* { box-sizing: border-box; }

:root {
  --measure: 34rem;
  --shell: 68rem;

  --step--1: clamp(0.80rem, 0.77rem + 0.13vw, 0.87rem);
  --step-0:  clamp(1.02rem, 0.98rem + 0.20vw, 1.14rem);
  --step-1:  clamp(1.22rem, 1.14rem + 0.38vw, 1.44rem);
  --step-2:  clamp(1.55rem, 1.40rem + 0.72vw, 1.98rem);
  --step-3:  clamp(2.05rem, 1.75rem + 1.45vw, 2.95rem);
  --step-4:  clamp(2.75rem, 2.05rem + 3.40vw, 4.90rem);
  --step-5:  clamp(3.2rem, 2.2rem + 5vw, 6.6rem);

  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: "IBM Plex Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
}

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--step-0);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 400;
  text-wrap: balance;
  letter-spacing: -0.01em;
  margin: 0;
}

p { margin: 0; }
a { color: var(--accent); }
img { max-width: 100%; }

a:focus-visible, .btn:focus-visible, .orb-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}

.shell { width: min(100% - 2.5rem, var(--shell)); margin-inline: auto; }
.col { width: min(100%, var(--measure)); }

.eyebrow {
  font-family: var(--mono);
  font-size: var(--step--1);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--faint);
}

/* ---------- top bar with the app orbs ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--ground) 82%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-soft);
}

.topbar .shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.6rem;
}

.brand {
  font-family: var(--serif);
  font-size: 1.45rem;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}

.brand em { color: var(--accent); }

.orb-nav { display: flex; align-items: center; gap: clamp(0.6rem, 2vw, 1rem); }

/* ---------- the orb: a water-filled circle holding an app icon ---------- */
.orb-link {
  display: grid;
  justify-items: center;
  gap: 0.35rem;
  text-decoration: none;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.orb {
  display: block;
  width: 46px;
  height: 46px;
  overflow: visible;
  transition: transform 0.25s cubic-bezier(0.22, 0.9, 0.3, 1);
}

.orb-link:hover .orb { transform: translateY(-2px) scale(1.06); }
.orb-link[aria-current="page"] { color: var(--ink); }
.orb-link[aria-current="page"] .orb-ring { opacity: 1; stroke-width: 5; }

/* Presentation attributes can't read custom properties, so colour is set here. */
.orb-bg   { fill: var(--orb-bg, #0A1420); }
.orb-ring { fill: none; stroke: var(--orb, #22D3EE); opacity: 0.55; }
.wave-a, .wave-b { fill: var(--orb, #22D3EE); }

.wave-group, .wave-a, .wave-b { transform-box: view-box; transform-origin: 0 0; }
.wave-group { animation: rise 1.5s cubic-bezier(0.22, 0.9, 0.3, 1) both; }
.wave-a { animation: drift 7s linear infinite; }
.wave-b { animation: drift 4.6s linear infinite reverse; }

@keyframes drift { from { transform: translateX(0); } to { transform: translateX(-100px); } }
@keyframes rise  { from { transform: translateY(150px); } to { transform: translateY(0); } }

@media (prefers-reduced-motion: reduce) {
  .wave-a, .wave-b, .wave-group, .reveal { animation: none !important; }
  * { transition-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
}

@media (max-width: 34rem) {
  .brand { font-size: 1.2rem; }
  .orb { width: 40px; height: 40px; }
  .orb-link span { display: none; }
}

/* ---------- buttons ---------- */
.cta-row { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2.2rem; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.7rem 1.15rem;
  border-radius: 2px;
  font-family: var(--mono);
  font-size: var(--step--1);
  letter-spacing: 0.04em;
  text-decoration: none;
  transition: transform 0.15s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--ink); color: var(--ground); border: 1px solid var(--ink); }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-bright { background: var(--bright); color: var(--bright-ink); border: 1px solid var(--bright); font-weight: 500; }
.btn-outline { background: transparent; color: var(--on-panel); border: 1px solid color-mix(in srgb, var(--on-panel-mut) 45%, transparent); }
.btn-outline:hover { border-color: var(--bright); color: var(--bright); }
.btn[aria-disabled="true"] { opacity: 0.6; pointer-events: none; }

/* ---------- app page hero ---------- */
.hero { padding-block: clamp(3rem, 8vw, 6rem) clamp(3rem, 7vw, 5.5rem); }

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}

@media (max-width: 46rem) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); }
  .hero-art { order: -1; justify-self: start; }
}

.hero h1 { font-size: var(--step-4); line-height: 0.95; margin-top: 0.6rem; }
.hero h1 em { font-style: italic; color: var(--accent); }

.lede { font-size: var(--step-1); line-height: 1.45; color: var(--ink-soft); margin-top: 1.4rem; max-width: 32ch; }

.byline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 1rem;
  margin-top: 2rem;
  font-family: var(--mono);
  font-size: var(--step--1);
  color: var(--muted);
}

.byline strong { font-weight: 500; color: var(--ink); }
.rule-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--faint); }

.hero-art { display: grid; place-items: center; justify-self: end; }
.hero-art .orb { width: clamp(190px, 26vw, 270px); height: auto; filter: drop-shadow(0 18px 34px rgba(10, 20, 32, 0.18)); }
.hero-art-caption { margin-top: 1rem; font-family: var(--mono); font-size: var(--step--1); color: var(--faint); text-align: center; }

/* ---------- sections ---------- */
section { padding-block: clamp(3rem, 7vw, 5.5rem); }
.band-line { border-top: 1px solid var(--line); }
.section-head { margin-bottom: 2.2rem; }
.section-head h2 { font-size: var(--step-3); line-height: 1.05; margin-top: 0.7rem; }
.big-line { margin-top: 1.2rem; font-size: var(--step-1); line-height: 1.5; }
.quiet { margin-top: 1.4rem; color: var(--muted); }

/* ---------- dark screenshot band ---------- */
.panel-band { background: var(--panel); color: var(--on-panel); }
.panel-band .eyebrow { color: var(--on-panel-mut); }
.panel-band h2 { color: var(--on-panel); font-size: var(--step-3); line-height: 1.05; margin-top: 0.8rem; }

.shot-row {
  display: grid;
  grid-template-columns: repeat(var(--shot-cols, 3), minmax(0, 1fr));
  gap: clamp(1rem, 3vw, 2.25rem);
  margin-top: 2.5rem;
}

.shot-row.wide { --shot-cols: 2; }

@media (max-width: 46rem) {
  .shot-row { grid-template-columns: minmax(0, 1fr); max-width: 20rem; margin-inline: auto; }
  .shot-row.wide { max-width: none; }
}

.shot { margin: 0; }
.shot img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--on-panel-mut) 25%, transparent);
}

.shot figcaption { margin-top: 0.9rem; font-family: var(--mono); font-size: var(--step--1); color: var(--on-panel-mut); line-height: 1.5; }
.shot figcaption b { display: block; color: var(--bright); font-weight: 500; letter-spacing: 0.05em; text-transform: uppercase; margin-bottom: 0.3rem; }

/* ---------- hard problems ---------- */
.problems { display: grid; margin-top: 0.5rem; border-top: 1px solid var(--line); }

.problem {
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr);
  gap: clamp(1rem, 4vw, 2.5rem);
  padding-block: 2rem;
  border-bottom: 1px solid var(--line);
}

@media (max-width: 46rem) { .problem { grid-template-columns: minmax(0, 1fr); gap: 0.75rem; } }

.problem-tag { font-family: var(--mono); font-size: var(--step--1); letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); line-height: 1.5; padding-top: 0.35rem; }
.problem h3 { font-size: var(--step-2); line-height: 1.15; margin-bottom: 0.7rem; }
.problem p { color: var(--muted); max-width: 58ch; }
.problem p + p { margin-top: 0.9rem; }

/* ---------- feature grid ---------- */
.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  margin-top: 2rem;
}

.grid-cards > div { background: var(--surface); padding: 1.6rem 1.5rem; }
.grid-cards h3 { font-family: var(--sans); font-size: var(--step-0); font-weight: 600; letter-spacing: 0; margin-bottom: 0.5rem; }
.grid-cards p { font-size: var(--step--1); color: var(--muted); line-height: 1.6; }

/* ---------- stack ---------- */
.stack-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 2rem 2.5rem; margin-top: 1rem; }
.stack-grid h3 { font-family: var(--mono); font-size: var(--step--1); font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); margin-bottom: 0.7rem; }
.stack-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.4rem; }
.stack-grid li { font-size: var(--step--1); color: var(--ink-soft); line-height: 1.5; }

/* ---------- next app / contact band ---------- */
.next { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.5rem; }
.next h2 { font-size: var(--step-3); line-height: 1.05; margin-top: 0.8rem; }
.next p.hire-lede { color: var(--on-panel-mut); margin-top: 1rem; max-width: 42ch; }

footer { padding-block: 2.5rem 3.5rem; font-family: var(--mono); font-size: var(--step--1); color: var(--faint); }
footer .shell { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; }
footer a { color: var(--muted); text-underline-offset: 3px; }

/* ---------- gentle entrance ---------- */
.reveal { animation: up 0.9s cubic-bezier(0.22, 0.9, 0.3, 1) both; }
.reveal.d1 { animation-delay: 0.12s; }
.reveal.d2 { animation-delay: 0.24s; }
.reveal.d3 { animation-delay: 0.36s; }
@keyframes up { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
