:root {
  --bg: #ffffff;
  --surface: #f5f5f3;
  --text: #16181d;
  --muted: #5a606b;
  --line: #e4e4e0;
  --accent: #d0021b;
  --button-bg: #16181d;
  --button-text: #ffffff;
  --shadow: 0 24px 48px -24px rgba(16, 24, 40, 0.28);
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111214;
    --surface: #1a1c1f;
    --text: #f1f1ee;
    --muted: #a3a8b1;
    --line: #2a2d31;
    --accent: #ff4d5e;
    --button-bg: #f1f1ee;
    --button-text: #111214;
    --shadow: 0 24px 48px -24px rgba(0, 0, 0, 0.7);
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1.0625rem/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: inherit;
}

.wrap {
  width: min(1120px, 100% - 32px);
  margin-inline: auto;
}

.skip {
  position: absolute;
  left: 16px;
  top: -48px;
  padding: 8px 14px;
  background: var(--button-bg);
  color: var(--button-text);
  border-radius: 6px;
  text-decoration: none;
  z-index: 10;
}

.skip:focus {
  top: 12px;
}

.masthead {
  padding: 28px 0 0;
}

.site {
  font-weight: 600;
  letter-spacing: 0.02em;
}

.site::after {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-left: 6px;
  border-radius: 50%;
  background: var(--accent);
  vertical-align: middle;
}

.intro {
  padding: clamp(56px, 10vw, 120px) 0 clamp(40px, 7vw, 88px);
  border-bottom: 1px solid var(--line);
}

h1,
h2 {
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.08;
  margin: 0;
}

h1 {
  font-size: clamp(2.6rem, 7vw, 5rem);
}

.lede {
  max-width: 36ch;
  margin: 24px 0 0;
  font-size: clamp(1.2rem, 2.4vw, 1.5rem);
  line-height: 1.5;
  color: var(--muted);
}

.project {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(32px, 6vw, 72px);
  align-items: center;
  padding: clamp(56px, 9vw, 104px) 0;
  border-bottom: 1px solid var(--line);
}

.project:nth-of-type(odd) .project-media {
  order: -1;
}

.kicker {
  margin: 0 0 12px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

h2 {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: clamp(2rem, 4vw, 2.8rem);
}

.app-icon {
  width: 48px;
  height: 48px;
  border-radius: 11px;
  flex: none;
}

.project-text p {
  margin: 18px 0 0;
}

.project-text .facts {
  font-size: 0.95rem;
  color: var(--muted);
}

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

.button {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 20px;
  border-radius: 999px;
  background: var(--button-bg);
  color: var(--button-text);
  font-weight: 500;
  text-decoration: none;
  transition: opacity 0.15s ease;
}

.button:hover {
  opacity: 0.85;
}

.button:focus-visible,
.badge:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.badge {
  display: inline-flex;
  border-radius: 8px;
}

.project-media {
  margin: 0;
}

.shot img {
  border-radius: 12px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.tees {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.tees img {
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 10px;
  background: var(--surface);
}

.footer {
  padding: 40px 0 56px;
  font-size: 0.9rem;
  color: var(--muted);
}

.footer p {
  margin: 0 0 6px;
}

/* Smaller projects, below the two main ones: a link to each product page. */
.also {
  padding: clamp(48px, 7vw, 80px) 0;
}

.also h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
}

.also-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 24px 48px;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
}

.also-list a {
  font-weight: 600;
  color: var(--text);
}

/* A small screenshot above each name, part of the same link. The image is
   aria-hidden beside its name, and keeps an alt because audits report an
   empty one as missing. */
.also-link {
  display: inline-flex;
  flex-direction: column;
  gap: 12px;
}

.also-link img {
  display: block;
  width: 100%;
  max-width: 320px;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: top left;
  border-radius: 10px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.also-list p {
  margin: 6px 0 0;
}

/* Two more screens of a smaller project, small, under its description; one link to its screens. */
.also-shots {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  max-width: 320px;
  margin-top: 14px;
}

.also-shots img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  border-radius: 6px;
  border: 1px solid var(--line);
}

/* A store badge under a smaller project's description. */
.also-badge {
  margin-top: 14px;
}

@media (max-width: 760px) {
  .project {
    grid-template-columns: minmax(0, 1fr);
  }

  .project:nth-of-type(odd) .project-media {
    order: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}

/* Markdown Reader pages: product page heading and text pages (privacy, support) */
.masthead .site {
  text-decoration: none;
}

.app-title {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: clamp(2rem, 4vw, 2.8rem);
}

.features {
  margin: 18px 0 0;
  padding-left: 1.2em;
}

.features li + li {
  margin-top: 6px;
}

.text-link {
  font-weight: 500;
}

.doc {
  max-width: 72ch;
  padding: clamp(40px, 7vw, 88px) 0;
}

.doc h1 {
  font-size: clamp(2.2rem, 5vw, 3.2rem);
}

.doc h2 {
  margin: 40px 0 0;
  font-size: 1.4rem;
}

.doc p {
  margin: 14px 0 0;
}

.doc .updated {
  color: var(--muted);
}

.doc code {
  font-size: 0.92em;
  /* A checksum is one long word: let it break on a phone. */
  overflow-wrap: anywhere;
}

/* DiskPlan for iPhone: a link to the page in the other language, and three phone screens side by side. */
.masthead .wrap {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.lang {
  font-size: 0.9rem;
  color: var(--muted);
}

.phones {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(10px, 2vw, 20px);
  max-width: 640px;
  justify-self: center;
}

.phones img {
  width: 100%;
  height: auto;
  border-radius: clamp(14px, 2.4vw, 24px);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

/* An iPhone app page: text on the left, the phone screens on the right, in two equal columns. */
.project.phone-app {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.project.phone-app .project-media {
  order: 0;
}

@media (max-width: 760px) {
  .project.phone-app {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* A preview made of several screens side by side: keep the middle of it. */
.also-link img.centered {
  object-position: center;
}

/* DiskPlan for iPhone: the product shown on phones and as widgets. */
.hero-lede {
  font-size: clamp(1.25rem, 2.4vw, 1.55rem);
  line-height: 1.35;
  font-weight: 600;
}

.phone {
  padding: clamp(6px, 1vw, 10px);
  border-radius: clamp(28px, 5vw, 52px);
  background: #0c0d10;
  box-shadow: var(--shadow), inset 0 0 0 2px #2c2f35;
}

.phone img,
.phone video {
  display: block;
  width: 100%;
  height: auto;
  border-radius: clamp(22px, 4.2vw, 43px);
}

.hero-phone {
  max-width: 340px;
  justify-self: center;
}

/* A band in the blues of the iPhone wallpaper, the same in light and dark. */
.showcase {
  padding: clamp(56px, 9vw, 104px) 0;
  background: radial-gradient(120% 80% at 80% 0%, #3f8ac4 0%, rgba(63, 138, 196, 0) 60%),
              linear-gradient(160deg, #0b2a4a 0%, #134a7a 55%, #0d2f52 100%);
  color: #ffffff;
}

.showcase-title {
  font-size: clamp(2rem, 4.4vw, 3rem);
  text-align: center;
  justify-content: center;
}

.showcase-lede {
  max-width: 46ch;
  margin: 16px auto 0;
  text-align: center;
  color: rgba(255, 255, 255, 0.82);
  font-size: 1.1rem;
}

.widget-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-areas:
    "free ready dup shots"
    "plan plan board board"
    "notes notes board board";
  gap: clamp(12px, 2vw, 22px);
  max-width: 980px;
  margin: clamp(32px, 5vw, 56px) auto 0;
  align-items: start;
}

.widget-grid img {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 18px 30px rgba(0, 10, 30, 0.35));
}

.w-free { grid-area: free; }
.w-ready { grid-area: ready; }
.w-dup { grid-area: dup; }
.w-shots { grid-area: shots; }
.w-plan { grid-area: plan; }
.w-board { grid-area: board; }

.w-notes {
  grid-area: notes;
  margin: 0;
  padding: 4px 0 0 1.1em;
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.02rem;
}

.w-notes li + li {
  margin-top: 10px;
}

.perks {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(16px, 3vw, 32px);
  padding: clamp(48px, 7vw, 88px) 0 0;
}

.perks-tight {
  padding-top: 20px;
}

.perks-four {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.perk {
  padding: 22px 24px;
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.perk h3 {
  margin: 0;
  font-size: 1.15rem;
}

.perk p {
  margin: 8px 0 0;
  color: var(--muted);
}

.screens {
  padding: clamp(48px, 7vw, 88px) 0 0;
}

.screens-title {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  text-align: center;
  justify-content: center;
}

.screen-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(14px, 3vw, 40px);
  max-width: 860px;
  margin: 28px auto 0;
}

.screen-row figure {
  margin: 0;
}

/* A checksum in a product page's facts is one long word: let it break on a phone, as in text pages. */
.facts code {
  overflow-wrap: anywhere;
}

/* TV screenshots: wide, two to a row, one on a phone */
.screen-row.tv {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 1100px;
}

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

.screens-note {
  margin: 20px auto 0;
  text-align: center;
  font-size: 0.92rem;
  color: var(--muted);
}

@media (max-width: 760px) {
  .screen-row.tv {
    grid-template-columns: minmax(0, 1fr);
  }
}

.screen-row figcaption {
  margin-top: 12px;
  text-align: center;
  font-size: 0.92rem;
  color: var(--muted);
}

@media (max-width: 760px) {
  .widget-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas:
      "free ready"
      "dup shots"
      "plan plan"
      "board board"
      "notes notes";
  }

  .perks {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero-phone {
    max-width: 260px;
  }
}

/* An image inside a text section, as wide as the text. */
.doc .proof {
  margin: 24px 0 0;
}

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

.doc .proof figcaption {
  margin-top: 10px;
  font-size: 0.92rem;
  color: var(--muted);
}

/* A still of a video, linking to it: a play button over the image. */
.video-link {
  position: relative;
  display: block;
}

.video-link::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 84px;
  height: 84px;
  margin: -42px 0 0 -42px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.78) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='white' d='M9 6.5v11l8.5-5.5z'/%3E%3C/svg%3E") center / 44px no-repeat;
  transition: transform 0.15s ease;
}

.video-link:hover::after,
.video-link:focus-visible::after {
  transform: scale(1.08);
}

/* DiskPlan TV: a screen on a stand, and a guide of episodes. */
.tv {
  padding-block: 56px 24px;
}

.tv-lede {
  margin: -8px auto 28px;
  color: var(--muted);
  max-width: 60ch;
  text-align: center;
}

.tv-set {
  max-width: 880px;
  margin-inline: auto;
}

.tv-screen {
  position: relative;
  aspect-ratio: 16 / 9;
  border: 12px solid #16181d;
  border-radius: 18px;
  background: #000;
  overflow: hidden;
  box-shadow: var(--shadow);
}

/* The stand under the screen. */
.tv-set::after {
  content: "";
  display: block;
  width: 22%;
  height: 10px;
  margin: 0 auto;
  border-radius: 0 0 10px 10px;
  background: #16181d;
}

.tv-screen video,
.tv-play,
.tv-play img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.tv-play {
  padding: 0;
  background: none;
  cursor: pointer;
}

.tv-play img {
  object-fit: cover;
}

.tv-screen video {
  background: #000;
  object-fit: contain;
}

.tv-play-icon {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 76px;
  height: 76px;
  margin: -38px 0 0 -38px;
  border-radius: 50%;
  background: rgba(17, 18, 20, 0.72);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  transition: transform 0.15s ease;
}

.tv-play-icon::after {
  content: "";
  position: absolute;
  left: 30px;
  top: 22px;
  border-style: solid;
  border-width: 16px 0 16px 26px;
  border-color: transparent transparent transparent #fff;
}

.tv-play:hover .tv-play-icon,
.tv-play:focus-visible .tv-play-icon {
  transform: scale(1.08);
}

.tv-now {
  margin: 14px 0 0;
  text-align: center;
}

.tv-guide-title {
  margin: 40px 0 12px;
  font: 600 1rem/1.4 var(--sans);
}

.tv-guide {
  list-style: none;
  margin: 0;
  padding: 0 0 8px;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(180px, 1fr);
  gap: 14px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
}

@media (min-width: 900px) {
  .tv-guide {
    grid-auto-flow: row;
    grid-template-columns: repeat(7, 1fr);
    overflow: visible;
  }
}

.tv-guide li {
  scroll-snap-align: start;
}

.tv-guide button {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.tv-guide img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 8px;
  border: 2px solid var(--line);
}

.tv-guide button:hover img,
.tv-guide button:focus-visible img {
  border-color: var(--muted);
}

.tv-guide button[aria-current="true"] img {
  border-color: var(--accent);
}

.tv-ep {
  display: block;
  margin-top: 8px;
  font-size: 0.8rem;
  color: var(--muted);
}

.tv-name {
  display: block;
  font-size: 0.92rem;
  font-weight: 500;
  line-height: 1.35;
}

.tv-note {
  margin-top: 20px;
  font-size: 0.9rem;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .tv-screen {
    border-color: #34373c;
  }

  :root:not([data-theme="light"]) .tv-set::after {
    background: #34373c;
  }
}

/* Home page: an iPhone app shown as three phone screens side by side, the middle one raised. */
.phones {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(10px, 1.6vw, 18px);
  align-items: center;
}

.phones img {
  border-radius: clamp(12px, 1.8vw, 20px);
  box-shadow: var(--shadow);
}

.phones img:nth-child(2) {
  transform: translateY(-6%);
}

/* Koppr user guide (koppr.fr/aide, koppr.fr/en/help): text at reading width, the app's screens in small phone
   frames under each step, two to a row on a phone. Pages written by scripts/koppr-help.py. */
.help {
  max-width: 880px;
  padding: clamp(28px, 6vw, 72px) 0 clamp(40px, 7vw, 88px);
}

.help h1 {
  margin: 10px 0 0;
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.12;
}

.help h2 {
  margin: 0;
  font-size: 1.4rem;
  scroll-margin-top: 16px;
}

.help section {
  margin-top: 44px;
}

.help p,
.help ul,
.help ol {
  max-width: 68ch;
}

.help p {
  margin: 14px 0 0;
}

.help ul,
.help ol.steps {
  margin: 14px 0 0;
  padding-left: 1.3em;
}

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

.help .lede {
  font-size: clamp(1.1rem, 2vw, 1.25rem);
  line-height: 1.5;
  color: var(--muted);
}

.crumbs {
  font-size: 0.9rem;
  color: var(--muted);
}

.crumbs a {
  color: inherit;
}

.toc {
  margin: 24px 0 0;
  padding: 14px 18px 14px 2.2em;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 0.95rem;
}

.toc li + li {
  margin-top: 4px;
}

.help .note {
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 0.95rem;
}

.shots {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(12px, 3vw, 28px);
  max-width: 720px;
  margin: 24px 0 0;
}

.shots.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 480px;
}

.shots.one {
  grid-template-columns: minmax(0, 1fr);
  max-width: 230px;
}

.shots figure {
  margin: 0;
}

.shots .phone {
  padding: clamp(4px, 0.8vw, 6px);
  border-radius: clamp(20px, 3.4vw, 30px);
}

.shots .phone img {
  border-radius: clamp(16px, 2.9vw, 25px);
}

.shots figcaption {
  margin-top: 10px;
  font-size: 0.86rem;
  line-height: 1.4;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 560px) {
  .shots,
  .shots.two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: none;
  }

  .shots.one {
    max-width: 50%;
  }
}

.req {
  width: 100%;
  margin: 18px 0 0;
  border-collapse: collapse;
  font-size: 0.95rem;
}

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

.req th {
  color: var(--muted);
  font-weight: 500;
}

.req td:first-child {
  width: 34%;
  font-weight: 500;
}

.help-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.help-grid li + li {
  margin-top: 0;
}

.help-grid a {
  display: block;
  height: 100%;
  padding: 16px 18px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  text-decoration: none;
}

.help-grid a:hover {
  border-color: var(--muted);
}

.help-grid strong {
  display: block;
  font-size: 1.05rem;
}

.help-grid span {
  display: block;
  margin-top: 4px;
  font-size: 0.93rem;
  color: var(--muted);
}

.help > h2 {
  margin-top: 44px;
}

.help-more {
  margin-top: 48px !important;
  color: var(--muted);
}

.pager {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 0.95rem;
}

.pager a:last-child {
  text-align: right;
  margin-left: auto;
}

@media (max-width: 640px) {
  .help-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .pager {
    flex-direction: column;
  }

  .pager a:last-child {
    margin-left: 0;
  }
}

/* koppr.fr: the teaser video, vertical, under the perks */
.teaser video {
  display: block;
  width: min(100%, 360px);
  height: auto;
  aspect-ratio: 9 / 16;
  margin: 0 auto;
  border-radius: 20px;
  background: #1c1d21;
}
