/* Remote for Bravia TV: one small stylesheet for four quiet pages.
   System fonts only. Light and dark follow the device. */

:root {
  --bg: #f7f5f0;
  --ink: #1d1c1a;
  --muted: #5a564e;
  --rule: #dcd7cc;
  --link: #1b4d8c;
  --mark: #cfe0f5;
  --serif: ui-serif, 'Iowan Old Style', 'Charter', 'Palatino Linotype', Georgia, serif;
  --sans: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #151513;
    --ink: #ebe8e1;
    --muted: #a9a49a;
    --rule: #2f2e2a;
    --link: #8fb9ee;
    --mark: #2a4468;
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-size: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
  line-height: 1.62;
  padding: 0 1.25rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

::selection {
  background: var(--mark);
  color: var(--ink);
}

header.site,
main,
footer.site {
  width: 100%;
  max-width: 40rem;
  margin-inline: auto;
}

/* Header */

header.site {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 1.5rem;
  padding: 1.5rem 0 1.125rem;
  border-bottom: 1px solid var(--rule);
  font-family: var(--sans);
  font-size: 0.9375rem;
}

header.site .name {
  color: var(--ink);
  font-weight: 650;
  text-decoration: none;
}

header.site nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
}

header.site nav a {
  color: var(--muted);
  text-decoration: none;
}

header.site a:hover {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 0.25em;
}

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

header.site nav a[aria-current='page'] {
  text-decoration: underline;
  text-underline-offset: 0.25em;
  text-decoration-thickness: 1px;
}

/* Text */

main {
  flex: 1 0 auto;
  padding: 2.75rem 0 4rem;
}

h1,
h2,
h3 {
  font-family: var(--sans);
  font-weight: 650;
  color: var(--ink);
  text-wrap: balance;
}

h1 {
  margin: 0 0 1.25rem;
  font-size: clamp(1.75rem, 1.4rem + 1.5vw, 2.375rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

h2 {
  margin: 2.75rem 0 0.625rem;
  font-size: 1.3125rem;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

h3 {
  margin: 2rem 0 0.5rem;
  font-size: 1.0625rem;
  line-height: 1.3;
}

p,
ul,
ol {
  margin: 0 0 1.05rem;
}

ul,
ol {
  padding-left: 1.4em;
}

li {
  margin-bottom: 0.4rem;
  padding-left: 0.2em;
}

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

strong {
  font-weight: 650;
}

.lead {
  font-size: 1.1875em;
  line-height: 1.5;
  margin-bottom: 0.5rem;
}

a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  overflow-wrap: anywhere;
}

a:hover {
  text-decoration-thickness: 2px;
}

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

/* Footer */

footer.site {
  padding: 1.25rem 0 2rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.875rem;
  line-height: 1.5;
}

footer.site p {
  margin: 0 0 0.25rem;
}

@media (max-width: 30rem) {
  main {
    padding-top: 2rem;
  }

  h2 {
    margin-top: 2.25rem;
  }
}

@media print {
  body {
    background: #fff;
    color: #000;
  }

  header.site nav {
    display: none;
  }
}
