/* nimblecompanions.com
   Idea: things stand on a ledge, like items put on a table.
   Palette: mist (page), paper (cards), ink (text, ledge), slate (secondary text), note (sticky yellow). */

:root {
  --mist: #f1f4f3;
  --paper: #ffffff;
  --ink: #1b2a41;
  --slate: #53657a;
  --note: #f6d25b;
  --line: #cdd6d9;
  --ledge: #1b2a41;
  --head: "Manrope", "Avenir Next", "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --text: "Manrope", "Avenir Next", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --prose: "Literata", Charter, "Iowan Old Style", "Palatino Linotype", Georgia, "Noto Serif", serif;
  --maxw: 70rem;
  --gutter: clamp(1.1rem, 4vw, 2.25rem);
}

@media (prefers-color-scheme: dark) {
  :root {
    --mist: #0f1722;
    --paper: #172233;
    --ink: #e8eef6;
    --slate: #9fb1c6;
    --line: #2a3a50;
    --ledge: #34496a;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--mist);
  color: var(--ink);
  font-family: var(--text);
  font-size: 1.0625rem;
  line-height: 1.6;
}
img, svg { max-width: 100%; height: auto; }
a { color: inherit; text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; border-radius: 4px; }
.skip { position: absolute; left: var(--gutter); top: -4rem; background: var(--ink); color: var(--mist); padding: 0.6rem 1rem; border-radius: 6px; z-index: 10; }
.skip:focus { top: 0.75rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }

/* Header */
.bar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1.75rem; padding-top: 1.25rem; padding-bottom: 1.25rem; }
.wordmark { font-family: var(--head); font-weight: 800; font-size: 1.375rem; letter-spacing: -0.03em; text-decoration: none; }
.nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; }
.nav a { text-decoration: none; padding: 0.25rem 0; border-bottom: 2px solid transparent; }
.nav a:hover { border-bottom-color: var(--ink); }
.nav a[aria-current="page"] { border-bottom-color: var(--ink); font-weight: 700; }
.lang { margin-left: auto; display: flex; gap: 0.75rem; font-size: 0.9375rem; }
.lang a { text-decoration: none; color: var(--slate); padding: 0.25rem 0; }
.lang a[aria-current="true"] { color: var(--ink); font-weight: 800; border-bottom: 2px solid var(--ink); }

/* Type */
h1, h2, h3 { font-family: var(--head); line-height: 1.15; margin: 0; }
h1 { font-size: clamp(2.5rem, 6.4vw, 4.5rem); font-weight: 800; letter-spacing: -0.035em; line-height: 1.02; max-width: 15ch; text-wrap: balance; }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 800; letter-spacing: -0.02em; }
h3 { font-size: 1.1875rem; font-weight: 800; letter-spacing: -0.01em; }
p { margin: 0 0 1rem; text-wrap: pretty; }
.lead { font-size: clamp(1.1875rem, 2.2vw, 1.4rem); line-height: 1.5; color: var(--slate); max-width: 34rem; margin-top: 1.5rem; }
.muted { color: var(--slate); }

/* Hero and the ledge */
.hero { padding-top: clamp(2.5rem, 8vw, 6rem); }
.hero .lead + p { margin-top: 1.5rem; }
.ledge { height: 1rem; background: var(--ledge); position: relative; z-index: 1; }
.scene-section .wrap { padding-top: clamp(2.5rem, 6vw, 4rem); }
.split { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: clamp(1.5rem, 5vw, 4rem); align-items: end; }
.split .copy { padding-bottom: clamp(2rem, 5vw, 3.5rem); }
.scene-art { display: block; width: 100%; max-width: 26rem; justify-self: end; margin-bottom: -2px; position: relative; z-index: 0; }
.hero-split .ledge { margin-top: 0; }

/* Things standing on the ledge */
.scene { display: flex; flex-wrap: wrap; align-items: flex-end; gap: clamp(0.75rem, 2.5vw, 1.75rem); }
.stand { background: var(--paper); border: 2px solid var(--ink); border-bottom: 0; border-radius: 12px 12px 0 0; padding: 1.5rem 1.75rem 2rem; flex: 1 1 22rem; max-width: 32rem; margin-bottom: -2px; position: relative; z-index: 0; }
.stand h3 { font-size: clamp(1.75rem, 3.4vw, 2.25rem); letter-spacing: -0.03em; margin-bottom: 0.75rem; }
.stand h3 a { text-decoration: none; }
.stand h3 a:hover { text-decoration: underline; text-decoration-thickness: 2px; }
.stand.empty { background: transparent; border: 2px dashed var(--line); border-bottom: 0; color: var(--slate); flex: 1 1 11rem; max-width: 16rem; min-height: 8rem; display: flex; align-items: flex-end; padding-bottom: 1.25rem; }
.stand.empty p { margin: 0; }

.note { display: inline-block; background: var(--note); color: #1b2a41; font-weight: 700; font-size: 0.9375rem; padding: 0.1rem 0.6rem; border-radius: 3px; transform: rotate(-1.5deg); }
.button { display: inline-block; background: var(--ink); color: var(--mist); font-weight: 700; text-decoration: none; padding: 0.7rem 1.15rem; border-radius: 8px; transition: background-color 0.12s, color 0.12s; }
.button:hover { background: var(--note); color: #1b2a41; }

/* One entrance: things settle onto the ledge */
@keyframes settle { from { opacity: 0; transform: translateY(-14px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: no-preference) {
  .scene > *, .scene-art { animation: settle 0.5s cubic-bezier(0.2, 0.8, 0.25, 1) both; }
  .scene > :nth-child(2) { animation-delay: 0.09s; }
}

/* Sections */
.section { padding: clamp(2.5rem, 6vw, 4.5rem) 0 0; }
.section h2 { margin-bottom: 1.5rem; }
.section + .section { padding-top: clamp(2rem, 5vw, 3.5rem); }
.trio, .pairs { display: grid; gap: 1.75rem 3rem; }
.trio { grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
.pairs { grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr)); }
.trio h3, .pairs h3 { margin-bottom: 0.4rem; }
.trio p, .pairs p { margin: 0; color: var(--slate); }
.section .narrow { max-width: 38rem; }
main > :last-child { margin-bottom: clamp(3rem, 8vw, 5.5rem); }

/* Legal and help pages */
.prose { max-width: 40rem; padding-top: clamp(2.5rem, 7vw, 4.5rem); font-family: var(--prose); line-height: 1.7; }
.prose h1 { font-size: clamp(2rem, 5vw, 3rem); max-width: none; margin-bottom: 0.75rem; }
.prose h2 { font-size: 1.3125rem; margin: 2.25rem 0 0.6rem; letter-spacing: -0.015em; }
.prose h3 { font-size: 1.0625rem; margin: 1.5rem 0 0.4rem; }
.prose ul, .prose ol { padding-left: 1.3rem; margin: 0 0 1rem; }
.prose li { margin-bottom: 0.4rem; }
.prose .muted, .prose table, .prose summary { font-family: var(--text); }
.table-wrap { overflow-x: auto; margin: 0 0 1.5rem; }
table { border-collapse: collapse; width: 100%; font-size: 0.9375rem; line-height: 1.5; }
th, td { text-align: left; vertical-align: top; padding: 0.7rem 1rem 0.7rem 0; border-top: 1px solid var(--line); }
th { font-weight: 800; border-top: 2px solid var(--ink); }
details { border-top: 1px solid var(--line); padding: 0.9rem 0; }
details:last-of-type { border-bottom: 1px solid var(--line); }
summary { cursor: pointer; font-weight: 800; }
details p { margin: 0.6rem 0 0; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 2.25rem 0 3rem; font-size: 0.9375rem; color: var(--slate); }
.foot { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 1.5rem 3rem; }
.foot h2 { font-size: 0.9375rem; letter-spacing: 0; margin-bottom: 0.5rem; color: var(--ink); }
.foot p, .foot ul { margin: 0; padding: 0; list-style: none; }
.foot li { margin-bottom: 0.25rem; }
.foot .fine { grid-column: 1 / -1; font-size: 0.875rem; max-width: 46rem; }

/* Placeholders in development builds */
mark.todo { background: var(--note); color: #1b2a41; padding: 0 0.3em; border-radius: 3px; outline: 1px dashed #1b2a41; }

@media (max-width: 760px) {
  .split { grid-template-columns: 1fr; }
  .scene-art { justify-self: start; max-width: 22rem; }
  .lang { margin-left: 0; }
}
