@font-face { font-family: 'Noto Serif Lao'; font-style: normal; font-weight: 100; font-display: swap; src: url("/assets/fonts/noto-serif-lao-latin-100-normal.woff2") format("woff2"); }
@font-face { font-family: 'Noto Serif Lao'; font-style: normal; font-weight: 200; font-display: swap; src: url("/assets/fonts/noto-serif-lao-latin-200-normal.woff2") format("woff2"); }
@font-face { font-family: 'Noto Serif Lao'; font-style: normal; font-weight: 300; font-display: swap; src: url("/assets/fonts/noto-serif-lao-latin-300-normal.woff2") format("woff2"); }
@font-face { font-family: 'Noto Serif Lao'; font-style: normal; font-weight: 400; font-display: swap; src: url("/assets/fonts/noto-serif-lao-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: 'Noto Serif Lao'; font-style: normal; font-weight: 500; font-display: swap; src: url("/assets/fonts/noto-serif-lao-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: 'Noto Serif Lao'; font-style: normal; font-weight: 600; font-display: swap; src: url("/assets/fonts/noto-serif-lao-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: 'Noto Serif Lao'; font-style: normal; font-weight: 700; font-display: swap; src: url("/assets/fonts/noto-serif-lao-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: 'Noto Serif Lao'; font-style: normal; font-weight: 800; font-display: swap; src: url("/assets/fonts/noto-serif-lao-latin-800-normal.woff2") format("woff2"); }
@font-face { font-family: 'Noto Serif Lao'; font-style: normal; font-weight: 900; font-display: swap; src: url("/assets/fonts/noto-serif-lao-latin-900-normal.woff2") format("woff2"); }
@font-face { font-family: 'Epilogue'; font-style: italic; font-weight: 100; font-display: swap; src: url("/assets/fonts/epilogue-latin-100-italic.woff2") format("woff2"); }
@font-face { font-family: 'Epilogue'; font-style: normal; font-weight: 100; font-display: swap; src: url("/assets/fonts/epilogue-latin-100-normal.woff2") format("woff2"); }
@font-face { font-family: 'Epilogue'; font-style: italic; font-weight: 200; font-display: swap; src: url("/assets/fonts/epilogue-latin-200-italic.woff2") format("woff2"); }
@font-face { font-family: 'Epilogue'; font-style: normal; font-weight: 200; font-display: swap; src: url("/assets/fonts/epilogue-latin-200-normal.woff2") format("woff2"); }
@font-face { font-family: 'Epilogue'; font-style: italic; font-weight: 300; font-display: swap; src: url("/assets/fonts/epilogue-latin-300-italic.woff2") format("woff2"); }
@font-face { font-family: 'Epilogue'; font-style: normal; font-weight: 300; font-display: swap; src: url("/assets/fonts/epilogue-latin-300-normal.woff2") format("woff2"); }
@font-face { font-family: 'Epilogue'; font-style: italic; font-weight: 400; font-display: swap; src: url("/assets/fonts/epilogue-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: 'Epilogue'; font-style: normal; font-weight: 400; font-display: swap; src: url("/assets/fonts/epilogue-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: 'Epilogue'; font-style: italic; font-weight: 500; font-display: swap; src: url("/assets/fonts/epilogue-latin-500-italic.woff2") format("woff2"); }
@font-face { font-family: 'Epilogue'; font-style: normal; font-weight: 500; font-display: swap; src: url("/assets/fonts/epilogue-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: 'Epilogue'; font-style: italic; font-weight: 600; font-display: swap; src: url("/assets/fonts/epilogue-latin-600-italic.woff2") format("woff2"); }
@font-face { font-family: 'Epilogue'; font-style: normal; font-weight: 600; font-display: swap; src: url("/assets/fonts/epilogue-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: 'Epilogue'; font-style: italic; font-weight: 700; font-display: swap; src: url("/assets/fonts/epilogue-latin-700-italic.woff2") format("woff2"); }
@font-face { font-family: 'Epilogue'; font-style: normal; font-weight: 700; font-display: swap; src: url("/assets/fonts/epilogue-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: 'Epilogue'; font-style: italic; font-weight: 800; font-display: swap; src: url("/assets/fonts/epilogue-latin-800-italic.woff2") format("woff2"); }
@font-face { font-family: 'Epilogue'; font-style: normal; font-weight: 800; font-display: swap; src: url("/assets/fonts/epilogue-latin-800-normal.woff2") format("woff2"); }
@font-face { font-family: 'Epilogue'; font-style: italic; font-weight: 900; font-display: swap; src: url("/assets/fonts/epilogue-latin-900-italic.woff2") format("woff2"); }
@font-face { font-family: 'Epilogue'; font-style: normal; font-weight: 900; font-display: swap; src: url("/assets/fonts/epilogue-latin-900-normal.woff2") format("woff2"); }
:root {
  --bg-light-base: #f8f3e6;
  --fg-light-base-body: #2a2418;
  --fg-light-base-heading: #2a2418;
  --fg-light-base-muted: #5c5240;
  --fg-light-base-link: #6c5e09;
  --fg-light-base-inverse: #2a2418;
  --bg-light-card: #fdfaf1;
  --fg-light-card-body: #2a2418;
  --fg-light-card-heading: #2a2418;
  --fg-light-card-muted: #5c5240;
  --fg-light-card-link: #6c5e09;
  --fg-light-card-inverse: #2a2418;
  --bg-light-elevated: #efe6cf;
  --fg-light-elevated-body: #2a2418;
  --fg-light-elevated-heading: #2a2418;
  --fg-light-elevated-muted: #5c5240;
  --fg-light-elevated-link: #6c5e09;
  --fg-light-elevated-inverse: #2a2418;
  --brand-light-accent: #6c5e09;
  --brand-light-accent-hover: #574a07;
  --brand-light-on-accent: #fdfaf1;
  --focus-light-ring: #6c5e09;
  --focus-ring: var(--focus-light-ring);
  --border-light-default: #80704e;
  --border-light-subtle: #ddd1b4;
}
.bg-surface-base { background: var(--bg-light-base); --fg-body: var(--fg-light-base-body); --fg-heading: var(--fg-light-base-heading); --fg-muted: var(--fg-light-base-muted); --fg-link: var(--fg-light-base-link); --fg-inverse: var(--fg-light-base-inverse); }
.bg-surface-card { background: var(--bg-light-card); --fg-body: var(--fg-light-card-body); --fg-heading: var(--fg-light-card-heading); --fg-muted: var(--fg-light-card-muted); --fg-link: var(--fg-light-card-link); --fg-inverse: var(--fg-light-card-inverse); }
.bg-surface-elevated { background: var(--bg-light-elevated); --fg-body: var(--fg-light-elevated-body); --fg-heading: var(--fg-light-elevated-heading); --fg-muted: var(--fg-light-elevated-muted); --fg-link: var(--fg-light-elevated-link); --fg-inverse: var(--fg-light-elevated-inverse); }
.text-role-body { color: var(--fg-body); overflow-wrap: anywhere; }
.text-role-heading { color: var(--fg-heading); overflow-wrap: anywhere; }
.text-role-muted { color: var(--fg-muted); }
.text-role-link { color: var(--fg-link); }
.text-role-inverse { color: var(--fg-inverse); }
.text-role-link { text-decoration: underline; }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
img { max-width: 100%; height: auto; }
.site-logo { max-width: 100%; height: auto; }
.site-menu > summary { list-style: none; cursor: pointer; }
.site-menu > summary::-webkit-details-marker { display: none; }
html:has(:focus-visible) :is(details.site-menu, details.site-nav-group)[open]:not(:focus-within) > ul { visibility: hidden; }
:where(section[data-section][style]) { background-size: cover; background-position: center; padding: clamp(1.5rem, 4vw, 3rem); }
:where(section[data-section][style] > .bg-surface-card) { padding: clamp(1rem, 3vw, 2rem); }
:where(section[data-section][style] > .bg-surface-card > :first-child) { margin-top: 0; }
:where(section[data-section][style] > .bg-surface-card > :last-child) { margin-bottom: 0; }
.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { position: static; padding: 0.25rem 0.5rem; outline: 2px solid var(--focus-ring); }

:root {
  --paper: var(--bg-light-base);
  --card: var(--bg-light-card);
  --tint: var(--bg-light-elevated);
  --gold: var(--brand-light-accent);
  --gold-deep: var(--brand-light-accent-hover);
  --on-gold: var(--brand-light-on-accent);
  --rule: var(--border-light-default);
  --rule-faint: var(--border-light-subtle);
  --serif: 'Noto Serif Lao', Georgia, serif;
  --sans: 'Epilogue', system-ui, sans-serif;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  --wide: 74rem;
}

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

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

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.68;
  font-weight: 400;
}

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 400;
  color: var(--fg-heading);
  text-wrap: balance;
}

/* ---------- Header ---------- */

.site-header {
  position: relative;
  z-index: 20;
  max-width: var(--wide);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.4rem 0 1.1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: manual;
  white-space: nowrap;
}

.brand .site-logo { width: 2.75rem; height: 2.75rem; flex: none; }

.brand-name {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.45rem;
  letter-spacing: 0.005em;
  line-height: 1.1;
}

.brand:hover .brand-name { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }

.strapline {
  margin: 0;
  font-family: var(--serif);
  font-style: normal;
  font-size: 1rem;
  white-space: nowrap;
}

.navbar {
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule-faint);
  min-height: 3rem;
  display: flex;
  align-items: center;
}

.site-nav ul {
  display: flex;
  flex-wrap: nowrap;
  gap: 2.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav a {
  display: inline-block;
  padding: 0.7rem 0;
  font-size: 0.97rem;
  white-space: nowrap;
  overflow-wrap: normal;
  color: var(--fg-heading);
  text-decoration: none;
  border-bottom: 2px solid transparent;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--gold-deep);
  border-bottom-color: var(--gold);
}

/* Phone menu: the renderer's details toggle */
.site-menu { display: none; width: 100%; }

.site-menu > summary {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.8rem 0;
  font-size: 0.97rem;
  white-space: nowrap;
}

.menu-icon {
  position: relative;
  display: inline-block;
  width: 1.15rem;
  height: 0.75rem;
  border-top: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
}

.menu-icon::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: calc(50% - 0.75px);
  border-top: 1.5px solid currentColor;
}

.site-menu[open] .menu-icon { border-color: var(--gold); }

.site-menu > ul {
  margin: 0;
  padding: 0.5rem var(--gutter) 1rem;
  list-style: none;
}

.site-menu[open] > ul {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  background: var(--card);
  border-bottom: 1px solid var(--rule);
  box-shadow: 0 14px 24px -18px var(--rule);
}

.site-menu li { border-bottom: 1px solid var(--rule-faint); }
.site-menu li:last-child { border-bottom: 0; }

.site-menu a {
  display: block;
  padding: 0.8rem 0;
  text-decoration: none;
}

.site-menu a:hover { color: var(--gold-deep); text-decoration: underline; }

@media (max-width: 860px) {
  .site-nav { display: none; }
  .site-menu { display: block; }
}

@media (max-width: 640px) {
  .strapline { display: none; }
  .masthead { padding: 1rem 0 0.8rem; }
  .brand-name { font-size: 1.3rem; }
  .brand .site-logo { width: 2.4rem; height: 2.4rem; }
}

/* ---------- Links ---------- */

.text-role-link {
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
  text-decoration-color: var(--rule);
}

.text-role-link:hover {
  color: var(--gold-deep);
  text-decoration-color: currentColor;
}

/* ---------- Page frame ---------- */

.page-wrap {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 0 var(--gutter) clamp(3rem, 7vw, 5.5rem);
}

.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.6rem;
  margin: 1.4rem 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.88rem;
}

.breadcrumbs li + li::before {
  content: "/";
  margin-right: 0.6rem;
  color: var(--rule);
}

/* ---------- Prose ---------- */

.prose { max-width: 38rem; }

.prose h2 {
  font-size: clamp(1.45rem, 2.6vw, 1.8rem);
  line-height: 1.25;
  margin: 2.6rem 0 0.8rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--rule-faint);
}

.prose h3 {
  font-size: 1.25rem;
  line-height: 1.3;
  margin: 2rem 0 0.6rem;
}

.prose p, .prose ul, .prose ol { margin: 0 0 1.1rem; }
.prose ul, .prose ol { padding-left: 1.3rem; }
.prose li { margin-bottom: 0.45rem; }
.prose li::marker { color: var(--gold); }

.prose blockquote {
  margin: 1.6rem 0;
  padding: 0.2rem 0 0.2rem 1.2rem;
  border-left: 1px solid var(--gold);
  font-family: var(--serif);
  font-size: 1.15rem;
}

.prose .table-scroll { overflow-x: auto; margin: 0 0 1.2rem; }
.prose table { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
.prose th, .prose td { text-align: left; padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--rule-faint); }

.prose figure { margin: 1.8rem 0; }
.prose .photo-inline img,
.prose .photo-hero img {
  display: block;
  width: 100%;
  border: 1px solid var(--rule-faint);
  padding: 0.4rem;
  background: var(--card);
}

/* ---------- Sketches ---------- */

.sketch { display: block; max-width: 100%; height: auto; overflow: visible; }
.sketch g { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.sketch .ink { stroke: var(--fg-heading); stroke-width: 1.5; }
.sketch .ink-faint { stroke: var(--rule); stroke-width: 1; opacity: 0.7; }
.sketch .ink-accent { stroke: var(--gold); stroke-width: 1.6; }
.sketch .dashed { stroke-dasharray: 2 5; stroke-width: 2.2; }
.sketch .dots { fill: var(--gold); stroke: none; }
.sketch .check { stroke-width: 4; }

/* ---------- Home: notebook spread ---------- */

.home-spread {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2rem;
  padding-top: clamp(2rem, 5vw, 3.5rem);
}

.cover-title h1 {
  margin: 0;
  font-size: clamp(2.5rem, 7vw, 4.4rem);
  line-height: 1.04;
  letter-spacing: -0.01em;
  max-width: 14ch;
}

.display {
  margin: 1.6rem 0 0;
  max-width: 34rem;
  border-top: 1px solid var(--rule);
}

.display-line {
  position: relative;
  margin: 0;
  padding: 0.75rem 0 0.75rem 1.5rem;
  border-bottom: 1px solid var(--rule-faint);
  font-size: 1.08rem;
  line-height: 1.5;
}

.display-line::before {
  content: "";
  position: absolute;
  left: 0.2rem;
  top: 1.35rem;
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--gold);
}

.index-prose { margin-top: 2.6rem; }

.index-prose > p:first-of-type {
  font-family: var(--serif);
  font-size: 1.22rem;
  line-height: 1.55;
}

.spread-drawing {
  margin: 0;
  max-width: 21rem;
  justify-self: center;
}

@media (min-width: 900px) {
  .home-spread {
    grid-template-columns: minmax(0, 1fr) minmax(17rem, 22rem);
    column-gap: clamp(3rem, 6vw, 5.5rem);
    align-items: start;
  }
  .spread-drawing {
    position: sticky;
    top: 2rem;
    grid-column: 2;
    grid-row: 1;
    padding: 1.5rem 0 1.5rem 1.75rem;
    border-left: 1px solid var(--rule-faint);
  }
  .spread-text { grid-column: 1; grid-row: 1; }
}

/* ---------- Topic hub: ruled contents ---------- */

.contents-page {
  max-width: 44rem;
  padding-top: clamp(1.8rem, 4vw, 3rem);
}

.page-head { padding-bottom: 1.4rem; border-bottom: 1px solid var(--rule); }

.icon-row { display: flex; gap: 1.1rem; margin-bottom: 1.2rem; }
.icon-row .icon { width: 2.6rem; height: 2.6rem; }

.page-title h1,
.reading-head h1,
.letter-title h1,
.note-title h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.12;
}

.contents-prose { max-width: none; margin-top: 1.6rem; }

.contents-prose ol {
  list-style: none;
  counter-reset: guide;
  padding: 0;
  margin: 1.2rem 0 1.6rem;
  border-top: 1px solid var(--rule);
}

.contents-prose ol > li {
  counter-increment: guide;
  position: relative;
  margin: 0;
  padding: 1rem 0 1rem 3rem;
  border-bottom: 1px solid var(--rule-faint);
}

.contents-prose ol > li::before {
  content: counter(guide);
  position: absolute;
  left: 0;
  top: 0.85rem;
  font-family: var(--serif);
  font-size: 1.35rem;
  color: var(--gold);
}

.contents-prose ol > li > a:first-child {
  font-family: var(--serif);
  font-size: 1.15rem;
}

/* ---------- Article: reading column with margin sketches ---------- */

.reading-page { padding-top: clamp(1.8rem, 4vw, 3rem); }

.reading-head { max-width: 46rem; padding-bottom: 1.4rem; border-bottom: 1px solid var(--rule); }

.reading-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.5rem; margin-top: 1.8rem; }

.margin-sketches { display: flex; gap: 1rem; overflow: hidden; }
.margin-sketch { width: 7rem; }

@media (min-width: 900px) {
  .reading-grid { grid-template-columns: 11rem minmax(0, 40rem); column-gap: clamp(2.5rem, 5vw, 4.5rem); }
  .reading-head { margin-left: calc(11rem + clamp(2.5rem, 5vw, 4.5rem)); }
  .margin-sketches {
    flex-direction: column;
    gap: 3.5rem;
    padding-top: 2.6rem;
    border-right: 1px solid var(--rule-faint);
    padding-right: 1.25rem;
  }
  .margin-sketch { width: 100%; }
}

/* ---------- About: editorial letter ---------- */

.letter-page {
  max-width: 40rem;
  margin: 0 auto;
  padding-top: clamp(2rem, 5vw, 3.5rem);
}

.profile-vignette { margin: 0 0 1.4rem; width: 6.5rem; }

.letter-title { padding-bottom: 0.4rem; }

.letter-prose > p:first-child {
  margin: 1.8rem 0 2rem;
  padding: 1.2rem 0;
  border-top: 1px solid var(--gold);
  border-bottom: 1px solid var(--rule-faint);
  font-family: var(--serif);
  font-size: clamp(1.3rem, 2.6vw, 1.6rem);
  line-height: 1.45;
}

/* ---------- Contact: split with index card ---------- */

.contact-page {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2.5rem;
  padding-top: clamp(1.8rem, 4vw, 3rem);
}

@media (min-width: 900px) {
  .contact-page { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); column-gap: clamp(2.5rem, 5vw, 4.5rem); align-items: start; }
}

.card-stage { position: relative; padding: 5.25rem 0 1.5rem; }

.contact-text .prose { margin-top: 1.4rem; }

.vial-outline {
  position: absolute;
  right: 2rem;
  top: 0;
  width: 3.4rem;
  pointer-events: none;
}

.vial-outline .ink-faint { opacity: 1; stroke-width: 3; }

.index-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.1rem 1.25rem;
  padding: clamp(1.25rem, 3vw, 2rem);
  border: 1px solid var(--rule);
  border-top: 3px double var(--rule);
  background-image: none;
}

@media (min-width: 560px) {
  .index-card { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.field { display: flex; flex-direction: column; gap: 0.35rem; }
.field-wide { grid-column: 1 / -1; }

.field label { font-size: 0.92rem; font-weight: 600; }

.field input,
.field textarea {
  width: 100%;
  font: inherit;
  color: var(--fg-body);
  background: var(--card);
  border: 0;
  border-bottom: 1px solid var(--rule);
  padding: 0.5rem 0.1rem;
  border-radius: 0;
}

.field textarea { border: 1px solid var(--rule); padding: 0.6rem; resize: vertical; }

.field input:focus-visible,
.field textarea:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.card-button {
  font: inherit;
  font-weight: 600;
  color: var(--on-gold);
  background: var(--gold);
  border: 0;
  padding: 0.75rem 1.6rem;
  cursor: pointer;
}

.card-button:hover { background: var(--gold-deep); color: var(--on-gold); }

/* ---------- Thank-you: centred note ---------- */

.note-page {
  max-width: 34rem;
  margin: 0 auto;
  padding-top: clamp(2.5rem, 7vw, 5rem);
  text-align: center;
}

.note-sketch { margin: 0 auto 1.5rem; width: 12rem; }
.note-prose { text-align: left; margin-top: 1.8rem; }

/* ---------- Footer ---------- */

.site-footer { border-top: 1px solid var(--rule); }

.footer-inner {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 2rem var(--gutter) 2.4rem;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.6rem 2rem;
}

.footer-brand { font-family: var(--serif); font-size: 1.2rem; text-decoration: none; }
.footer-brand:hover { text-decoration: underline; }
.footer-line { margin: 0; font-size: 0.95rem; }

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