:root {
  color-scheme: light dark;

  --paper: #f4f6f5;
  --surface: #ffffff;
  --ink: #18302c;
  --muted: #55625e;
  --rule: #d6ddda;
  --headwise: #0b7a75;
  --framekeep: #5546d6;
  --games: #b8441a;
  --on-accent: #ffffff;
  --focus: #0b7a75;
  --edge: oklch(0 0 0 / 0.1);

  --serif: Charter, "Bitstream Charter", "Iowan Old Style", "Sitka Text", Cambria, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --column: 38rem;
  --frame: 108rem;
  --gutter: clamp(1.25rem, 4vw, 3rem);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #121817;
    --surface: #18201f;
    --ink: #e2e9e7;
    --muted: #9eaba7;
    --rule: #2c3735;
    --headwise: #4cc3ba;
    --framekeep: #a59cff;
    --games: #ff9a6b;
    --on-accent: #0f1716;
    --focus: #4cc3ba;
    --edge: oklch(1 0 0 / 0.1);
  }
}

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

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

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.125rem/1.6 var(--serif);
  font-kerning: normal;
  text-rendering: optimizeLegibility;
}

main {
  flex: 1;
}

img,
svg {
  display: block;
}

::selection {
  background: color-mix(in srgb, var(--headwise) 28%, transparent);
}

a {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: color-mix(in srgb, currentColor 45%, transparent);
  text-underline-offset: 0.2em;
}

@media (hover: hover) {
  a:hover {
    text-decoration-thickness: 2px;
    text-decoration-color: currentColor;
  }
}

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

code {
  font-family: var(--mono);
  font-size: 0.84em;
  padding: 0.1em 0.35em;
  border-radius: 4px;
  background: color-mix(in srgb, var(--ink) 7%, transparent);
  overflow-wrap: anywhere;
}

.frame {
  width: min(100% - 2 * var(--gutter), var(--frame));
  margin-inline: auto;
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: -4rem;
  padding: 0.5rem 0.875rem;
  border-radius: 0.5rem;
  background: var(--ink);
  color: var(--paper);
  font: 600 0.9375rem/1.2 var(--sans);
  text-decoration: none;
}

.skip:focus {
  top: 0.75rem;
}

/* Header */

.site-header {
  padding-block: 1.25rem;
}

.site-header .frame {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  padding-block: 0.375rem;
  color: var(--ink);
  font: 700 1.25rem/1 var(--serif);
  letter-spacing: -0.01em;
  text-decoration: none;
}

.brand img {
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0 clamp(1rem, 2vw, 1.5rem);
  margin: 0;
  padding: 0;
  list-style: none;
  font: 500 0.9375rem/1.2 var(--sans);
}

.site-nav a {
  display: inline-block;
  padding-block: 0.625rem;
  color: var(--muted);
  text-decoration: none;
}

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

@media (hover: hover) {
  .site-nav a:hover {
    color: var(--ink);
  }
}

.site-nav a[aria-current="page"] {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.45em;
}

/* Home */

.hero {
  display: grid;
  justify-items: start;
  gap: 1.75rem;
  padding-top: clamp(2rem, 6vw, 5rem);
}

.hero__mark {
  width: clamp(5rem, 22vw, 7rem);
  height: auto;
  border-radius: 22%;
}

.hero h1 {
  max-width: 13ch;
  margin: 0;
  font-weight: 400;
  font-size: clamp(2.625rem, 1.4rem + 5vw, 6rem);
  line-height: 1.02;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.hero .lede {
  max-width: 36rem;
  margin: 1.5rem 0 0;
  color: var(--muted);
  font-size: clamp(1.1875rem, 1.05rem + 0.5vw, 1.5rem);
  line-height: 1.5;
  text-wrap: pretty;
}

@media (min-width: 52rem) {
  .hero {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    column-gap: clamp(2rem, 6vw, 7rem);
  }

  .hero__mark {
    order: 1;
    width: clamp(12rem, 20vw, 21rem);
  }
}

/* A half rest: the musical sign for silence, a block resting on a line. */
.rest {
  position: relative;
  height: 2px;
  margin: clamp(2.5rem, 6vw, 4.5rem) 0 clamp(2rem, 4vw, 3rem);
  border: 0;
  background: var(--ink);
  overflow: visible;
}

.rest::before {
  content: "";
  position: absolute;
  left: 0;
  bottom: 2px;
  width: 2.75rem;
  height: 1.125rem;
  border-radius: 2px 2px 0 0;
  background: var(--games);
}

.tools {
  display: grid;
  gap: 1.25rem;
  padding-bottom: clamp(3rem, 7vw, 5.5rem);
}

.tools__head h2 {
  margin: 0;
  font-weight: 400;
  font-size: clamp(1.875rem, 1.4rem + 1.6vw, 2.75rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.tools__head p {
  max-width: 36rem;
  margin: 0.625rem 0 0.25rem;
  color: var(--muted);
  text-wrap: pretty;
}

.tool {
  --accent: var(--headwise);
  --pad: clamp(1.25rem, 2.2vw, 1.5rem);
  display: flex;
  flex-direction: column;
  padding: var(--pad);
  border: 1px solid var(--rule);
  border-radius: calc(0.5rem + var(--pad) + 1px);
  background: var(--surface);
}

.tool--framekeep {
  --accent: var(--framekeep);
}

.tool--game {
  --accent: var(--games);
}

.tool--sister {
  --accent: var(--ink);
}

.tool__picture {
  width: 100%;
  height: auto;
  margin-bottom: 1.5rem;
  border-radius: 0.5rem;
  outline: 1px solid var(--edge);
  outline-offset: -1px;
}

.tool__body {
  display: flex;
  flex: 1;
  flex-direction: column;
}

.tool__icon {
  width: 3.5rem;
  height: 3.5rem;
  margin-bottom: 1.5rem;
}

.tool h3 {
  margin: 0;
  font-size: 1.875rem;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.015em;
}

.tool__kind {
  margin: 0.375rem 0 0;
  color: var(--accent);
  font: 600 1rem/1.4 var(--sans);
}

.tool p {
  text-wrap: pretty;
}

.tool__about {
  margin: 1.125rem 0 0;
}

.tool--sister .tool__about {
  max-width: 40rem;
  margin: 0;
}

.tool__price {
  margin: 1rem 0 0;
  color: var(--muted);
}

.stores {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: auto 0 0;
  padding: 1.75rem 0 0;
  list-style: none;
}

/* Phone: every product gets the screen to itself. */
@media (max-width: 39.99rem) {
  html {
    scroll-snap-type: y proximity;
  }

  .tools > article.tool {
    min-height: calc(100dvh - 1.5rem);
    justify-content: safe center;
    scroll-snap-align: center;
  }

  .tools > article.tool .tool__body {
    flex: none;
  }

  .tools > article.tool .stores {
    margin-top: 0;
  }

  .tool__picture {
    align-self: center;
    width: clamp(60%, (100dvh - 27rem) * 4 / 3, 100%);
  }

  .tool--game .store {
    flex: 1;
  }
}

/* Tablet: the picture sits beside the text. */
@media (min-width: 40rem) and (max-width: 63.99rem) {
  .tool--game {
    flex-direction: row;
    align-items: center;
    gap: var(--pad);
  }

  .tool--game .tool__picture {
    width: 46%;
    margin: 0;
  }

  .tools:not(.tools--games) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tools__head,
  .tool--sister {
    grid-column: 1 / -1;
  }
}

/* Desktop: the heading above, the products side by side. */
@media (min-width: 64rem) {
  html {
    font-size: 106.25%;
  }

  .tools {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem;
  }

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

  .tools__head,
  .tool--sister {
    grid-column: 1 / -1;
  }

  .tool--sister {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem 2rem;
  }

  .tool--sister .stores {
    margin: 0;
    padding: 0;
  }
}

/* Wide desktop: the heading moves into a rail on the left. */
@media (min-width: 84rem) {
  .tools {
    grid-template-columns: 17rem repeat(2, minmax(0, 1fr));
    column-gap: 1.75rem;
  }

  .tools--games {
    grid-template-columns: 17rem repeat(3, minmax(0, 1fr));
  }

  .tools__head {
    grid-column: 1;
    padding-right: 1.5rem;
  }

  .tool--sister {
    grid-column: 2 / -1;
  }
}

.store,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0.5rem 1.125rem;
  border: 1px solid transparent;
  border-radius: 0.625rem;
  font: 600 0.9375rem/1.2 var(--sans);
  text-decoration: none;
}

a.store {
  background: var(--accent);
  color: var(--on-accent);
}

a.store--quiet {
  border-color: var(--ink);
  background: transparent;
  color: var(--ink);
}

@media (hover: hover) {
  a.store:hover {
    background: color-mix(in srgb, var(--accent) 86%, var(--ink));
  }

  a.store--quiet:hover {
    background: color-mix(in srgb, var(--ink) 8%, transparent);
  }
}

a.store:focus-visible,
.button:focus-visible {
  outline-color: var(--on-accent);
  outline-offset: -5px;
  border-radius: 0.625rem;
}

a.store--quiet:focus-visible {
  outline-color: var(--focus);
}

/* Dashed outline = not available yet, on both store links and the Pro button. */
.store--soon,
.button:disabled {
  border: 1px dashed color-mix(in srgb, var(--muted) 60%, transparent);
  background: transparent;
  color: var(--muted);
}

/* Inner pages */

.page {
  padding-block: clamp(2.5rem, 6vw, 4.5rem) clamp(3.5rem, 8vw, 5.5rem);
}

.prose {
  max-width: var(--column);
}

.prose h1 {
  margin: 0;
  font-weight: 400;
  font-size: clamp(2.25rem, 1.6rem + 2.6vw, 3.25rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.prose .meta {
  margin: 0.875rem 0 0;
  color: var(--muted);
  font: 400 0.9375rem/1.5 var(--sans);
}

.prose .lede {
  margin: 1.25rem 0 0;
  font-size: 1.25rem;
  line-height: 1.5;
  text-wrap: pretty;
}

.prose > .meta + p,
.prose > .lede + p {
  margin-top: 2rem;
}

.prose h2 {
  margin: 2.75rem 0 0.75rem;
  font-size: 1.375rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.005em;
}

.prose p,
.prose ul,
.prose dl {
  margin: 0 0 1rem;
}

.prose ul {
  padding-left: 1.25rem;
}

.prose li {
  margin-bottom: 0.5rem;
  padding-left: 0.25rem;
}

.prose li::marker {
  color: var(--muted);
}

.mail {
  font-weight: 700;
  overflow-wrap: anywhere;
}

@media (min-width: 64rem) {
  .page .prose {
    margin-inline: auto;
  }
}

/* Headwise Pro */

.price {
  margin: 2.25rem 0 0.5rem;
  padding: clamp(1.5rem, 3vw, 2rem);
  border: 1px solid var(--rule);
  border-radius: 1.125rem;
  background: var(--surface);
}

.price__amount {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.75rem;
  margin: 0;
}

.price__amount strong {
  font-size: 3.5rem;
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.03em;
}

.price__amount span {
  color: var(--muted);
  font: 500 1rem/1.4 var(--sans);
}

.price__launch {
  margin: 1rem 0 0;
  color: var(--headwise);
  font: 600 1rem/1.4 var(--sans);
}

.price__note {
  margin: 0.375rem 0 0;
  color: var(--muted);
  font: 400 0.9375rem/1.5 var(--sans);
}

.button {
  min-height: 3rem;
  margin-top: 1.5rem;
  padding-inline: 1.5rem;
  background: var(--headwise);
  color: var(--on-accent);
  font-size: 1rem;
  cursor: pointer;
}

@media (hover: hover) {
  a.button:hover {
    background: color-mix(in srgb, var(--headwise) 86%, var(--ink));
  }
}

.button:disabled {
  cursor: not-allowed;
}

.features dt {
  margin-top: 1.25rem;
  font-weight: 700;
}

.features dd {
  margin: 0.25rem 0 0;
}

/* Footer */

.site-footer {
  padding-block: 2rem 2.5rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font: 400 0.9375rem/1.5 var(--sans);
}

.site-footer ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.5rem;
  margin: 0 0 0.75rem;
  padding: 0;
  list-style: none;
}

.site-footer a {
  display: inline-block;
  padding-block: 0.375rem;
  text-decoration: none;
}

@media (hover: hover) {
  .site-footer a:hover {
    color: var(--ink);
    text-decoration: underline;
  }
}

.site-footer p {
  margin: 0;
}

/* Motion: one entrance on the home page, the rest settling onto its line, and press feedback. */

@media (prefers-reduced-motion: no-preference) {
  .hero__mark,
  .hero h1,
  .hero .lede {
    animation: rise 300ms ease-out both;
  }

  .hero h1 {
    animation-delay: 100ms;
  }

  .hero .lede {
    animation-delay: 200ms;
  }

  .rest::before {
    animation: settle 300ms ease-out 400ms both;
  }

  a.store,
  .button {
    transition-property: scale, background-color;
    transition-duration: 150ms;
    transition-timing-function: ease-out;
  }

  a.store:active,
  .button:not(:disabled):active {
    scale: 0.96;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero__mark,
  .hero h1,
  .hero .lede,
  .rest::before {
    animation: fade 300ms ease-out both;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    filter: blur(4px);
    translate: 0 12px;
  }
}

@keyframes settle {
  from {
    opacity: 0;
    translate: 0 -12px;
  }
}

@keyframes fade {
  from {
    opacity: 0;
  }
}
