@font-face {
  font-family: "Newsreader";
  src: url("assets/fonts/newsreader.woff2") format("woff2");
  font-weight: 300 600;
  font-style: normal;
  font-display: swap;
}

/* The sky and ink are driven by scroll position (day.js). These are the 6 am values. */
:root {
  --sky-top: #2b2e5a;
  --sky-mid: #9b5b8c;
  --sky-bottom: #f4a07a;
  --ink: #fff7f0;
  --ink-soft: rgba(255, 247, 240, 0.74);
  --line: rgba(255, 247, 240, 0.22);
  --glass: rgba(255, 255, 255, 0.12);
  --sun-x: 18vw;
  --sun-y: 70vh;
  --sun-opacity: 1;
  --moon-opacity: 0;
  --stars: 0;
  --yellow: #ffd60a;
  --serif: "Newsreader", "New York", "Iowan Old Style", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--sky-top);
  color: var(--ink);
  font: 1.0625rem/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ---------- Sky ---------- */

.sky {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: linear-gradient(180deg, var(--sky-top) 0%, var(--sky-mid) 55%, var(--sky-bottom) 100%);
}

.sky .sun,
.sky .moon {
  position: absolute;
  left: 0;
  top: 0;
  border-radius: 50%;
  will-change: transform, opacity;
}

.sky .sun {
  width: 44vmax;
  height: 44vmax;
  margin: -22vmax 0 0 -22vmax;
  background: radial-gradient(circle, rgba(255, 246, 220, 0.95) 0 5%, rgba(255, 214, 150, 0.55) 12%, rgba(255, 190, 120, 0.18) 34%, transparent 62%);
  transform: translate(var(--sun-x), var(--sun-y));
  opacity: var(--sun-opacity);
}

.sky .moon {
  width: 16vmax;
  height: 16vmax;
  margin: -8vmax 0 0 -8vmax;
  background: radial-gradient(circle, rgba(244, 246, 255, 0.95) 0 11%, rgba(210, 222, 255, 0.22) 18%, transparent 58%);
  transform: translate(88vw, 11vh);
  opacity: var(--moon-opacity);
}

.sky .stars {
  position: absolute;
  inset: 0;
  opacity: var(--stars);
  background-image:
    radial-gradient(1.4px 1.4px at 12% 18%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 27% 8%, #fff 50%, transparent 51%),
    radial-gradient(1.6px 1.6px at 41% 26%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 56% 12%, #fff 50%, transparent 51%),
    radial-gradient(1.2px 1.2px at 64% 34%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 71% 6%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 86% 28%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 93% 14%, #fff 50%, transparent 51%),
    radial-gradient(1.2px 1.2px at 8% 40%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 34% 44%, #fff 50%, transparent 51%),
    radial-gradient(1.3px 1.3px at 50% 50%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 79% 46%, #fff 50%, transparent 51%);
}

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

.bar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px max(20px, calc((100vw - 1160px) / 2));
  background: linear-gradient(180deg, color-mix(in srgb, var(--sky-top) 70%, transparent), transparent);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-mask-image: linear-gradient(180deg, #000 70%, transparent);
  mask-image: linear-gradient(180deg, #000 70%, transparent);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.brand img {
  width: 28px;
  height: 28px;
  border-radius: 7px;
}

.bar nav {
  display: flex;
  gap: 22px;
  font-size: 0.9375rem;
}

.bar nav a {
  color: var(--ink-soft);
  text-decoration: none;
}

.bar nav a:hover,
.bar nav a[aria-current="page"] {
  color: var(--ink);
}

/* ---------- Hours (sections) ---------- */

.hour {
  display: grid;
  align-items: center;
  min-height: 100svh;
  padding: 96px max(20px, calc((100vw - 1160px) / 2));
}

.hour-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  align-items: center;
  gap: clamp(40px, 7vw, 110px);
}

.time {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 20px;
  font: 400 1.375rem/1 var(--serif);
  color: var(--ink-soft);
}

.time::after {
  content: "";
  width: 56px;
  height: 1px;
  background: currentColor;
  opacity: 0.6;
}

h1,
h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-optical-sizing: auto;
  text-wrap: balance;
}

h1 {
  font-size: clamp(3.1rem, 7.4vw, 6.4rem);
  line-height: 0.98;
  letter-spacing: -0.025em;
}

h2 {
  font-size: clamp(2.4rem, 4.8vw, 4rem);
  line-height: 1.02;
  letter-spacing: -0.02em;
}

.lede {
  max-width: 34ch;
  margin: 26px 0 0;
  font-size: clamp(1.125rem, 1.6vw, 1.3125rem);
  line-height: 1.5;
  color: var(--ink-soft);
  text-wrap: pretty;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 24px;
  margin-top: 36px;
}

.soon {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px 12px 16px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--sky-top);
  font-weight: 600;
  font-size: 0.9375rem;
}

.soon svg {
  width: 18px;
  height: 18px;
}

.text-link {
  color: var(--ink);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-underline-offset: 5px;
}

.text-link:hover {
  text-decoration-color: currentColor;
}

/* ---------- The 9:16 frame ---------- */

.frame {
  position: relative;
  justify-self: center;
  width: min(360px, 74vw);
  aspect-ratio: 9 / 16;
  margin: 0;
  overflow: hidden;
  border-radius: 30px;
  background: #0a0c14;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.14),
    0 40px 80px -20px rgba(10, 8, 30, 0.55),
    0 12px 30px -10px rgba(10, 8, 30, 0.35);
  container-type: inline-size;
}

.frame video,
.frame > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---------- Layout playground ---------- */

.playground {
  display: grid;
  justify-items: center;
  gap: 26px;
}

.tile {
  position: absolute;
  display: grid;
  place-items: center;
  overflow: hidden;
  background-size: cover;
  background-position: center;
  transition:
    left 0.55s var(--ease),
    top 0.55s var(--ease),
    width 0.55s var(--ease),
    height 0.55s var(--ease),
    opacity 0.35s ease;
}

.tile span {
  color: #fff;
  font: 400 6.2cqw/1 var(--serif);
  text-shadow: 0 0 1.6cqw rgba(0, 0, 0, 0.55);
}

.tile[hidden] {
  display: grid;
  opacity: 0;
  pointer-events: none;
}

.picker {
  display: flex;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(20px) saturate(170%);
  backdrop-filter: blur(20px) saturate(170%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.picker button {
  position: relative;
  width: 34px;
  height: 52px;
  padding: 5px;
  border: 0;
  border-radius: 10px;
  background: none;
  cursor: pointer;
  transition: transform 0.1s ease-out;
}

.picker button:active {
  transform: scale(0.92);
}

.picker .glyph {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
}

.picker .glyph i {
  position: absolute;
  border-radius: 2px;
  background: var(--ink-soft);
  opacity: 0.55;
  transition: background 0.2s, opacity 0.2s;
}

.picker button[aria-checked="true"] .glyph i {
  background: var(--yellow);
  opacity: 1;
}

.picker-name {
  margin: -12px 0 0;
  min-height: 1.6em;
  color: var(--ink-soft);
  font-size: 0.9375rem;
}

/* ---------- Tools (3 pm) ---------- */

.tools {
  display: grid;
  gap: 22px;
  margin: 36px 0 0;
  padding: 0;
  list-style: none;
  max-width: 30rem;
}

.tools li {
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  gap: 16px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.tools strong {
  font: 500 1.25rem/1.3 var(--serif);
}

.tools span {
  color: var(--ink-soft);
}

.screens {
  position: relative;
  justify-self: center;
  width: min(460px, 86vw);
  height: min(640px, 110vw);
}

.screen {
  position: absolute;
  width: 62%;
  margin: 0;
  overflow: hidden;
  border-radius: 34px;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.16),
    0 36px 70px -24px rgba(40, 20, 0, 0.55);
}

.screen img {
  display: block;
  width: 100%;
  height: auto;
}

.screen:first-child {
  left: 0;
  top: 0;
}

.screen:last-child {
  right: 0;
  bottom: 0;
}

.screen.solo {
  position: relative;
  justify-self: center;
  width: min(320px, 70vw);
}

.spec {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 30px 0 0;
  padding: 0;
  list-style: none;
}

.spec li {
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.9375rem;
}

/* ---------- Night ---------- */

.night {
  text-align: center;
}

.night .lede {
  margin-inline: auto;
}

.night .time {
  justify-content: center;
}

.night .time::before {
  content: "";
  width: 56px;
  height: 1px;
  background: currentColor;
  opacity: 0.6;
}

.night .actions {
  justify-content: center;
}

.icon-large {
  width: 96px;
  height: 96px;
  margin: 0 auto 30px;
  border-radius: 22px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}

footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 24px;
  padding: 28px max(20px, calc((100vw - 1160px) / 2)) 40px;
  color: var(--ink-soft);
  font-size: 0.875rem;
}

footer nav {
  display: flex;
  gap: 20px;
}

footer a {
  text-decoration: none;
}

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

/* ---------- Document pages (privacy, support) ---------- */

.doc-page {
  --sky-top: #3d8fd6;
  --sky-mid: #8ccbf2;
  --sky-bottom: #eaf6fc;
  --ink: #0e2340;
  --ink-soft: rgba(14, 35, 64, 0.72);
  --line: rgba(14, 35, 64, 0.14);
  --glass: rgba(255, 255, 255, 0.6);
  --sun-x: 82vw;
  --sun-y: 8vh;
  color-scheme: light;
}

.doc-page .bar {
  background: linear-gradient(180deg, rgba(61, 143, 214, 0.6), transparent);
}

.doc-page .bar nav a,
.doc-page .brand {
  color: #fff;
}

.doc-page .bar nav a[aria-current="page"] {
  text-decoration: underline;
  text-underline-offset: 5px;
}

.sheet {
  width: min(760px, 100% - 32px);
  margin: 48px auto 64px;
  padding: clamp(28px, 6vw, 64px);
  border-radius: 32px;
  background: rgba(255, 255, 255, 0.82);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  backdrop-filter: blur(24px) saturate(160%);
  box-shadow: 0 30px 80px -30px rgba(14, 35, 64, 0.35);
}

.sheet h1 {
  font-size: clamp(2.6rem, 6vw, 3.8rem);
}

.sheet .updated {
  margin: 12px 0 36px;
  color: var(--ink-soft);
}

.sheet h2 {
  margin: 40px 0 10px;
  font-size: 1.625rem;
  letter-spacing: -0.01em;
}

.sheet p,
.sheet li {
  max-width: 64ch;
}

.sheet ul {
  padding-left: 1.2em;
}

.sheet li + li {
  margin-top: 8px;
}

.sheet details {
  border-bottom: 1px solid var(--line);
}

.sheet summary {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 0;
  cursor: pointer;
  list-style: none;
  font: 500 1.25rem/1.35 var(--serif);
}

.sheet summary::-webkit-details-marker {
  display: none;
}

.sheet summary::after {
  content: "+";
  flex: none;
  font-family: var(--sans);
  font-weight: 300;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--ink-soft);
  transition: transform 0.25s var(--ease);
}

.sheet details[open] summary::after {
  transform: rotate(45deg);
}

.sheet details p {
  margin: 0 0 22px;
  color: var(--ink-soft);
}

.note {
  margin-top: 40px;
  padding: 22px 24px;
  border-radius: 20px;
  background: rgba(61, 143, 214, 0.1);
}

.note a {
  font-weight: 600;
  color: #0b5cad;
}

.doc-page footer {
  color: rgba(14, 35, 64, 0.7);
}

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

@media (max-width: 860px) {
  .hour {
    min-height: auto;
    padding-block: 72px;
  }

  .hour-grid {
    grid-template-columns: 1fr;
  }

  .hero .frame {
    order: 2;
  }

  .screens {
    height: min(600px, 128vw);
  }
}

@media (max-width: 420px) {
  .picker {
    gap: 2px;
    padding: 6px 8px;
  }

  .picker button {
    width: 30px;
    height: 46px;
    padding: 4px;
  }

  .tools li {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

/* ---------- Preferences ---------- */

@media (prefers-reduced-motion: reduce) {
  .tile,
  .picker button,
  .sheet summary::after {
    transition: opacity 0.2s ease;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .bar,
  .picker,
  .sheet {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  .sheet {
    background: #fff;
  }
}
