/* remnml.app — the site looks like the app: black on white, system type, one accent. */

:root {
  --paper: #ffffff;
  --raised: #f2f2f7;
  --ink: #000000;
  --secondary: #6e6e73;
  --tertiary: #aeaeb2;
  --rule: #e5e5ea;
  --accent: #007aff;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.04), 0 12px 40px rgb(0 0 0 / 0.07);

  --column: 40rem;
  --wide: 68rem;
  --gutter: clamp(1rem, 5vw, 2.5rem);

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #000000;
    --raised: #1c1c1e;
    --ink: #ffffff;
    --secondary: #98989d;
    --tertiary: #636366;
    --rule: #2c2c2e;
    --accent: #0a84ff;
    --shadow: 0 0 0 1px #2c2c2e;
  }
}

:root[data-theme="dark"] {
  --paper: #000000;
  --raised: #1c1c1e;
  --ink: #ffffff;
  --secondary: #98989d;
  --tertiary: #636366;
  --rule: #2c2c2e;
  --accent: #0a84ff;
  --shadow: 0 0 0 1px #2c2c2e;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 1.0625rem; /* 17px, the iOS body size */
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

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

h1,
h2,
h3 {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-weight: 600;
  letter-spacing: -0.02em;
}

p,
ul,
ol,
dl {
  margin: 0;
}

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

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

.skip {
  position: absolute;
  left: -999px;
}

.skip:focus {
  left: var(--gutter);
  top: 0.75rem;
  background: var(--paper);
  padding: 0.25rem 0.5rem;
}

/* Header */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 1.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--ink);
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.brand:hover {
  text-decoration: none;
}

.brand svg {
  width: 1.375rem;
  height: 1.375rem;
}

.site-nav {
  display: flex;
  gap: 1.25rem;
  font-size: 0.9375rem;
}

.site-nav a {
  color: var(--secondary);
}

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

/* Home: the opening */

.intro {
  padding-block: clamp(2.5rem, 9vw, 6rem) 2.5rem;
}

.intro h1 {
  font-size: clamp(2.75rem, 9vw, 4.75rem);
  line-height: 1.02;
  letter-spacing: -0.045em;
  max-width: 11ch;
}

.intro .lede {
  margin-top: 1.5rem;
  max-width: 34rem;
  font-size: 1.25rem;
  line-height: 1.45;
  color: var(--secondary);
}

.get {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  margin-top: 2rem;
}

.store-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-weight: 600;
  font-size: 1rem;
}

.store-button:hover {
  text-decoration: none;
  opacity: 0.85;
}

.store-button svg {
  width: 1.1rem;
  height: 1.1rem;
  fill: currentColor;
}

.get .price {
  color: var(--secondary);
  font-size: 0.9375rem;
}

/* Home: the working demo */

.demo {
  padding-block: 1rem 1rem;
}

.app {
  background: var(--paper);
  border-radius: 1.75rem;
  box-shadow: var(--shadow);
  padding: 1.75rem clamp(1.25rem, 4vw, 2.25rem) 1.25rem;
}

.app h2 {
  font-size: 2.125rem;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.app h3 {
  margin-top: 1.75rem;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.rows {
  list-style: none;
  padding: 0;
  margin-top: 0.75rem;
}

.rows li {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.875rem;
  min-height: 2.75rem;
  overflow: hidden;
  transition: opacity 0.25s ease, min-height 0.3s ease, height 0.3s ease;
}

.rows li.collapsing {
  opacity: 0;
  min-height: 0;
  height: 0;
}

.rows .empty {
  display: block;
  color: var(--tertiary);
}

.check {
  appearance: none;
  width: 1.375rem;
  height: 1.375rem;
  margin: 0;
  padding: 0;
  border: 1.5px solid var(--tertiary);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.check:hover {
  border-color: var(--secondary);
}

li.done .check {
  border-color: var(--accent);
  background: var(--accent) radial-gradient(circle, var(--paper) 0 28%, transparent 30%);
}

.rows .title {
  min-width: 0;
  overflow-wrap: anywhere;
  transition: color 0.2s ease;
}

li.done .title {
  color: var(--tertiary);
}

.rows .meta {
  color: var(--secondary);
  font-size: 0.9375rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.rows .meta .when {
  color: var(--accent);
}

.rows .meta .bang {
  font-weight: 600;
}

.rows .meta .repeat {
  color: var(--tertiary);
}

.rows li.added {
  animation: arrive 0.35s ease-out;
}

@keyframes arrive {
  from {
    opacity: 0;
    transform: translateY(-0.25rem);
  }
}

.entry {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
}

.preview {
  min-height: 1.4em;
  font-size: 0.8125rem;
  color: var(--secondary);
}

.preview .tint {
  color: var(--accent);
}

.preview .quiet,
.preview .sep {
  color: var(--tertiary);
}

.preview .bang {
  font-weight: 600;
}

.field {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 0.875rem;
  margin-top: 0.375rem;
}

.field .plus {
  width: 1.375rem;
  text-align: center;
  font-size: 1.5rem;
  font-weight: 300;
  line-height: 1;
  color: var(--tertiary);
}

/* The input is transparent over a mirror that colors the words it understood. */
.input-wrap {
  position: relative;
  min-width: 0;
}

.input-wrap input,
.input-wrap .mirror {
  font: inherit;
  font-size: 1.1875rem;
  letter-spacing: normal;
  line-height: 1.5;
  padding: 0.375rem 0;
  margin: 0;
  border: 0;
  width: 100%;
}

.input-wrap input {
  position: relative;
  background: transparent;
  color: transparent;
  caret-color: var(--accent);
  outline: none;
}

.input-wrap input::placeholder {
  color: var(--tertiary);
}

.input-wrap input::selection {
  background: color-mix(in srgb, var(--accent) 25%, transparent);
  color: transparent;
}

/* The caret shows where you're typing; a light ring marks keyboard focus without shouting. */
.input-wrap:has(input:focus-visible) {
  outline: 2px solid color-mix(in srgb, var(--accent) 35%, transparent);
  outline-offset: 6px;
  border-radius: 8px;
}

.mirror {
  position: absolute;
  inset: 0;
  white-space: pre;
  overflow: hidden;
  color: var(--ink);
  pointer-events: none;
}

.mirror .tok {
  color: var(--accent);
}

.mirror .note {
  color: var(--secondary);
}

.demo-note {
  margin-top: 0.875rem;
  font-size: 0.875rem;
  color: var(--secondary);
}

/* Home: what you can type */

.section {
  padding-top: clamp(4rem, 10vw, 6.5rem);
}

.section h2 {
  font-size: clamp(1.75rem, 5vw, 2.25rem);
  line-height: 1.15;
}

.section h2 + p {
  margin-top: 0.75rem;
  color: var(--secondary);
}

.syntax {
  width: 100%;
  margin-top: 1.5rem;
  border-collapse: collapse;
}

.syntax th {
  text-align: left;
  font-weight: 400;
  font-size: 0.875rem;
  color: var(--secondary);
  padding-bottom: 0.5rem;
}

.syntax td {
  padding-block: 0.625rem;
  border-top: 1px solid var(--rule);
  vertical-align: top;
}

.syntax td:first-child {
  width: 46%;
  padding-right: 1rem;
  color: var(--accent);
}

/* Home: screenshots */

.shots {
  display: flex;
  gap: clamp(0.75rem, 2.5vw, 1.5rem);
  margin-top: 2rem;
  padding-bottom: 0.5rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
}

.shots figure {
  flex: 0 0 auto;
  width: clamp(11rem, 24vw, 15.5rem);
  margin: 0;
  scroll-snap-align: start;
}

.shots img {
  border-radius: 1.75rem;
  box-shadow: var(--shadow);
}

.shots figcaption {
  margin-top: 0.75rem;
  font-size: 0.875rem;
  color: var(--secondary);
}

.ipad {
  margin-top: clamp(2rem, 5vw, 3rem);
}

.ipad img {
  border-radius: 1.25rem;
  box-shadow: var(--shadow);
}

.ipad figcaption {
  margin-top: 0.75rem;
  font-size: 0.875rem;
  color: var(--secondary);
}

/* Home and pages: prose */

.points {
  display: grid;
  gap: 2rem;
  margin-top: 2rem;
}

.points h3,
.prose h2 {
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.points p {
  margin-top: 0.375rem;
  color: var(--secondary);
}

.points p kbd,
.prose kbd {
  font: inherit;
  color: var(--ink);
}

.pricing {
  margin-top: 1.5rem;
  display: grid;
  gap: 1rem;
}

.pricing p {
  color: var(--secondary);
}

.pricing strong {
  color: var(--ink);
  font-weight: 600;
}

/* Pages */

.page {
  padding-block: clamp(2rem, 7vw, 4.5rem) 0;
}

.page h1 {
  font-size: clamp(2.25rem, 7vw, 3.25rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.page .updated {
  margin-top: 0.75rem;
  color: var(--secondary);
  font-size: 0.9375rem;
}

.prose {
  margin-top: 2.5rem;
}

.prose h2 {
  margin-top: 2.5rem;
}

.prose p,
.prose ul {
  margin-top: 0.75rem;
}

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

.prose li + li {
  margin-top: 0.375rem;
}

.prose .summary {
  font-size: 1.25rem;
  line-height: 1.45;
  margin-top: 0;
}

.faq details {
  border-top: 1px solid var(--rule);
}

.faq details:last-of-type {
  border-bottom: 1px solid var(--rule);
}

.faq summary {
  cursor: pointer;
  padding-block: 1rem;
  font-weight: 600;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

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

.faq summary::after {
  content: "+";
  font-weight: 300;
  font-size: 1.375rem;
  line-height: 1;
  color: var(--tertiary);
}

.faq details[open] summary::after {
  content: "−";
}

.faq details > :not(summary) {
  margin-top: 0;
  padding-bottom: 1rem;
  color: var(--secondary);
}

.faq details > p + p,
.faq details > p + ul {
  margin-top: -0.5rem;
}

.contact {
  margin-top: 2.5rem;
  padding: 1.5rem;
  border-radius: 1.25rem;
  background: var(--raised);
}

.contact p + p {
  margin-top: 0.5rem;
  color: var(--secondary);
}

/* Footer */

.site-footer {
  margin-top: clamp(4rem, 10vw, 7rem);
  padding-block: 2rem 3rem;
  border-top: 1px solid var(--rule);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem 2rem;
  font-size: 0.875rem;
  color: var(--secondary);
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
}

.site-footer a {
  color: var(--secondary);
}

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