@font-face { font-family: 'Ysabeau Infant'; font-style: italic; font-weight: 500; font-display: swap; src: url("/assets/fonts/ysabeau-infant-latin-500-italic.woff2") format("woff2"); }
@font-face { font-family: 'Ysabeau Infant'; font-style: normal; font-weight: 500; font-display: swap; src: url("/assets/fonts/ysabeau-infant-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: 'Ysabeau Infant'; font-style: normal; font-weight: 700; font-display: swap; src: url("/assets/fonts/ysabeau-infant-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: 'Mukta'; font-style: normal; font-weight: 400; font-display: swap; src: url("/assets/fonts/mukta-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: 'Mukta'; font-style: normal; font-weight: 600; font-display: swap; src: url("/assets/fonts/mukta-latin-600-normal.woff2") format("woff2"); }
:root {
  --bg-light-base: #f2f6f6;
  --fg-light-base-body: #17282c;
  --fg-light-base-heading: #17282c;
  --fg-light-base-muted: #4a5f63;
  --fg-light-base-link: #1b6080;
  --fg-light-base-inverse: #123241;
  --bg-light-card: #ffffff;
  --fg-light-card-body: #17282c;
  --fg-light-card-heading: #17282c;
  --fg-light-card-muted: #4a5f63;
  --fg-light-card-link: #1b6080;
  --fg-light-card-inverse: #123241;
  --bg-light-elevated: #e6efee;
  --fg-light-elevated-body: #17282c;
  --fg-light-elevated-heading: #17282c;
  --fg-light-elevated-muted: #4a5f63;
  --fg-light-elevated-link: #1b6080;
  --fg-light-elevated-inverse: #123241;
  --brand-light-accent: #1b6080;
  --brand-light-accent-hover: #134a63;
  --brand-light-on-accent: #ffffff;
  --focus-light-ring: #1b6080;
  --border-light-default: #5f7b80;
  --border-light-subtle: #c3d4d4;
}
.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; }
.text-role-link:hover { color: var(--brand-light-accent-hover); }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 2px solid var(--focus-light-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; }
: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-light-ring); }

/* Dermatology field guide: cool plate paper, humanist headings, one calm accent for figure labels and step numbers. */
:root {
  --heading: 'Ysabeau Infant', Optima, Candara, sans-serif;
  --text: 'Mukta', 'Segoe UI', system-ui, sans-serif;
  --accent: var(--brand-light-accent);
  --accent-hover: var(--brand-light-accent-hover);
  --rule: var(--border-light-default);
  --hair: var(--border-light-subtle);
  --rail: 17rem;
  --measure: 38rem;
}

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

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

body {
  margin: 0;
  font-family: var(--text);
  font-size: 1.0625rem;
  line-height: 1.65;
}

h1, h2, h3 {
  font-family: var(--heading);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.005em;
  text-wrap: balance;
}

h1 { font-size: clamp(2.1rem, 4.6vw, 3.4rem); margin: 0.2rem 0 0; }
h2 { font-size: clamp(1.35rem, 2.2vw, 1.7rem); margin: 2.4rem 0 0.6rem; }
h3 { font-size: 1.2rem; margin: 1.8rem 0 0.4rem; font-weight: 500; }

p { margin: 0 0 1rem; }
ul, ol { padding-left: 1.2rem; margin: 0 0 1rem; }
li { margin-bottom: 0.45rem; }

.text-role-link { text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
.text-role-link:hover { text-decoration-thickness: 2px; }

/* ---------- Frame: side rail plus leaf ---------- */

.guide { min-height: 100vh; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--rule);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  font-family: var(--heading);
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1.2;
}
.brand .site-logo { width: 2.4rem; height: 2.4rem; flex: none; }
.brand-name { max-width: 12rem; }

.rail-motto { display: none; }

/* Collapsed menu (narrow screens) */
.site-menu { position: relative; }
.site-menu > summary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  padding: 0.35rem 0.85rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  font-family: var(--heading);
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}
.menu-icon {
  width: 1rem;
  height: 0.7rem;
  border-top: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  position: relative;
}
.menu-icon::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  border-top: 2px solid currentColor;
  transform: translateY(-50%);
}
.site-menu[open] > summary { background: var(--bg-light-card); }
.site-menu > ul {
  position: absolute;
  right: 0;
  top: calc(100% + 0.5rem);
  width: min(20rem, calc(100vw - 2rem));
  max-height: 75vh;
  overflow: auto;
  margin: 0;
  padding: 0.9rem 1rem;
  list-style: none;
  background: var(--bg-light-card);
  border: 1px solid var(--rule);
  border-radius: 0.5rem;
}
.site-menu ul ul { list-style: none; padding-left: 0.9rem; margin: 0.3rem 0 0.4rem; border-left: 1px solid var(--hair); }
.site-menu li { margin: 0; }
.site-menu a { display: block; padding: 0.4rem 0; }

.site-nav { display: none; }

.leaf {
  min-width: 0;
  padding: 0 1rem;
}

.breadcrumbs { max-width: 64rem; margin: 1.2rem auto 0; font-size: 0.92rem; }
.breadcrumbs ol { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.25rem 0.5rem; }
.breadcrumbs li { margin: 0; }
.breadcrumbs li + li::before { content: "/"; margin-right: 0.5rem; color: var(--rule); }

@media (min-width: 60rem) {
  .guide {
    display: grid;
    grid-template-columns: var(--rail) minmax(0, 1fr);
  }
  .site-header {
    height: 100vh;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 1.25rem;
    padding: 2rem 1.5rem;
    border-bottom: 0;
    border-right: 1px solid var(--rule);
    overflow-y: auto;
  }
  .brand { flex-direction: column; align-items: flex-start; font-size: 1.2rem; }
  .brand .site-logo { width: 3.25rem; height: 3.25rem; }
  .rail-motto {
    display: block;
    margin: 0;
    padding-bottom: 1.1rem;
    border-bottom: 1px solid var(--hair);
    font-family: var(--heading);
    font-style: italic;
    font-weight: 500;
  }
  .site-menu { display: none; }
  .site-nav { display: block; }
  .site-nav > ul { list-style: none; margin: 0; padding: 0; }
  .site-nav li { margin: 0; }
  .site-nav > ul > li { border-bottom: 1px solid var(--hair); }
  .site-nav > ul > li > a,
  .site-nav-group > summary {
    display: block;
    padding: 0.7rem 0;
    font-family: var(--heading);
    font-weight: 700;
    font-size: 1rem;
    line-height: 1.3;
  }
  .site-nav > ul > li > a { text-decoration: none; }
  .site-nav > ul > li > a:hover { text-decoration: underline; }
  .site-nav-group > summary { cursor: pointer; list-style: none; position: relative; padding-right: 1.25rem; }
  .site-nav-group > summary::-webkit-details-marker { display: none; }
  .site-nav-group > summary::after {
    content: "+";
    position: absolute;
    right: 0;
    top: 0.65rem;
    color: var(--accent);
    font-weight: 500;
  }
  .site-nav-group[open] > summary::after { content: "\2212"; }
  .site-nav-group ul { list-style: none; margin: 0 0 0.8rem; padding: 0 0 0 0.8rem; border-left: 2px solid var(--accent); }
  .site-nav-group a { display: block; padding: 0.3rem 0; font-size: 0.93rem; line-height: 1.35; }
  .leaf { padding: 0 clamp(1.5rem, 4vw, 4rem); }
}

/* ---------- Shared page sheet ---------- */

.sheet { max-width: 64rem; margin: 0 auto; padding: 2rem 0 4rem; }

.plate-label {
  display: block;
  font-family: var(--heading);
  font-style: italic;
  font-weight: 500;
  font-size: 1rem;
  color: var(--accent);
}

.photo-hero, .photo-inline { margin: 0 0 1.5rem; }
.photo-hero img, .photo-inline img {
  display: block;
  width: 100%;
  border: 1px solid var(--rule);
  outline: 1px solid var(--hair);
  outline-offset: 5px;
  background: var(--bg-light-card);
}

.accent-block {
  margin: 1.5rem 0;
  padding: 0.25rem 0 0.25rem 1.1rem;
  border-left: 3px solid var(--accent);
}

.table-scroll { overflow-x: auto; margin: 0 0 1.25rem; }
.table-scroll table { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
.table-scroll th, .table-scroll td { text-align: left; padding: 0.5rem 0.7rem; border-bottom: 1px solid var(--hair); vertical-align: top; }
.table-scroll th { border-bottom-color: var(--rule); font-family: var(--heading); }

/* Figure labels on body sections */
.home-entry, .entry-body, .chapter-body, .preface-body { counter-reset: fig; }
.home-entry > h2::before,
.entry-body > h2::before,
.chapter-body > h2::before {
  counter-increment: fig;
  content: "Fig. " counter(fig);
  display: block;
  margin-bottom: 0.2rem;
  font-style: italic;
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--accent);
}

/* ---------- Home: grid of specimen plates ---------- */

.sheet-home { display: grid; gap: 1.5rem; }

.plate {
  border: 1px solid var(--rule);
  outline: 1px solid var(--hair);
  outline-offset: -8px;
  padding: clamp(1.5rem, 4vw, 2.75rem);
}

.plate-cover h1 { max-width: 16ch; }
.display { margin-top: 1.5rem; padding-top: 1.1rem; border-top: 1px solid var(--hair); }
.display-line { margin: 0 0 0.5rem; max-width: 34rem; font-size: 1.05rem; }
.display-line:last-child { margin-bottom: 0; }

.home-entry > :not(.photo-hero) { max-width: var(--measure); }
.home-entry > .photo-hero { margin: 0 0 1rem; }

@media (min-width: 48rem) {
  .sheet-home {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: 2rem;
    row-gap: 0;
    align-items: start;
  }
  .plate-cover { grid-column: 1 / span 7; grid-row: 1; align-self: stretch; display: flex; flex-direction: column; justify-content: center; }
  .home-entry { display: contents; }
  .home-entry > .photo-hero {
    grid-column: 8 / span 5;
    grid-row: 1 / span 3;
    position: sticky;
    top: 5rem;
    margin: 0;
  }
  .home-entry > :not(.photo-hero) { grid-column: 1 / span 7; }
  .home-entry > .photo-hero + * { margin-top: 2rem; }
}
@media (min-width: 60rem) {
  .home-entry > .photo-hero { top: 2rem; }
}

/* ---------- Topic hub: stepped chapters ---------- */

.chapter-head { max-width: 46rem; margin-bottom: 1.75rem; }
.chapter-body { max-width: var(--measure); }
.chapter-body > .photo-hero { max-width: 46rem; }

.chapter-steps {
  margin-top: 3rem;
  padding: clamp(1.25rem, 3vw, 2.25rem);
  border: 1px solid var(--rule);
}
.chapter-steps h2 { margin-top: 0; }
.chapter-steps ul { list-style: none; padding: 0; margin: 1.25rem 0 0; counter-reset: step; }
.chapter-steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 2.6rem minmax(0, 1fr);
  align-items: baseline;
  gap: 0.75rem;
  margin: 0;
  padding: 0.85rem 0;
  border-top: 1px solid var(--hair);
}
.chapter-steps li::before {
  content: counter(step);
  font-family: var(--heading);
  font-weight: 700;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--accent);
}
.chapter-steps li a { font-family: var(--heading); font-weight: 700; font-size: 1.12rem; line-height: 1.3; }
@media (min-width: 48rem) {
  .chapter-steps li:nth-child(2) { margin-left: 2.5rem; }
  .chapter-steps li:nth-child(3) { margin-left: 5rem; }
  .chapter-steps li:nth-child(4) { margin-left: 7.5rem; }
  .chapter-steps li:nth-child(n+5) { margin-left: 10rem; }
}

/* ---------- Article: entry plus pinned side panel ---------- */

.entry-head { max-width: 46rem; margin-bottom: 1.75rem; }
.entry-body > * { max-width: var(--measure); }
.entry-body > .photo-hero { max-width: 30rem; }

@media (min-width: 64rem) {
  .entry-body:has(> .photo-hero) {
    display: grid;
    grid-template-columns: minmax(0, var(--measure)) minmax(14rem, 1fr);
    column-gap: clamp(2rem, 4vw, 3.5rem);
    align-items: start;
  }
  .entry-body:has(> .photo-hero) > * { grid-column: 1; }
  .entry-body:has(> .photo-hero) > .photo-hero {
    grid-column: 2;
    grid-row: 1 / span 6;
    position: sticky;
    top: 2rem;
    margin: 0;
    padding: 0.9rem;
    background: var(--bg-light-card);
    border: 1px solid var(--rule);
  }
  .entry-body:has(> .photo-hero) > .photo-hero img { outline: 0; }
  .entry-body:has(> .photo-hero) > :nth-child(2) { margin-top: 0; }
}

/* ---------- About: centred preface ---------- */

.sheet-preface { max-width: 40rem; }
.preface-head { text-align: center; margin-bottom: 2rem; }
.preface-head h1 { margin-left: auto; margin-right: auto; }
.preface-body > .photo-hero { margin-bottom: 2rem; }
.preface-body > h2 { text-align: center; }
.preface-body > h2::after {
  content: "";
  display: block;
  width: 2.5rem;
  margin: 0.6rem auto 0;
  border-top: 2px solid var(--accent);
}

/* ---------- Contact: two columns ---------- */

.log-head { max-width: 46rem; margin-bottom: 1.75rem; }
.log-columns { display: grid; gap: 2rem; }
.log-body > * { max-width: var(--measure); }
.log-body > :first-child { margin-top: 0; }
.log-form {
  display: grid;
  gap: 1.1rem;
  align-self: start;
  padding: clamp(1.25rem, 3vw, 2rem);
  border: 1px solid var(--rule);
}
.field { display: grid; gap: 0.35rem; }
.field label { font-family: var(--heading); font-weight: 700; font-size: 1rem; }
.field input, .field textarea {
  width: 100%;
  min-height: 2.75rem;
  padding: 0.6rem 0.75rem;
  font: inherit;
  color: var(--fg-light-card-body);
  background: var(--bg-light-card);
  border: 1px solid var(--rule);
  border-radius: 0.3rem;
}
.field textarea { resize: vertical; }
.field input:focus-visible, .field textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.log-submit {
  justify-self: start;
  min-height: 2.75rem;
  padding: 0.6rem 1.4rem;
  font-family: var(--heading);
  font-weight: 700;
  font-size: 1.02rem;
  color: var(--brand-light-on-accent);
  background: var(--accent);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
}
.log-submit:hover { background: var(--accent-hover); }
.log-submit:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
@media (min-width: 52rem) {
  .log-columns { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: clamp(2rem, 4vw, 3.5rem); }
  .log-form { position: sticky; top: 2rem; }
}

/* ---------- Thank you: split panel ---------- */

.logged-split { display: grid; border: 1px solid var(--rule); }
.logged-note, .logged-next { padding: clamp(1.5rem, 4vw, 2.75rem); }
.logged-head { margin-bottom: 1.25rem; }
.logged-next { border-top: 1px solid var(--rule); }
.logged-next h2 { margin-top: 0; font-style: italic; font-weight: 500; color: var(--accent); }
.next-list { list-style: none; padding: 0; margin: 0; }
.next-list li { margin: 0; padding: 0.8rem 0; border-top: 1px solid var(--hair); }
.next-list a { font-family: var(--heading); font-weight: 700; font-size: 1.12rem; line-height: 1.3; }
@media (min-width: 52rem) {
  .logged-split { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
  .logged-next { border-top: 0; border-left: 1px solid var(--rule); }
}

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

.site-footer {
  max-width: 64rem;
  margin: 0 auto;
  padding: 1.75rem 0 2.5rem;
  border-top: 1px solid var(--rule);
  font-size: 0.95rem;
}
.footer-line { max-width: 34rem; margin-bottom: 0.4rem; }
.footer-ref { margin: 0; }

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