/* ──────────────────────────────────────────────────────────
   wemakethings — horizon
   One large drawing on white paper; the page sits lightly on top.
   ────────────────────────────────────────────────────────── */

:root {
  --white: #fbfaf8;
  --paper: #fbfaf8;
  --ink: #1e1e1e;
  --ink-2: #4c4b48;
  --ink-3: #8f8d88;
  --rule: rgba(30, 30, 30, 0.12);
  --red: #e8384f;
  --line: rgba(30, 30, 30, 0.22);
  color-scheme: light;

  --display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --sans: "Instrument Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --hand: "Reenie Beanie", "Bradley Hand", cursive;

  --gutter: clamp(20px, 4vw, 56px);
  --ease: cubic-bezier(.2, .7, .1, 1);
  interpolate-size: allow-keywords;
}

/* dark: the same drawing on a charcoal sheet, in light pencil */
:root[data-theme="dark"] {
  --white: #151517;
  --paper: #151517;
  --ink: #ece8e1;
  --ink-2: #b8b3aa;
  --ink-3: #7f7b74;
  --rule: rgba(236, 232, 225, 0.14);
  --red: #ff5c70;
  --line: rgba(236, 232, 225, 0.24);
  color-scheme: dark;
}
html { background: var(--white); }
/* changing theme: a slow crossfade of the whole page (view transitions), or, where
   those aren't supported, the colours easing across */
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 1.1s; animation-timing-function: cubic-bezier(.4, 0, .2, 1); }
@supports not (view-transition-name: none) {
  html, body { transition: background-color .9s ease, color .9s ease; }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }

body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
::selection { background: #f7a8b8; color: var(--ink); }
:focus-visible { outline: 1.5px solid var(--red); outline-offset: 3px; }

.skip { position: absolute; left: 12px; top: -40px; z-index: 300; background: var(--ink); color: var(--white); padding: 8px 12px; font-size: 13px; text-decoration: none; }
.skip:focus { top: 12px; }
.wrap { max-width: 1320px; margin: 0 auto; padding: 0 var(--gutter); }
.hand { font-family: var(--hand); font-weight: 400; letter-spacing: 0.01em; }

#drawing { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 0; pointer-events: none; }
main, .closing, .nav { position: relative; z-index: 1; }

/* ─────────── nav ─────────── */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 80;
  display: flex; justify-content: space-between; align-items: center;
  padding: 22px var(--gutter);
  font-size: 14px;
  transition: transform .5s var(--ease);
}
.nav a { text-decoration: none; }
.mark { font-weight: 500; letter-spacing: -0.01em; }
.nav nav { display: flex; gap: 28px; }
.nav nav a { color: var(--ink-2); transition: color .2s; }
.nav nav a:hover, .nav nav a.active { color: var(--ink); }
.theme-toggle { background: none; border: 0; padding: 0; font: inherit; color: var(--ink-2); cursor: pointer; transition: color .2s; }
.theme-toggle:hover { color: var(--ink); }
/* the top hand behind "connect with us" can be picked up */
body.hand-hover { cursor: grab; }
body.hand-drag, body.hand-drag * { cursor: grabbing !important; user-select: none; -webkit-user-select: none; }
@media (max-width: 760px) {
  .nav { font-size: 13px; }
  .nav nav { gap: 16px; }
}

/* ─────────── sheet corners, like annotations at the edge of a drawing ─────────── */
.sheet { position: relative; }
.corner { position: absolute; font-size: 17px; color: var(--ink-2); pointer-events: none; }
.corner.tr { top: 76px; right: var(--gutter); display: flex; gap: 14px; align-items: baseline; pointer-events: auto; }
.redraw {
  background: none; border: 0; padding: 0; margin-left: 6px;
  font-size: inherit; color: var(--ink); cursor: pointer;
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px;
  transition: color .2s;
}
.redraw:hover { color: var(--red); }
.corner.br { bottom: 28px; right: var(--gutter); }

/* ─────────── hero ─────────── */
.hero { height: 100svh; min-height: 640px; }
.hero-type { position: absolute; left: var(--gutter); bottom: clamp(32px, 7vh, 72px); max-width: 560px; }
.big { margin: 0; font: 340 clamp(64px, 8.6vw, 140px)/0.86 var(--display); letter-spacing: -0.035em; }
.big em { font-style: italic; }
.big .rise { display: inline-block; }
.hero-lede { font: 16px/1.5 var(--serif); color: var(--ink-2); max-width: 34ch; margin: 22px 0 22px; }
.legend { display: flex; flex-direction: column; font-size: 19px; line-height: 1.05; color: var(--ink-2); list-style: none; margin: 0; padding: 0; }
.legend .roman, .roman { font-size: 22px; text-decoration: underline; text-underline-offset: 3px; color: var(--ink); }
.rise { animation: rise 1.4s var(--ease) both; }
.big .rise:nth-child(2) { animation-delay: .12s; }
.hero-lede.rise { animation-delay: .3s; }
.legend.rise { animation-delay: .45s; }
@keyframes rise { from { opacity: 0; transform: translateY(24px); } }
@media (max-width: 760px) {
  .hero-type { right: var(--gutter); background: color-mix(in srgb, var(--white) 88%, transparent); padding: 8px 0; }
  .corner.tr { top: 64px; font-size: 16px; }
}

/* ─────────── contents ─────────── */
.contents { padding: clamp(96px, 16vh, 180px) 0; }
.kicker { font-size: 24px; color: var(--ink-2); margin: 0 0 18px; }
.toc { list-style: none; margin: 0; padding: 0; max-width: 820px; }
.toc li { border-bottom: 1px solid var(--rule); }
.toc a {
  display: grid; grid-template-columns: 48px minmax(0, 1fr) minmax(0, 1.3fr) 88px;
  align-items: baseline; gap: 16px;
  padding: 18px 0; text-decoration: none;
  transition: opacity .35s, padding .5s var(--ease);
}
.toc:hover a { opacity: .3; }
.toc a:hover { opacity: 1; padding-left: 10px; }
.toc .n { font-size: 22px; color: var(--ink-3); }
.toc .t { font: 340 clamp(34px, 4vw, 54px)/1 var(--display); letter-spacing: -0.035em; }
.toc .d { font: italic 17px/1.3 var(--serif); color: var(--ink-2); }
.toc .s { font-size: 12px; color: var(--ink-3); text-align: right; }
@media (max-width: 760px) {
  .toc a { grid-template-columns: 34px 1fr auto; }
  .toc .d { grid-column: 2 / -1; }
}

/* ─────────── positions (one per project) ─────────── */
.pos { min-height: 150vh; padding: 22vh 0 18vh; }
.pos-wrap { display: flex; }
.pos[data-side="left"] .pos-wrap { justify-content: flex-end; }
.pos-text {
  width: min(460px, 100%);
  background: color-mix(in srgb, var(--white) 86%, transparent);
  padding: 8px 0;
}
.pos h2 { margin: 4px 0 16px; font: 340 clamp(48px, 4.8vw, 72px)/0.95 var(--display); letter-spacing: -0.035em; }
.lede { font: 18px/1.55 var(--serif); margin: 0 0 22px; }
.lede i { font-style: italic; }
.pos .legend { margin: 0 0 24px; }
.links { display: flex; align-items: baseline; gap: 18px; margin: 0 0 28px; font-size: 13px; }
.status { color: var(--ink-3); }
.link { font-size: 14px; font-weight: 500; text-decoration: none; border-bottom: 1px solid currentColor; padding-bottom: 2px; transition: opacity .2s; }
.link:hover { opacity: .5; }
@media (max-width: 760px) {
  .pos { padding-top: 62vh; min-height: 0; }
  main > .pos:last-child { padding-bottom: 80vh; }   /* room for the interlude after the last project */
  .pos[data-side="left"] .pos-wrap { justify-content: flex-start; }
}

.try { border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.try summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; padding: 14px 0; font-size: 14px; }
.try summary::-webkit-details-marker { display: none; }
.try summary span { font-size: 18px; font-weight: 300; transition: transform .5s var(--ease); }
.try[open] summary span { transform: rotate(45deg); }
.try::details-content { height: 0; overflow: clip; transition: height .7s var(--ease), content-visibility .7s allow-discrete; }
.try[open]::details-content { height: auto; }
.try-body { padding: 8px 0 28px; }

.reveal { opacity: 0; transform: translateY(24px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ─────────── plates: each project, annotated ─────────── */
.plate-wrap { display: flex; justify-content: center; padding-top: 14vh; }
.plate { margin: 0; width: min(720px, 56vw); position: relative; }
.plate.tall { width: min(300px, 70vw); }
@property --lens { syntax: "<length>"; inherits: true; initial-value: 0px; }
.plate-frame {
  --lens: 0px; --mx: 50%; --my: 50%;
  position: relative; cursor: zoom-in;
  transition: --lens .6s var(--ease);
}
.plate-frame img { display: block; width: 100%; height: auto; border-radius: 3px; }
.plate-frame .sketch { outline: 1px solid var(--line); outline-offset: 6px; }
/* the pencil sketches are on white paper: in the dark, turn them to light pencil on charcoal, keeping their hues */
:root[data-theme="dark"] .plate-frame .sketch { filter: invert(0.92) hue-rotate(180deg) saturate(1.2); }
/* the real app, revealed through a soft lens that follows the pointer */
.plate-frame .photo {
  position: absolute; inset: 0; height: 100%;
  -webkit-mask-image: radial-gradient(circle var(--lens) at var(--mx) var(--my), #000 72%, transparent 100%);
          mask-image: radial-gradient(circle var(--lens) at var(--mx) var(--my), #000 72%, transparent 100%);
}
.plate-frame:hover { --lens: 130px; }
.plate-frame.open { --lens: 2400px; cursor: zoom-out; }
.plate.tall .plate-frame img { border-radius: 24px; }
.plate.tall .plate-frame .sketch { outline-offset: 8px; border-radius: 24px; }
.lens-hint { color: var(--ink-3); }
.plate svg.notes { position: absolute; inset: 0; overflow: visible; pointer-events: none; }
.plate .lead { fill: none; stroke: var(--red); stroke-width: 1.1; stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1.2s var(--ease) var(--d); }
.plate .dot { fill: rgba(232,56,79,.2); stroke: var(--red); stroke-width: 1.2; transform-box: fill-box; transform-origin: center; transform: scale(0); transition: transform .5s var(--ease) var(--d); }
.plate .label { font: 21px var(--hand); fill: var(--ink); opacity: 0; transition: opacity .7s ease calc(var(--d) + .7s); }
.plate .num { font: 16px var(--hand); fill: var(--red); opacity: 0; transition: opacity .5s ease var(--d); }
.plate.drawn .lead { stroke-dashoffset: 0; }
.plate.drawn .dot { transform: scale(1); }
.plate.drawn .label, .plate.drawn .num { opacity: 1; }
.plate figcaption { font-size: 20px; color: var(--ink-2); margin-top: 12px; }
.notes-list { display: none; }
@media (max-width: 900px) {
  .plate { width: 100%; }
  .plate-frame:hover { --lens: 0px; }
  .plate-frame.open { --lens: 2400px; }
  .plate.tall { width: min(300px, 80vw); }
  .plate .label, .plate .lead { display: none; }
  .plate .num { font-size: 18px; }
  .notes-list { display: block; margin: 12px 0 0; padding-left: 1.4em; font-size: 19px; line-height: 1.15; color: var(--ink-2); }
  .notes-list li::marker { color: var(--red); }
}
@media (prefers-reduced-motion: reduce) {
  .plate .lead { stroke-dashoffset: 0; transition: none; }
  .plate .dot { transform: none; transition: none; }
  .plate .label, .plate .num { opacity: 1; transition: none; }
}

/* ─────────── where the horizon ends ─────────── */
.closing { min-height: 140vh; padding: 24vh 0 32px; }
/* the footer sits well below the email, leaving the lower hand room to show */
.closing-wrap { min-height: calc(140vh - 24vh - 32px); display: flex; flex-direction: column; justify-content: flex-end; gap: clamp(120px, 30vh, 320px); }
.closing-text { max-width: none; }
.hello {
  display: inline-block; text-decoration: none;
  font: 340 clamp(24px, 7.2vw, 96px)/1 var(--display); letter-spacing: -0.035em; white-space: nowrap;
  transition: color .3s;
}
.hello:hover { color: var(--red); }
.sign { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; }
.signature { font-size: 30px; margin: 0; color: var(--ink-2); }
.sign-right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.credit { margin: 0; font-size: 22px; color: var(--ink-3); }
.credit a { color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; transition: color .2s; }
.credit a:hover { color: var(--red); }
@media (max-width: 760px) {
  .sign { flex-direction: column; align-items: flex-start; }
  .sign-right { align-items: flex-start; }
  .sign > .legend { display: none; }            /* decorative, and it would run into the hand above */
  .closing-wrap { gap: calc(24px + 34vw); }     /* the footer sits below the lower hand */
  .signature { font-size: 26px; }
}

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; }
  .rise { animation: none; }
}

/* ─────────── figures ─────────── */
figcaption { color: var(--ink-3); padding-top: 4px; }
.try figcaption { font: 12px/1.5 var(--sans); letter-spacing: 0; }
figcaption b { font-weight: 500; color: var(--ink); margin-right: 8px; }
.fig { position: relative; margin: 0; }
.fig figcaption { margin-top: 10px; }
/* a real app, playable in the page, in a phone-shaped frame */
.phone {
  width: min(340px, 100%); aspect-ratio: 9 / 18.5; margin: 8px auto 6px;
  border: 1.5px solid var(--line); border-radius: 36px; padding: 8px;
  background: var(--white);
}
.phone iframe { display: block; width: 100%; height: 100%; border: 0; border-radius: 28px; background: #111; }

