/* =====================================================================
   site.css — hand-authored styles for merovex.github.io
   Replaces Tailwind (build-time main.css + runtime CDN) with plain CSS
   built on OpenProps tokens. Load order (see _includes/head.html):
     open-props.min.css → open-props.normalize.min.css → fonts.css
       → cal-heatmap.css → site.css   (site.css wins the cascade)
   No build step: this file is served as-is.

   Sections:
     1. Theme tokens (override OpenProps semantic vars per data-color-scheme)
     2. Base / Preflight-parity resets
     3. Semantic components
     4. Prose (.prosed) — ports @tailwindcss/typography metrics
     5. Forms (.form-input/.form-select/.form-control-lg)
     6. Controller-toggled classes
     7. Utility layer (static → responsive → dark → arbitrary → state)
     8. Preserved plain-CSS blocks (blobs, calendar, clock, tooltip)
   ===================================================================== */

/* ---------------------------------------------------------------------
   1. THEME TOKENS
   OpenProps normalize sets --surface-1/--text-1/--link on :where(html)
   (zero specificity) and flips them via prefers-color-scheme. We override
   them with the site's brand palette and drive light/dark off the
   [data-color-scheme] attribute instead. Plain :root (0,1,0) beats
   OpenProps' :where() (0,0,0); :root[data-color-scheme="dark"] (0,2,0)
   wins for the dark theme regardless of OS preference.
   --------------------------------------------------------------------- */
:root {
  /* brand primary (Tailwind indigo — controllers also use indigo-500/700) */
  --primary-300: #a5b4fc;
  --primary-400: #818cf8;
  --primary-500: #6366f1;
  --primary-600: #4f46e5;
  --primary-700: #4338ca;

  /* custom gray scale (exact hexes from the old tailwind.config.js) */
  --gray-50:  #E8EAEE;
  --gray-100: #D9DDE3;
  --gray-200: #C1C8D1;
  --gray-300: #A7B1BE;
  --gray-400: #909CAD;
  --gray-500: #78879B;
  --gray-600: #627084;
  --gray-700: #505C6D;
  --gray-800: #3D4652;
  --gray-900: #2B323B;
  --gray-950: #22272E;
  --grey-800: #2A313C;

  /* accent palettes used across templates */
  --heatmap-300: #6ee7b7;
  --heatmap-400: #34d399;
  --heatmap-500: #10b981;
  --amber-100: #fef3c7;
  --amber-200: #fde68a;
  --amber-300: #fcd34d;
  --amber-600: #d97706;
  --blue-300: #93c5fd;
  --blue-400: #60a5fa;
  --blue-700: #1d4ed8;
  --blue-800: #1e40af;
  --violet-300: #c4b5fd;
  --violet-400: #a78bfa;
  --violet-600: #7c3aed;
  --violet-900: #4c1d95;
  --rose-500: #f43f5e;
  --stone-500: #78716c;
  --stone-900: #1c1917;

  /* fonts (local @font-face in fonts.css) */
  --font-sans: 'Atkinson Hyperlegible', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-display: 'Fjalla One', var(--font-sans);

  /* OpenProps semantic vars — overridden for brand + light theme */
  --surface-1: #fffcf9;          /* page background */
  --surface-2: #fee2e2;          /* was bg-red-100 (forms, surface-2) */
  --surface-3: var(--gray-200);  /* was bg-base-300 / disabled inputs */
  --text-1: #18181b;             /* body text (light) */
  --text-2: var(--gray-700);     /* subtle text (light) */
  --brand: var(--primary-500);
  --link: var(--blue-700);
  --border-subtle: var(--gray-100);
}

:root[data-color-scheme="dark"] {
  --surface-1: var(--gray-950);
  --surface-2: var(--gray-900);
  --surface-3: var(--gray-800);
  --text-1: var(--gray-50);
  --text-2: var(--gray-400);
  --link: var(--blue-400);
  --border-subtle: var(--gray-700);
}

/* ---------------------------------------------------------------------
   2. BASE / PREFLIGHT-PARITY
   Restore the Tailwind-Preflight behaviour the templates assume, on top
   of OpenProps normalize (which gives box-sizing + margin:0 already).
   --------------------------------------------------------------------- */
html { line-height: 1.5; }
html, body { font-family: var(--font-sans); }
body {
  background-color: var(--surface-1);
  color: var(--text-1);
  min-block-size: 100%;
}
/* Restore inherit-coloured links (Preflight); .permalink etc. opt back in */
a { color: inherit; text-decoration: inherit; }
a:where([href]):where(:not(:hover)) { text-decoration: inherit; }
/* Preflight-style form/button reset: OpenProps normalize gives buttons their
   own chrome (background/border/padding); the site assumes bare buttons that
   inherit colour, so chrome comes only from .btn / utilities. */
button, input, optgroup, select, textarea {
  font-family: inherit;
  font-size: 100%;
  font-weight: inherit;
  line-height: inherit;
  color: inherit;
  margin: 0;
  padding: 0;
}
button, [type='button'], [type='reset'], [type='submit'] {
  -webkit-appearance: button;
  background-color: transparent;
  background-image: none;
  border: 0;
}
button { cursor: pointer; }
:disabled { cursor: default; }
/* Headings size from classes/prose, not OpenProps' token sizing */
h1, h2, h3, h4, h5, h6 {
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
  max-inline-size: none;
  text-wrap: balance;
}
/* OpenProps normalize caps text elements with a readability max-inline-size
   (e.g. p → --size-content-3) and gives blockquote a grid/padding. Tailwind
   never constrained these — let them fill their container as before. */
p, li, dd, dt, figcaption, blockquote, td, th, small {
  max-inline-size: none;
}
blockquote { display: block; padding: 0; gap: normal; }
td, th { background: transparent; }
h1 { font-family: var(--font-display); padding-top: 0.5rem; }
img, svg, video, canvas { max-width: 100%; }
:where(svg) { display: inline; }   /* templates rely on inline svg + .inline-block */

/* ---------------------------------------------------------------------
   3. SEMANTIC COMPONENTS  (ports of the old main.css @apply rules)
   --------------------------------------------------------------------- */
.surface-1 { background-color: var(--surface-1); color: var(--text-1); }
.surface-2 { background-color: var(--surface-2); color: var(--text-1); }
.bg-base-300 { background-color: var(--surface-3); color: var(--text-1); }

.bordered { border: 1px solid var(--border-subtle); }
.text-subtle { color: var(--text-2); }

/* heading scale */
.h1 { font-weight: 700; font-size: 2.25rem; line-height: 2.5rem; }
.h2 { font-weight: 600; font-size: 1.5rem; line-height: 2rem; }
.h3 { font-weight: 600; font-size: 1.25rem; line-height: 1.75rem; }
@media (min-width: 768px) {
  .h1 { font-size: 3rem; line-height: 1; }
  .h2 { font-size: 1.875rem; line-height: 2.25rem; }
  .h3 { font-size: 1.5rem; line-height: 2rem; }
}

.dev { background-color: color-mix(in srgb, var(--rose-500) 20%, transparent); }

/* post cards (home + tools list) */
.post-card {
  position: relative;
  max-width: 65ch;
  border-radius: 0.25rem;
  box-shadow: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -4px rgba(0,0,0,.1);
  margin-inline: auto;
  padding: 1.5rem 2rem;
  margin-block: 2rem;
  border: 1px solid var(--border-subtle);
  aspect-ratio: 16 / 9;
}
.post-card header, .post-card footer { text-align: center; }
.post-card header h2 { font-weight: 600; font-size: 1.5rem; line-height: 2rem; }
.post-card header span, .post-card footer span {
  color: var(--gray-500);
  font-size: 0.875rem;
  line-height: 1.25rem;
}
:root[data-color-scheme="dark"] .post-card header span,
:root[data-color-scheme="dark"] .post-card footer span { color: var(--gray-400); }

.clamped {
  display: -webkit-box;
  -webkit-line-clamp: 5;
  line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* article / post */
.post { max-width: 65ch; margin-inline: auto; margin-block: 1rem; }
@media (min-width: 768px) { .post { margin-block: 2rem; } }
.post header { text-align: center; }
/* post bodies opt into prose via class="content prosed" in _layouts/post.html */
.content img { border-radius: 0.5rem; box-shadow: 0 1px 3px 0 rgba(0,0,0,.1), 0 1px 2px -1px rgba(0,0,0,.1); }
.post h1 { font-weight: 700; font-size: 2.25rem; line-height: 1.375; }
@media (min-width: 768px) { .post h1 { font-size: 3rem; } }
.post h1 span { color: var(--gray-500); font-size: 0.875rem; }
:root[data-color-scheme="dark"] .post h1 span { color: var(--gray-400); }

/* permalink */
.permalink {
  color: var(--blue-700);
  text-decoration: underline;
}
.permalink:hover { background-color: var(--amber-200); color: var(--blue-800); }
.permalink:focus { background-color: var(--amber-200); color: var(--blue-800); }
.permalink:active { background-color: var(--amber-200); color: var(--blue-800); }
:root[data-color-scheme="dark"] .permalink { color: var(--blue-400); }
:root[data-color-scheme="dark"] .permalink:hover,
:root[data-color-scheme="dark"] .permalink:focus,
:root[data-color-scheme="dark"] .permalink:active { color: var(--blue-300); background-color: var(--blue-700); }

/* subscription form */
.subscription_form {
  font-size: 0.9em;
  max-width: 36rem;
  width: 100%;
  margin-inline: auto;
  position: relative;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
}
.subscription_form::before {
  content: '';
  display: block;
  position: absolute;
  top: 0;
  height: 0.25rem;
  width: 25%;
  border-top: 1px solid var(--gray-500);
  left: 50%;
  transform: translateX(-50%);
}
.subscription_form input {
  border-radius: 9999px 0 0 9999px;
  padding: 0.5rem 1rem;
  flex: 1 1 0%;
  border: 1px solid var(--gray-300);
}
.subscription_form button {
  background-color: var(--gray-200);
  border-radius: 0 9999px 9999px 0;
  padding: 0.5rem 1rem;
  border: 1px solid var(--gray-300);
  border-left: 0;
}
:root[data-color-scheme="dark"] .subscription_form input { border-color: var(--gray-500); background-color: var(--gray-800); }
:root[data-color-scheme="dark"] .subscription_form button { background-color: var(--gray-600); border-color: var(--gray-500); }

/* buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  border: 1px solid transparent;
  border-radius: 0.375rem;
  box-shadow: 0 1px 2px 0 rgba(0,0,0,.05);
  font-size: 0.875rem;
  font-weight: 500;
}
.btn:focus { outline: none; box-shadow: 0 0 0 2px var(--surface-1), 0 0 0 4px var(--primary-500); }
.btn-primary { background-color: var(--primary-500); color: #fff; }
.btn-primary:hover { background-color: var(--primary-600); }
.btn-white { background-color: #fff; color: var(--gray-700); }
.btn-white:hover { background-color: var(--gray-50); }
.btn-small { font-size: 0.75rem; }
.year-button {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.5rem 1rem; border: 1px solid transparent; border-radius: 0.375rem;
  box-shadow: 0 1px 2px 0 rgba(0,0,0,.05); font-size: 0.75rem; font-weight: 500;
  background-color: #fff; color: var(--gray-700); margin-block: 0.25rem;
}
.year-button:hover { background-color: var(--gray-50); }
.year-button.active { background-color: var(--primary-500); color: #fff; }
.year-button.active:hover { background-color: var(--primary-600); }
.btn-wordcount {
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.875rem; border: 1px solid var(--border-subtle);
  border-radius: 0.5rem; box-shadow: 0 1px 3px 0 rgba(0,0,0,.1);
  padding: 0.25rem 0.5rem;
}
.btn-wordcount:hover { background-color: var(--primary-700); color: #fff; }
:root[data-color-scheme="dark"] .btn-wordcount:hover { background-color: var(--primary-500); color: #fff; }

/* contribution heatmap wrapper */
.heatmap { margin-inline: auto; background-color: var(--gray-50); }
:root[data-color-scheme="dark"] .heatmap { background-color: var(--gray-800); }

/* calendar-graph SVG fills (calendar_graph_controller) */
.calgraph-text { font-family: var(--font-sans); font-size: 0.75rem; fill: var(--gray-800); }
.calgraph-text-bold { font-family: var(--font-sans); font-size: 0.75rem; fill: var(--gray-600); }
:root[data-color-scheme="dark"] .calgraph-text { fill: color-mix(in srgb, var(--gray-100) 50%, transparent); }
:root[data-color-scheme="dark"] .calgraph-text-bold { fill: var(--gray-100); }
.calgraph-1 { fill: color-mix(in srgb, var(--gray-500) 15%, transparent); stroke: color-mix(in srgb, var(--gray-300) 50%, transparent); }
.calgraph-2 { fill: var(--primary-300); stroke: color-mix(in srgb, var(--gray-500) 15%, transparent); }
.calgraph-3 { fill: var(--primary-400); stroke: color-mix(in srgb, var(--gray-500) 15%, transparent); }
.calgraph-4 { fill: var(--primary-500); stroke: color-mix(in srgb, var(--gray-500) 15%, transparent); }
.calgraph-5 { fill: var(--primary-700); stroke: color-mix(in srgb, var(--gray-500) 15%, transparent); }
:root[data-color-scheme="dark"] .calgraph-1 { stroke: color-mix(in srgb, var(--gray-500) 25%, transparent); }
:root[data-color-scheme="dark"] .calgraph-2 { fill: color-mix(in srgb, var(--heatmap-400) 50%, transparent); }
:root[data-color-scheme="dark"] .calgraph-3 { fill: color-mix(in srgb, var(--heatmap-400) 60%, transparent); }
:root[data-color-scheme="dark"] .calgraph-4 { fill: color-mix(in srgb, var(--heatmap-400) 70%, transparent); }
:root[data-color-scheme="dark"] .calgraph-5 { fill: var(--heatmap-400); }

/* ---------------------------------------------------------------------
   4. PROSE  (.prosed)  — metrics & colours ported from @tailwindcss/typography
   --------------------------------------------------------------------- */
.prosed {
  --tw-prose-body: #374151;
  --tw-prose-headings: #111827;
  --tw-prose-links: #111827;
  --tw-prose-bold: #111827;
  --tw-prose-counters: #6b7280;
  --tw-prose-bullets: #d1d5db;
  --tw-prose-hr: #e5e7eb;
  --tw-prose-quotes: #111827;
  --tw-prose-quote-borders: #e5e7eb;
  --tw-prose-code: #111827;
  --tw-prose-pre-code: #e5e7eb;
  --tw-prose-pre-bg: #1f2937;
  --tw-prose-th-borders: #d1d5db;
  --tw-prose-td-borders: #e5e7eb;
  color: var(--tw-prose-body);
  max-width: 65ch;
  font-size: 1rem;
  line-height: 1.75;
}
:root[data-color-scheme="dark"] .prosed {
  --tw-prose-body: #d1d5db;
  --tw-prose-headings: #fff;
  --tw-prose-links: #fff;
  --tw-prose-bold: #fff;
  --tw-prose-counters: #9ca3af;
  --tw-prose-bullets: #4b5563;
  --tw-prose-hr: #374151;
  --tw-prose-quotes: #f3f4f6;
  --tw-prose-quote-borders: #374151;
  --tw-prose-code: #fff;
  --tw-prose-pre-code: #d1d5db;
  --tw-prose-pre-bg: rgba(0,0,0,.5);
  --tw-prose-th-borders: #4b5563;
  --tw-prose-td-borders: #374151;
}
.prosed p { margin-block: 1.25em; }
.prosed a { color: var(--tw-prose-links); font-weight: 500; text-decoration: underline; }
.prosed strong { color: var(--tw-prose-bold); font-weight: 600; }
.prosed ol { list-style-type: decimal; margin-block: 1.25em; padding-left: 1.625em; }
.prosed ul { list-style-type: disc; margin-block: 1.25em; padding-left: 1.625em; }
.prosed li { margin-block: 0.5em; }
.prosed ol > li::marker { color: var(--tw-prose-counters); font-weight: 400; }
.prosed ul > li::marker { color: var(--tw-prose-bullets); }
.prosed hr { border-color: var(--tw-prose-hr); border-top-width: 1px; margin-block: 3em; }
.prosed blockquote {
  border-left: 0.25rem solid var(--tw-prose-quote-borders);
  color: var(--tw-prose-quotes);
  font-style: italic; font-weight: 500;
  margin-block: 1.6em; padding-left: 1em;
  quotes: "\201C""\201D""\2018""\2019";
}
.prosed h1 { color: var(--tw-prose-headings); font-weight: 800; font-size: 2.25em; line-height: 1.1111111; margin-top: 0; margin-bottom: 0.8888889em; }
.prosed h2 { color: var(--tw-prose-headings); font-weight: 700; font-size: 1.5em; line-height: 1.3333333; margin-top: 2em; margin-bottom: 1em; }
.prosed h3 { color: var(--tw-prose-headings); font-weight: 600; font-size: 1.25em; line-height: 1.6; margin-top: 1.6em; margin-bottom: 0.6em; }
.prosed h4 { color: var(--tw-prose-headings); font-weight: 600; line-height: 1.5; margin-top: 1.5em; margin-bottom: 0.5em; }
.prosed img, .prosed picture { margin-block: 2em; }
.prosed picture { display: block; }
.prosed code { color: var(--tw-prose-code); font-size: 0.875em; font-weight: 600; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }
.prosed pre {
  background-color: var(--tw-prose-pre-bg); color: var(--tw-prose-pre-code);
  border-radius: 0.375rem; font-size: 0.875em; font-weight: 400; line-height: 1.7142857;
  margin-block: 1.7142857em; overflow-x: auto; padding: 0.8571429em 1.1428571em;
}
.prosed pre code { background: transparent; border-width: 0; border-radius: 0; color: inherit; font-size: inherit; font-weight: inherit; padding: 0; }
.prosed table { width: 100%; font-size: 0.875em; line-height: 1.7142857; margin-block: 2em; table-layout: auto; text-align: left; border-collapse: collapse; }
.prosed thead { border-bottom: 1px solid var(--tw-prose-th-borders); }
.prosed thead th { color: var(--tw-prose-headings); font-weight: 600; padding: 0 0.5714286em 0.5714286em; vertical-align: bottom; }
.prosed tbody tr { border-bottom: 1px solid var(--tw-prose-td-borders); }
.prosed tbody tr:last-child { border-bottom-width: 0; }
.prosed tbody td { vertical-align: baseline; padding: 0.5714286em; }
.prosed > :first-child { margin-top: 0; }
.prosed > :last-child { margin-bottom: 0; }
/* lg:prose-lg bump (main.css used lg:prose-lg) */
@media (min-width: 1024px) {
  .prosed { font-size: 1.125rem; line-height: 1.7777778; }
}

/* ---------------------------------------------------------------------
   5. FORMS  (values ported from @tailwindcss/forms output)
   --------------------------------------------------------------------- */
.form-input,
.form-select {
  appearance: none;
  display: block;
  width: 100%;
  border-width: 0;
  border-radius: 0.375rem;
  background-color: var(--surface-2);
  color: var(--text-1);
}
.form-input {
  padding: 0.375rem 0.5rem;
  font-size: 1rem;
  line-height: 1.5rem;
  box-shadow: 0 1px 2px 0 rgba(0,0,0,.05), inset 0 0 0 1px var(--gray-400);
}
.form-input::placeholder { color: var(--gray-500); opacity: 1; }
.form-input:focus { outline: 2px solid transparent; outline-offset: 2px; box-shadow: inset 0 0 0 2px var(--primary-500); }
.form-input[disabled], .form-input[readonly] { background-color: var(--gray-200); }
:root[data-color-scheme="dark"] .form-input { box-shadow: 0 1px 2px 0 rgba(0,0,0,.05), inset 0 0 0 1px hsla(0,0%,100%,.1); }
:root[data-color-scheme="dark"] .form-input[disabled],
:root[data-color-scheme="dark"] .form-input[readonly] { background-color: var(--gray-600); }

.form-select {
  margin-top: 0.5rem;
  padding: 0.375rem 2.5rem 0.375rem 0.75rem;
  font-size: 0.875rem;
  line-height: 1.5rem;
  box-shadow: inset 0 0 0 1px var(--gray-300);
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%2378879B' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3E%3C/svg%3E");
  background-position: right 0.5rem center;
  background-repeat: no-repeat;
  background-size: 1.5em 1.5em;
}
.form-select:focus { outline: 2px solid transparent; outline-offset: 2px; box-shadow: inset 0 0 0 2px var(--primary-600); }
:root[data-color-scheme="dark"] .form-select { box-shadow: inset 0 0 0 1px hsla(0,0%,100%,.1); }
:root[data-color-scheme="dark"] .form-select:focus { box-shadow: inset 0 0 0 2px var(--primary-500); }

.form-control-lg {
  font-size: 1.25rem;
  margin-block: 0.5rem;
  display: block;
  width: 100%;
  border-radius: 0.375rem;
  border-width: 0;
  padding: 1rem;
  color: var(--gray-900);
  background-color: var(--surface-2);
  box-shadow: 0 1px 2px 0 rgba(0,0,0,.05), inset 0 0 0 1px var(--gray-300);
}
.form-control-lg::placeholder { color: var(--gray-400); }
.form-control-lg:focus { outline: none; box-shadow: inset 0 0 0 2px var(--primary-600); }
.form-control-lg[disabled], .form-control-lg[readonly] { background-color: var(--gray-200); }
:root[data-color-scheme="dark"] .form-control-lg { background-color: var(--gray-700); color: var(--gray-50); box-shadow: 0 1px 2px 0 rgba(0,0,0,.05), inset 0 0 0 1px var(--gray-600); }
:root[data-color-scheme="dark"] .form-control-lg:focus { box-shadow: inset 0 0 0 2px var(--primary-500); }

/* ---------------------------------------------------------------------
   6. CONTROLLER-TOGGLED CLASSES (referenced from assets/controllers/*.js)
   --------------------------------------------------------------------- */
.bg-indigo-500 { background-color: var(--primary-500); }
.hover\:bg-indigo-700:hover { background-color: var(--primary-700); }
.bg-amber-100 { background-color: var(--amber-100); }
.bg-amber-300 { background-color: var(--amber-300); }
.text-black { color: #000; }
:root[data-color-scheme="dark"] .dark\:bg-amber-600 { background-color: var(--amber-600); }
.highlight { transition: background-color 1.5s ease-in-out; }

/* ---------------------------------------------------------------------
   7. UTILITY LAYER (only utilities actually used by templates/controllers)
   --------------------------------------------------------------------- */
/* display */
.block { display: block; }
.inline-block { display: inline-block; }
.inline-flex { display: inline-flex; }
.flex { display: flex; }
.hidden { display: none; }
.flex-col { flex-direction: column; }
.flex-1 { flex: 1 1 0%; }
.shrink-0 { flex-shrink: 0; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-around { justify-content: space-around; }

/* position */
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.z-0 { z-index: 0; }
.top-0 { top: 0; }
.left-0 { left: 0; }
.inset-y-0 { top: 0; bottom: 0; }

/* sizing */
.w-full { width: 100%; }
.w-2\/3 { width: 66.666667%; }
.w-56 { width: 14rem; }
.w-9 { width: 2.25rem; }
.w-4 { width: 1rem; }
.w-3\.5 { width: 0.875rem; }
.h-full { height: 100%; }
.h-screen { height: 100vh; }
.h-5 { height: 1.25rem; }
.h-3\.5 { height: 0.875rem; }
.min-h-screen { min-height: 100vh; }
.size-4 { width: 1rem; height: 1rem; }
.size-6 { width: 1.5rem; height: 1.5rem; }
.size-24 { width: 6rem; height: 6rem; }
.max-w-prose { max-width: 65ch; }
.max-w-lg { max-width: 32rem; }
.max-w-xl { max-width: 36rem; }
.max-w-2xl { max-width: 42rem; }
.max-w-3xl { max-width: 48rem; }
.max-w-5xl { max-width: 64rem; }

/* spacing — margins */
.mx-auto { margin-inline: auto; }
.-mx-4 { margin-inline: -1rem; }
.-mx-8 { margin-inline: -2rem; }
.mt-16 { margin-top: 4rem; }
.mr-1 { margin-right: 0.25rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-12 { margin-bottom: 3rem; }
.mb-20 { margin-bottom: 5rem; }
.my-1 { margin-block: 0.25rem; }
.my-4 { margin-block: 1rem; }
.my-8 { margin-block: 2rem; }
.my-12 { margin-block: 3rem; }
.pb-4 { padding-bottom: 1rem; }
.pt-2 { padding-top: 0.5rem; }

/* spacing — padding */
.p-1 { padding: 0.25rem; }
.p-1\.5 { padding: 0.375rem; }
.p-2 { padding: 0.5rem; }
.p-4 { padding: 1rem; }
.p-14 { padding: 3.5rem; }
.px-2 { padding-inline: 0.5rem; }
.px-3 { padding-inline: 0.75rem; }
.px-4 { padding-inline: 1rem; }
.py-1 { padding-block: 0.25rem; }
.py-2 { padding-block: 0.5rem; }

/* gaps & stacks */
.gap-6 { gap: 1.5rem; }
.space-x-2 > * + * { margin-left: 0.5rem; }
.space-x-4 > * + * { margin-left: 1rem; }
.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-0 > * + * { margin-top: 0; }

/* typography */
.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }
.text-3xl { font-size: 1.875rem; line-height: 2.25rem; }
.text-4xl { font-size: 2.25rem; line-height: 2.5rem; }
.text-7xl { font-size: 4.5rem; line-height: 1; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.uppercase { text-transform: uppercase; }
.tracking-widest { letter-spacing: 0.1em; }
.leading-none { line-height: 1; }

/* colours */
.text-white { color: #fff; }
.text-gray-500 { color: var(--gray-500); }
.text-gray-600 { color: var(--gray-600); }
.text-gray-900 { color: var(--gray-900); }
.text-stone-500 { color: var(--stone-500); }
.bg-gray-100 { background-color: var(--gray-100); }
.bg-grey-800 { background-color: var(--grey-800); }
.bg-stone-900 { background-color: var(--stone-900); }
.bg-primary-500\/20 { background-color: color-mix(in srgb, var(--primary-500) 20%, transparent); }
.bg-primary-500\/30 { background-color: color-mix(in srgb, var(--primary-500) 30%, transparent); }
.bg-primary-500\/\[0\.20\] { background-color: color-mix(in srgb, var(--primary-500) 20%, transparent); }
.fill-gray-500 { fill: var(--gray-500); }
.stroke-1 { stroke-width: 1; }
.stroke-gray-100 { stroke: var(--gray-100); }
.stroke-gray-400 { stroke: var(--gray-400); }
.stroke-gray-500 { stroke: var(--gray-500); }
.border-gray-500 { border-color: var(--gray-500); }

/* borders & radius */
.border { border-width: 1px; border-style: solid; }
.border-0 { border-width: 0; }
.rounded { border-radius: 0.25rem; }
.rounded-md { border-radius: 0.375rem; }
.rounded-full { border-radius: 9999px; }

/* effects */
.shadow { box-shadow: 0 1px 3px 0 rgba(0,0,0,.1), 0 1px 2px -1px rgba(0,0,0,.1); }
.shadow-sm { box-shadow: 0 1px 2px 0 rgba(0,0,0,.05); }
.shadow-lg { box-shadow: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -4px rgba(0,0,0,.1); }
.shadow-xl { box-shadow: 0 20px 25px -5px rgba(0,0,0,.1), 0 8px 10px -6px rgba(0,0,0,.1); }
.shadow-inner { box-shadow: inset 0 2px 4px 0 rgba(0,0,0,.05); }
.opacity-0 { opacity: 0; }
.opacity-50 { opacity: 0.5; }
.opacity-60 { opacity: 0.6; }
.opacity-100 { opacity: 1; }

/* misc */
.overflow-x-auto { overflow-x: auto; }
.cursor-pointer { cursor: pointer; }
.float-right { float: right; }
.table-fixed { table-layout: fixed; }
.appearance-none { appearance: none; -webkit-appearance: none; }
.snap-x { scroll-snap-type: x var(--tw-snap-strictness, mandatory); }
.snap-mandatory { --tw-snap-strictness: mandatory; }
.snap-center { scroll-snap-align: center; }
.transition {
  transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;
  transition-timing-function: cubic-bezier(.4, 0, .2, 1);
  transition-duration: .15s;
}
.ease-in-out { transition-timing-function: cubic-bezier(.4, 0, .2, 1); }
.delay-100 { transition-delay: 100ms; }
.delay-150 { transition-delay: 150ms; }
.duration-350 { transition-duration: 350ms; }
.duration-700 { transition-duration: 700ms; }
.placeholder-gray-400::placeholder,
.placeholder\:text-gray-400::placeholder { color: var(--gray-400); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border-width: 0;
}

/* ring/focus utilities (inline-styled inputs in tools) */
.ring-1 { box-shadow: inset 0 0 0 1px var(--gray-300); }
.ring-inset { }
.ring-gray-300 { }
.focus\:outline-none:focus { outline: 2px solid transparent; outline-offset: 2px; }
.focus\:ring-2:focus { box-shadow: inset 0 0 0 2px var(--primary-600); }
.focus\:ring-inset:focus { }
.focus\:ring-primary-600:focus { box-shadow: inset 0 0 0 2px var(--primary-600); }
.focus\:border-primary-500:focus { border-color: var(--primary-500); }
.hover\:bg-gray-500\/10:hover { background-color: color-mix(in srgb, var(--gray-500) 10%, transparent); }
.hover\:opacity-100:hover { opacity: 1; }
.hover\:stroke-gray-500:hover { stroke: var(--gray-500); }

/* first/last child */
.first\:pl-8:first-child { padding-left: 2rem; }
.last\:pr-8:last-child { padding-right: 2rem; }

/* responsive — sm (640px) */
@media (min-width: 640px) {
  .sm\:w-48 { width: 12rem; }
  .sm\:leading-6 { line-height: 1.5rem; }
}
/* responsive — md (768px) */
@media (min-width: 768px) {
  .md\:flex { display: flex; }
  .md\:inline-block { display: inline-block; }
  .md\:mx-0 { margin-inline: 0; }
  .md\:my-8 { margin-block: 2rem; }
  .md\:px-0 { padding-inline: 0; }
  .md\:w-2\/3 { width: 66.666667%; }
  .md\:text-base { font-size: 1rem; line-height: 1.5rem; }
  .md\:text-3xl { font-size: 1.875rem; line-height: 2.25rem; }
  .md\:text-4xl { font-size: 2.25rem; line-height: 2.5rem; }
  .md\:text-5xl { font-size: 3rem; line-height: 1; }
  .md\:space-x-1 > * + * { margin-left: 0.25rem; }
  .md\:prose-lg { font-size: 1.125rem; line-height: 1.7777778; }
  .md\:h-\[500px\] { height: 500px; }
  .md\:rounded-none { border-radius: 0; }
  .md\:rounded-l-xl { border-top-left-radius: 0.75rem; border-bottom-left-radius: 0.75rem; }
  .md\:rounded-r-xl { border-top-right-radius: 0.75rem; border-bottom-right-radius: 0.75rem; }
  .md\:rounded-l-none { border-top-left-radius: 0; border-bottom-left-radius: 0; }
  .md\:rounded-r-none { border-top-right-radius: 0; border-bottom-right-radius: 0; }
}
/* responsive — lg (1024px) */
@media (min-width: 1024px) {
  .lg\:hidden { display: none; }
  .lg\:block { display: block; }
}

/* arbitrary values (kept as escaped class names so markup is untouched) */
.h-\[360px\] { height: 360px; }
.w-\[240px\] { width: 240px; }
.h-\[320px\] { height: 320px; }
.aspect-\[2\/3\] { aspect-ratio: 2 / 3; }
.min-h-\[300px\] { min-height: 300px; }
.opacity-\[0\.70\] { opacity: 0.70; }
.tracking-tightest { letter-spacing: -0.05em; }
.bg-violet-600 { background-color: var(--violet-600); }
.text-grey-950 { color: #fff; }
.border-violet-300 { border-color: var(--violet-300); }
.border-b-4 { border-bottom-width: 4px; }
.border-b-violet-900 { border-bottom-color: var(--violet-900); }

/* dark-only utilities used inline in templates */
:root[data-color-scheme="dark"] .dark\:inline-block { display: inline-block; }
:root[data-color-scheme="dark"] .dark\:hidden { display: none; }
:root[data-color-scheme="dark"] .dark\:stroke-gray-700 { stroke: var(--gray-700); }
:root[data-color-scheme="dark"] .dark\:text-gray-300 { color: var(--gray-300); }
:root[data-color-scheme="dark"] .dark\:text-gray-50 { color: var(--gray-50); }
:root[data-color-scheme="dark"] .dark\:text-white { color: #fff; }
:root[data-color-scheme="dark"] .dark\:border-violet-400 { border-color: var(--violet-400); }
:root[data-color-scheme="dark"] .dark\:bg-gray-800\/\[0\.16\] { background-color: color-mix(in srgb, var(--gray-800) 16%, transparent); }
:root[data-color-scheme="dark"] .dark\:placeholder-gray-300\/50::placeholder { color: color-mix(in srgb, var(--gray-300) 50%, transparent); }
:root[data-color-scheme="dark"] .dark\:ring-gray-600 { box-shadow: inset 0 0 0 1px var(--gray-600); }
:root[data-color-scheme="dark"] .dark\:focus\:ring-primary-500:focus { box-shadow: inset 0 0 0 2px var(--primary-500); }

/* container (Tailwind .container — used by 404.html) */
.container { width: 100%; }
@media (min-width: 640px) { .container { max-width: 640px; } }
@media (min-width: 768px) { .container { max-width: 768px; } }
@media (min-width: 1024px) { .container { max-width: 1024px; } }
@media (min-width: 1280px) { .container { max-width: 1280px; } }
@media (min-width: 1536px) { .container { max-width: 1536px; } }

/* ---------------------------------------------------------------------
   8. PRESERVED PLAIN-CSS BLOCKS (ported verbatim from old main.css)
   --------------------------------------------------------------------- */
:root {
  --radius-blob-1: 30% 70% 70% 30% / 53% 30% 70% 47%;
  --radius-blob-2: 53% 47% 34% 66% / 63% 46% 54% 37%;
  --radius-blob-3: 37% 63% 56% 44% / 49% 56% 44% 51%;
  --radius-blob-4: 63% 37% 37% 63% / 43% 37% 63% 57%;
  --radius-blob-5: 49% 51% 48% 52% / 57% 44% 56% 43%;
  --radius-blob-6: 35% 65% 30% 70% / 50% 58% 42% 50%;
}
.rounded-blob-1 { border-radius: var(--radius-blob-1); }
.rounded-blob-2 { border-radius: var(--radius-blob-2); }
.rounded-blob-3 { border-radius: var(--radius-blob-3); }
.rounded-blob-4 { border-radius: var(--radius-blob-4); }
.rounded-blob-5 { border-radius: var(--radius-blob-5); }
.rounded-blob-6 { border-radius: var(--radius-blob-6); }

/* clock (days_clock / clock.html) */
svg#clock { height: auto; max-height: 90vh; width: 100%; }
.bgDot { stroke: none; }
.clockCircle { fill: none; stroke: #2a2a2a; }
.clockArc { fill: none; stroke: hsl(200, 60%, 60%); }
.clockDot { fill: hsl(200, 80%, 85%); }
.caption { fill: hsl(200, 60%, 95%); }
.dayText { font-size: 1.875rem; line-height: 2.25rem; }
.daysText, .weatherText { font-size: 1.25rem; line-height: 1.75rem; }
.dateText, .tempText { font-size: 3rem; line-height: 1; }
.timeText { line-height: 1; font-weight: 500; }

/* contribution calendar (cal-heatmap / contribution-map includes) */
.ContributionCalendar-day {
  fill: var(--color-calendar-graph-day-bg);
  shape-rendering: geometricPrecision;
  background-color: var(--color-calendar-graph-day-bg);
  border-radius: 2px;
  outline: 1px solid var(--color-calendar-graph-day-border);
  outline-offset: -1px;
  border: none;
}
.contribution-map { margin-block: auto; border-spacing: 3px; }
.ContributionCalendar-grid { width: max-content; border-collapse: separate; border-spacing: 3px; position: relative; }
:root {
  --color-calendar-graph-day-bg: #ebedf0;
  --color-calendar-graph-day-border: rgba(27, 31, 35, 0.06);
  --color-calendar-graph-day-L1-bg: #9be9a8;
  --color-calendar-graph-day-L2-bg: #40c463;
  --color-calendar-graph-day-L2-border: rgba(27, 31, 35, 0.06);
  --color-calendar-graph-day-L3-bg: #30a14e;
  --color-calendar-graph-day-L3-border: rgba(27, 31, 35, 0.06);
  --color-calendar-graph-day-L4-bg: #216e39;
  --color-calendar-graph-day-L4-border: rgba(27, 31, 35, 0.06);
}
:root[data-color-scheme="dark"] {
  --color-calendar-graph-day-bg: #2d333b;
  --color-calendar-graph-day-border: rgba(255, 255, 255, 0.05);
  --color-calendar-graph-day-L1-bg: #0e4429;
  --color-calendar-graph-day-L2-bg: #006d32;
  --color-calendar-graph-day-L3-bg: #26a641;
  --color-calendar-graph-day-L4-bg: #39d353;
}
.ContributionCalendar-day[data-level="0"] { outline: 1px solid var(--color-calendar-graph-day-border); }
.ContributionCalendar-day[data-level="1"] { fill: var(--color-calendar-graph-day-L1-bg); background-color: var(--color-calendar-graph-day-L1-bg); outline: 1px solid var(--color-calendar-graph-day-border); }
.ContributionCalendar-day[data-level="2"] { fill: var(--color-calendar-graph-day-L2-bg); background-color: var(--color-calendar-graph-day-L2-bg); outline: 1px solid var(--color-calendar-graph-day-L2-border); }
.ContributionCalendar-day[data-level="3"] { fill: var(--color-calendar-graph-day-L3-bg); background-color: var(--color-calendar-graph-day-L3-bg); outline: 1px solid var(--color-calendar-graph-day-L3-border); }
.ContributionCalendar-day[data-level="4"] { fill: var(--color-calendar-graph-day-L4-bg); background-color: var(--color-calendar-graph-day-L4-bg); outline: 1px solid var(--color-calendar-graph-day-L4-border); }

/* tooltip (contribution calendar hover) */
.ContributionCalendar-day .tooltip {
  background-color: var(--gray-800); color: #fff; font-size: 0.75rem;
  border-radius: 2px; width: 11rem; margin-left: -86px; text-align: center;
  padding: 0.25rem 0.5rem; z-index: 5000; visibility: hidden; opacity: 0;
  transition: opacity 0.125s ease-in-out;
}
.ContributionCalendar-day:hover .tooltip { visibility: visible; opacity: 1; }
#arrow, [data-popper-arrow] { width: 0; height: 0; border-style: solid; position: absolute; margin: 0 5px; }
.tooltip[data-popper-placement^='top'] > #arrow { bottom: -4px; border-width: 0 5px 5px 5px; border-color: transparent transparent #596678 transparent; }
.tooltip[data-popper-placement^='bottom'] > #arrow { top: -4px; border-width: 5px 5px 0 5px; border-color: #596678 transparent transparent transparent; }
.tooltip[data-popper-placement^='left'] > #arrow { right: -4px; border-width: 5px 5px 5px 0; border-color: transparent #596678 transparent transparent; }
.tooltip[data-popper-placement^='right'] > #arrow { left: -4px; border-width: 5px 0 5px 5px; border-color: transparent transparent transparent #596678; }
