/* Nestlist public site. One shared stylesheet, no external fonts or scripts.
   Colors and type mirror the iOS app's AppTheme: paper, ink, olive, sage,
   sand, muted and line, Georgia titles and the system sans for body copy. */

:root {
  color-scheme: light dark;
  --paper: #faf9f5;
  --surface: #ffffff;
  --ink: #20251f;
  --muted: #5f665d;
  --line: #dadfd2;
  --olive: #505d42;
  --olive-press: #434f37;
  --on-olive: #ffffff;
  --sage: #e8ecdf;
  --sand: #f0e9df;
  --link: #48563a;
  --shadow: 0 1px 2px rgba(32, 37, 31, 0.04), 0 8px 24px rgba(32, 37, 31, 0.06);
  --radius: 20px;
  --serif: Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #151813;
    --surface: #1e221c;
    --ink: #eceee7;
    --muted: #a9b0a5;
    --line: #333a2f;
    --olive: #a7b98d;
    --olive-press: #b8c8a0;
    --on-olive: #151813;
    --sage: #283024;
    --sand: #2f2a22;
    --link: #b9c99f;
    --shadow: none;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 16px;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

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

.skip:focus {
  left: 16px;
  top: 8px;
  z-index: 10;
  background: var(--surface);
  color: var(--ink);
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
}

/* Layout */

header.site,
main,
footer.site {
  width: 100%;
  max-width: 48rem;
  margin: 0 auto;
  padding-left: 16px;
  padding-right: 16px;
}

/* Header */

header.site {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  padding-top: 18px;
  padding-bottom: 14px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--serif);
  font-size: 1.35rem;
}

.brand img {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  border: 1px solid var(--line);
}

nav[aria-label="Site"] ul {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

nav[aria-label="Site"] a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.94rem;
  text-decoration: none;
  border: 1px solid transparent;
}

nav[aria-label="Site"] a:hover {
  color: var(--ink);
  background: var(--sage);
}

nav[aria-label="Site"] a[aria-current="page"] {
  color: var(--ink);
  background: var(--surface);
  border-color: var(--line);
}

/* Hero: the app's article header, with the title over the open side of the
   photo on wide screens and below it on phones. */

main {
  padding-top: 4px;
  padding-bottom: 56px;
}

.hero {
  position: relative;
  margin: 0 0 28px;
  border-radius: 24px;
  overflow: hidden;
  background: var(--sand);
}

.hero-art {
  display: block;
  width: 100%;
  aspect-ratio: 21 / 8;
  object-fit: cover;
  object-position: right center;
}

.hero-copy {
  padding: 20px 20px 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 24px 24px;
}

@media (min-width: 640px) {
  .hero {
    background: none;
  }

  .hero-art {
    aspect-ratio: auto;
    min-height: 240px;
  }

  .hero-copy {
    position: absolute;
    inset: 0 auto 0 0;
    width: 50%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 28px 32px;
    background: none;
    border: 0;
    border-radius: 0;
  }
}

/* The photos are light, so the overlaid title keeps dark ink in dark mode. */
@media (min-width: 640px) and (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .hero-copy {
    color: #20251f;
  }

  :root:not([data-theme="light"]) .hero-copy .meta,
  :root:not([data-theme="light"]) .hero-copy .lede {
    color: #4d554b;
  }
}

/* Type */

h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -0.005em;
}

h1 {
  font-size: clamp(2rem, 1.4rem + 2.6vw, 2.75rem);
  line-height: 1.12;
  margin: 0 0 8px;
}

.hero-copy .meta,
.hero-copy .lede {
  margin: 0;
  color: var(--muted);
}

.hero-copy .lede {
  font-size: 1.08rem;
}

h2 {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.55rem;
  line-height: 1.25;
  margin: 44px 0 12px;
  scroll-margin-top: 16px;
}

h2 .num {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--sage);
  color: var(--olive);
  font-family: var(--sans);
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
}

h3 {
  font-size: 1.2rem;
  margin: 28px 0 6px;
}

p,
ul,
ol {
  margin: 0 0 1em;
}

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

li {
  margin-bottom: 0.45em;
}

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

strong {
  font-weight: 600;
}

a {
  color: var(--link);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

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

a:focus-visible,
.button:focus-visible {
  outline: 2px solid var(--olive);
  outline-offset: 3px;
  border-radius: 6px;
}

/* Cards, matching the app's SurfaceCard */

.note,
.toc,
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 22px;
  margin: 0 0 24px;
}

.note {
  background: var(--sage);
  border-color: transparent;
  box-shadow: none;
}

.note > :last-child,
.card > :last-child {
  margin-bottom: 0;
}

.note ul {
  margin-top: 8px;
}

main > p.note {
  padding: 14px 20px;
}

.card h2 {
  margin-top: 0;
}

.toc {
  padding: 18px 22px;
}

.toc::before {
  content: "On this page";
  display: block;
  margin-bottom: 8px;
  font-family: var(--serif);
  font-size: 1.15rem;
}

.toc ol {
  margin: 0;
  padding-left: 1.6em;
  columns: 2 16rem;
  column-gap: 28px;
}

.toc li {
  break-inside: avoid;
  margin-bottom: 4px;
}

.toc a {
  text-decoration: none;
}

.toc a:hover {
  text-decoration: underline;
}

/* Home page link cards with the app's round sage and sand badges */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 12px;
  margin: 0 0 24px;
  padding: 0;
  list-style: none;
}

.cards li {
  margin: 0;
}

.cards a {
  display: grid;
  grid-template-columns: 44px 1fr;
  grid-template-rows: auto auto;
  column-gap: 14px;
  align-items: center;
  height: 100%;
  min-height: 84px;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  color: var(--ink);
  text-decoration: none;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.cards a:hover {
  border-color: var(--olive);
}

.cards a:active {
  transform: scale(0.99);
}

.badge {
  grid-row: 1 / span 2;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: var(--ink);
}

.badge.sage {
  background: var(--sage);
}

.badge.sand {
  background: var(--sand);
}

.cards strong {
  font-family: var(--serif);
  font-size: 1.12rem;
  font-weight: 400;
  align-self: end;
}

.cards span:not(.badge) {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.4;
  align-self: start;
}

/* Primary capsule button, matching OliveButtonStyle (regular weight) */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 24px;
  border-radius: 999px;
  background: var(--olive);
  color: var(--on-olive);
  font-weight: 400;
  text-decoration: none;
  overflow-wrap: anywhere;
  transition: background-color 0.12s ease, transform 0.12s ease;
}

.button:hover {
  background: var(--olive-press);
  text-decoration: none;
}

.button:active {
  transform: scale(0.985);
}

.contact .button {
  margin-top: 4px;
}

/* Tables */

.table-wrap {
  overflow-x: auto;
  margin: 0 0 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
}

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.95rem;
  line-height: 1.45;
}

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

tr:last-child td {
  border-bottom: 0;
}

th {
  background: var(--sand);
  font-weight: 600;
}

td:first-child {
  font-weight: 500;
}

.placeholder {
  background: var(--sand);
  outline: 1px dashed var(--olive);
  padding: 0 4px;
  border-radius: 4px;
  overflow-wrap: anywhere;
}

/* Footer */

footer.site {
  padding-top: 24px;
  padding-bottom: 40px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.92rem;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.1rem;
}

.footer-brand img {
  border-radius: 7px;
  border: 1px solid var(--line);
}

footer.site ul {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  margin: 0 0 10px;
  padding: 0;
  list-style: none;
}

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

footer.site p {
  margin: 0;
}

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

@media print {
  header.site nav,
  .hero-art,
  .toc,
  footer.site ul {
    display: none;
  }

  .hero-copy {
    position: static;
    width: auto;
    padding: 0;
    border: 0;
  }

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

/* Phones: the brand sits on its own row and the page links scroll sideways
   in one line instead of wrapping unevenly. */
@media (max-width: 639px) {
  header.site nav {
    width: calc(100% + 32px);
    margin: 0 -16px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  header.site nav::-webkit-scrollbar {
    display: none;
  }

  nav[aria-label="Site"] ul {
    flex-wrap: nowrap;
    padding: 0 16px;
  }

  nav[aria-label="Site"] a {
    white-space: nowrap;
    background: var(--surface);
    border-color: var(--line);
  }

  nav[aria-label="Site"] a[aria-current="page"] {
    background: var(--olive);
    border-color: var(--olive);
    color: var(--on-olive);
  }
}
