@font-face {
  font-family: 'Geist';
  src: url('fonts/geist-latin.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Geist Mono';
  src: url('fonts/geist-mono-latin.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Identity, measured in the Wanderer painting */
  --ciel: #cfd3e2;
  --rocher: #100e13;

  --fond: #eef0f4;
  --surface: #ffffff;
  --texte: var(--rocher);
  --texte-doux: #4f5560;
  --texte-doux-sombre: #a3a9b4;
  --trait: #c9cdd6;
  --trait-sombre: #2f2e36;
  --sur-image: #ffffff;
  --voile: rgb(16 14 19 / 0.36);
  --voile-leger: rgb(16 14 19 / 0.28);

  --type-texte: #4a6a8e;
  --type-nombre: #8a5b2c;
  --type-booleen: #6a5a86;
  --type-date: #85506a;
  --type-json: #2f6670;
  --type-enum: #6e6328;
  --type-relation: #3e6b54;
  --personne-1: #b0482c;
  --personne-2: #2d5fa0;

  --sans: 'Geist', system-ui, sans-serif;
  --mono: 'Geist Mono', ui-monospace, monospace;

  --espace-1: 4px;
  --espace-2: 8px;
  --espace-3: 12px;
  --espace-4: 16px;
  --espace-5: 24px;
  --espace-6: 48px;
  --espace-7: 72px;

  --voix: clamp(2.75rem, 1.6rem + 3.9vw, 4.75rem);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  color-scheme: light;
  scrollbar-color: var(--texte-doux) var(--fond);
}

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

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  color: var(--texte);
  background: var(--fond);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: var(--rocher);
  color: var(--sur-image);
}

a {
  color: inherit;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

code,
pre {
  font-family: var(--mono);
}

h1,
h2,
p,
dl,
dd,
figure,
pre {
  margin: 0;
}

.skip {
  position: absolute;
  left: var(--espace-5);
  top: -100px;
  z-index: 10;
  padding: var(--espace-2) var(--espace-3);
  background: var(--surface);
  color: var(--texte);
}

.skip:focus {
  top: var(--espace-5);
}

/* Paintings: full-bleed, untouched */

.painting {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.painting-wanderer {
  object-position: 50% 30%;
}

/* Primary button: the only pill */

.pill {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 var(--espace-4);
  border-radius: 999px;
  background: var(--sur-image);
  color: var(--rocher);
  font-weight: 500;
  font-size: 13px;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.2s var(--ease-out);
}

.pill:hover {
  background: var(--ciel);
}

.pill:focus-visible {
  outline: 2px solid var(--rocher);
  outline-offset: 0;
}

/* Framed veil panel on a painting */

.frame {
  position: absolute;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: var(--espace-4);
  width: min(340px, calc(100% - 2 * var(--espace-5)));
  padding: 18px 20px 22px;
  border: 1px solid var(--sur-image);
  background: var(--voile);
  color: var(--sur-image);
}

.frame h1,
.frame h2 {
  font-weight: 500;
  font-size: 30px;
  line-height: 1;
  letter-spacing: -0.03em;
}

.frame p {
  font-size: 13px;
  line-height: 1.4;
}

.frame .pill {
  align-self: flex-start;
}

.frame .status {
  margin-top: calc(-1 * var(--espace-2));
}

.credit {
  font-size: 12px;
  line-height: 1.35;
  text-align: right;
}

/* 1. Hero */

.hero {
  position: relative;
  min-height: max(100svh, 640px);
  overflow: hidden;
  background: #33413a;
  color: var(--sur-image);
}

.nav {
  position: absolute;
  z-index: 3;
  left: var(--espace-5);
  right: var(--espace-5);
  top: 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--espace-4);
  font-size: 13px;
}

.nav-links {
  display: flex;
  gap: 28px;
  align-items: center;
}

.nav-links a {
  text-decoration: none;
}

.nav-links a:hover {
  text-decoration: underline;
}

.wordmark {
  font-weight: 500;
  font-size: 15px;
}

.diagram {
  position: absolute;
  z-index: 1;
  right: 9.7vw;
  top: 49.5%;
  width: 500px;
  height: 290px;
}

.wires {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.wires path {
  fill: none;
  stroke: var(--sur-image);
  stroke-width: 1;
}

.wires circle {
  fill: var(--sur-image);
}

.line-node {
  position: absolute;
  border: 1px solid var(--sur-image);
  background: var(--voile-leger);
  font-size: 12px;
}

.line-node-head,
.line-node-row {
  display: flex;
  justify-content: space-between;
  gap: var(--espace-4);
}

.line-node-head {
  padding: var(--espace-2) 10px;
}

.line-node-head span:first-child {
  font-weight: 500;
}

.line-node-row {
  padding: 6px 10px;
  border-top: 1px solid rgb(255 255 255 / 0.6);
  font-family: var(--mono);
  font-size: 11px;
}

.line-node-user {
  left: 0;
  top: 110px;
  width: 200px;
}

.line-node-order {
  left: 320px;
  top: 0;
  width: 180px;
}

.line-node-route {
  left: 320px;
  top: 238px;
  padding: var(--espace-2) 10px;
  font-family: var(--mono);
  font-size: 11px;
}

.frame-hero {
  left: var(--espace-5);
  bottom: var(--espace-5);
}

.credit-hero {
  position: absolute;
  z-index: 2;
  right: var(--espace-5);
  bottom: var(--espace-5);
}

/* 2. Voice and index */

.voice {
  padding: var(--espace-7) var(--espace-5);
  background: var(--surface);
}

.voice-title {
  max-width: 1100px;
  font-weight: 400;
  font-size: var(--voix);
  line-height: 1.08;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.index {
  margin-top: var(--espace-7);
  border-bottom: 1px solid var(--texte);
}

.index-row {
  display: grid;
  grid-template-columns: 240px 1fr 1fr;
  gap: var(--espace-5);
  padding: 20px 0;
  border-top: 1px solid var(--texte);
}

.index-row dt {
  font-weight: 500;
}

.index-detail {
  font-size: 13px;
  color: var(--texte-doux);
}

/* 3. Canvas demo on the sky */

.sky {
  position: relative;
  padding: 80px var(--espace-5);
  background: var(--ciel);
}

.sky-figure {
  display: flex;
  justify-content: center;
}

.sky-caption {
  position: absolute;
  left: var(--espace-5);
  top: var(--espace-5);
  font-size: 13px;
}

.board {
  position: relative;
  width: 1100px;
  max-width: 100%;
  height: 660px;
  overflow: hidden;
  border: 1px solid var(--texte);
  background: var(--fond);
}

.board-bar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 20px;
  height: 40px;
  padding: 0 14px;
  border-bottom: 1px solid var(--trait);
  background: var(--surface);
  font-size: 12px;
}

.board-name {
  font-weight: 500;
}

.board-muted,
.board-tab {
  color: var(--texte-doux);
}

.board-tab {
  display: flex;
  align-items: center;
  align-self: stretch;
}

.board-muted + .board-tab {
  margin-left: var(--espace-4);
}

.board-tab-active {
  color: var(--texte);
  border-bottom: 1px solid var(--texte);
}

.board-people {
  display: inline-flex;
  gap: var(--espace-1);
  margin-left: auto;
}

.person {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  color: var(--sur-image);
  font-family: var(--mono);
  font-size: 10px;
}

.person-1 {
  background: var(--personne-1);
}

.person-2 {
  background: var(--personne-2);
}

.board-export {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 var(--espace-3);
  border-radius: 999px;
  background: var(--texte);
  color: var(--sur-image);
  font-weight: 500;
}

.board-stage {
  position: absolute;
  left: 0;
  top: 40px;
  width: 1100px;
  height: 620px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48'%3E%3Cpath d='M21 24H27M24 21V27' stroke='%23C9CDD6' stroke-width='1'/%3E%3C/svg%3E");
}

.board-wires {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.board-wires path {
  fill: none;
  stroke: var(--type-relation);
  stroke-width: 1;
}

.board-wires circle {
  fill: var(--type-relation);
}

.node {
  position: absolute;
  width: 200px;
  border: 1px solid var(--texte);
  background: var(--surface);
  font-size: 12px;
}

.node-head {
  display: flex;
  justify-content: space-between;
  padding: var(--espace-2) 10px;
}

.node-head span:first-child {
  font-weight: 500;
}

.node-head span:last-child {
  color: var(--texte-doux);
}

.node-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  border-top: 1px solid var(--trait);
  font-family: var(--mono);
  font-size: 11px;
}

.t::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 6px;
  border-radius: 50%;
  background: currentColor;
}

.t-string {
  color: var(--type-texte);
}
.t-number {
  color: var(--type-nombre);
}
.t-boolean {
  color: var(--type-booleen);
}
.t-date {
  color: var(--type-date);
}
.t-json {
  color: var(--type-json);
}
.t-enum {
  color: var(--type-enum);
}

.node-user {
  left: 120px;
  top: 140px;
}

.node-order {
  left: 480px;
  top: 340px;
}

.node-product {
  left: 800px;
  top: 132px;
}

.corners {
  position: absolute;
  left: -7px;
  top: -7px;
  width: 214px;
  height: calc(100% + 14px);
  overflow: visible;
  pointer-events: none;
}

.corners path {
  fill: none;
  stroke: var(--personne-2);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.tag {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 6px;
  color: var(--sur-image);
  font-family: var(--mono);
  font-size: 11px;
  white-space: nowrap;
}

.tag-1 {
  background: var(--personne-1);
}

.tag-2 {
  position: absolute;
  left: -6px;
  top: -30px;
  background: var(--personne-2);
}

.cursor {
  position: absolute;
  left: 600px;
  top: 460px;
}

.cursor svg {
  display: block;
  width: 20px;
  height: 20px;
}

.cursor path {
  stroke: var(--personne-1);
  stroke-width: 1;
}

.cursor .tag {
  margin: 28px 0 0 28px;
}

/* 4. Export on ink */

.ink {
  display: grid;
  grid-template-columns: minmax(0, 640px) minmax(0, 656px);
  justify-content: space-between;
  gap: var(--espace-6);
  padding: var(--espace-7) var(--espace-5);
  background: var(--rocher);
  color: var(--fond);
}

.ink-text {
  display: flex;
  flex-direction: column;
  gap: var(--espace-6);
}

.ink-text p {
  max-width: 420px;
  color: var(--texte-doux-sombre);
}

.ink-code {
  display: flex;
  flex-direction: column;
  gap: var(--espace-6);
}

.code {
  padding: 20px var(--espace-5);
  border: 1px solid var(--fond);
  font-size: 13px;
  line-height: 1.6;
  overflow-x: auto;
}

.code-snippet {
  border-color: var(--trait-sombre);
}

.code-comment {
  color: var(--texte-doux-sombre);
}

.ink ::selection {
  background: var(--fond);
  color: var(--rocher);
}

/* 5. Close on the Monk */

.close {
  position: relative;
  min-height: max(100svh, 640px);
  overflow: hidden;
  background: #3a4250;
  color: var(--sur-image);
}

.frame-close {
  left: var(--espace-5);
  top: var(--espace-5);
}

.footer {
  position: absolute;
  z-index: 2;
  left: var(--espace-5);
  right: var(--espace-5);
  bottom: var(--espace-5);
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: var(--espace-4);
  font-size: 12px;
  line-height: 1.35;
}

.footer a {
  text-decoration: none;
}

.footer a:hover {
  text-decoration: underline;
}

/* Motion: the drawing draws itself once, the cursor drifts */

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }

  .wires path {
    stroke-dasharray: 400;
    stroke-dashoffset: 0;
    animation: draw 1.4s var(--ease-out) 0.3s backwards;
  }

  .wires circle {
    animation: appear 0.6s var(--ease-out) 0.2s backwards;
  }

  .cursor {
    animation: drift 7s ease-in-out infinite alternate;
  }
}

@keyframes draw {
  from {
    stroke-dashoffset: 400;
  }
}

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

@keyframes drift {
  to {
    transform: translate(46px, -18px);
  }
}

/* Desktop: the comp's section heights and offsets */

@media (min-width: 1041px) {
  .voice {
    min-height: 760px;
  }

  .ink {
    min-height: 720px;
    align-items: start;
  }

  .ink-text {
    gap: 94px;
  }

  .ink-code {
    gap: 130px;
  }
}

/* Mid widths: the hero drawing shrinks, the board scrolls in place */

@media (max-width: 1180px) {
  .board {
    overflow-x: auto;
  }
}

@media (max-width: 1040px) {
  .diagram {
    right: var(--espace-5);
  }

  .ink {
    grid-template-columns: 1fr;
  }
}

/* Small screens */

@media (max-width: 760px) {
  .nav-links a:not(.wordmark) {
    display: none;
  }

  .diagram {
    top: 96px;
    right: var(--espace-5);
    width: 200px;
    height: auto;
    display: flex;
    flex-direction: column;
  }

  .wires,
  .line-node-route {
    display: none;
  }

  .line-node {
    position: relative;
    left: auto;
    top: auto;
    width: 100%;
  }

  .line-node-order {
    margin-top: 40px;
    margin-left: 40px;
    width: calc(100% - 40px);
  }

  .line-node-order::before {
    content: '';
    position: absolute;
    left: 40px;
    top: -41px;
    height: 40px;
    border-left: 1px solid var(--sur-image);
  }

  .frame-hero {
    bottom: 84px;
  }

  .credit-hero {
    left: var(--espace-5);
    right: auto;
    text-align: left;
  }

  .index-row {
    grid-template-columns: 1fr;
    gap: var(--espace-1);
  }

  .sky {
    padding: 64px var(--espace-4) var(--espace-6);
  }

  .sky-caption {
    left: var(--espace-4);
  }

  .board {
    height: auto;
    overflow: hidden;
  }

  .board-bar {
    gap: var(--espace-3);
  }

  .board-muted {
    display: none;
  }

  .board-stage {
    position: relative;
    top: 0;
    width: auto;
    height: auto;
    display: flex;
    flex-direction: column;
    gap: 44px;
    padding: var(--espace-6) var(--espace-5);
  }

  .board-wires {
    display: none;
  }

  .node-user {
    order: 1;
  }
  .node-order {
    order: 3;
  }
  .node-product {
    order: 4;
  }

  .cursor {
    order: 2;
    position: relative;
    left: auto;
    top: 22px;
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
    gap: 6px;
    align-self: flex-end;
    height: 0;
    margin: -44px var(--espace-6) 0 0;
  }

  .cursor .tag {
    margin: 0;
  }

  .node {
    position: relative;
    left: auto;
    top: auto;
    width: 100%;
  }

  .node + .node::before {
    content: '';
    position: absolute;
    left: 24px;
    top: -45px;
    height: 44px;
    border-left: 1px solid var(--type-relation);
  }

  .corners {
    width: calc(100% + 14px);
  }

  .tag-2 {
    top: auto;
    bottom: calc(100% + 8px);
    left: auto;
    right: -6px;
  }

  .ink {
    padding: var(--espace-6) var(--espace-5);
  }

  .footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .footer .credit {
    text-align: left;
  }
}

/* Charter: white text on a painting always sits on the veil */

.nav-links,
.credit-hero,
.footer p {
  padding: 6px 10px;
  background: var(--voile);
}

.nav {
  left: calc(var(--espace-5) - 10px);
}
