/* mylinks.reddec.net — the app's palette, one page at a time.
   Warm paper, ink, a single oxblood accent, hairlines instead of cards, an
   oversized serif for titles and monospace for metadata. Light and dark follow
   the system: the site has no theme switch because the app has none either.
   No JavaScript anywhere. */

/* ------------------------------------------------------------------ fonts */

@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/source-serif.woff2") format("woff2");
}

@font-face {
  font-family: "Source Serif 4";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/source-serif-italic.woff2") format("woff2");
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/inter.woff2") format("woff2");
}

/* ----------------------------------------------------------------- tokens */

:root {
  color-scheme: light dark;

  /* Straight from the app's Theme.kt: warm paper, ink, oxblood. */
  --paper: #faf7f1;
  --paper-deep: #f1ebe0;
  --surface: #fffdf9;
  --rule: #e2d9cb;
  --rule-strong: #cfc3b0;

  --ink: #17140f;
  --ink-soft: #4a443b;
  --muted: #6b635a;

  --accent: #93331f;
  --accent-soft: #f3e5df;

  --display: "Source Serif 4", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --wrap: 74rem;
  --gutter: clamp(1.25rem, 5vw, 3.5rem);
  --block: clamp(3.5rem, 8vw, 6.5rem);
  --radius: 10px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #121110;
    --paper-deep: #1c1a17;
    --surface: #1c1a17;
    --rule: #3c3833;
    --rule-strong: #524b44;

    --ink: #f0eae0;
    --ink-soft: #d6cec2;
    --muted: #9e9488;

    --accent: #e08a6b;
    --accent-soft: #33241e;
  }
}

/* ------------------------------------------------------------------- base */

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

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.6rem, 6.2vw, 4.75rem);
  line-height: 0.98;
  letter-spacing: -0.022em;
}

h2 {
  font-size: clamp(1.75rem, 3.4vw, 2.5rem);
  line-height: 1.08;
}

h3 {
  font-size: 1.3125rem;
  line-height: 1.24;
  letter-spacing: -0.008em;
}

p {
  margin: 0;
  text-wrap: pretty;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
  text-decoration-color: var(--rule-strong);
  text-underline-offset: 0.22em;
  transition: color 120ms ease, text-decoration-color 120ms ease;
}

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

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

code,
kbd {
  font-family: var(--mono);
  font-size: 0.78125rem;
  font-variant-ligatures: none;
}

::selection {
  background: var(--accent);
  color: var(--paper);
}

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

/* ------------------------------------------------------------------ shell */

main {
  flex: 1 0 auto;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip-link {
  position: absolute;
  top: -4rem;
  left: 0;
  z-index: 40;
  padding: 0.7rem 1rem;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
}

.skip-link:focus {
  top: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--paper) 94%, transparent);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--rule);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: 3.5rem;
}

/* The wordmark is the app's own: uppercase, wide tracking, no logo. */
.brand {
  padding-block: 0.35rem;
  font-family: var(--sans);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
}

.brand:hover {
  color: var(--accent);
}

.brand--footer {
  font-size: 0.75rem;
  color: var(--muted);
}

.topnav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.35rem;
}

.topnav a {
  padding-block: 0.45rem;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
}

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

.topnav a[aria-current="page"] {
  color: var(--ink);
  box-shadow: inset 0 -2px 0 var(--accent);
}

.footer {
  margin-top: var(--block);
  border-top: 1px solid var(--rule);
  background: var(--paper-deep);
  padding-block: clamp(2rem, 4vw, 3rem);
}

.footer-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1.5rem 3rem;
  align-items: start;
}

.footer-mark {
  display: grid;
  gap: 0.6rem;
  max-width: 34rem;
}

.footer-line {
  font-size: 0.8125rem;
  color: var(--muted);
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.25rem;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

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

.footer-copy {
  grid-column: 1 / -1;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
  color: var(--muted);
}

/* ------------------------------------------------------------ typography */

.kicker {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  color: var(--accent);
}

.meta {
  font-family: var(--mono);
  font-size: 0.75rem;
  line-height: 1.5;
  letter-spacing: 0.02em;
  color: var(--muted);
}

.lede {
  max-width: 40ch;
  font-size: clamp(1.0625rem, 1.5vw, 1.1875rem);
  line-height: 1.6;
  color: var(--ink-soft);
}

.prose {
  max-width: 62ch;
  display: grid;
  gap: 1rem;
}

.prose p {
  color: var(--ink-soft);
}

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

.prose a {
  color: var(--ink);
}

.rule {
  height: 1px;
  background: var(--rule);
  border: 0;
  margin: 0;
}

/* --------------------------------------------------------------- buttons */

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.15rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background-color 120ms ease, color 120ms ease, border-color 120ms ease;
}

.btn--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--paper);
}

.btn--primary:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

.btn--ghost {
  border-color: var(--rule-strong);
  color: var(--ink);
}

.btn--ghost:hover {
  border-color: var(--ink);
  color: var(--ink);
  background: var(--paper-deep);
}

/* Icons are inline SVGs from src/icons/ (Material Design Light), sized in em so
   they track the text; currentColor keeps them in the label's colour. */
.icon {
  width: 1.05em;
  height: 1.05em;
  fill: currentColor;
  flex: none;
}

.btn .icon {
  margin-top: -0.1em;
}

/* ------------------------------------------------------------------ hero */

/* Ruled paper behind the first screen: faint ink lines that fade out. */
.hero {
  position: relative;
  padding-block: clamp(2.5rem, 6vw, 5.5rem) clamp(2rem, 4vw, 3rem);
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: -1px 0 0;
  z-index: -1;
  background-image: repeating-linear-gradient(
    to bottom,
    color-mix(in srgb, var(--ink) 7%, transparent) 0 1px,
    transparent 1px 2.4rem
  );
  mask-image: radial-gradient(120% 90% at 15% 0%, #000 0%, transparent 72%);
  pointer-events: none;
}

.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(0, 0.98fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}

.hero-copy {
  display: grid;
  gap: 1.25rem;
  justify-items: start;
}

.hero-copy h1 {
  max-width: 15ch;
}

.hero-copy h1 em {
  font-style: italic;
  color: var(--accent);
}

.hero-note {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.15rem;
  padding-top: 0.4rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
}

/* No bullet separators: a wrapped separator is a stray glyph at the start of
   the next line, and the mono face already reads as a spec strip. */
.hero-note span {
  white-space: nowrap;
}

.hero-shots {
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
  gap: 0;
}

.hero-shots .phone:first-child {
  width: min(17rem, 19vw);
}

/* The second screen is a step behind and a step lower: depth without motion. */
.hero-shots .phone:last-child {
  width: min(15rem, 17vw);
  margin-left: clamp(-2.5rem, -1.8vw, -1rem);
  margin-top: clamp(2rem, 4vw, 3.25rem);
}

/* -------------------------------------------------------------- screenshots */

.phone {
  margin: 0;
  padding: 0.4rem;
  background: var(--surface);
  border: 1px solid var(--rule-strong);
  border-radius: 1.9rem;
  box-shadow:
    0 1px 0 color-mix(in srgb, var(--ink) 4%, transparent),
    0 18px 40px -32px color-mix(in srgb, var(--ink) 60%, transparent);
}

.phone img {
  width: 100%;
  border-radius: 1.55rem;
  border: 1px solid var(--rule);
}

.phone--flat {
  padding: 0;
  background: none;
  box-shadow: none;
  border-color: var(--rule);
}

.phone--flat img {
  border-radius: 0.75rem;
  border: 0;
}

/* --------------------------------------------------------------- sections */

.section {
  padding-block: clamp(2.5rem, 5vw, 4rem);
}

.section--tight {
  padding-block: clamp(1.75rem, 3vw, 2.5rem);
}

.section-head {
  display: grid;
  gap: 0.6rem;
  max-width: 46ch;
  margin-bottom: clamp(1.75rem, 3vw, 2.5rem);
}

.section-head p {
  color: var(--muted);
  font-size: 0.9375rem;
}

.section-foot {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
  font-size: 0.8125rem;
  letter-spacing: 0.04em;
}

.section-foot a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
  letter-spacing: 0.02em;
}

.section-foot a:hover {
  text-decoration: underline;
}

/* Banded block: a solid plane, not a card, separated by hairlines. */
.band {
  border-block: 1px solid var(--rule);
  background: var(--paper-deep);
}

/* ------------------------------------------------------------- page header */

.page-head {
  display: grid;
  gap: 1rem;
  padding-block: clamp(2.5rem, 5vw, 4.5rem) clamp(1.5rem, 3vw, 2.5rem);
  border-bottom: 1px solid var(--rule);
}

.page-head h1 {
  max-width: 22ch;
}

.page-head .lede {
  max-width: 52ch;
}

/* -------------------------------------------------------------- the list */

/* The feature list borrows the app's library row: serif title, muted line
   underneath, monospace tag chips, hairline between rows. */
.rows {
  display: grid;
  border-top: 1px solid var(--rule);
}

.row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 0.5rem 2.5rem;
  padding-block: 1.35rem;
  border-bottom: 1px solid var(--rule);
}

.row h3 {
  font-size: 1.25rem;
}

.row-body {
  display: grid;
  gap: 0.55rem;
  font-size: 0.9375rem;
  line-height: 1.62;
  color: var(--ink-soft);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.chip {
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.02em;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 0.35rem;
  padding: 0.1rem 0.4rem;
}

.group-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.6rem;
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ------------------------------------------------------------- promises */

.promises {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1.25rem, 3vw, 2.5rem);
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
}

.promise {
  display: grid;
  gap: 0.5rem;
  align-content: start;
}

.promise .num {
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.14em;
  color: var(--accent);
}

.promise h3 {
  font-size: 1.1875rem;
}

.promise p {
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--muted);
}

/* --------------------------------------------------------------- the look */

.look {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

.look-copy {
  display: grid;
  gap: 1rem;
  justify-items: start;
}

.look-copy .prose {
  gap: 0.9rem;
  font-size: 0.9375rem;
}

.look-shot {
  display: flex;
  justify-content: center;
}

.look-shot .phone {
  width: min(20rem, 100%);
}

/* --------------------------------------------------------------- gallery */

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(16rem, 100%), 1fr));
  gap: clamp(1.5rem, 3vw, 2.5rem) clamp(1.25rem, 3vw, 2rem);
}

.shot {
  display: grid;
  gap: 0.85rem;
  align-content: start;
}

.shot .phone {
  justify-self: start;
  width: 100%;
  max-width: 18rem;
}

.shot h3 {
  font-size: 1.125rem;
}

.shot p {
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--muted);
}

.gallery-section + .gallery-section {
  margin-top: clamp(2.5rem, 5vw, 4rem);
}

/* Inside the documentation column the article gap already separates groups. */
.article .gallery-section + .gallery-section {
  margin-top: 0;
}

/* --------------------------------------------------------------- prose pages */

.article {
  display: grid;
  gap: clamp(2rem, 4vw, 3rem);
  padding-block: clamp(2rem, 4vw, 3rem);
  max-width: 68rem;
}

.block {
  display: grid;
  grid-template-columns: minmax(0, 0.42fr) minmax(0, 1fr);
  gap: 0.75rem clamp(1.5rem, 4vw, 3.5rem);
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
}

.block-title {
  display: grid;
  gap: 0.4rem;
  align-content: start;
}

.block-body {
  display: grid;
  gap: 1rem;
  max-width: 62ch;
}

.block-body > p {
  color: var(--ink-soft);
  font-size: 0.9375rem;
}

/* Numbered steps: a list that reads like a caption set under a figure. */
.steps {
  display: grid;
  gap: 1.1rem;
  counter-reset: step;
}

.steps li {
  display: grid;
  grid-template-columns: 2.25rem minmax(0, 1fr);
  gap: 0.75rem;
  font-size: 0.9375rem;
  color: var(--ink-soft);
}

.steps li::before {
  counter-increment: step;
  content: counter(step, decimal-leading-zero);
  font-family: var(--mono);
  font-size: 0.75rem;
  line-height: 1.9;
  color: var(--accent);
}

.steps b {
  color: var(--ink);
  font-weight: 600;
}

.plain-list {
  display: grid;
  gap: 0.6rem;
  font-size: 0.9375rem;
  color: var(--ink-soft);
}

.plain-list li {
  position: relative;
  padding-left: 1.15rem;
}

.plain-list li::before {
  content: "";
  position: absolute;
  top: 0.68em;
  left: 0;
  width: 0.42rem;
  height: 1px;
  background: var(--accent);
}

p code,
li code {
  padding: 0.1rem 0.35rem;
  background: var(--paper-deep);
  border: 1px solid var(--rule);
  border-radius: 0.3rem;
  color: var(--ink);
  font-size: 0.85em;
}

/* --------------------------------------------------------------- closing */

.closing {
  display: grid;
  gap: 1.5rem;
  justify-items: start;
  padding-block: clamp(3rem, 6vw, 5rem);
  border-top: 1px solid var(--rule);
}

.closing h2 {
  max-width: 24ch;
}

/* ---------------------------------------------------------------- narrow */

@media (max-width: 62rem) {
  .hero-inner,
  .look {
    grid-template-columns: minmax(0, 1fr);
  }

  /* Stacked hero: the pair is centred under the copy, not pinned to the left
     edge with the whole right half empty. */
  .hero-shots {
    justify-content: center;
  }

  .hero-shots .phone:first-child {
    width: 18rem;
  }

  .hero-shots .phone:last-child {
    width: 15rem;
    margin-left: -1.75rem;
    margin-top: 2.5rem;
  }

  .look-shot {
    justify-content: flex-start;
  }

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

  .block-title {
    gap: 0.25rem;
  }
}

@media (max-width: 44rem) {
  body {
    font-size: 1rem;
  }

  .topbar-inner {
    gap: 1rem;
  }

  .topnav {
    gap: 0.15rem 0.95rem;
  }

  .topnav a {
    font-size: 0.6875rem;
    letter-spacing: 0.1em;
  }

  .row {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.5rem;
    padding-block: 1.2rem;
  }

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

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

  .footer-copy {
    grid-column: auto;
  }

  /* One shot per row, thumbnail beside its caption: the gallery reads as an
     index instead of a column of full-width phones. */
  .gallery {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.35rem;
  }

  .shot {
    grid-template-columns: 8.5rem minmax(0, 1fr);
    gap: 1rem 1.15rem;
    align-items: start;
  }

  .shot .phone {
    width: 8.5rem;
  }

  .shot h3 {
    font-size: 1.0625rem;
  }

  .shot p {
    font-size: 0.875rem;
  }
}

@media (max-width: 26rem) {
  .topbar-inner {
    flex-wrap: wrap;
    padding-block: 0.55rem;
  }

  .hero-shots .phone:last-child {
    display: none;
  }

  .hero-shots .phone:first-child {
    width: 16rem;
  }
}

/* ----------------------------------------------------------------- print */

@media print {
  .topbar,
  .footer-nav,
  .actions,
  .hero::before {
    display: none;
  }

  body {
    background: #fff;
    color: #000;
  }

  .hero-shots,
  .gallery {
    break-inside: avoid;
  }
}
