@import url("fonts.css");

@font-face {
  font-family: "PP Writer";
  src: url(assets/fonts/PPWriter-Book.woff2) format("woff2"), url(assets/fonts/PPWriter-Book.woff) format("woff");
  font-display: swap;
}

:root {
  --bg: #ffffff;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --line: #d2d2d7;
  --bezel: #1d1d1f;
  --panel: #a9b39c;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0f0f10;
  --text: #ececec;
  --muted: #9a9aa0;
  --line: #3a3a3e;
  --bezel: #2c2c2e;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 18px/1.6 "PP Writer", Georgia, serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }

.page {
  max-width: 1080px;
  margin: 0 auto;
  padding: 120px 40px 96px;
  display: grid;
  grid-template-columns: 426px minmax(0, 1fr);
  gap: 104px;
  align-items: start;
}

/* The phone: the top half of an iPhone, fading into the page. */
.device { position: sticky; top: 48px; }
.phone {
  position: relative;
  background: var(--bezel);
  padding: 12px 12px 0;
  border-radius: 74px 74px 0 0;
}
.screen {
  position: relative;
  border-radius: 62px 62px 0 0;
  overflow: hidden;
  background: var(--panel);
}
#lcd {
  display: block;
  width: 100%;
  aspect-ratio: 402 / 450;
  touch-action: pan-y; /* horizontal drags scroll the map */
}
.island {
  position: absolute;
  top: 11px;
  left: 50%;
  width: 31%;
  height: 37px;
  transform: translateX(-50%);
  background: #000;
  border-radius: 20px;
  pointer-events: none;
}
/* The phone fades into the page at the bottom. */
.fade {
  position: absolute;
  left: -1px;
  right: -1px;
  bottom: -1px;
  height: 30%;
  background: linear-gradient(to bottom, transparent, var(--bg) 92%);
  pointer-events: none;
}

/* The controls, after the app's (Radio98/UI/Widgets.swift): a 2-pixel black border with
   stepped corners, white, or black with white writing when chosen; bold pixel Helvetica. */
:root { --ink: #000; --paper: #fff; }
:root[data-theme="dark"] { --ink: #e9e9e6; --paper: #0f0f10; }

.controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}
.px-button, .px-strip {
  /* Stepped corners: two pixels clear at each, as the app's pixelFrame(radius: 3, width: 2). */
  clip-path: polygon(2px 0, calc(100% - 2px) 0, calc(100% - 2px) 1px, calc(100% - 1px) 1px, calc(100% - 1px) 2px, 100% 2px,
    100% calc(100% - 2px), calc(100% - 1px) calc(100% - 2px), calc(100% - 1px) calc(100% - 1px), calc(100% - 2px) calc(100% - 1px), calc(100% - 2px) 100%,
    2px 100%, 2px calc(100% - 1px), 1px calc(100% - 1px), 1px calc(100% - 2px), 0 calc(100% - 2px),
    0 2px, 1px 2px, 1px 1px, 2px 1px);
  box-shadow: inset 0 0 0 2px var(--ink);
  background: var(--paper);
}
.px-button, .px-strip button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 32px;
  margin: 0;
  padding: 0 9px;
  border: 0;
  border-radius: 0;
  background: var(--paper);
  color: var(--ink);
  font: 14px/1 PH14B, sans-serif;
  -webkit-font-smoothing: none;
  cursor: pointer;
}
.px-button:active, .px-button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.px-strip { display: inline-flex; padding: 2px; }
.px-strip button { height: 28px; padding: 0 7px; }
.px-strip button + button { box-shadow: -1px 0 0 var(--ink); margin-left: 1px; }
.px-strip button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.px-button:focus-visible, .px-strip button:focus-visible { outline: 2px solid #0071e3; outline-offset: -4px; }
a:focus-visible { outline: 2px solid #0071e3; outline-offset: 2px; }
.emoji { display: block; width: 12px; height: 12px; }
.emoji svg { display: block; width: 12px; height: 12px; fill: currentColor; shape-rendering: crispEdges; }
.icon {
  display: block;
  width: 14px;
  height: 14px;
  background: currentColor;
  -webkit-mask: var(--icon) center / contain no-repeat;
  mask: var(--icon) center / contain no-repeat;
}
.play-icon { --icon: url(assets/icons/solid-play.svg); }
.stop-icon { --icon: url(assets/icons/solid-stop.svg); }

/* The words. */
.words { max-width: 34em; padding-top: 24px; }
h1 {
  margin: 0 0 40px;
  font-weight: normal;
  font-size: 88px;
  line-height: 1;
  letter-spacing: -0.02em;
}
.lede { margin: 0 0 40px; font-size: 22px; line-height: 1.5; }
.manifesto p { margin: 0 0 1.1em; color: var(--text); }
.manifesto { margin-bottom: 48px; }
.epitaph { display: block; width: 280px; max-width: 100%; margin: 8px 0 48px; line-height: 0; }
.epitaph img { width: 100%; height: auto; }
.buttons { display: flex; flex-wrap: wrap; gap: 12px; margin: -8px 0 40px; }
.badge { display: inline-block; line-height: 0; }
.badge img { width: 150px; height: auto; }
.kofi { display: block; width: fit-content; margin: 20px auto 0; }
.kofi img { width: 198px; }
.badge .on-dark, [data-theme="dark"] .badge .on-light { display: none; }
[data-theme="dark"] .badge .on-dark { display: inline; }
.shop {
  box-sizing: border-box;
  width: 150px; height: 50px;
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  border-radius: 11px;
  background: #003de4; color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
  text-decoration: none; line-height: 1.05;
}
.shop .small { font-size: 11px; letter-spacing: 0.01em; }
.shop .big { font-size: 20px; font-weight: 500; letter-spacing: -0.01em; }
.shop:hover { background: #0034c4; }
footer {
  grid-column: 2;
  max-width: 34em;
  display: flex;
  justify-content: space-between;
  margin-top: -8px;
  font-size: 14px;
  color: var(--muted);
}
footer a { color: var(--muted); text-decoration: none; }
footer a:hover { color: var(--text); text-decoration: underline; }

@media (max-width: 960px) {
  .page {
    grid-template-columns: minmax(0, 1fr);
    gap: 64px;
    padding: 64px 16px 64px;
  }
  /* One column: the name, the phone, the download buttons, then the manifesto, the sign and the
     footer. The words' box steps aside so the phone can sit between its parts. */
  .page { gap: 0; }
  .words { display: contents; }
  .words > *, footer { width: 100%; max-width: 612px; margin-left: auto; margin-right: auto; }
  h1 { order: 1; font-size: 64px; margin-top: 0; margin-bottom: 28px; text-align: center; }
  .device { position: static; width: 100%; max-width: 426px; margin: 0 auto 40px; order: 2; }
  .buttons { order: 3; margin-top: 0; margin-bottom: 48px; justify-content: center; }
  .manifesto { order: 4; }
  .epitaph { order: 5; width: 280px; max-width: 100%; margin-left: max(0px, calc((100% - 612px) / 2)); }
  .lede { font-size: 20px; }
  footer { grid-column: 1; order: 6; }
}
@media (max-width: 420px) {
  .phone { padding: 9px 9px 0; border-radius: 56px 56px 0 0; }
  .screen { border-radius: 47px 47px 0 0; }
  .island { top: 8px; height: 28px; }
  .px-strip button { padding: 0 5px; }
}

/* The privacy policy. */
.policy { max-width: 38em; margin: 0 auto; padding: 120px 40px 96px; }
.policy h1 { font-size: 64px; margin-bottom: 32px; }
.policy h2 { font-weight: normal; font-size: 26px; margin: 48px 0 12px; }
.policy p, .policy li { margin: 0 0 0.9em; }
.policy ul { padding-left: 1.2em; }
.policy .back { display: inline-block; margin-bottom: 48px; color: var(--muted); font-size: 15px; }
@media (max-width: 600px) { .policy { padding: 64px 16px; } .policy h1 { font-size: 48px; } }

/* Screenshots: a strip of corners, each opening whole in a lightbox. */
.shots {
  display: flex;
  gap: 12px;
  margin: 28px 0 0;
  padding: 0 0 8px;
  list-style: none;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
}
.shots li { flex: 0 0 auto; scroll-snap-align: start; }
.shots button {
  display: block;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
}
.shots img {
  display: block;
  width: 132px;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 6px;
  box-shadow: 0 0 0 1px var(--line);
  transition: transform 120ms ease-out;
}
.shots button:hover img { transform: translateY(-2px); }
.shots button:focus-visible { outline: 2px solid #0071e3; outline-offset: 3px; border-radius: 8px; }

.lightbox {
  max-width: none;
  max-height: none;
  width: 100vw;
  height: 100vh;
  margin: 0;
  padding: 24px;
  border: 0;
  background: transparent;
  color: #ececec;
}
.lightbox[open] { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; }
.lightbox::backdrop { background: rgba(10, 10, 12, 0.88); }
.lightbox img {
  display: block;
  max-width: min(92vw, 1100px);
  max-height: calc(100vh - 150px);
  object-fit: contain;
  border-radius: 8px;
}
.lightbox-buttons { display: flex; gap: 8px; }
.lightbox .px-button { --ink: #e9e9e6; --paper: #0f0f10; min-width: 44px; font-size: 18px; }
@media (prefers-reduced-motion: reduce) { .shots img { transition: none; } }
