/* Fonts and all colors live here. For self-hosting, replace this import with
   @font-face declarations pointing at files in static/fonts/. */
@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500&family=Newsreader:ital,opsz,wght@0,6..72,400;0,6..72,500;0,6..72,600;1,6..72,400&display=swap");

:root {
  color-scheme: light;
  --color-bg-primary: #FBFAF8;
  --color-bg-secondary: #F3F1EC;
  --color-white: #FFFFFF;
  --color-text-primary: #242522;
  --color-text-secondary: #686A66;
  --color-text-muted: #92948E;
  --color-border: #D6D5D0;
  --color-lightbox-backdrop: rgb(36 37 34 / 88%);
  --color-accent-yellow: #FBE07B;
  --color-accent-yellow-light: #FFF5CA;
  --color-accent-yellow-dark: #A67C28;
  --color-accent-green: #8FEBB6;
  --color-accent-green-light: #E1F8E9;
  --color-accent-green-dark: #408361;
  --color-accent-pink: #F5B1BC;
  --color-accent-pink-light: #FCE9ED;
  --color-accent-red-dark: #B25B65;
  --color-accent-blue: #A9D6F5;
  --color-accent-blue-light: #E6F3FC;
  --color-accent-blue-dark: #417DA6;

  /* Functional aliases can be changed independently of the palette. */
  --color-selection: var(--color-accent-yellow-light);
  --color-focus: var(--color-text-primary);
  --color-code-comment: var(--color-text-secondary);
  --color-code-keyword: #675379;
  --color-code-string: #38634B;
  --color-code-number: #805D38;
  --color-code-function: #3B637C;
  --color-code-error: #9D3F4A;

  --font-primary: "Newsreader", Georgia, "Times New Roman", serif;
  --font-mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  --text-name: clamp(2.75rem, 5.5vw, 3.75rem);
  --text-page-title: clamp(2.4rem, 5vw, 3.25rem);
  --text-heading: clamp(1.85rem, 3.8vw, 2.25rem);
  --text-entry: 1.5rem;
  --text-body: 1.1875rem;
  --text-small: 1rem;
  --text-meta: 0.75rem;
  --text-caption: 0.6875rem;
  --width-content: 55rem;
  --width-reading: 68ch;
  --space-section: clamp(2.75rem, 6vw, 4rem);
  --publication-figure-width: 200px;
  --publication-figure-height: 140px;
  --publication-detail-figure-max-width: 100%;
  --publication-detail-figure-max-height: 350px;
}

/* Keep the desktop scale intact; narrower layouts use their own proportions. */
@media (max-width: 900px) {
  :root {
    --text-name: clamp(2.5rem, 5.5vw, 3.09375rem);
    --text-heading: clamp(1.875rem, 3.8vw, 2.125rem);
    --text-entry: clamp(1.4375rem, 2.67vw, 1.5rem);
    --text-body: 1.125rem;
    --space-section: clamp(2.5rem, 5.5vw, 3rem);
  }
}

@media (max-width: 600px) {
  :root {
    --text-name: clamp(2rem, 6vw + 0.5rem, 2.25rem);
    --text-page-title: clamp(2rem, 5vw + 0.75rem, 2.375rem);
    --text-heading: clamp(1.75rem, 4vw + 0.75rem, 2rem);
    --text-entry: clamp(1.3125rem, 2.5vw + 0.75rem, 1.4375rem);
    --text-body: clamp(1.0625rem, 1vw + 0.8125rem, 1.125rem);
    --text-small: 0.9375rem;
    --text-caption: 0.75rem;
    --space-section: clamp(2.25rem, 6vw, 2.5rem);
  }
}

/* Apply to main or a section; nested content inherits the nearest accent. */
.selection--yellow { --color-selection: var(--color-accent-yellow-light); }
.selection--green { --color-selection: var(--color-accent-green-light); }
.selection--pink { --color-selection: var(--color-accent-pink-light); }
.selection--blue { --color-selection: var(--color-accent-blue-light); }
