/* Willow Nest. Colours, fonts, spacing and radii come from tokens.css (Willow brand v2).
   tokens.css is a copy of willow-brand/tokens/tokens.css; refresh it from there, never edit it here. */
:root {
  --mark: var(--pillar-on-nest);
  --pad: var(--space-12);
  --section: var(--space-24);
}
[data-theme="dusk"] {
  --mark: var(--pillar-on-workshop);
}
* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--space-8);
}
a {
  color: inherit;
  text-underline-offset: 5px;
  text-decoration-thickness: 1px;
}
button,
a,
input,
summary {
  touch-action: manipulation;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  font-size: clamp(36px, 5.6vw, 72px);
  line-height: 1;
  margin-bottom: var(--space-6);
}
h2 {
  font-size: clamp(32px, 3.6vw, 44px);
  line-height: 1.1;
  margin-bottom: var(--space-6);
}
h3 {
  font-size: 28px;
  line-height: 1.2;
}
p {
  max-width: 68ch;
}

/* Buttons: pill, one filled button per view */
button,
.button {
  font: 600 15px/1.2 var(--font-sans);
  letter-spacing: 0.02em;
  color: var(--text);
  background: transparent;
  border: 1px solid var(--line-control);
  border-radius: var(--radius-pill);
  padding: var(--space-3) 20px;
  min-height: 44px;
  cursor: pointer;
}
.button {
  display: inline-flex;
  align-items: center;
  gap: var(--space-4);
  text-decoration: none;
}
button:hover,
.button:hover {
  border-color: var(--text);
}
.button.primary {
  background: var(--accent-fill);
  border-color: var(--accent-fill);
  color: var(--on-accent);
}

/* Labels and metadata */
.eyebrow {
  font-size: 13px;
  line-height: 1.4;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--space-6);
}
.kicker {
  font-size: 15px;
  color: var(--text-muted);
  margin-bottom: var(--space-4);
}
.meta,
.dialog-bar > span,
.pillar,
.hero-art small,
footer small {
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.4;
  letter-spacing: 0;
}
.note {
  font-size: 15px;
  color: var(--text-muted);
  margin-top: var(--space-6);
}

header,
main,
footer {
  max-width: 1320px;
  margin: auto;
}
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-2) var(--pad);
  border-bottom: 1px solid var(--line);
  gap: var(--space-6);
}
.brand {
  display: block;
  flex: none;
  margin-left: -22px; /* the logo file carries its own clear space */
}
.lockup {
  display: block;
  width: 220px;
  height: auto;
}
.lockup g {
  fill: var(--mark);
}
nav {
  display: flex;
  gap: var(--space-8);
  font-size: 15px;
}
nav a {
  text-decoration: none;
  padding: var(--space-2) 0;
  border-bottom: 1px solid transparent;
}
nav a:hover {
  border-color: var(--accent);
}
.controls {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.controls button {
  font-size: 13px;
  padding: var(--space-2) var(--space-4);
}
.themes {
  display: inline-flex;
  border: 1px solid var(--line-control);
  border-radius: var(--radius-pill);
  padding: 3px;
}
.themes button {
  border: 0;
  min-height: 36px;
  font-weight: 400;
  color: var(--text-muted);
}
.themes button[aria-pressed="true"] {
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
}

.hero {
  padding: var(--space-24) var(--pad) var(--space-16);
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: var(--space-16);
  align-items: center;
}
.intro {
  font-family: var(--font-display);
  font-size: 21px;
  line-height: 1.5;
  color: var(--text-muted);
}
.hero-copy {
  max-width: 46ch;
  margin-bottom: var(--space-8);
}
.textlink {
  display: block;
  width: fit-content;
  margin-top: var(--space-6);
  font-size: 15px;
}
/* The pillar depth is a ground: Willow Nest's cover panel, always with its numeral and name. */
.hero-art {
  min-height: 460px;
  background: var(--pillar-nest);
  color: var(--pillar-on-nest);
  border: 1px solid var(--line);
  padding: var(--space-8);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--space-8);
}
.paper p {
  font: 400 36px/1.2 var(--font-display);
  letter-spacing: 0;
  margin: 0 0 var(--space-6);
}
.paper-rule {
  width: 48px;
  height: 1px;
  background: currentColor;
}
.hero-art-foot {
  display: flex;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.principle {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: var(--space-16);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: var(--space-8) var(--pad);
  align-items: center;
}
.principle span {
  font: 400 28px/1.2 var(--font-display);
  letter-spacing: 0;
}
.principle p {
  font-size: 15px;
  color: var(--text-muted);
  max-width: 52ch;
  margin: 0;
}

section:not(.hero) {
  padding: var(--section) var(--pad);
}
.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: var(--space-12);
  margin-bottom: var(--space-6);
}
.section-head h2 {
  max-width: 650px;
}
.section-head > p {
  font-size: 15px;
  color: var(--text-muted);
  flex-shrink: 0;
}
.filters {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-bottom: var(--space-8);
}
.filters button {
  font-size: 15px;
  font-weight: 400;
}
.filters .active {
  background: var(--surface);
  border-color: var(--text);
  font-weight: 600;
}
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
}
.card {
  padding: var(--space-6);
  background: var(--surface);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: start;
  min-height: 280px;
}
.card .meta {
  color: var(--text-muted);
  margin-bottom: var(--space-6);
}
.card h3 {
  margin-bottom: var(--space-3);
}
.card p {
  font-size: 15px;
}
.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-6);
  margin-top: auto;
}
.card .card-actions button {
  padding: var(--space-2) 0;
  min-height: 44px;
  border: 0;
  border-radius: 0;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 5px;
  text-decoration-thickness: 1px;
}
.collection-download {
  margin-top: var(--space-12);
  padding: var(--space-8);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-raised);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-8);
}
.collection-download .eyebrow {
  margin-bottom: var(--space-3);
}
.collection-download h3 {
  margin-bottom: var(--space-3);
}
.collection-download p:not(.eyebrow) {
  font-size: 15px;
  max-width: 60ch;
  margin: 0;
}
.collection-download button {
  flex-shrink: 0;
}

.small {
  background: var(--surface-raised);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-16);
}
.small h2 {
  margin-bottom: var(--space-4);
}
.prompt {
  border-left: 1px solid var(--line-control);
  padding-left: var(--space-12);
  align-self: center;
}
.prompt p {
  font: 400 28px/1.3 var(--font-display);
  letter-spacing: 0;
}
.shop {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-12);
}
.shop p:not(.eyebrow) {
  max-width: 62ch;
}
.shop .button {
  flex-shrink: 0;
}
.about {
  background: var(--surface);
}
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-24);
  margin-top: var(--space-12);
}
.about-grid > p {
  font-family: var(--font-display);
  font-size: 21px;
  line-height: 1.5;
  color: var(--text-muted);
}
.about-grid h3 {
  font: 600 17px/1.4 var(--font-sans);
  margin-bottom: var(--space-2);
}
.about-grid div p {
  font-size: 15px;
}
.faq {
  max-width: 900px;
  margin: auto;
}
details {
  border-bottom: 1px solid var(--line);
  padding: var(--space-4) 0;
}
summary {
  cursor: pointer;
  padding: var(--space-2) var(--space-6) var(--space-2) 0;
  font-weight: 600;
}
details p {
  font-size: 15px;
  margin: var(--space-4) 0 var(--space-1);
}
.contact {
  background: var(--surface-raised);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.contact h2 {
  font-size: 28px;
  line-height: 1.2;
  margin-bottom: var(--space-3);
}
.contact a {
  color: var(--accent);
  font-weight: 600;
}
footer {
  padding: var(--space-8) var(--pad) var(--space-12);
  display: flex;
  align-items: center;
  gap: var(--space-8);
  flex-wrap: wrap;
}
footer .lockup {
  width: 204px;
}
footer p {
  margin: 0;
  font-size: 15px;
  color: var(--text-muted);
}
footer > a:not(.brand) {
  margin-left: auto;
  font-size: 15px;
}
footer small {
  width: 100%;
  color: var(--text-muted);
  border-top: 1px solid var(--line);
  padding-top: var(--space-6);
}
.skip {
  position: absolute;
  left: 20px;
  top: -80px;
  z-index: 5;
  background: var(--ground);
  padding: var(--space-3);
}
.skip:focus {
  top: 10px;
}

/* Readers and download dialog: Daylight reading surface in a 10px card */
dialog {
  width: min(760px, 94vw);
  max-height: 90vh;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--ground);
  color: var(--text);
  padding: var(--space-8) var(--space-12);
}
dialog::backdrop {
  background: color-mix(in srgb, var(--pillar-on-nest) 55%, transparent);
}
.dialog-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
  margin-bottom: var(--space-8);
  color: var(--text-muted);
}
.dialog-bar button {
  font-size: 15px;
  color: var(--text);
  white-space: nowrap;
  flex: none;
}
dialog h2 {
  font-size: clamp(28px, 4vw, 44px);
}
dialog h3 {
  font: 600 17px/1.4 var(--font-sans);
  margin-top: var(--space-8);
}
dialog .meta {
  color: var(--text-muted);
  margin-bottom: var(--space-4);
}
dialog label {
  display: flex;
  gap: var(--space-3);
  align-items: start;
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--line);
}
dialog input {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin-top: 4px;
  accent-color: var(--accent);
}
dialog blockquote {
  margin: var(--space-4) 0 0;
  padding-left: var(--space-6);
  border-left: 1px solid var(--line-control);
  font: italic 400 21px/1.5 var(--font-display);
  letter-spacing: 0;
}
.gentle {
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: var(--space-6);
  margin-top: var(--space-6);
  font-size: 15px;
}
#reader-download {
  margin-top: var(--space-6);
}
.companion-download {
  text-align: left;
}
.download-editions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}
.download-edition {
  padding: var(--space-4);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-raised);
}
#download-dialog .download-edition h3 {
  font: 600 17px/1.4 var(--font-sans);
  margin: 0 0 var(--space-4);
}
.edition-links {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-3);
  font-size: 15px;
}
.edition-links a {
  padding: var(--space-1) 0;
  color: var(--accent);
  font-weight: 600;
}
.edition-links [aria-disabled="true"] {
  cursor: wait;
}

/* Simpler view: fewer surfaces, no cover panel */
.simple .hero-art {
  display: none;
}
.simple .hero {
  grid-template-columns: 1fr;
  max-width: 900px;
}
.simple .card,
.simple .about,
.simple .small,
.simple .contact,
.simple .collection-download,
.simple .download-edition {
  background: var(--ground);
}
.simple .card {
  border: 1px solid var(--line);
}
.simple .cards {
  grid-template-columns: 1fr 1fr;
}

@media (max-width: 1000px) {
  header {
    flex-wrap: wrap;
  }
  nav {
    order: 3;
    width: 100%;
    gap: var(--space-6);
  }
}
@media (max-width: 800px) {
  :root {
    --pad: var(--space-6);
    --section: var(--space-16);
  }
  .lockup {
    width: 204px;
  }
  .brand {
    margin-left: -20px;
  }
  nav {
    justify-content: space-between;
    gap: var(--space-4);
  }
  .controls {
    flex-wrap: wrap;
    justify-content: flex-end;
  }
  .hero {
    padding: var(--space-12) var(--pad);
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }
  .hero-art {
    min-height: 320px;
    padding: var(--space-6);
  }
  .paper p {
    font-size: 28px;
  }
  .principle {
    grid-template-columns: 1fr;
    gap: var(--space-3);
    padding: var(--space-6) var(--pad);
  }
  .section-head {
    display: block;
  }
  .cards,
  .simple .cards {
    grid-template-columns: 1fr;
  }
  .card {
    min-height: 240px;
  }
  .small,
  .about-grid {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }
  .prompt {
    border-left: 0;
    border-top: 1px solid var(--line-control);
    padding: var(--space-6) 0 0;
  }
  .collection-download,
  .shop {
    display: block;
  }
  .collection-download {
    padding: var(--space-6);
  }
  .collection-download button,
  .shop .button {
    margin-top: var(--space-6);
  }
  footer {
    gap: var(--space-6);
  }
  footer > a:not(.brand) {
    margin-left: 0;
  }
  dialog {
    padding: var(--space-6);
  }
}
@media (max-width: 520px) {
  .download-editions {
    grid-template-columns: 1fr;
  }
  #download-title {
    overflow-wrap: break-word;
  }
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
@media print {
  body > *:not(dialog) {
    display: none !important;
  }
  dialog {
    position: static;
    max-height: none;
    width: 100%;
    border: 0;
    padding: 0;
    overflow: visible;
  }
  dialog .dialog-bar,
  dialog > button,
  dialog > .note {
    display: none;
  }
  dialog::backdrop {
    display: none;
  }
}
