/*
 * Toesig - the public site.
 * The product's own design system (documentation/design/design-system.md, ADR-0049): one light theme,
 * a warm bone canvas, near-black ink, coral only ever as a fill, hairlines instead of shadows, square
 * corners, a geometric sans for prose and a monospace for anything that names a thing.
 */

@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("fonts/plus-jakarta-sans-latin.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "JetBrains Mono";
  src: url("fonts/jetbrains-mono-latin.woff2") format("woff2");
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --ground: #f2efe6;
  --surface: #fbf9f4;
  --sunken: #e7e3d6;
  --ink: #13110b;
  --muted: #4a453b;
  --hairline: #d8d1c3;
  --edge: #625b4f;
  --accent: #ef8667; /* a fill, never text */
  --on-accent: #13110b;
  --link: #28566e;
  --live: #8a4f0a;
  --live-soft: #f4dfb2;
  --positive: #28683e;

  --sunset: linear-gradient(100deg, #f0714a, #e85c7e 50%, #6c8cea);
  --mesh:
    radial-gradient(circle at 12% 14%, #f0714a3d, transparent 30%),
    radial-gradient(circle at 86% 20%, #6c8cea38, transparent 32%),
    radial-gradient(circle at 60% 88%, #e85c7e2e, transparent 36%);

  --sans: "Plus Jakarta Sans", ui-sans-serif, "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --radius: 3px;
  --gutter: 16px;
  --measure: 62ch;
}

@media (min-width: 720px) {
  :root {
    --gutter: 32px;
  }
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-x: hidden;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: var(--link);
  text-underline-offset: 0.18em;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 700;
}

p {
  margin: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

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

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

.skip {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 10;
  padding: 10px 14px;
  background: var(--ink);
  color: var(--ground);
  font-family: var(--mono);
  font-size: 0.8125rem;
  font-weight: 700;
}

.skip:focus {
  top: 12px;
}

/* ---------- Type ---------- */

.eyebrow,
.data-label {
  font-family: var(--mono);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.sep::before {
  content: "//";
  margin-inline: 0.5rem;
  opacity: 0.55;
}

.display {
  font-size: clamp(2.75rem, 8vw, 5.75rem);
  line-height: 0.95;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.sunset {
  background: var(--sunset);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  display: inline-block;
  padding-block-end: 0.12em;
}

@media (forced-colors: active) {
  .sunset {
    background: none;
    color: CanvasText;
  }
}

.h2 {
  font-size: clamp(2rem, 4.6vw, 3.5rem);
  line-height: 1;
  letter-spacing: -0.03em;
  max-width: 16ch;
  margin-block: 14px 22px;
  text-wrap: balance;
}

.h2-wide {
  max-width: 24ch;
}

h3 {
  font-size: 1.125rem;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.lede {
  font-size: clamp(1.0625rem, 1.6vw, 1.25rem);
  color: var(--muted);
  max-width: var(--measure);
}

.metric {
  font-size: clamp(2.25rem, 4vw, 3.25rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
}

.fineprint {
  font-size: 0.875rem;
  color: var(--muted);
}

/* ---------- Controls ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 0;
  font-family: var(--mono);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  transition:
    transform 160ms ease,
    background-color 160ms ease;
}

.btn-primary {
  background: var(--accent);
  color: var(--on-accent);
  border: 1px solid var(--accent);
}

.btn-primary:hover {
  background: #f39a7f;
}

.btn-secondary {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--edge);
}

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

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

.btn-small {
  min-height: 44px;
  padding: 0 16px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}

.chip::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.chip.in {
  background: #dcebdf;
  color: var(--positive);
}

.chip.reconnecting {
  background: var(--live-soft);
  color: var(--live);
}

/* ---------- Masthead ---------- */

.masthead {
  position: sticky;
  top: 0;
  z-index: 5;
  background: rgb(242 239 230 / 0.86);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--hairline);
}

.masthead-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font-family: var(--mono);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-decoration: none;
}

.wordmark-quiet {
  min-height: 32px;
}

.nav {
  display: none;
  gap: 28px;
}

.nav a {
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
}

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

@media (min-width: 860px) {
  .nav {
    display: flex;
  }
}

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

.hero {
  background-image: var(--mesh);
  border-bottom: 1px solid var(--hairline);
  padding-block: clamp(40px, 7vw, 96px) 0;
}

.hero-grid {
  display: grid;
  gap: 48px;
  align-items: center;
}

@media (min-width: 1000px) {
  .hero-grid {
    grid-template-columns: 1.05fr 1fr;
    gap: 56px;
  }
}

.hero-copy .display {
  margin-block: 18px 22px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-block: 30px 18px;
}

/* The room illustration */

.room {
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 16px;
}

.room-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--hairline);
}

.room-count {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
  white-space: nowrap;
}

.room-count b {
  color: var(--ink);
  font-size: 1rem;
}

.tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding-block: 14px;
}

@media (min-width: 520px) {
  .tiles {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.tile {
  position: relative;
  display: grid;
  gap: 6px;
  padding: 8px;
  background: var(--ground);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
}

.who {
  font-size: 0.8125rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* The status sits on the picture, as it does in the product, so the name keeps the whole row. */
.tile .chip {
  position: absolute;
  left: 13px;
  bottom: 34px;
  box-shadow: 0 0 0 2px var(--surface);
}

.counter:not(:empty)::before {
  content: " ";
}

/* An abstract lesson page in each tile: never a real screen, never a real product. */
.screen {
  grid-column: 1 / -1;
  aspect-ratio: 16 / 10;
  border-radius: 2px;
  background:
    linear-gradient(var(--sunken), var(--sunken)) 8% 14% / 46% 8% no-repeat,
    linear-gradient(#d4cdbd, #d4cdbd) 8% 34% / 84% 5% no-repeat,
    linear-gradient(#d4cdbd, #d4cdbd) 8% 46% / 70% 5% no-repeat,
    linear-gradient(#d4cdbd, #d4cdbd) 8% 58% / 78% 5% no-repeat,
    #fffdf8;
  border: 1px solid var(--hairline);
  transition: filter 300ms ease;
}

.s1 {
  background:
    linear-gradient(var(--sunken), var(--sunken)) 8% 14% / 46% 8% no-repeat,
    linear-gradient(#d4cdbd, #d4cdbd) 8% 34% / 84% 5% no-repeat,
    linear-gradient(#d4cdbd, #d4cdbd) 8% 46% / 70% 5% no-repeat,
    linear-gradient(#f6d9cf, #f6d9cf) 8% 76% / 32% 12% no-repeat,
    #fffdf8;
}

.s2 {
  background:
    linear-gradient(#cfdde6, #cfdde6) 8% 16% / 38% 30% no-repeat,
    linear-gradient(#d4cdbd, #d4cdbd) 56% 16% / 36% 5% no-repeat,
    linear-gradient(#d4cdbd, #d4cdbd) 56% 28% / 30% 5% no-repeat,
    linear-gradient(#d4cdbd, #d4cdbd) 8% 62% / 84% 5% no-repeat,
    #fffdf8;
}

.s3 {
  background:
    linear-gradient(var(--sunken), var(--sunken)) 8% 14% / 60% 8% no-repeat,
    repeating-linear-gradient(90deg, #e9e4d7 0 18%, transparent 18% 22%) 8% 50% / 84% 26% no-repeat,
    #fffdf8;
}

.s4 {
  background:
    radial-gradient(circle at 30% 52%, #e7c6b9 0 18%, transparent 19%),
    linear-gradient(#d4cdbd, #d4cdbd) 58% 36% / 34% 5% no-repeat,
    linear-gradient(#d4cdbd, #d4cdbd) 58% 50% / 28% 5% no-repeat,
    linear-gradient(#d4cdbd, #d4cdbd) 58% 64% / 32% 5% no-repeat,
    #fffdf8;
}

.s5 {
  background:
    linear-gradient(var(--sunken), var(--sunken)) 8% 14% / 40% 8% no-repeat,
    linear-gradient(#d4cdbd, #d4cdbd) 8% 36% / 84% 5% no-repeat,
    linear-gradient(#d9e3d8, #d9e3d8) 8% 62% / 40% 22% no-repeat,
    linear-gradient(#d9e3d8, #d9e3d8) 52% 62% / 40% 22% no-repeat,
    #fffdf8;
}

.s6 {
  background:
    linear-gradient(#d4cdbd, #d4cdbd) 8% 18% / 84% 5% no-repeat,
    linear-gradient(#d4cdbd, #d4cdbd) 8% 30% / 64% 5% no-repeat,
    linear-gradient(#cfdde6, #cfdde6) 8% 56% / 84% 28% no-repeat,
    #fffdf8;
}

.tile.is-out .screen {
  filter: grayscale(1) opacity(0.45);
}

.tile.is-out {
  border-color: var(--live);
}

/* The heartbeat instrument */

.trace {
  border-top: 1px solid var(--hairline);
  padding-top: 12px;
}

.trace-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.grace-read b {
  color: var(--ink);
}

.trace-svg {
  width: 100%;
  height: 56px;
  overflow: hidden;
}

.trace-base {
  stroke: var(--hairline);
  stroke-width: 1;
}

.trace-line {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.6;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.trace-gap {
  fill: var(--live-soft);
}

.playhead {
  stroke: var(--accent);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.grace-bar {
  height: 4px;
  background: var(--sunken);
  margin-top: 8px;
  overflow: hidden;
}

.grace-bar span {
  display: block;
  height: 100%;
  width: 100%;
  background: var(--live);
  transform: scaleX(0);
  transform-origin: left center;
}

.room-caption {
  position: relative;
  min-height: 1.6em;
  margin-top: 12px;
  font-size: 0.875rem;
  font-weight: 600;
}

.room-caption span {
  position: absolute;
  inset: 0;
}

.room-caption [data-caption-b],
.room-caption [data-caption-c] {
  opacity: 0;
}

/* The strip of constants */

.strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: clamp(48px, 7vw, 88px);
  margin-bottom: 0;
  border-top: 1px solid var(--hairline);
}

.strip > div {
  padding: 22px 16px 26px 0;
  border-bottom: 1px solid var(--hairline);
}

.strip dd {
  margin: 10px 0 0;
  max-width: 24ch;
  font-size: 0.9375rem;
  color: var(--muted);
}

@media (min-width: 860px) {
  .strip {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .strip > div {
    border-bottom: 0;
    padding-inline: 0 24px;
  }

  .strip > div + div {
    border-left: 1px solid var(--hairline);
    padding-left: 24px;
  }
}

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

.section {
  padding-block: clamp(56px, 8vw, 104px);
  border-bottom: 1px solid var(--hairline);
}

.section-surface {
  background: var(--surface);
}

/* Features */

.features {
  display: grid;
  margin-top: 36px;
  border-top: 1px solid var(--hairline);
}

.feature {
  display: grid;
  grid-template-columns: 40px 1fr;
  column-gap: 16px;
  align-items: start;
  padding: 22px 0;
  border-bottom: 1px solid var(--hairline);
}

.feature h3 {
  grid-column: 2;
  margin-bottom: 4px;
}

.feature p {
  grid-column: 2;
  color: var(--muted);
  font-size: 0.9688rem;
  max-width: 40ch;
}

.icon {
  grid-row: 1 / span 2;
  width: 40px;
  height: 40px;
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.feature:hover .icon {
  stroke: var(--live);
}

@media (min-width: 720px) {
  .features {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 32px;
  }
}

@media (min-width: 1000px) {
  .features {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    column-gap: 40px;
  }

  .feature {
    padding: 28px 0;
  }
}

.note {
  margin-top: 20px;
  max-width: 70ch;
}

/* Privacy */

.day {
  margin: 36px 0 0;
}

.day-bar {
  display: grid;
  grid-template-columns: 1.03fr 2.67fr 4.3fr;
  height: 40px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}

.day-off {
  background: repeating-linear-gradient(135deg, transparent 0 7px, var(--sunken) 7px 9px);
}

.day-on {
  background: var(--live);
  transform-origin: left center;
}

.day-marks {
  display: grid;
  grid-template-columns: 1.03fr 2.67fr 4.3fr auto;
  margin-top: 8px;
  font-family: var(--mono);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.mark {
  color: var(--ink);
  white-space: nowrap;
}

.day-marks span:last-child {
  text-align: right;
}

@media (max-width: 560px) {
  .day-marks {
    grid-template-columns: 1fr 1fr;
    row-gap: 4px;
  }

  .day-marks span:last-child {
    text-align: left;
  }
}

.day figcaption {
  margin-top: 12px;
  font-size: 0.9375rem;
  color: var(--muted);
}

.points {
  display: grid;
  gap: 0;
  margin-top: 36px;
  border-top: 1px solid var(--hairline);
}

.points li {
  padding: 18px 0;
  border-bottom: 1px solid var(--hairline);
}

.points h3 {
  margin-bottom: 4px;
}

.points p {
  color: var(--muted);
  font-size: 0.9688rem;
}

@media (min-width: 720px) {
  .points {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 32px;
  }
}

@media (min-width: 1000px) {
  .points {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .points li {
    border-bottom: 0;
    padding: 22px 24px 0 0;
  }

  .points li + li {
    border-left: 1px solid var(--hairline);
    padding-left: 24px;
  }
}

/* Gallery */

.gallery {
  display: grid;
  gap: 28px;
  margin-block: 36px 20px;
}

.shot {
  margin: 0;
}

.shot img {
  width: 100%;
  height: auto;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  background: var(--ground);
}

.shot figcaption {
  display: flex;
  gap: 10px;
  align-items: baseline;
  margin-top: 10px;
  font-size: 0.9375rem;
  color: var(--muted);
}

.shot figcaption b {
  flex: none;
  white-space: nowrap;
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
}

@media (min-width: 860px) {
  .gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Footer: who runs this, and how to reach them */

.footer {
  padding-block: 44px 36px;
  background-image: var(--mesh);
}

.footer-grid {
  display: grid;
  gap: 28px;
}

.footer-line {
  margin-top: 12px;
  max-width: 36ch;
  color: var(--muted);
}

.footer-facts {
  display: grid;
  gap: 14px;
  margin: 0;
}

.footer-facts dd {
  margin: 4px 0 0;
  font-weight: 600;
}

.footer-small {
  padding-top: 20px;
  border-top: 1px solid var(--hairline);
  font-size: 0.875rem;
  color: var(--muted);
}

@media (min-width: 860px) {
  .footer-grid {
    grid-template-columns: 1fr 1.4fr;
    align-items: start;
  }

  .footer-facts {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .footer-small {
    grid-column: 1 / -1;
  }
}

/* Motion: everything above is complete without it. */

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

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