/* njsingh.com
   Base borrowed from KaribuKit: Satoshi, navy ink, mint accent.
   One family, one accent. */

@font-face {
  font-family: "Satoshi";
  src: url("../fonts/Satoshi-Variable.woff2") format("woff2");
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --bg: oklch(1 0 0);
  --surface: oklch(0.972 0.005 268);
  --ink: oklch(0.235 0.042 268);
  --ink-2: oklch(0.43 0.03 268);
  --line: oklch(0.905 0.01 268);
  --mint: oklch(0.905 0.115 160);
  --mint-ink: oklch(0.41 0.1 160);
  --hl: oklch(0.905 0.115 160 / 0.75);
  --arm: oklch(0.7 0.13 160);
  --arm-on: oklch(0.41 0.1 160);
  --halo: oklch(0.905 0.115 160 / 0.42);
  --shot-shadow: 0 1px 2px oklch(0.235 0.042 268 / 0.05), 0 18px 40px -22px oklch(0.235 0.042 268 / 0.28);

  --font: "Satoshi", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;

  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: clamp(1.2rem, 1.1rem + 0.5vw, 1.375rem);
  --step-2: clamp(1.6rem, 1.35rem + 1.2vw, 2.25rem);
  --step-3: clamp(2.35rem, 1.2rem + 5.2vw, 5rem);

  --gutter: clamp(1.25rem, 5vw, 3rem);
  --section: clamp(3.5rem, 8vw, 6.5rem);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  --z-sticky: 10;
  --z-skip: 20;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: oklch(0.165 0.028 268);
  --surface: oklch(0.21 0.032 268);
  --ink: oklch(0.955 0.008 268);
  --ink-2: oklch(0.77 0.02 268);
  --line: oklch(0.3 0.03 268);
  --mint-ink: oklch(0.905 0.115 160);
  --hl: oklch(0.905 0.115 160 / 0.36);
  --arm: oklch(0.905 0.115 160 / 0.62);
  --arm-on: oklch(0.905 0.115 160);
  --halo: oklch(0.905 0.115 160 / 0.2);
  --shot-shadow: 0 0 0 1px oklch(0.3 0.03 268);
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 1.5rem;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--step-0);
  font-weight: 450;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-variant-numeric: lining-nums;
}

h1,
h2,
h3,
p,
ul,
ol,
dl,
dd,
figure {
  margin: 0;
  padding: 0;
}

ul,
ol {
  list-style: none;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-color: var(--mint-ink);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.22em;
  transition: text-decoration-color 160ms var(--ease), color 160ms var(--ease);
}

a:hover {
  color: var(--mint-ink);
}

:focus-visible {
  outline: 2px solid var(--mint-ink);
  outline-offset: 3px;
  border-radius: 4px;
}

::selection {
  background: var(--mint);
  color: oklch(0.235 0.042 268);
}

.wrap {
  max-width: 70rem;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  position: absolute;
  left: var(--gutter);
  top: -4rem;
  background: var(--ink);
  color: var(--bg);
  padding: 0.5rem 0.9rem;
  border-radius: 8px;
  text-decoration: none;
  z-index: var(--z-skip);
}

.skip:focus {
  top: 0.75rem;
}

/* ---------- Header ---------- */

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

.name {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: -0.01em;
  text-decoration: none;
  min-height: 2.75rem;
}

.name:hover {
  color: inherit;
}

.dot {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 0 1.5px var(--ink);
  flex: none;
}

.top nav {
  display: flex;
  align-items: center;
  gap: clamp(0.9rem, 3vw, 1.75rem);
  font-size: 1rem;
  font-weight: 500;
}

.top nav a {
  text-decoration: none;
  padding-block: 0.6rem;
}

.top nav a:hover {
  text-decoration: underline;
  text-decoration-color: var(--mint-ink);
}

.theme {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--ink);
  width: 2.75rem;
  height: 2.75rem;
  margin-right: -0.9rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background-color 160ms var(--ease);
}

.theme:hover {
  background: var(--surface);
}

.theme span {
  width: 0.95rem;
  height: 0.95rem;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  background: linear-gradient(90deg, currentColor 50%, transparent 50%);
}

/* ---------- Hero ---------- */

.hero {
  padding-block: clamp(2rem, 5vw, 3.75rem) clamp(3.5rem, 8vw, 6rem);
}

h1 {
  font-size: var(--step-3);
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: -0.032em;
  max-width: 17ch;
  text-wrap: balance;
}

.lede {
  margin-top: clamp(1.25rem, 3vw, 2rem);
  font-size: var(--step-1);
  line-height: 1.45;
  color: var(--ink-2);
  max-width: 44ch;
  text-wrap: pretty;
}

/* ---------- The map: body and arms ---------- */

.map {
  position: relative;
  margin-top: clamp(2.5rem, 5vw, 3.75rem);
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  column-gap: clamp(4.5rem, 12vw, 10rem);
  align-items: center;
}

.map svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.map path {
  fill: none;
  stroke: var(--arm);
  stroke-width: 1.5;
  stroke-linecap: round;
  transition: stroke 200ms var(--ease), stroke-width 200ms var(--ease);
}

.map path.on {
  stroke: var(--arm-on);
  stroke-width: 2.25;
}

.map circle {
  fill: var(--bg);
  stroke: var(--arm);
  stroke-width: 1.5;
  transition: fill 200ms var(--ease), stroke 200ms var(--ease);
}

.map circle.on {
  fill: var(--mint);
  stroke: var(--arm-on);
}

.map-body {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  font-size: var(--step-1);
  font-weight: 700;
  letter-spacing: -0.015em;
  text-decoration: none;
  white-space: nowrap;
  padding-block: 0.5rem;
  flex-direction: row-reverse;
}

.map-body:hover {
  color: inherit;
}

.map-body .dot {
  position: relative;
  width: 1rem;
  height: 1rem;
  box-shadow: 0 0 0 1.5px var(--ink), 0 0 0 7px var(--halo);
  transition: box-shadow 240ms var(--ease);
}

.map-body:hover .dot {
  box-shadow: 0 0 0 1.5px var(--ink), 0 0 0 10px var(--halo);
}

.map-body .dot::after {
  content: "";
  position: absolute;
  inset: -1.5px;
  border-radius: 50%;
  border: 1.5px solid var(--arm-on);
  opacity: 0;
  pointer-events: none;
}

.map-arms {
  position: relative;
}

.map-arms li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 1.5rem;
  padding-left: 1.1rem;
}

.map-arms li + li {
  border-top: 1px solid var(--line);
}

.arm {
  display: grid;
  grid-template-columns: minmax(0, 13rem) minmax(0, 1fr);
  gap: 0.25rem 1.5rem;
  align-items: baseline;
  padding-block: 0.95rem;
  text-decoration: none;
}

.arm b {
  font-size: var(--step-1);
  font-weight: 500;
  letter-spacing: -0.02em;
  transition: color 160ms var(--ease);
}

.arm span {
  color: var(--ink-2);
}

.arm:hover {
  color: inherit;
}

.arm:hover b {
  color: var(--mint-ink);
}

.live {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 2.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.live i {
  font-style: normal;
  transition: transform 200ms var(--ease);
}

a.live:hover i {
  transform: translate(2px, -2px);
}

.live.quiet {
  font-weight: 500;
  color: var(--ink-2);
}

/* ---------- Sections ---------- */

section {
  padding-bottom: var(--section);
}

section::before {
  content: "";
  display: block;
  width: min(100% - 2 * var(--gutter), 70rem - 2 * var(--gutter));
  margin: 0 auto var(--section);
  border-top: 1px solid var(--line);
}

h2 {
  font-size: var(--step-2);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.022em;
  text-wrap: balance;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: start;
}

.what {
  margin-top: 1.1rem;
  font-size: var(--step-1);
  line-height: 1.4;
  letter-spacing: -0.01em;
  color: var(--ink-2);
  max-width: 32ch;
  text-wrap: pretty;
}

.fact {
  margin-top: 0.9rem;
  font-size: var(--step-1);
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: -0.01em;
  max-width: 32ch;
  text-wrap: pretty;
}

.hl {
  background: linear-gradient(transparent 58%, var(--hl) 58%, var(--hl) 94%, transparent 94%);
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.try {
  margin-top: 2.25rem;
  max-width: 40ch;
}

.try p {
  color: var(--ink-2);
}

.try b {
  font-weight: 700;
  color: var(--ink);
}

.go {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
  padding: 0.75rem 1.15rem;
  min-height: 2.75rem;
  border-radius: 8px;
  background: var(--ink);
  color: var(--bg);
  font-weight: 600;
  text-decoration: none;
  transition: transform 200ms var(--ease), background-color 200ms var(--ease);
}

.go:hover {
  color: var(--bg);
  transform: translateY(-1px);
}

.go:active {
  transform: translateY(0);
}

.copy:active {
  transform: translateY(1px);
}

.go span {
  transition: transform 200ms var(--ease);
}

.go:hover span {
  transform: translate(2px, -2px);
}

.more {
  margin-top: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  font-size: 1rem;
  color: var(--ink-2);
}

.more a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
}

.prompt {
  margin-top: 0.85rem;
  display: grid;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.prompt code {
  font-family: var(--mono);
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.copy {
  appearance: none;
  justify-self: start;
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  padding: 0.55rem 0.95rem;
  min-height: 2.75rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 160ms var(--ease), color 160ms var(--ease);
}

.copy:hover {
  background: var(--ink);
  color: var(--bg);
}

.shot {
  display: block;
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shot-shadow);
  outline: 1px solid var(--line);
  outline-offset: -1px;
  transition: transform 400ms var(--ease);
}

.shot:hover {
  transform: translateY(-3px);
}

.shot img {
  transition: filter 240ms var(--ease);
}

:root[data-theme="dark"] .shot img {
  filter: brightness(0.88);
}

:root[data-theme="dark"] .shot:hover img {
  filter: none;
}

.shot img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: top;
}

.shot.strip img {
  aspect-ratio: 1280 / 270;
}

/* The one video on the page: a real thumbnail that opens YouTube, never an embed */

.video {
  margin-top: 2rem;
}

.video .shot {
  position: relative;
}

.video .shot img {
  aspect-ratio: 16 / 9;
}

.play {
  position: absolute;
  left: 50%;
  top: 68%;
  width: 3.5rem;
  height: 3.5rem;
  margin: -1.75rem 0 0 -1.75rem;
  border-radius: 50%;
  background: oklch(0.165 0.028 268 / 0.82);
  box-shadow: 0 0 0 1.5px oklch(1 0 0 / 0.75);
  transition: transform 240ms var(--ease), background-color 240ms var(--ease);
}

.play::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  margin: -0.55rem 0 0 -0.32rem;
  border-style: solid;
  border-width: 0.55rem 0 0.55rem 0.9rem;
  border-color: transparent transparent transparent oklch(1 0 0);
}

.shot:hover .play {
  transform: scale(1.08);
  background: oklch(0.165 0.028 268 / 0.95);
}

.video figcaption a {
  white-space: nowrap;
}

figcaption {
  margin-top: 0.75rem;
  font-size: var(--step--1);
  color: var(--ink-2);
}

/* Body section */

.loop {
  display: grid;
  gap: 0;
}

.loop li {
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr);
  gap: 1rem;
  padding-block: 0.85rem;
  border-top: 1px solid var(--line);
}

.loop li:last-child {
  border-bottom: 1px solid var(--line);
}

.loop b {
  font-weight: 700;
}

.loop span {
  color: var(--ink-2);
}

/* In build */

section.slim {
  padding-bottom: clamp(2.25rem, 5vw, 3.5rem);
}

section.slim::before {
  margin-bottom: clamp(2.25rem, 5vw, 3.5rem);
}

.slim .what {
  margin-top: 0;
}


.inbuild {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(1rem, 6vw, 5rem);
  align-items: baseline;
}

.tag {
  display: inline-block;
  margin-left: 0.6rem;
  padding: 0.15rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0;
  color: var(--ink-2);
  vertical-align: middle;
}

/* Before */

.before {
  margin-top: 2rem;
}

.before div {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: 0.25rem clamp(1rem, 6vw, 5rem);
  padding-block: 1.1rem;
  border-top: 1px solid var(--line);
}

.before dt {
  font-weight: 700;
}

.before dt small {
  display: block;
  font-size: var(--step--1);
  font-weight: 450;
  color: var(--ink-2);
}

.before dd {
  color: var(--ink-2);
  max-width: 52ch;
  text-wrap: pretty;
}

.aside {
  margin-top: 2rem;
  color: var(--ink-2);
  max-width: 60ch;
}

/* Contact */

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

.mail {
  display: inline-block;
  min-height: 2.75rem;
  padding-block: 0.3rem;
  font-size: clamp(1.7rem, 0.6rem + 5.2vw, 4.5rem);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.028em;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.14em;
  overflow-wrap: anywhere;
}

.social {
  margin-top: 2.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.75rem;
  font-weight: 500;
}

.social a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  min-width: 2.75rem;
}

.social .plain {
  display: inline-block;
  padding-block: 0.6rem;
  color: var(--ink-2);
}

.foot {
  padding-block: 0 2rem;
  font-size: var(--step--1);
  color: var(--ink-2);
}

.foot::before {
  content: "";
  display: block;
  width: min(100% - 2 * var(--gutter), 70rem - 2 * var(--gutter));
  margin: 0 auto 1.25rem;
  border-top: 1px solid var(--line);
}

.foot .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 2rem;
}

.foot a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
}

/* ---------- Motion ---------- */

@media (prefers-reduced-motion: no-preference) {
  .map path {
    stroke-dasharray: var(--len, 0);
    stroke-dashoffset: 0;
  }

  .map.draw path {
    animation: draw 650ms var(--ease) both;
    animation-delay: calc(var(--i, 0) * 60ms + 220ms);
  }

  .map.draw circle {
    animation: land 260ms var(--ease) both;
    animation-delay: calc(var(--i, 0) * 60ms + 720ms);
  }

  .map.draw .map-body .dot::after {
    animation: pulse 820ms var(--ease) 60ms both;
  }

  @keyframes draw {
    from {
      stroke-dashoffset: var(--len, 0);
    }
    to {
      stroke-dashoffset: 0;
    }
  }

  @keyframes land {
    from {
      opacity: 0;
    }
    to {
      opacity: 1;
    }
  }

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* ---------- Small screens ---------- */

@media (max-width: 1099px) {
  .arm {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.1rem;
    padding-block: 0.8rem;
  }
}

@media (max-width: 760px) {
  .map {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 0.25rem;
  }

  .map-body {
    flex-direction: row;
    justify-self: start;
  }

  .map-arms {
    padding-left: 1.6rem;
  }

  .map-arms li {
    position: relative;
    grid-template-columns: minmax(0, 1fr);
    padding-left: 1rem;
  }

  .arm {
    grid-template-columns: minmax(0, 1fr);
    padding-block: 0.8rem;
  }

  .arm b {
    padding-right: 8.75rem;
  }

  .live {
    position: absolute;
    top: 0.3rem;
    right: 0;
    font-size: 1rem;
  }

  .split,
  .inbuild,
  .before div {
    grid-template-columns: minmax(0, 1fr);
  }

  .split {
    gap: 2rem;
  }

  /* Put the screenshot right after the fact, before the try-it */
  .split:has(> .copy-col) {
    display: flex;
    flex-direction: column;
    gap: 0;
  }

  .split:has(> .copy-col) > .copy-col {
    display: contents;
  }

  .split:has(> .copy-col) > figure {
    order: 1;
    margin-top: 1.75rem;
  }

  .split:has(> .copy-col) .try {
    order: 2;
    border-top: 0;
    padding-top: 0;
  }

  .split:has(> .copy-col) .more {
    order: 3;
  }

  .fact,
  .what,
  .try {
    max-width: none;
  }

  .loop li {
    grid-template-columns: 6rem minmax(0, 1fr);
  }

  .theme {
    border-color: transparent;
    width: 2.75rem;
  }
}

@media (max-width: 420px) {
  .top nav {
    gap: 0.85rem;
  }

  .name {
    font-size: 1.0625rem;
  }
}

@media print {
  .theme,
  .skip {
    display: none !important;
  }
}
