/* giorgi.uk
   One stylesheet for the whole site. Colours come from my sketches:
   biro blue for links and diagrams, highlighter yellow for the odd mark,
   black ink on slightly warm paper. */

:root {
  --paper: #fbfbf8;
  --paper-2: #f3f3ee;
  --paper-3: #e8e8e1;
  --ink: #16181b;
  --ink-2: #3c4047;
  --ink-3: #686d75;
  --rule: #dfdfd8;
  --rule-2: #c8c9c1;
  --blue: #2440d0;
  --blue-2: #1a2f9e;
  --blue-soft: #e9edfc;
  --hl: #ffe25e;
  --hl-ink: #16181b;
  --dot: #d6d7cf;
  --good: #23784a;
  --bad: #c2382b;
  --code-bg: #f1f1ec;

  --sans: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

  --wrap: 1440px;
  --gutter: clamp(24px, 3.6vw, 56px);
  --nav-h: 64px;

  /* the cube: hue and saturation here, the lightness of each face comes from site.js */
  --cube-h: 230;
  --cube-s: 74%;

  --out: cubic-bezier(.2, .7, .2, 1);
  --spring: cubic-bezier(.3, 1.5, .5, 1);
  color-scheme: light;
}

html[data-theme="dark"] {
  --paper: #121417;
  --paper-2: #1a1d21;
  --paper-3: #242830;
  --ink: #ecebe6;
  --ink-2: #c4c5c0;
  --ink-3: #8e9299;
  --rule: #2c3036;
  --rule-2: #3e434b;
  --blue: #93a6ff;
  --blue-2: #b9c5ff;
  --blue-soft: #1c2342;
  --hl: #5a4f12;
  --hl-ink: #fff4bd;
  --dot: #2a2e34;
  --good: #72c995;
  --bad: #f2897c;
  --code-bg: #1d2025;
  --cube-s: 84%;
  color-scheme: dark;
}

/* ---------- base ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--nav-h) + 24px);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink-2);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.62;
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img, svg, video, iframe { display: block; max-width: 100%; }
img { height: auto; }

h1, h2, h3, h4 {
  margin: 0;
  color: var(--ink);
  font-family: var(--sans);
  font-stretch: 88%;
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.018em;
  text-wrap: balance;
}

p { margin: 0 0 1em; text-wrap: pretty; }
strong, b { color: var(--ink); font-weight: 650; }
small { font-size: 0.85em; }

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}
a:hover { color: var(--blue); }

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
  border-radius: 2px;
}
main:focus, [tabindex="-1"]:focus { outline: none; }

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

code, kbd, samp, .mono {
  font-family: var(--mono);
  font-size: 0.86em;
}
:not(pre) > code {
  padding: 0.08em 0.36em;
  border-radius: 4px;
  background: var(--code-bg);
  color: var(--ink);
}

hr { border: 0; border-top: 1px solid var(--rule); margin: 48px 0; }

.nowrap { white-space: nowrap; }
math { font-family: "Cambria Math", "STIX Two Math", "Latin Modern Math", math; }
.p-sec math:not([display]) { font-size: 1.08em; }

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.skip-link {
  position: fixed;
  top: 12px; left: 12px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 6px;
  background: var(--ink);
  color: var(--paper);
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-160%);
}
.skip-link:focus { transform: none; color: var(--paper); }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* A highlighter swipe over the lower part of a phrase, like in my notes. */
.hl {
  background: linear-gradient(transparent 52%, var(--hl) 52%, var(--hl) 92%, transparent 92%);
  color: inherit;
  padding: 0 0.08em;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
html[data-theme="dark"] .hl { color: var(--hl-ink); }

/* The dotted paper my iPad sketches are drawn on. */
.dots {
  background-color: var(--paper-2);
  background-image: radial-gradient(circle, var(--dot) 1.1px, transparent 1.4px);
  background-size: 18px 18px;
  background-position: 9px 9px;
}

.label {
  margin: 0;
  color: var(--ink-3);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
}

.arrow-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  color: var(--ink);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--rule-2);
}
.arrow-link:hover { color: var(--blue); text-decoration-color: currentColor; }
.arrow-link .arr { display: inline-block; transition: transform 0.18s ease; }
.arrow-link:hover .arr { transform: translateX(3px); }
.arrow-link:hover .arr.down { transform: translateY(3px); }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 20px;
  border: 1px solid var(--blue);
  border-radius: 8px;
  background: var(--blue);
  color: #fff;
  font: 600 16px/1 var(--sans);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.25s ease, transform 0.25s var(--out);
}
.button:hover {
  background: var(--blue-2);
  border-color: var(--blue-2);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 10px 22px -12px color-mix(in srgb, var(--blue) 80%, transparent);
}
.button:active { transform: translateY(0) scale(0.98); box-shadow: none; transition-duration: 0.08s; }
.button.ghost:hover { box-shadow: 0 10px 22px -16px rgba(20, 22, 26, 0.4); }
html[data-theme="dark"] .button { color: #0e1222; }
html[data-theme="dark"] .button:hover { color: #0e1222; }
html[data-theme="dark"] .button.ghost, html[data-theme="dark"] .button.ghost:hover { color: var(--ink); }
.button.ghost { background: transparent; border-color: var(--rule-2); color: var(--ink); }
.button.ghost:hover { border-color: var(--ink); color: var(--ink); background: transparent; }

/* ---------- navigation ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}
/* After you scroll a bit the bar turns into frosted glass (site.js adds .is-stuck). */
.nav.is-stuck {
  background: color-mix(in srgb, var(--paper) 80%, transparent);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: 0 12px 30px -28px rgba(20, 22, 26, 0.6);
}
/* How far through a write-up you are. Only on the project pages. */
.nav-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: var(--blue);
  transform: scaleX(var(--read, 0));
  transform-origin: 0 50%;
  pointer-events: none;
}
.nav-inner {
  position: relative;
  display: flex;
  align-items: center;
  gap: 28px;
  height: var(--nav-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  margin-right: auto;
  color: var(--ink);
  font-size: 17px;
  font-weight: 700;
  font-stretch: 88%;
  letter-spacing: -0.01em;
  text-decoration: none;
  white-space: nowrap;
}
.brand:hover { color: var(--ink); }
.brand .cube-scene { --s: 16px; margin: 0 -2px 0 -4px; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}
.nav-links a,
.nav-work > a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 7px;
  color: var(--ink-2);
  font-size: 15.5px;
  font-weight: 500;
  text-decoration: none;
}
.nav-links a:hover { color: var(--ink); background: var(--paper-2); }
.nav-links a.active,
.nav-links a[aria-current="page"] { color: var(--ink); }
.nav-links > a.active::after,
.nav-work > a.active::after {
  content: "";
  width: 5px; height: 5px;
  margin-left: 7px;
  border-radius: 50%;
  background: var(--blue);
}

.nav-work { position: relative; display: flex; align-items: center; }
.nav-work > a { padding-right: 4px; }
.work-toggle {
  display: grid;
  place-items: center;
  width: 28px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ink-3);
  cursor: pointer;
}
.work-toggle:hover { color: var(--ink); background: var(--paper-2); }
.work-toggle svg { transition: transform 0.18s ease; }
.work-open .work-toggle svg { transform: rotate(180deg); }

.work-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: -8px;
  width: 280px;
  padding: 8px;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: var(--paper);
  box-shadow: 0 12px 32px -12px rgba(20, 22, 26, 0.22);
  visibility: hidden;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0s linear 0.15s;
}
.work-dropdown::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: -10px;
  height: 10px;
}
.work-open .work-dropdown {
  visibility: visible;
  opacity: 1;
  transform: none;
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0s;
}
@media (hover: hover) and (min-width: 821px) {
  .nav-work:hover .work-dropdown {
    visibility: visible;
    opacity: 1;
    transform: none;
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0s;
  }
}
.work-dropdown a {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: 12px;
  width: 100%;
  min-height: 42px;
  padding: 9px 10px;
  border-radius: 6px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 500;
}
.work-dropdown a span { color: var(--ink-3); font-size: 13px; font-weight: 400; }
.work-dropdown a:hover { background: var(--paper-2); color: var(--blue); }
.work-dropdown a[aria-current="page"] { background: var(--blue-soft); color: var(--blue); }
.work-dropdown .all { border-top: 1px solid var(--rule); border-radius: 0 0 6px 6px; margin-top: 6px; color: var(--ink-2); }

.theme-toggle {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--rule);
  border-radius: 50%;
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.theme-toggle:hover { color: var(--ink); border-color: var(--rule-2); }
.theme-toggle svg { width: 18px; height: 18px; transition: transform 0.35s ease; }
html[data-theme="dark"] .theme-toggle svg { transform: rotate(180deg); }

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  place-items: center;
}
.nav-toggle span {
  display: block;
  width: 18px;
  height: 1.6px;
  border-radius: 2px;
  background: currentColor;
  transition: transform 0.2s ease, opacity 0.15s ease;
}
.nav-toggle span + span { margin-top: 4.5px; }
.nav.menu-open .nav-toggle span:nth-child(1) { transform: translateY(6.1px) rotate(45deg); }
.nav.menu-open .nav-toggle span:nth-child(2) { opacity: 0; }
.nav.menu-open .nav-toggle span:nth-child(3) { transform: translateY(-6.1px) rotate(-45deg); }

/* The bouncing ball under the nav (drawn by site.js on wide screens). */
.nav-ball, .nav-ball-shadow, .nav-trail {
  position: absolute;
  left: 0;
  top: 0;
  pointer-events: none;
  will-change: transform, opacity;
}
.nav-ball {
  z-index: 2;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, color-mix(in srgb, #fff 60%, var(--blue)) 0 16%, var(--blue) 58%);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 14%, transparent), 0 2px 6px -1px color-mix(in srgb, var(--blue) 45%, transparent);
  transform-origin: 50% 100%;
  opacity: 0;
}
.nav-trail { z-index: 1; width: 6px; height: 6px; border-radius: 50%; background: var(--blue); opacity: 0; }
.nav-trail.t2 { width: 5px; height: 5px; }
.nav-trail.t3 { width: 4px; height: 4px; }
.nav-ball-shadow { width: 14px; height: 3px; border-radius: 50%; background: var(--ink); opacity: 0; }
@media (min-width: 821px) {
  .nav.has-ball .nav-links > a.active::after,
  .nav.has-ball .nav-work > a.active::after { display: none; }
}
@media (max-width: 820px) {
  .nav-ball, .nav-ball-shadow, .nav-trail { display: none; }
}

/* ---------- footer ---------- */

.footer {
  margin-top: 96px;
  border-top: 1px solid var(--rule);
  color: var(--ink-3);
  font-size: 14.5px;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 32px;
  padding-top: 26px;
  padding-bottom: 34px;
}
.footer p { margin: 0; }
.footer a { color: var(--ink-2); }
.footer a:hover { color: var(--blue); }

/* ---------- home ---------- */

/* The opening screen fills the window, so the projects only appear once you scroll. */
.hero {
  position: relative;
  display: grid;
  align-items: center;
  min-height: calc(100vh - var(--nav-h));
  min-height: calc(100svh - var(--nav-h));
  padding: 56px 0 88px;
}
.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
  gap: 72px;
  align-items: center;
}
.hero-title {
  margin: 0 0 28px;
  font-size: clamp(46px, 6.6vw, 94px);
  font-stretch: 85%;
  font-weight: 760;
  line-height: 0.96;
  letter-spacing: -0.035em;
}
/* My name sits above the big line, small, with a blue dash in front. */
.hero-name {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
  color: var(--ink-2);
  font-size: 16px;
  font-stretch: 100%;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.005em;
}
.hero-name::before {
  content: "";
  width: 22px;
  height: 2px;
  border-radius: 2px;
  background: var(--blue);
}
.hero-name small { color: var(--ink-3); font-size: 1em; font-weight: 400; }
/* Each line slides up from behind its own edge when the page loads. */
.hero-title .line { display: block; overflow: clip; padding-bottom: 0.08em; margin-bottom: -0.08em; }
.hero-title .line > span { display: block; }
.hero-lede {
  max-width: 34em;
  margin: 0 0 34px;
  color: var(--ink-2);
  font-size: clamp(18px, 1.55vw, 20.5px);
  line-height: 1.6;
}
.hero-links { display: flex; flex-wrap: wrap; gap: 12px; }
/* Load-in for the opening screen. Only with JS on (the head script adds .js),
   so nothing is ever stuck invisible. */
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes lineUp { from { transform: translateY(108%); } to { transform: none; } }
.js .hero-title .line > span { animation: lineUp 0.9s cubic-bezier(.16, 1, .3, 1) 0.05s both; }
.js .hero-title .line + .line > span { animation-delay: 0.14s; }
.js .hero-lede,
.js .hero-links,
.js .now { animation: rise 0.8s var(--out) 0.3s both; }

.now {
  position: relative;
  padding: 26px 28px 20px;
  border: 1px solid var(--rule);
  border-radius: 16px;
  background: var(--paper);
  box-shadow: 0 1px 2px rgba(20, 22, 26, 0.04), 0 18px 40px -28px rgba(20, 22, 26, 0.28);
}
.now-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 16px;
}
.now-head h2 { font-size: 19px; letter-spacing: -0.01em; }
.now-head time { color: var(--ink-3); font-size: 14px; }
.now ul { margin: 0; padding: 0; list-style: none; }
.now li {
  position: relative;
  padding: 13px 0 13px 24px;
  border-top: 1px solid var(--rule);
  font-size: 16px;
  line-height: 1.5;
}
.now li::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 21px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--blue);
}
.now li a { color: var(--ink); text-decoration-color: var(--rule-2); }
.now li a:hover { color: var(--blue); }

.section { padding-top: 112px; }
.section-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 48px;
  align-items: end;
  position: relative;
  margin-bottom: 44px;
  padding-bottom: 20px;
}
/* The line under each heading draws itself in from the left. */
.section-head::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--ink);
  transform-origin: 0 50%;
  transition: transform 1.3s cubic-bezier(.65, 0, .15, 1) 0.15s;
}
.section-head.will-reveal:not(.is-in)::after { transform: scaleX(0); }
.section-head h2 { font-size: clamp(34px, 4vw, 52px); letter-spacing: -0.03em; }
.section-head p { max-width: 36em; margin: 0 0 4px; justify-self: end; color: var(--ink-3); font-size: 16px; }

.project {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr);
  gap: 56px;
  align-items: center;
  padding: 40px 0;
}
.project + .project { border-top: 1px solid var(--rule); }
.project:nth-of-type(even) .project-media { order: 2; }

.project-media {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 5 / 4;
  border-radius: 12px;
  overflow: hidden;
  color: inherit;
  text-decoration: none;
}
.project-media picture { display: contents; }
.project-media img.main {
  position: absolute;
  top: 7%;
  left: 50%;
  width: auto;
  height: 86%;
  max-width: none;
  transform: translateX(-50%);
  transition: transform 0.35s ease;
}
.project-media:hover img.main { transform: translateX(-50%) scale(1.025); }
.project-media img.main.print {
  top: 8%;
  height: 84%;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 18px 36px -22px rgba(20, 22, 26, 0.55), 0 0 0 1px rgba(20, 22, 26, 0.06);
  transform: translateX(-50%) rotate(1.2deg);
}
.project-media:hover img.main.print { transform: translateX(-50%) rotate(0deg) scale(1.02); }
.project-media .inset {
  position: absolute;
  left: 5%;
  bottom: 6%;
  width: 34%;
  margin: 0;
  padding: 6px 6px 4px;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--paper);
  box-shadow: 0 10px 24px -14px rgba(20, 22, 26, 0.45);
  transform: rotate(-2.5deg);
}
.project-media .inset.right { left: auto; right: 5%; transform: rotate(2deg); }
.project-media .inset img { width: 100%; border-radius: 3px; background: #fff; }
.project-media .inset figcaption { padding: 5px 2px 1px; color: var(--ink-3); font-size: 11.5px; line-height: 1.3; }

.phone-shot {
  width: 40%;
  max-width: 230px;
  border: 7px solid #0b0c0e;
  border-radius: 30px;
  background: #0b0c0e;
  box-shadow: 0 22px 40px -22px rgba(0, 0, 0, 0.55);
}
.phone-shot img { width: 100%; border-radius: 23px; }

.project-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin-bottom: 12px;
  color: var(--ink-3);
  font-size: 15px;
}
.project-meta .year { color: var(--blue); font-weight: 650; }
.project h3 { font-size: clamp(28px, 3vw, 40px); letter-spacing: -0.025em; margin-bottom: 14px; }
.project h3 a { text-decoration: none; }
.project h3 a:hover { color: var(--blue); }
.project-text > p { max-width: 38em; }
.tools {
  display: flex;
  flex-wrap: wrap;
  margin: 16px 0 18px;
  padding: 0;
  list-style: none;
  color: var(--ink-3);
  font-size: 14.5px;
  line-height: 1.6;
}
.tools li + li::before { content: "\00b7"; margin: 0 9px; color: var(--rule-2); }

.pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  margin-top: 24px;
  padding-top: 40px;
  border-top: 1px solid var(--rule);
}
.card {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.card-media {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 10;
  margin-bottom: 22px;
  border-radius: 12px;
  overflow: hidden;
  color: var(--ink);
  text-decoration: none;
}
.card-media img {
  position: absolute;
  top: 9%;
  left: 50%;
  width: auto;
  height: 82%;
  max-width: none;
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 12px 28px -16px rgba(20, 22, 26, 0.5);
  transform: translateX(-50%) rotate(-1.5deg);
  transition: transform 0.35s ease;
}
.card-media:hover img { transform: translateX(-50%) rotate(0deg) scale(1.02); }
.card-media svg { width: 74%; height: auto; }
.card h3 { font-size: clamp(25px, 2.4vw, 32px); margin-bottom: 12px; letter-spacing: -0.02em; }
.card h3 a { text-decoration: none; }
.card h3 a:hover { color: var(--blue); }
.card p { max-width: 40em; }
.card .arrow-link { margin-top: auto; align-self: flex-start; }

.about {
  display: grid;
  grid-template-columns: minmax(0, 360px) minmax(0, 1fr);
  gap: 72px;
  align-items: start;
}
/* The photo is a print taped to the page, slightly wonky. It straightens up on hover. */
.about-photo {
  position: sticky;
  top: calc(var(--nav-h) + 44px);
  margin: 0;
  padding: 10px 10px 12px;
  border-radius: 3px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(20, 22, 26, 0.08), 0 24px 46px -28px rgba(20, 22, 26, 0.5);
  rotate: -1.8deg;
  transition: rotate 0.7s var(--spring), translate 0.7s var(--spring), box-shadow 0.4s ease;
}
.about-photo:hover { rotate: 0deg; translate: 0 -4px; box-shadow: 0 1px 2px rgba(20, 22, 26, 0.08), 0 34px 60px -30px rgba(20, 22, 26, 0.5); }
.about-photo::before {
  content: "";
  position: absolute;
  z-index: 1;
  top: -13px;
  left: 50%;
  width: 96px;
  height: 26px;
  translate: -50% 0;
  rotate: 3deg;
  background: rgba(255, 226, 94, 0.55);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}
html[data-theme="dark"] .about-photo { background: #ecebe5; }
.about-photo img { width: 100%; border-radius: 2px; }
.about-photo figcaption { margin-top: 10px; color: var(--ink-3); font-size: 14px; }
.about-text { max-width: 46em; }
.about-text > p { font-size: 18.5px; line-height: 1.65; }
.facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 32px;
  margin: 32px 0 0;
  border-top: 1px solid var(--rule);
}
.facts div { padding: 14px 0; border-bottom: 1px solid var(--rule); }
.facts dt { color: var(--ink-3); font-size: 14px; }
.facts dd { margin: 2px 0 0; color: var(--ink); font-weight: 550; }

.xp { margin: 0; padding: 0; list-style: none; }
.xp-item {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 40px;
  padding: 34px 0;
  border-bottom: 1px solid var(--rule);
}
.xp-item:first-child { padding-top: 6px; }
.xp-when { color: var(--ink-3); font-size: 15px; line-height: 1.5; }
/* A photo under the date, for the entries I've got one for. */
.xp-photo { margin: 18px 0 0; }
.xp-photo img { width: 100%; border-radius: 10px; }
.xp-photo figcaption { margin-top: 8px; color: var(--ink-3); font-size: 13.5px; line-height: 1.4; }
.xp-when strong { display: block; color: var(--blue); font-weight: 650; }
.xp-body { max-width: 52em; }
.xp-body h3 { font-size: 26px; letter-spacing: -0.02em; margin-bottom: 4px; }
.xp-body .role { margin: 0 0 14px; color: var(--ink-3); font-size: 15.5px; }
.xp-body > :last-child { margin-bottom: 0; }
.xp-new {
  display: inline-block;
  margin-left: 10px;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--hl);
  color: var(--hl-ink);
  font-size: 12.5px;
  font-weight: 600;
  vertical-align: 5px;
  letter-spacing: 0;
}
.xp-points { margin: 4px 0 18px; padding-left: 20px; }
.xp-points li { margin-bottom: 8px; padding-left: 4px; }
.xp-points li::marker { color: var(--blue); }

.xp-more {
  margin-top: 0;
  border-bottom: 1px solid var(--rule);
}
.xp-more summary,
.disclose summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 60px;
  color: var(--ink);
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.xp-more summary::-webkit-details-marker,
.disclose summary::-webkit-details-marker { display: none; }
/* Plus that turns into a minus. Drawn with two gradient bars so it can animate. */
.xp-more summary::after,
.disclose summary::after,
.mode-item summary::after {
  content: "";
  flex: none;
  width: 28px;
  height: 28px;
  border: 1px solid var(--rule-2);
  border-radius: 50%;
  background:
    linear-gradient(currentColor, currentColor) center / 11px 1.6px no-repeat,
    linear-gradient(currentColor, currentColor) center / 1.6px 11px no-repeat;
  color: var(--ink-2);
  transition: transform 0.4s cubic-bezier(.2, .8, .2, 1), background-size 0.3s ease, border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}
.xp-more summary:hover::after,
.disclose summary:hover::after,
.mode-item summary:hover::after { border-color: var(--blue); color: var(--blue); }
.xp-more[open] summary::after,
.disclose[open] summary::after,
.mode-item[open] summary::after { transform: rotate(180deg); background-size: 11px 1.6px, 1.6px 0; }
details.is-closing > summary::after { transform: rotate(0deg); background-size: 11px 1.6px, 1.6px 11px; }
.details-body { overflow: hidden; }
.xp-more summary, .disclose summary { transition: color 0.25s ease; }
.xp-more[open]:not(.is-closing) > summary,
.disclose[open]:not(.is-closing) > summary { color: var(--blue); }
.xp-more[open]:not(.is-closing) > summary::after,
.disclose[open]:not(.is-closing) > summary::after,
.mode-item[open]:not(.is-closing) > summary::after { border-color: var(--blue); color: var(--blue); background-color: var(--blue-soft); }
.xp-more, .disclose, .mode-item { transition: border-color 0.3s ease; }
.xp-more[open]:not(.is-closing), .disclose[open]:not(.is-closing) { border-bottom-color: color-mix(in srgb, var(--blue) 45%, var(--rule)); }
.details-body > :first-child { margin-top: 0; }
.xp-more summary:focus-visible,
.disclose summary:focus-visible,
.mode-item summary:focus-visible { outline-offset: -2px; }
.xp-more summary span { margin-left: auto; color: var(--ink-3); font-weight: 400; font-size: 15px; }
.xp-more-body {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px;
  padding: 6px 0 30px 240px;
}
.xp-more-body h4 { font-size: 18px; margin-bottom: 6px; letter-spacing: -0.01em; }
.xp-more-body p { margin: 0; font-size: 15.5px; }

.edu {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 40px;
  margin-top: 64px;
}
.edu h3 { font-size: 26px; letter-spacing: -0.02em; }
.subjects {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 20px;
  padding: 0;
  list-style: none;
}
.subjects li {
  padding: 16px 16px 14px;
  border: 1px solid var(--rule);
  border-radius: 10px;
  color: var(--ink);
  font-weight: 600;
  line-height: 1.3;
}
.subjects li span { display: block; margin-top: 18px; color: var(--ink-3); font-size: 14px; font-weight: 400; }
.subjects li b { color: var(--blue); font-size: 20px; }
.disclose { border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); max-width: 640px; }
.gcse { margin: 0 0 22px; }
.gcse div { display: grid; grid-template-columns: 90px 1fr; gap: 12px; padding: 6px 0; }
.gcse dt { color: var(--ink); font-weight: 650; }
.gcse dd { margin: 0; }

.contact {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 48px;
  align-items: end;
  padding: 44px 0 0;
  border-top: 1px solid var(--ink);
}
.contact h2 { font-size: clamp(34px, 4vw, 52px); letter-spacing: -0.03em; margin-bottom: 16px; }
.contact p { max-width: 32em; margin: 0; }
.contact-links { display: grid; gap: 6px; justify-items: start; }
.email {
  color: var(--ink);
  font-size: clamp(20px, 2.2vw, 28px);
  font-weight: 650;
  font-stretch: 90%;
  letter-spacing: -0.015em;
  text-decoration: underline;
  text-decoration-color: var(--blue);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.18em;
  overflow-wrap: anywhere;
}
.email:hover { color: var(--blue); }

/* ---------- project pages ---------- */

.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding-top: 28px;
  color: var(--ink-3);
  font-size: 14.5px;
}
.crumbs a { color: var(--ink-3); text-decoration: none; }
.crumbs a:hover { color: var(--blue); text-decoration: underline; }
.crumbs [aria-current] { color: var(--ink-2); }

.p-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.92fr);
  gap: 64px;
  align-items: center;
  padding: 40px 0 64px;
  border-bottom: 1px solid var(--rule);
}
.p-head.no-media { grid-template-columns: minmax(0, 1fr); }
.p-kicker { margin: 0 0 18px; color: var(--blue); font-size: 15.5px; font-weight: 650; }
.p-title {
  margin-bottom: 22px;
  font-size: clamp(42px, 5.6vw, 76px);
  font-stretch: 85%;
  font-weight: 750;
  line-height: 0.98;
  letter-spacing: -0.032em;
}
.p-standfirst {
  max-width: 34em;
  margin: 0 0 28px;
  color: var(--ink);
  font-size: clamp(19px, 1.7vw, 22px);
  line-height: 1.5;
}
.p-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 28px;
  max-width: 560px;
  margin: 0;
  border-top: 1px solid var(--rule);
}
.p-facts div { padding: 12px 0; border-bottom: 1px solid var(--rule); min-width: 0; }
.p-facts dt { color: var(--ink-3); font-size: 13.5px; }
.p-facts dd { margin: 1px 0 0; color: var(--ink); font-weight: 600; font-size: 16px; overflow-wrap: anywhere; }
.p-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }

.p-figure { margin: 0; }
.p-figure .frame {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
}
.p-figure .frame.white { background: #fff; }
.p-figure .frame.bordered { border: 1px solid var(--rule); }
.p-figure .frame.pad { padding: 6%; }
.p-figure .frame.tall img { max-height: 560px; width: auto; margin: 0 auto; }
html[data-theme="dark"] .p-figure .frame.bordered { border-color: transparent; }
.p-figure figcaption { margin-top: 12px; color: var(--ink-3); font-size: 14px; line-height: 1.5; }

/* Labelled photo: the labels sit around the picture like on my sketches. */
.callouts { position: relative; padding: 6% 4%; }
.callouts img { width: 74%; margin: 0 auto; }
.callouts svg.marks {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
}
.marks path { fill: none; stroke: var(--blue); stroke-width: 1.6; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.marks circle { fill: var(--blue); }
.callout-label {
  position: absolute;
  max-width: 11em;
  color: var(--blue);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
}
.callout-label span { display: block; color: var(--ink-3); font-weight: 400; font-size: 13px; }

.p-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 80px;
  padding-top: 56px;
}
.toc { position: relative; }
.toc details { position: sticky; top: calc(var(--nav-h) + 28px); }
.toc summary {
  display: none;
  list-style: none;
}
.toc summary::-webkit-details-marker { display: none; }
.toc-title { margin: 0 0 12px; color: var(--ink-3); font-size: 13.5px; font-weight: 600; }
.toc ol { margin: 0; padding: 0; list-style: none; border-left: 1px solid var(--rule); }
.toc li a {
  display: block;
  margin-left: -1px;
  padding: 6px 0 6px 16px;
  border-left: 2px solid transparent;
  color: var(--ink-3);
  font-size: 14.5px;
  line-height: 1.35;
  text-decoration: none;
}
.toc li a:hover { color: var(--ink); }
.toc li a.active { border-left-color: var(--blue); color: var(--ink); font-weight: 600; }
/* With JS a single marker slides between the links instead. */
.toc ol { position: relative; }
.toc-marker {
  position: absolute;
  left: -1px;
  top: 0;
  width: 2px;
  height: var(--h, 0);
  border-radius: 2px;
  background: var(--blue);
  transform: translateY(var(--y, 0));
  opacity: 0;
  transition: transform 0.45s var(--out), height 0.45s var(--out), opacity 0.2s ease;
}
.toc-marker.on { opacity: 1; }
.toc ol:has(.toc-marker) li a.active { border-left-color: transparent; }
.toc li a { transition: color 0.2s ease; }

.p-main { min-width: 0; max-width: 1000px; overflow-x: clip; }
.p-sec { padding-bottom: 64px; }
.p-sec + .p-sec { padding-top: 56px; border-top: 1px solid var(--rule); }
.p-sec > h2 {
  margin-bottom: 20px;
  font-size: clamp(28px, 3vw, 38px);
  letter-spacing: -0.024em;
}
.p-sec h3 { margin: 36px 0 10px; font-size: 21px; letter-spacing: -0.012em; }
.p-sec > p, .p-sec > ul:not([class]), .p-sec > ol:not([class]), .prose { max-width: 46em; }
.p-sec > p.intro { color: var(--ink); font-size: 19px; line-height: 1.55; }
.p-sec ul:not([class]), .p-sec ol:not([class]) { padding-left: 22px; }
.p-sec ul:not([class]) li, .p-sec ol:not([class]) li { margin-bottom: 8px; padding-left: 4px; }
.p-sec li::marker { color: var(--blue); }
.p-sec a:not([class]) { color: var(--blue); text-decoration-color: color-mix(in srgb, var(--blue) 40%, transparent); }
.p-sec a:not([class]):hover { text-decoration-color: currentColor; }

.fig { margin: 32px 0; }
.fig > img, .fig > .frame { border-radius: 12px; }
.fig > .frame { overflow: hidden; }
.fig figcaption { max-width: 50em; margin-top: 12px; color: var(--ink-3); font-size: 14.5px; line-height: 1.55; }
.fig figcaption b { color: var(--ink-2); }
.fig.sketch > .frame { padding: 4%; background: #fff; border: 1px solid var(--rule); }
.fig > .frame.pad { padding: 4% 6%; }
.fig > .frame.pad svg { max-width: 480px; margin: 0 auto; }
.fig.sketch img { margin: 0 auto; max-height: 720px; width: auto; }

.side-by-side {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin: 32px 0;
}
.side-by-side figure { margin: 0; display: flex; flex-direction: column; }
.side-by-side .frame {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 6%;
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: #fff;
}
.side-by-side img { max-height: 380px; width: auto; }
.side-by-side figcaption { margin-top: 10px; color: var(--ink-3); font-size: 14px; }
.side-by-side figcaption b { color: var(--ink); }
html[data-theme="dark"] .side-by-side .frame,
html[data-theme="dark"] .fig.sketch > .frame { background: #f4f4f0; border-color: transparent; }

.callout {
  max-width: 46em;
  margin: 28px 0;
  padding: 18px 22px;
  border-left: 3px solid var(--blue);
  border-radius: 0 10px 10px 0;
  background: var(--blue-soft);
  color: var(--ink);
}
.callout p:last-child { margin-bottom: 0; }
.callout .callout-title { display: block; margin-bottom: 4px; font-weight: 700; }

.notes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 40px;
  margin: 28px 0;
  border-top: 1px solid var(--rule);
}
.notes.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.notes > div { padding: 22px 0; border-bottom: 1px solid var(--rule); }
.notes h3 { margin: 0 0 8px; font-size: 18px; }
.notes p { margin: 0; font-size: 16px; }

.numbers { margin: 28px 0; padding: 0; list-style: none; border-top: 1px solid var(--rule); }
.numbers li {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 24px;
  padding: 20px 0;
  border-bottom: 1px solid var(--rule);
}
.numbers .n {
  color: var(--blue);
  font-size: 34px;
  font-stretch: 85%;
  font-weight: 750;
  line-height: 1;
  letter-spacing: -0.02em;
}
.numbers .n small { font-size: 0.5em; font-weight: 600; margin-left: 2px; }
.numbers h3 { margin: 0 0 4px; font-size: 18px; }
.numbers p { margin: 0; font-size: 16px; max-width: 46em; }

/* Device and system diagrams (inline SVG). */
.diagram {
  --diagram-accent: var(--blue);
  margin: 32px 0;
  padding: 28px;
  border: 1px solid var(--rule);
  border-radius: 14px;
  background: var(--paper);
}
.diagram.dots { border-color: var(--rule); }
.diagram svg { width: 100%; height: auto; overflow: visible; }
.diagram figcaption { margin: 22px 0 0; padding-top: 16px; border-top: 1px solid var(--rule); color: var(--ink-3); font-size: 14.5px; line-height: 1.55; }
.diagram-node rect { fill: var(--paper); stroke: var(--rule-2); stroke-width: 1.3; }
.diagram-title { font: 650 18px var(--sans); font-stretch: 92%; fill: var(--ink); }
.diagram-sub { font: 14px var(--sans); fill: var(--ink-2); }
.diagram-pin { font: 13px var(--mono); fill: var(--ink-3); }
.diagram-core rect { fill: var(--ink); stroke: var(--ink); }
.diagram-core text { fill: var(--paper); }
.diagram-line { fill: none; stroke: var(--diagram-accent); stroke-width: 1.8; stroke-linejoin: round; }
.diagram-line.wireless { stroke-dasharray: 6 5; }
.diagram-label { font: 500 14px var(--sans); fill: var(--ink-2); }
.diagram-label-bg { fill: var(--paper); }
.diagram .marker-fill { fill: var(--diagram-accent); }
.connection-list { display: none; margin: 0; padding: 0; list-style: none; }

/* Tables. */
.table-scroll { max-width: 100%; margin: 28px 0; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-scroll:focus-visible { outline-offset: 2px; }
table.data {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-size: 15.5px;
  line-height: 1.45;
}
table.data caption { padding: 0 0 10px; color: var(--ink-3); font-size: 14px; text-align: left; }
table.data th, table.data td { padding: 12px 16px 12px 0; border-bottom: 1px solid var(--rule); text-align: left; vertical-align: top; }
table.data thead th { padding-top: 0; border-bottom: 1px solid var(--ink); color: var(--ink-3); font-size: 13.5px; font-weight: 600; }
table.data tbody th { color: var(--ink); font-weight: 600; }
table.data td.pin, table.data .pin { font-family: var(--mono); font-size: 14px; color: var(--blue); white-space: nowrap; }

/* Light switch: the five modes. */
.modes { margin: 28px 0; border-top: 1px solid var(--rule); }
.mode-item { border-bottom: 1px solid var(--rule); }
.mode-item summary {
  display: grid;
  grid-template-columns: 36px 120px minmax(0, 1fr) 28px;
  align-items: center;
  gap: 16px;
  min-height: 64px;
  padding: 10px 0;
  cursor: pointer;
  list-style: none;
}
.mode-item summary::-webkit-details-marker { display: none; }
.mode-number { color: var(--ink-3); font-family: var(--mono); font-size: 13px; }
.mode-item summary strong { font-size: 19px; font-stretch: 92%; }
.mode-item summary > span:not(.mode-number) { color: var(--ink-3); font-size: 15.5px; }
.mode-item[open] summary strong, .mode-item summary:hover strong { color: var(--blue); }
.mode-body { padding: 0 44px 24px 52px; }
.mode-body p { max-width: 46em; }
.mode-route { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 34px; margin: 4px 0 0; padding: 0; list-style: none; }
.mode-route li { position: relative; padding: 6px 13px; border: 1px solid var(--rule-2); border-radius: 999px; font-size: 14.5px; line-height: 1.4; }
.mode-route li:nth-child(2) { border-color: var(--blue); background: var(--blue-soft); color: var(--blue); font-weight: 600; }
.mode-route li + li::before { content: "\2192"; position: absolute; left: -25px; top: 50%; transform: translateY(-52%); color: var(--ink-3); }

/* Blinds: touch gestures and automation rules. */
.gestures {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 28px 0;
}
.gestures article {
  padding: 20px 22px;
  border: 1px solid var(--rule);
  border-radius: 12px;
}
.gesture-time { display: block; margin-bottom: 6px; color: var(--blue); font-size: 14.5px; font-weight: 650; }
.gestures h3 { margin: 0 0 8px; font-size: 19px; }
.gestures p { margin: 0; font-size: 16px; }

.rules { margin: 28px 0; padding: 0; list-style: none; counter-reset: rule; border-top: 1px solid var(--rule); }
.rules > li {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) minmax(0, 0.8fr);
  gap: 8px 24px;
  padding: 22px 0;
  border-bottom: 1px solid var(--rule);
  counter-increment: rule;
}
.rules > li::before {
  content: counter(rule, decimal-leading-zero);
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 13px;
  padding-top: 4px;
}
.rules h3 { margin: 0 0 6px; font-size: 19px; }
.rules p { margin: 0; font-size: 16px; }
.rules dl { margin: 0; font-size: 14.5px; }
.rules dt { color: var(--ink-3); }
.rules dd { margin: 0 0 8px; color: var(--ink); }

/* Downloads. */
.files { margin: 28px 0; padding: 0; list-style: none; border-top: 1px solid var(--rule); }
.files li { border-bottom: 1px solid var(--rule); }
.files a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 20px;
  min-height: 72px;
  padding: 12px 4px;
  text-decoration: none;
}
.files strong { display: block; font-size: 17.5px; }
.files span.desc { color: var(--ink-3); font-size: 14.5px; }
.files .size { color: var(--ink-3); font-family: var(--mono); font-size: 13.5px; }
.files .dl {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--rule-2);
  border-radius: 50%;
  color: var(--ink-2);
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.files a:hover strong { color: var(--blue); }
.files a:hover .dl { background: var(--blue); border-color: var(--blue); color: #fff; }

/* Sleep score weights and formulas. */
.weights {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 28px 0;
}
.weights div { padding: 18px 18px 16px; border: 1px solid var(--rule); border-top-width: 4px; border-radius: 12px; }
/* The four weights as one bar, so you can see how the score splits up.
   Each card underneath gets the same shade along its top edge. */
.weight-bar {
  display: flex;
  gap: 3px;
  height: 34px;
  margin: 18px 0 14px;
  overflow: hidden;
  border-radius: 8px;
}
.weight-bar span {
  display: flex;
  align-items: center;
  min-width: 0;
  padding: 0 10px;
  overflow: hidden;
  white-space: nowrap;
  font-size: 13.5px;
  font-weight: 650;
}
.weight-bar span:nth-child(1) { flex: 40; }
.weight-bar span:nth-child(2) { flex: 35; }
.weight-bar span:nth-child(3) { flex: 15; }
.weight-bar span:nth-child(4) { flex: 10; }
.weight-bar span:nth-child(1), .weights div:nth-child(1) { --shade: var(--blue); }
.weight-bar span:nth-child(2), .weights div:nth-child(2) { --shade: color-mix(in srgb, var(--blue) 78%, var(--paper)); }
.weight-bar span:nth-child(3), .weights div:nth-child(3) { --shade: color-mix(in srgb, var(--blue) 56%, var(--paper)); }
.weight-bar span:nth-child(4), .weights div:nth-child(4) { --shade: color-mix(in srgb, var(--blue) 36%, var(--paper)); }
.weight-bar span { background: var(--shade); color: var(--ink); }
.weight-bar span:nth-child(-n+2) { color: #fff; }
html[data-theme="dark"] .weight-bar span:nth-child(-n+2) { color: #0e1222; }
.weights div { border-top-color: var(--shade); }
.weights b { display: block; color: var(--blue); font-size: 32px; font-stretch: 85%; font-weight: 750; line-height: 1; }
.weights strong { display: block; margin: 14px 0 4px; font-size: 16.5px; }
.weights p { margin: 0; font-size: 14.5px; line-height: 1.5; }
.formulas { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 28px 0; }
.formula {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow-x: auto;
  padding: 22px 24px;
  border: 1px solid var(--rule);
  border-radius: 12px;
}
.formula h3 { margin: 0 0 8px; font-size: 18px; }
.formula p { margin: 0 0 18px; font-size: 15.5px; }
.formula math { margin-top: auto; font-size: 20px; color: var(--ink); }

/* Zaylo Remote: the live demo inside a plain phone outline. The app always runs
   at a real 390 x 844 phone size and site.js scales it to fit the frame, so its
   layout never gets squashed. */
.demo { margin: 0; display: grid; justify-items: center; }
.device-frame {
  position: relative;
  width: min(100%, 352px);
  padding: 9px;
  border-radius: 50px;
  background: linear-gradient(145deg, #2a2d33, #0b0c0e 38%, #0b0c0e 70%, #23262b);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06) inset, 0 0 0 1px var(--rule-2), 0 30px 70px -34px rgba(0, 0, 0, 0.7);
}
.device-screen {
  position: relative;
  aspect-ratio: 390 / 844;
  overflow: hidden;
  border-radius: 41px;
  background: #07080a;
  isolation: isolate;
}
.device-screen iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 390px;
  height: 844px;
  max-width: none;
  border: 0;
  background: #07080a;
  transform: scale(var(--screen-scale, 0.87));
  transform-origin: 0 0;
}
.demo figcaption { max-width: 28em; margin-top: 16px; color: var(--ink-3); font-size: 14.5px; text-align: center; }

.screens { margin: 28px 0; padding: 0; list-style: none; border-top: 1px solid var(--rule); }
.screens li { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 24px; padding: 18px 0; border-bottom: 1px solid var(--rule); }
.screens h3 { margin: 0; font-size: 18px; }
.screens p { margin: 0; font-size: 16px; }

.link-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 28px 0; }
.link-cards a {
  display: block;
  padding: 22px 24px;
  border: 1px solid var(--rule);
  border-radius: 12px;
  text-decoration: none;
  transition: border-color 0.15s ease;
}
.link-cards a:hover { border-color: var(--blue); color: inherit; }
.link-cards strong { display: block; margin-bottom: 6px; font-size: 19px; font-stretch: 92%; }
.link-cards a:hover strong { color: var(--blue); }
.link-cards span { display: block; color: var(--ink-2); font-size: 15.5px; }

/* Robot: status list and parts. */
.status { margin: 28px 0; padding: 0; list-style: none; border-top: 1px solid var(--rule); }
.status li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 15px 0; border-bottom: 1px solid var(--rule); }
.status li span:first-child { color: var(--ink); font-weight: 550; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 3px 11px;
  border: 1px solid var(--rule-2);
  border-radius: 999px;
  color: var(--ink-2);
  font-size: 13.5px;
  white-space: nowrap;
}
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); }
.badge.done::before { background: var(--good); }
.badge.now { border-color: var(--blue); color: var(--blue); }
.badge.now::before { background: var(--blue); }
.badge.later::before { background: transparent; border: 1.5px solid var(--ink-3); width: 6px; height: 6px; }

.steps { margin: 28px 0; padding: 0; list-style: none; counter-reset: step; }
.steps > li {
  position: relative;
  padding: 0 0 26px 52px;
  counter-increment: step;
}
.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: -2px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1.5px solid var(--blue);
  border-radius: 50%;
  color: var(--blue);
  font-weight: 700;
  font-size: 15px;
}
.steps > li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 16px;
  top: 34px;
  bottom: 4px;
  border-left: 1px dashed var(--rule-2);
}
.steps h3 { margin: 2px 0 6px; font-size: 19px; }
.steps p { margin: 0; max-width: 46em; }

.next-up {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: end;
  margin-top: 24px;
  padding: 36px 0 0;
  border-top: 1px solid var(--ink);
}
.next-up .label { margin-bottom: 6px; }
.next-up a.next {
  color: var(--ink);
  font-size: clamp(26px, 3.4vw, 42px);
  font-stretch: 86%;
  font-weight: 750;
  letter-spacing: -0.025em;
  line-height: 1.1;
  text-decoration: none;
}
.next-up a.next:hover { color: var(--blue); }
.next-up a.next .arr { display: inline-block; transition: transform 0.2s ease; }
.next-up a.next:hover .arr { transform: translateX(6px); }

/* ---------- paper (inverted pendulum) ---------- */

.paper .p-main { max-width: 920px; }
.paper .p-sec > p { max-width: none; }
.paper .p-sec { font-size: 17.5px; }
.paper .p-sec > h2 .num { margin-right: 12px; color: var(--blue); font-variant-numeric: tabular-nums; }
.paper .lead { color: var(--ink); font-size: 20px; line-height: 1.55; }

.eq {
  position: relative;
  margin: 22px 0;
  padding: 18px 56px;
  overflow-x: auto;
  overflow-y: hidden;
  border-radius: 10px;
  background: var(--paper-2);
  color: var(--ink);
  text-align: center;
}
.eq .eq-num {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 13px;
}
.eq .katex-display { margin: 0; }
.katex { font-size: 1.12em; color: var(--ink); }

.defs { margin: 24px 0; border-top: 1px solid var(--rule); }
.defs .defs-title { padding: 12px 0 4px; color: var(--ink-3); font-size: 14px; font-weight: 600; }
.defs .def-row { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 18px; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.defs .sym { color: var(--blue); font-weight: 650; }
.defs .def { font-size: 16px; }

.note {
  margin: 24px 0;
  padding: 18px 22px;
  border-left: 3px solid var(--blue);
  border-radius: 0 10px 10px 0;
  background: var(--blue-soft);
}
.note.warn { border-left-color: var(--bad); background: color-mix(in srgb, var(--bad) 8%, var(--paper)); }
.note.tip { border-left-color: var(--good); background: color-mix(in srgb, var(--good) 9%, var(--paper)); }
.note-label { display: block; margin-bottom: 6px; color: var(--ink); font-weight: 700; font-size: 16px; }
.note p { margin: 0; font-size: 16.5px; }

.matrix-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 14px; margin: 22px 0; }
.matrix-card {
  position: relative;
  padding: 34px 16px 18px;
  overflow-x: auto;
  border-radius: 10px;
  background: var(--paper-2);
  color: var(--ink);
  text-align: center;
}
.matrix-card .mc-tag { position: absolute; top: 10px; left: 14px; color: var(--ink-3); font-size: 13px; font-weight: 600; }

.worked { margin: 28px 0; padding: 0; list-style: none; counter-reset: step; }
.worked > li { position: relative; padding: 0 0 8px 52px; counter-increment: step; }
.worked > li + li { padding-top: 22px; border-top: 1px solid var(--rule); }
.worked > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1.5px solid var(--blue);
  border-radius: 50%;
  color: var(--blue);
  font-weight: 700;
  font-size: 15px;
}
.worked > li + li::before { top: 22px; }
.worked h3 { margin: 3px 0 10px; font-size: 20px; }

.ptable { width: 100%; min-width: 440px; border-collapse: collapse; font-size: 15.5px; }
.ptable th, .ptable td { padding: 10px 14px 10px 0; border-bottom: 1px solid var(--rule); text-align: left; }
.ptable thead th { border-bottom-color: var(--ink); color: var(--ink-3); font-size: 13.5px; font-weight: 600; }

pre.code {
  margin: 22px 0;
  padding: 18px 20px;
  overflow-x: auto;
  border-radius: 10px;
  background: #15171c;
  color: #e6e6e1;
  font-family: var(--mono);
  font-size: 14.5px;
  line-height: 1.6;
}
pre.code .file { display: block; margin-bottom: 10px; color: #8d93a0; font-size: 12.5px; }
pre.code .kw { color: #9fb2ff; }
pre.code .fn { color: #ffd76a; }

.results {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 28px 0;
}
.results div { padding: 16px; border: 1px solid var(--rule); border-radius: 12px; }
.results p { margin: 0; }
.results .k { color: var(--ink-3); font-size: 13.5px; }
.results .v { margin: 8px 0 4px; color: var(--ink); font-size: 26px; font-stretch: 86%; font-weight: 750; line-height: 1; }
.results .v.good { color: var(--good); }
.results .s { color: var(--ink-3); font-size: 13.5px; }

/* Paper diagrams. */
.d-stroke { stroke: var(--ink); }
.d-fill-paper { fill: var(--paper); }
.d-fill-ink { fill: var(--ink); }
.d-pole { stroke: var(--ink); }
.d-accent { stroke: var(--blue); }
.d-fill-accent { fill: var(--blue); }
.d-dim { stroke: var(--ink-3); }
.d-faint { stroke: var(--rule-2); }
.d-good { stroke: var(--good); }
.d-bad { stroke: var(--bad); }
.d-fill-good { fill: var(--good); }
.d-band { fill: var(--blue-soft); }
.d-band-good { fill: color-mix(in srgb, var(--good) 10%, transparent); }
.d-band-bad { fill: color-mix(in srgb, var(--bad) 8%, transparent); }
.d-label { font: 500 14px var(--sans); fill: var(--ink); }
.d-label-sm { font: 12.5px var(--sans); fill: var(--ink-3); }
.d-label-accent { fill: var(--blue); }
.d-label-good { fill: var(--good); }
.d-label-bad { fill: var(--bad); }

/* ---------- the cube ---------- */

/* Six faces in proper 3D. The resting angle is the usual isometric view
   (turned 45° and tipped forward 35.26°). Once site.js loads it takes over
   the transform and works out how bright each face is from where it points,
   so the shading stays right while it spins. The --lit values here are only
   for the resting pose, in case the script never runs. */
.cube-scene {
  --s: 18px;
  display: inline-grid;
  place-items: center;
  flex: none;
  width: calc(var(--s) * 1.75);
  height: calc(var(--s) * 1.75);
  perspective: calc(var(--s) * 16);
}
.cube {
  position: relative;
  width: var(--s);
  height: var(--s);
  transform-style: preserve-3d;
  transform: rotateX(-35.264deg) rotateY(45deg);
}
.cube > i {
  position: absolute;
  inset: 0;
  border-radius: calc(var(--s) * 0.1);
  background: hsl(var(--cube-h) var(--cube-s) var(--lit, 40%));
  box-shadow: inset 0 0 0 max(0.5px, calc(var(--s) * 0.02)) rgb(255 255 255 / 0.16);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}
.cube .f1 { transform: translateZ(calc(var(--s) / 2)); --lit: 32%; }
.cube .f2 { transform: rotateY(180deg) translateZ(calc(var(--s) / 2)); }
.cube .f3 { transform: rotateY(90deg) translateZ(calc(var(--s) / 2)); }
.cube .f4 { transform: rotateY(-90deg) translateZ(calc(var(--s) / 2)); --lit: 51%; }
.cube .f5 { transform: rotateX(90deg) translateZ(calc(var(--s) / 2)); --lit: 70%; }
.cube .f6 { transform: rotateX(-90deg) translateZ(calc(var(--s) / 2)); }

/* The big one on the 404 page. Press it and it spins, or flick it. */
.cube-toy {
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
}
.cube-toy .cube-scene { transition: scale 0.3s var(--spring); }
.cube-toy:hover .cube-scene { scale: 1.1; }
.cube-toy:active .cube-scene { scale: 0.9; transition-duration: 0.1s; }

/* ---------- things coming into view ---------- */

/* site.js puts .will-reveal on anything that starts below the fold and adds
   .is-in when it scrolls into view, then takes both off again once it's done.
   Nothing that's already on screen when the page loads gets hidden. */
/* The starting positions only apply until .is-in arrives. (The photo's used to
   be plain .about-photo.will-reveal, which beat the finished state, so it sat
   still while fading in and then jumped when the classes came off.) */
.will-reveal:not(.is-in) { opacity: 0; transform: translateY(28px); }
.about-photo.will-reveal:not(.is-in) { transform: translateY(24px) rotate(-3deg); }
.will-reveal.is-in {
  transition: opacity 0.8s var(--out), transform 1.05s var(--out), rotate 0.7s var(--spring), translate 0.7s var(--spring);
  transition-delay: var(--delay, 0s), var(--delay, 0s), 0s, 0s;
}

/* The pinned-on sketch straightens up a bit when you hover the picture. */
.project-media .inset { transition: rotate 0.6s var(--spring); }
.project-media:hover .inset { rotate: 1.5deg; }

/* ---------- page and theme changes ---------- */

/* Moving between pages fades instead of flashing white (Chrome, Edge and Safari). */
@view-transition { navigation: auto; }
.nav { view-transition-name: nav; }
::view-transition-old(root) { animation: 0.18s ease both pageOut; }
::view-transition-new(root) { animation: 0.5s var(--out) both pageIn; }
@keyframes pageOut { to { opacity: 0; } }
@keyframes pageIn { from { opacity: 0; transform: translateY(12px); } }

/* Switching theme spreads out in a circle from the button. */
html.theme-anim .nav { view-transition-name: none; }
html.theme-anim::view-transition-old(root),
html.theme-anim::view-transition-new(root) { mix-blend-mode: normal; }
html.theme-anim::view-transition-old(root) { animation: none; }
html.theme-anim::view-transition-new(root) { animation: 0.7s cubic-bezier(.45, 0, .2, 1) both themeIn; }
@keyframes themeIn {
  from { clip-path: circle(0 at var(--tx) var(--ty)); }
  to { clip-path: circle(var(--tr) at var(--tx) var(--ty)); }
}

/* ---------- 404 ---------- */

.nf { padding-top: 120px; padding-bottom: 40px; }
.nf .nf-code { margin: 0 0 8px; color: var(--blue); font-size: clamp(90px, 18vw, 200px); font-stretch: 80%; font-weight: 800; line-height: 0.9; letter-spacing: -0.04em; }
.nf h1 { font-size: clamp(30px, 4vw, 46px); margin-bottom: 16px; }
.nf p { max-width: 34em; font-size: 18.5px; }
.nf-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.nf .cube-toy { margin: 0 0 18px -18px; padding: 18px; }
.nf .cube-scene { --s: 74px; }
.nf-hint { color: var(--ink-3); font-size: 14px; }

/* ---------- responsive ---------- */

@media (max-width: 1100px) {
  :root { --gutter: 32px; }
  .hero-inner { gap: 48px; }
  .project { gap: 40px; }
  .about { grid-template-columns: minmax(0, 280px) minmax(0, 1fr); gap: 48px; }
  .xp-item, .edu { grid-template-columns: 160px minmax(0, 1fr); gap: 28px; }
  .xp-more-body { padding-left: 188px; grid-template-columns: 1fr; gap: 20px; }
  .p-layout { grid-template-columns: 180px minmax(0, 1fr); gap: 48px; }
  .p-head { gap: 44px; }
  .subjects { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .hero { padding: 48px 0 64px; }
  .hero-inner { grid-template-columns: 1fr; gap: 40px; }
  .now { max-width: 560px; }
  .project, .project:nth-of-type(even) { grid-template-columns: 1fr; gap: 28px; }
  .project:nth-of-type(even) .project-media { order: 0; }
  .p-head { grid-template-columns: 1fr; }
  .p-head .p-figure { max-width: 620px; }
  .p-layout { grid-template-columns: 1fr; gap: 0; padding-top: 28px; }
  .toc { margin-bottom: 28px; }
  .toc details { position: static; border: 1px solid var(--rule); border-radius: 12px; }
  .toc summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 54px;
    padding: 0 18px;
    color: var(--ink);
    font-weight: 600;
    cursor: pointer;
  }
  .toc summary::after { content: "+"; font-size: 20px; color: var(--ink-3); }
  .toc details[open] summary::after { content: "\2212"; }
  .toc .toc-title { display: none; }
  .toc ol { margin: 0 18px 16px; }
  .notes.three { grid-template-columns: 1fr; }
  .weights { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .results { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rules > li { grid-template-columns: 36px minmax(0, 1fr); }
  .rules > li dl { grid-column: 2; }
}

@media (max-width: 820px) {
  :root { --gutter: 24px; --nav-h: 60px; }
  .nav-inner { gap: 8px; }
  .nav-toggle { display: grid; }
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    max-height: calc(100dvh - var(--nav-h));
    padding: 10px var(--gutter) 20px;
    overflow-y: auto;
    overscroll-behavior: contain;
    border-bottom: 1px solid var(--rule);
    background: var(--paper);
    box-shadow: 0 18px 30px -24px rgba(20, 22, 26, 0.4);
    visibility: hidden;
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0s linear 0.18s;
  }
  .nav.menu-open .nav-links {
    visibility: visible;
    opacity: 1;
    transform: none;
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0s;
  }
  .nav-links a, .nav-work > a { min-height: 50px; padding: 0 8px; font-size: 18px; }
  .nav-work { flex-wrap: wrap; }
  .nav-work > a { flex: 1; }
  .work-toggle { width: 50px; height: 50px; }
  .work-dropdown {
    position: static;
    flex-basis: 100%;
    width: auto;
    max-height: 0;
    padding: 0 0 0 10px;
    overflow: hidden;
    border: 0;
    border-left: 1px solid var(--rule);
    border-radius: 0;
    margin-left: 8px;
    box-shadow: none;
    transform: none;
    transition: max-height 0.22s ease, visibility 0s linear 0.22s, opacity 0.15s ease;
  }
  .work-dropdown::before { display: none; }
  .work-open .work-dropdown { max-height: 420px; margin-bottom: 8px; transition: max-height 0.22s ease, visibility 0s, opacity 0.15s ease; }
  .work-dropdown a { font-size: 16px; min-height: 46px; }
}

@media (max-width: 640px) {
  :root { --gutter: 20px; }
  body { font-size: 16.5px; }
  .brand { font-size: 16px; gap: 9px; }
  .hero { padding: 36px 0 48px; }
  .hero-name { margin-bottom: 18px; font-size: 15px; }
  .hero-title { margin-bottom: 20px; }
  .about-photo { rotate: -1.2deg; }
  .hero-links .button { flex: 1 1 auto; }
  .now { padding: 20px 20px 16px; }
  .section { padding-top: 84px; }
  .section-head { grid-template-columns: 1fr; gap: 10px; margin-bottom: 28px; }
  .section-head p { justify-self: start; }
  .project { padding: 32px 0; }
  .project-media { aspect-ratio: 4 / 3.4; }
  .pair { grid-template-columns: 1fr; gap: 48px; }
  .about { grid-template-columns: 1fr; gap: 28px; }
  .about-photo { position: static; max-width: 260px; }
  .about-text > p { font-size: 17px; }
  .facts { grid-template-columns: 1fr; }
  .xp-item, .edu { grid-template-columns: 1fr; gap: 8px; }
  .xp-photo { max-width: 300px; margin: 12px 0 8px; }
  .xp-more-body { padding-left: 0; }
  .xp-body h3 { font-size: 23px; }
  .subjects { grid-template-columns: 1fr 1fr; }
  .contact { grid-template-columns: 1fr; gap: 24px; }
  .footer-inner { flex-direction: column; }
  .p-head { padding: 28px 0 40px; gap: 32px; }
  .p-facts { grid-template-columns: 1fr 1fr; }
  .p-sec { padding-bottom: 48px; }
  .p-sec + .p-sec { padding-top: 44px; }
  .callouts { padding: 4% 2%; }
  .callout-label { font-size: 12px; max-width: 8.5em; }
  .callout-label span { display: none; }
  .diagram { padding: 18px; }
  .diagram svg.connection-svg { display: none; }
  .connection-list { display: grid; }
  .connection-list li { padding: 14px 0; border-bottom: 1px solid var(--rule); }
  .connection-list li:first-child { padding-top: 0; }
  .connection-list li:last-child { border-bottom: 0; padding-bottom: 0; }
  .connection-list strong { font-size: 16px; }
  .connection-list .to { margin: 0 8px; color: var(--blue); }
  .connection-list p { margin: 4px 0 0; font-size: 15px; }
  .diagram figcaption { margin-top: 16px; }
  .notes, .gestures, .formulas, .side-by-side, .link-cards, .matrix-grid { grid-template-columns: 1fr; }
  .numbers li { grid-template-columns: 76px minmax(0, 1fr); gap: 16px; }
  .numbers .n { font-size: 28px; }
  .mode-item summary { grid-template-columns: 26px minmax(0, 1fr) 28px; gap: 4px 10px; }
  .mode-item summary > span:not(.mode-number) { grid-column: 2; grid-row: 2; }
  .mode-item summary::after { grid-column: 3; grid-row: 1 / span 2; }
  .mode-body { padding: 0 0 22px 36px; }
  .mode-route { flex-direction: column; align-items: flex-start; gap: 24px; }
  .mode-route li + li::before { content: "\2193"; left: 16px; top: -23px; transform: none; }
  .formula math { font-size: 17px; }
  .screens li { grid-template-columns: 1fr; gap: 4px; }
  .files a { grid-template-columns: minmax(0, 1fr) auto; }
  .files .size { display: none; }
  .next-up { grid-template-columns: 1fr; }
  .eq { padding: 16px 14px; }
  .eq .eq-num { position: static; display: block; transform: none; margin-bottom: 6px; text-align: left; }
  .defs .def-row { grid-template-columns: 52px minmax(0, 1fr); gap: 12px; }
  .weights { grid-template-columns: 1fr 1fr; }
  .weights b { font-size: 26px; }
  .weight-bar span { padding: 0 6px; font-size: 12.5px; }
  .results .v { font-size: 22px; }
  .worked > li { padding-left: 44px; }
  .nf { padding-top: 72px; }
}

@media (max-width: 370px) {
  .brand-name { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-delay: 0s !important;
    scroll-behavior: auto !important;
  }
  @view-transition { navigation: none; }
}

@media print {
  .nav, .skip-link, .toc, .theme-toggle, .footer, .next-up, .cube-toy { display: none !important; }
  .will-reveal { opacity: 1 !important; transform: none !important; }
  body { background: #fff; color: #000; }
  .p-layout { display: block; }
  .diagram svg.connection-svg { display: block; }
  .connection-list { display: none; }
}
