/* Durpin teaser. Safelight palette from docs/product/03-design-system.md. */

@font-face {
  font-family: 'Space Mono';
  src: url('/fonts/SpaceMono_700Bold.ttf') format('truetype');
  font-weight: 700;
  font-display: swap;
}

:root {
  --ground: #0C0A09;
  --raised: #171412;
  --paper: #F6F1EA;
  --paper2: #B4ABA1;
  --paper3: #8C8379;
  --safelight: #FF6A3D;
  --stamp: #FF9A4A;
  --darkroom: #6B1A0E;
  --darkroom-deep: #1A0B07;
  --print: #F4EDE3;
  --hairline: rgba(255, 238, 220, 0.10);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  /* Dim red light from the top, across the whole page width */
  background:
    radial-gradient(ellipse 70% 520px at 50% 0%, rgba(107, 26, 14, 0.45), transparent 100%) no-repeat,
    var(--ground);
  color: var(--paper);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

main,
footer {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 20px;
}

.stamp {
  font-family: 'Space Mono', ui-monospace, monospace;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--stamp);
  text-shadow: 0 0 10px rgba(255, 120, 40, 0.55);
  margin: 0;
}

/* Hero */

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  color: var(--paper);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.mark {
  width: 30px;
  height: 30px;
  color: var(--safelight);
}

.hero {
  padding: 72px 0 56px;
  text-align: center;
}

h1 {
  font-size: clamp(28px, 9vw, 56px);
  overflow-wrap: break-word;
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 16px auto 12px;
  max-width: 14ch;
}

.lede {
  font-size: clamp(17px, 2.4vw, 20px);
  color: var(--paper2);
  margin: 0 auto 48px;
  max-width: 32ch;
}

.status {
  color: var(--paper3);
  font-size: 15px;
  margin: 40px 0 0;
}

/* The print: rises out of the darkroom red and develops */

.print {
  width: min(300px, 78vw);
  margin: 0 auto;
  padding: 12px 12px 44px;
  background: var(--print);
  border-radius: 3px;
  transform: rotate(1.2deg);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.6);
  animation: rise 1.2s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.photo {
  position: relative;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background:
    /* Sun low over the water, its glow, then the sky */
    radial-gradient(circle at 50% 52%, #FBE3A6 0 9%, rgba(251, 227, 166, 0) 9.5%),
    radial-gradient(ellipse 80% 36% at 50% 54%, rgba(255, 176, 110, 0.75), rgba(255, 176, 110, 0) 70%),
    /* Water below the horizon */
    linear-gradient(180deg, transparent 0 56%, #3B2F45 56%, #2A2538 74%, #1C1A28 100%),
    linear-gradient(180deg, #E8A06B 0%, #D9805E 28%, #B9625A 46%, #8E4E5A 56%);
}

/* The sun's path on the water */
.photo::after {
  content: '';
  position: absolute;
  left: 44%;
  right: 44%;
  top: 57%;
  bottom: 8%;
  background: repeating-linear-gradient(180deg, rgba(251, 214, 150, 0.55) 0 3px, transparent 3px 9px);
  filter: blur(0.6px);
  -webkit-mask-image: linear-gradient(180deg, #000, transparent);
  mask-image: linear-gradient(180deg, #000, transparent);
}

/* Darkroom red over the photo, clearing slowly */
.photo::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background: var(--darkroom);
  animation: develop 4s 0.8s ease-in-out both;
}

/* The date stamp (03-design-system.md): bottom right, 3.6% of the
   width, inset 4%. It lands once the photo has developed. */
.photo {
  container-type: inline-size;
}

.date {
  position: absolute;
  right: 4cqw;
  bottom: 3.2cqw;
  font-family: 'Space Mono', ui-monospace, monospace;
  font-weight: 700;
  font-size: max(3.6cqw, 9px);
  line-height: 1.2;
  color: var(--stamp);
  text-shadow: 0 0 6px rgba(255, 120, 40, 0.65);
  transform-origin: right bottom;
  z-index: 2;
  animation: stamp 0.3s 4.6s ease-out both;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(40px) rotate(1.2deg) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) rotate(1.2deg) scale(1);
  }
}

@keyframes stamp {
  from {
    opacity: 0;
    transform: scale(1.1);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

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

/* How it works */

section h2 {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--paper3);
  margin: 0 0 20px;
}

.loop,
.promises,
.story {
  padding: 48px 0;
  border-top: 1px solid var(--hairline);
}

.loop ol {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 28px;
}

.step {
  font-family: 'Space Mono', ui-monospace, monospace;
  font-weight: 700;
  font-size: 13px;
  color: var(--stamp);
}

.loop h3 {
  font-size: 20px;
  margin: 6px 0 6px;
}

.loop p,
.promises li {
  color: var(--paper2);
  margin: 0;
}

.promises ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 16px;
}

.promises strong {
  color: var(--paper);
  font-weight: 600;
}

/* Footer */

footer {
  padding: 40px 20px 56px;
  border-top: 1px solid var(--hairline);
  color: var(--paper3);
  font-size: 14px;
}

footer p {
  margin: 4px 0 0;
}

@media (prefers-reduced-motion: reduce) {
  .print,
  .photo::before,
  .date {
    animation: none;
  }
  .photo::before {
    opacity: 0;
  }
}

/* Invite page */

.invite .code-label {
  margin: 8px 0 6px;
  color: var(--paper3);
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.invite .code {
  font-family: 'Space Mono', ui-monospace, monospace;
  font-weight: 700;
  font-size: 40px;
  letter-spacing: 0.18em;
  color: var(--paper);
  margin: 0 0 32px;
}

.button {
  display: inline-block;
  padding: 16px 32px;
  border-radius: 999px;
  background: var(--safelight);
  color: var(--ground);
  font-weight: 600;
  font-size: 17px;
  text-decoration: none;
}

.invite .status {
  max-width: 34ch;
  margin: 32px auto 0;
}

.status a {
  color: var(--paper);
  text-underline-offset: 3px;
}

footer a {
  color: inherit;
  text-decoration: none;
}

footer .links a {
  color: var(--paper2);
  text-decoration: underline;
  text-decoration-color: var(--hairline);
  text-underline-offset: 3px;
}

footer .links a:hover,
footer .links a:focus-visible {
  color: var(--paper);
}

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

/* Why it's built this way */

.story > p {
  color: var(--paper2);
  margin: 0 0 28px;
  max-width: 60ch;
}

.story dl {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px 28px;
}

.story dt {
  font-weight: 600;
  margin: 0 0 4px;
}

.story dd {
  margin: 0;
  color: var(--paper2);
}

/* Privacy page */

.updated {
  color: var(--paper3);
  font-size: 14px;
  margin: 0;
}

/* Not found */

.lost .button {
  margin-top: 8px;
}

/* The bar at the top of every page */

header.site {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(12, 10, 9, 0.78);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--hairline);
}

header.site .bar {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 20px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

header.site .brand {
  font-size: 17px;
  gap: 9px;
  color: var(--paper);
  text-decoration: none;
}

header.site .brand img {
  display: block;
  width: 28px;
  height: 28px;
  border-radius: 7px;
}

header.site nav {
  display: flex;
  gap: 4px;
}

header.site nav a {
  color: var(--paper2);
  text-decoration: none;
  font-size: 15px;
  padding: 7px 12px;
  border-radius: 999px;
  white-space: nowrap;
}

header.site nav a:hover {
  color: var(--paper);
  background: var(--raised);
}

header.site nav a[aria-current='page'] {
  color: var(--paper);
  background: rgba(255, 106, 61, 0.14);
  box-shadow: inset 0 0 0 1px rgba(255, 106, 61, 0.35);
}

main.wide {
  max-width: 1080px;
}

/* Feature pages and What's new (made by scripts/build-site-features.mjs) */

.hero .stamp a {
  color: inherit;
  text-decoration: none;
}

.hero .lede:last-child {
  margin-bottom: 0;
}

/* "New in build 8", "Since build 7": a small LCD-style label */
.badge {
  display: inline-block;
  margin: 0;
  font-family: 'Space Mono', ui-monospace, monospace;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--paper3);
}

.badge.new {
  color: var(--stamp);
  text-shadow: 0 0 8px rgba(255, 120, 40, 0.45);
}

.badge a {
  color: inherit;
  text-decoration: none;
}

.hero .badge {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--hairline);
  background: rgba(23, 20, 18, 0.7);
}

.hero .badge.new {
  border-color: rgba(255, 106, 61, 0.4);
}

/* A link that reads like a button, under a hero */
.cta {
  margin: 0;
}

.loop .cta {
  margin-top: 32px;
}

.cta a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: 999px;
  background: var(--safelight);
  color: #1A0B07;
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
}

.cta a::after {
  content: '\2192';
}

.cta a:hover {
  background: #FF7E57;
}

.doc,
.features {
  padding: 48px 0;
  border-top: 1px solid var(--hairline);
}

.doc p,
.doc li {
  color: var(--paper2);
}

.doc p {
  margin: 0 0 16px;
  max-width: 62ch;
}

.doc > :last-child {
  margin-bottom: 0;
}

.doc h2 {
  font-size: 13px;
}

.doc h3 {
  font-size: 19px;
  margin: 28px 0 8px;
}

.doc ul {
  margin: 0 0 16px;
  padding-left: 20px;
  display: grid;
  gap: 8px;
}

.doc li::marker {
  color: var(--stamp);
}

.doc strong {
  color: var(--paper);
  font-weight: 600;
}

.doc code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  color: var(--paper);
  background: var(--raised);
  padding: 1px 5px;
  border-radius: 4px;
  overflow-wrap: anywhere;
}

.doc a,
.what a {
  color: var(--paper);
  text-decoration-color: rgba(255, 106, 61, 0.55);
  text-underline-offset: 3px;
}

.doc a:hover,
.what a:hover {
  text-decoration-color: var(--safelight);
}

/* A phone: the recordings sit in a dark bezel, at their own size */

.phone {
  position: relative;
  padding: 7px;
  border-radius: 30px;
  background: linear-gradient(160deg, #26201C, #110E0C);
  box-shadow:
    inset 0 0 0 1px rgba(255, 238, 220, 0.09),
    0 24px 60px -24px rgba(0, 0, 0, 0.85),
    0 0 0 1px rgba(0, 0, 0, 0.6);
}

.phone img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 24px;
  background: var(--raised);
}

/* On a feature page: one recording, or two side by side (Android, iPhone) */

.shot {
  margin: 32px auto;
  max-width: 320px;
}

.shot figcaption {
  margin-top: 12px;
  text-align: center;
  font-family: 'Space Mono', ui-monospace, monospace;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--paper3);
}

.pair {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 320px));
  justify-content: center;
  /* Phones of different heights: their labels still line up */
  align-items: end;
  gap: 28px;
  margin: 32px 0;
}

.pair .shot {
  margin: 0;
  width: 100%;
}

.table {
  overflow-x: auto;
  margin: 0 0 16px;
}

.doc table {
  border-collapse: collapse;
  font-size: 15px;
  min-width: 100%;
}

.doc td,
.doc th {
  text-align: left;
  padding: 8px 12px 8px 0;
  border-bottom: 1px solid var(--hairline);
  vertical-align: top;
}

.doc td {
  color: var(--paper2);
}

/* The end of a feature page: the features before and after it */

.next {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  padding: 40px 0 64px;
  border-top: 1px solid var(--hairline);
}

.next a {
  display: grid;
  gap: 4px;
  padding: 16px 18px;
  border-radius: 16px;
  background: var(--raised);
  border: 1px solid var(--hairline);
  color: var(--paper);
  font-weight: 600;
  text-decoration: none;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.next a:hover {
  border-color: rgba(255, 106, 61, 0.45);
  transform: translateY(-2px);
}

.next span {
  font-family: 'Space Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--paper3);
  font-weight: 700;
}

/* The feature index: a grid of phones, the newest build's first and bigger */

.cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

/* The newest build's features: two to a row, so four make a square */
.cards.big {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 400px), 1fr));
  gap: 24px;
}

.card {
  display: flex;
  flex-direction: column;
  height: 100%;
  border-radius: 24px;
  background:
    radial-gradient(ellipse 90% 60% at 50% 0%, rgba(107, 26, 14, 0.35), transparent 70%),
    var(--raised);
  border: 1px solid var(--hairline);
  color: var(--paper);
  text-decoration: none;
  overflow: hidden;
  transition: border-color 0.25s ease, transform 0.25s ease;
}

.card:hover {
  border-color: rgba(255, 106, 61, 0.45);
  transform: translateY(-3px);
}

/* The phone peeks up from the bottom of its window, cut off like a photo */
.card .phone {
  width: 62%;
  max-width: 220px;
  margin: 28px auto 0;
  aspect-ratio: 9 / 15;
  overflow: hidden;
  border-radius: 30px 30px 0 0;
  padding-bottom: 0;
}

.card .phone img {
  height: 100%;
  object-fit: cover;
  object-position: top;
  border-radius: 24px 24px 0 0;
}

/* No recording yet: the phone shows the app icon */
.card .phone.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.card .phone.empty img {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  opacity: 0.85;
}

.card .phone.empty span {
  font-family: 'Space Mono', ui-monospace, monospace;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--paper3);
}

.cards.big .card .phone {
  width: 52%;
  max-width: 250px;
  margin-top: 36px;
}

.card-text {
  display: grid;
  gap: 6px;
  padding: 20px 22px 24px;
  border-top: 1px solid var(--hairline);
  background: var(--raised);
}

.card h3 {
  margin: 0;
  font-size: 19px;
  line-height: 1.25;
}

.card p {
  margin: 0;
  color: var(--paper2);
  font-size: 15px;
}

.card .badge {
  font-size: 11px;
}

/* What's new: a timeline, one stop per build, its number like a date stamp */

.timeline {
  position: relative;
  padding: 16px 0 64px;
  border-top: 1px solid var(--hairline);
}

.build {
  position: relative;
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 28px;
  padding: 32px 0;
}

/* The rail down the left, and a dot for each build */
.build::before {
  content: '';
  position: absolute;
  left: 150px;
  top: 0;
  bottom: 0;
  width: 1px;
  margin-left: 14px;
  background: var(--hairline);
}

.build::after {
  content: '';
  position: absolute;
  left: 150px;
  top: 42px;
  width: 9px;
  height: 9px;
  margin-left: 10px;
  border-radius: 50%;
  background: var(--paper3);
}

.build.latest::after {
  background: var(--safelight);
  box-shadow: 0 0 0 4px rgba(255, 106, 61, 0.2), 0 0 14px rgba(255, 106, 61, 0.7);
}

.when {
  text-align: right;
}

.when h2 {
  font-family: 'Space Mono', ui-monospace, monospace;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--paper);
  margin: 4px 0 4px;
}

.latest .when h2 {
  color: var(--stamp);
  text-shadow: 0 0 10px rgba(255, 120, 40, 0.55);
}

.when p {
  margin: 0;
  color: var(--paper3);
  font-size: 14px;
}

.when .tag {
  display: inline-block;
  margin-top: 10px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: #1A0B07;
  background: var(--safelight);
}

.what {
  padding-left: 28px;
}

.latest .what {
  padding: 22px 24px 24px;
  margin-left: 28px;
  border-radius: 20px;
  background: var(--raised);
  border: 1px solid rgba(255, 106, 61, 0.3);
}

.what .note {
  margin: 0 0 16px;
  color: var(--paper);
}

.what h3 {
  font-family: 'Space Mono', ui-monospace, monospace;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--paper3);
  margin: 0 0 10px;
}

.what ul.new,
.what ul.fixed {
  list-style: none;
  margin: 0 0 22px;
  padding: 0;
  display: grid;
  gap: 9px;
}

.what ul.new li,
.what ul.fixed li {
  position: relative;
  padding-left: 22px;
  color: var(--paper2);
}

.what ul.new li::before,
.what ul.fixed li::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 0.62em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--safelight);
}

.what ul.fixed li::before {
  background: transparent;
  box-shadow: inset 0 0 0 1.5px var(--paper3);
}

.what > :last-child {
  margin-bottom: 0;
}

.what .more {
  list-style: none;
  margin: 4px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.what .more a {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--hairline);
  background: rgba(12, 10, 9, 0.6);
  color: var(--paper);
  font-size: 14px;
  text-decoration: none;
}

.what .more a:hover {
  border-color: rgba(255, 106, 61, 0.5);
}

/* Footer links on one line, wrapping on a phone */

footer .links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-top: 12px;
}

footer .links a[aria-current='page'] {
  color: var(--paper);
}

@media (max-width: 640px) {
  header.site .bar {
    padding: 0 16px;
  }
  header.site .brand span {
    display: none;
  }
  header.site nav a {
    padding: 7px 10px;
  }
  main,
  footer {
    padding-left: 16px;
    padding-right: 16px;
  }
  .hero {
    padding: 48px 0 40px;
  }
  .build {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 24px 0 24px 26px;
  }
  .build::before,
  .build::after {
    left: 0;
    margin-left: 4px;
  }
  .build::after {
    top: 33px;
    margin-left: 0;
  }
  .when {
    text-align: left;
  }
  .when .tag {
    margin-top: 6px;
  }
  .what,
  .latest .what {
    padding-left: 0;
    margin-left: 0;
  }
  .latest .what {
    padding: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .card,
  .next a {
    transition: none;
  }
  .card:hover,
  .next a:hover {
    transform: none;
  }
}
