/* Design system shared by every page entity: frontpage, notes, presentations.
   Tokens and page chrome live here and only here — entity stylesheets
   (src/styles.css, note.css, deck.css) add layout on top, never redefine tokens. */

:root {
  --paper: #F7F3EC;
  --ink: #171717;
  --muted: #5F5B54;
  --soft: #8B857A;
  --line: #D8D0C2;
  --accent: #23395B;
  --warm: #8F5B3E;
  --surface: #EDE6DA;
  --surface-raised: #FFF9F0;
  --overlay: rgba(247, 243, 236, 0.94);
  --shadow: rgba(45, 35, 25, 0.14);
  --track: #E8E1D6;
  --display: "EB Garamond", Georgia, serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, system-ui, "Helvetica Neue", Arial, sans-serif;
  --max: 1120px;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --paper: #17191B;
  --ink: #F3EEE5;
  --muted: #C9C1B5;
  --soft: #A79D91;
  --line: #3E3B36;
  --accent: #A9C7EE;
  --warm: #D7A17C;
  --surface: #23201D;
  --surface-raised: #292521;
  --overlay: rgba(23, 25, 27, 0.94);
  --shadow: rgba(0, 0, 0, 0.34);
  --track: #37332E;
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --paper: #17191B;
    --ink: #F3EEE5;
    --muted: #C9C1B5;
    --soft: #A79D91;
    --line: #3E3B36;
    --accent: #A9C7EE;
    --warm: #D7A17C;
    --surface: #23201D;
    --surface-raised: #292521;
    --overlay: rgba(23, 25, 27, 0.94);
    --shadow: rgba(0, 0, 0, 0.34);
    --track: #37332E;
    color-scheme: dark;
  }
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

svg {
  display: block;
}

a {
  color: inherit;
}

a:hover {
  color: var(--accent);
}

p, h1, h2, h3 {
  margin: 0;
}

h1, h2 {
  font-family: var(--display);
  font-weight: 500;
  letter-spacing: 0;
}

:focus-visible {
  outline: 3px solid var(--warm);
  outline-offset: 4px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 12px;
  left: 12px;
  padding: 9px 12px;
  transform: translateY(-180%);
  border: 1px solid var(--ink);
  background: var(--paper);
  font-weight: 650;
  text-decoration: none;
}

.skip-link:focus {
  transform: none;
}

.page {
  width: min(100%, var(--max));
  margin: 0 auto;
  padding: 28px 40px 48px;
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--ink);
}

.site-header a {
  text-decoration: none;
}

.site-name {
  line-height: 1;
  font-weight: 650;
  text-decoration: none;
}

.nav {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 24px;
  color: var(--muted);
  font-size: 14px;
}

.site-header-actions {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}

.theme-toggle {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  padding: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}

.theme-toggle svg,
.menu-toggle svg {
  width: 15px;
  height: 15px;
}

.theme-toggle:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.theme-glyph {
  transform-box: fill-box;
  transform-origin: center;
  transition: opacity 180ms ease, transform 220ms ease;
}

.theme-glyph--sun {
  opacity: 0;
  transform: rotate(-35deg) scale(0.55);
}

.theme-glyph--moon {
  opacity: 1;
  transform: rotate(0) scale(1);
}

:root[data-theme="dark"] .theme-glyph--sun {
  opacity: 1;
  transform: rotate(0) scale(1);
}

:root[data-theme="dark"] .theme-glyph--moon {
  opacity: 0;
  transform: rotate(35deg) scale(0.55);
}

.menu-toggle {
  display: none;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  padding: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}

.menu-toggle:hover {
  color: var(--accent);
  border-color: var(--accent);
}


.eyebrow {
  color: var(--muted);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.25;
  text-transform: uppercase;
}

.section {
  padding: 56px 0;
  border-top: 1px solid var(--ink);
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding-top: 22px;
  border-top: 1px solid var(--ink);
  color: var(--muted);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.25;
}

@media (max-width: 860px) {
  .page {
    padding: 22px 22px 36px;
  }

  .site-header {
    flex-wrap: wrap;
    gap: 14px;
    padding-bottom: 14px;
  }

  .site-header-actions {
    margin-left: auto;
  }

  html[data-js] .menu-toggle {
    display: inline-grid;
  }

  .nav {
    flex-basis: 100%;
    order: 3;
    justify-content: stretch;
    gap: 0;
    border-top: 1px solid var(--line);
    font-size: 13px;
  }

  .nav a {
    width: 100%;
    padding: 11px 0;
    border-bottom: 1px solid var(--line);
  }

  html[data-js] .site-header:not([data-menu-open="true"]) .nav {
    display: none;
  }

  .section {
    padding: 42px 0;
  }

  .footer {
    display: grid;
    justify-items: start;
  }
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .theme-glyph--sun {
    opacity: 1;
    transform: rotate(0) scale(1);
  }

  :root:not([data-theme]) .theme-glyph--moon {
    opacity: 0;
    transform: rotate(35deg) scale(0.55);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .theme-glyph {
    transition: none;
  }
}

@media print {
  :root,
  :root[data-theme] {
    --paper: #FFFFFF;
    --ink: #171717;
    --muted: #5F5B54;
    --soft: #8B857A;
    --line: #D8D0C2;
    --accent: #23395B;
    --warm: #8F5B3E;
    --surface: #EDE6DA;
    --surface-raised: #FFF9F0;
    --overlay: rgba(247, 243, 236, 0.94);
    --shadow: rgba(45, 35, 25, 0.14);
    --track: #E8E1D6;
    color-scheme: light;
  }
}
