/*
Theme Name: Mythos Modern
Theme URI: https://thoth.podcast/themes/mythos-modern
Author: Thoth Podcast
Author URI: https://thoth.podcast
Description: Mythos Modern — a cinematic, RTL-first WordPress theme for the Thoth Podcast. A premium mythology streaming library and digital museum of myths, legends, folklore, and long-form storytelling. Built with Tailwind CSS and vanilla JavaScript (no jQuery), PHP 8+, and the WordPress coding standards.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: mythos-modern
Tags: rtl-language-support, translation-ready, custom-logo, custom-menu, featured-images, threaded-comments, blog, podcast, full-width-template, accessibility-ready
*/

/* ==========================================================================
   BUILD NOTE
   --------------------------------------------------------------------------
   This file (style.css) is BOTH:
     1) The WordPress theme stylesheet header (above) — required so WordPress
        can register the theme. Do not remove the comment block above.
     2) The Tailwind SOURCE that is compiled to /assets/css/app.css.

   To compile:
       npm install
       npm run build      (one-off, minified -> /assets/css/app.css)
       npm run dev        (watch mode while developing)

   functions.php enqueues the COMPILED /assets/css/app.css when it exists, and
   falls back to this source file otherwise (so the site is still largely
   styled before the first build — only Tailwind utility classes are missing
   until you run the build).

   All component styles below are authored in plain CSS using CSS custom
   properties (no @apply), so they render identically whether compiled by
   Tailwind or loaded raw as a fallback. RTL is the authored default and uses
   CSS logical properties throughout.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Estedad — primary Persian typeface (self-hosted, variable weight 100–900)
   Place the font file at: /assets/fonts/Estedad/Estedad-Variable.woff2
   (Estedad is an open-source Persian font; download the variable .woff2 and
   drop it in the path above. You may add static weights if you prefer.)
   -------------------------------------------------------------------------- */

@font-face {
  font-family: "Estedad";

  src: url("assets/fonts/Estedad/Estedad-Variable.woff2") format("woff2-variations"),
       url("assets/fonts/Estedad/Estedad-Variable.woff2") format("woff2");

  font-weight: 100 900;

  font-style: normal;

  font-display: swap;
}

/* Tailwind layers — utilities/components/base are injected here at build time. */

*, ::before, ::after {
  --tw-border-spacing-x: 0;
  --tw-border-spacing-y: 0;
  --tw-translate-x: 0;
  --tw-translate-y: 0;
  --tw-rotate: 0;
  --tw-skew-x: 0;
  --tw-skew-y: 0;
  --tw-scale-x: 1;
  --tw-scale-y: 1;
  --tw-pan-x:  ;
  --tw-pan-y:  ;
  --tw-pinch-zoom:  ;
  --tw-scroll-snap-strictness: proximity;
  --tw-gradient-from-position:  ;
  --tw-gradient-via-position:  ;
  --tw-gradient-to-position:  ;
  --tw-ordinal:  ;
  --tw-slashed-zero:  ;
  --tw-numeric-figure:  ;
  --tw-numeric-spacing:  ;
  --tw-numeric-fraction:  ;
  --tw-ring-inset:  ;
  --tw-ring-offset-width: 0px;
  --tw-ring-offset-color: #fff;
  --tw-ring-color: rgb(59 130 246 / 0.5);
  --tw-ring-offset-shadow: 0 0 #0000;
  --tw-ring-shadow: 0 0 #0000;
  --tw-shadow: 0 0 #0000;
  --tw-shadow-colored: 0 0 #0000;
  --tw-blur:  ;
  --tw-brightness:  ;
  --tw-contrast:  ;
  --tw-grayscale:  ;
  --tw-hue-rotate:  ;
  --tw-invert:  ;
  --tw-saturate:  ;
  --tw-sepia:  ;
  --tw-drop-shadow:  ;
  --tw-backdrop-blur:  ;
  --tw-backdrop-brightness:  ;
  --tw-backdrop-contrast:  ;
  --tw-backdrop-grayscale:  ;
  --tw-backdrop-hue-rotate:  ;
  --tw-backdrop-invert:  ;
  --tw-backdrop-opacity:  ;
  --tw-backdrop-saturate:  ;
  --tw-backdrop-sepia:  ;
  --tw-contain-size:  ;
  --tw-contain-layout:  ;
  --tw-contain-paint:  ;
  --tw-contain-style:  ;
}

::backdrop {
  --tw-border-spacing-x: 0;
  --tw-border-spacing-y: 0;
  --tw-translate-x: 0;
  --tw-translate-y: 0;
  --tw-rotate: 0;
  --tw-skew-x: 0;
  --tw-skew-y: 0;
  --tw-scale-x: 1;
  --tw-scale-y: 1;
  --tw-pan-x:  ;
  --tw-pan-y:  ;
  --tw-pinch-zoom:  ;
  --tw-scroll-snap-strictness: proximity;
  --tw-gradient-from-position:  ;
  --tw-gradient-via-position:  ;
  --tw-gradient-to-position:  ;
  --tw-ordinal:  ;
  --tw-slashed-zero:  ;
  --tw-numeric-figure:  ;
  --tw-numeric-spacing:  ;
  --tw-numeric-fraction:  ;
  --tw-ring-inset:  ;
  --tw-ring-offset-width: 0px;
  --tw-ring-offset-color: #fff;
  --tw-ring-color: rgb(59 130 246 / 0.5);
  --tw-ring-offset-shadow: 0 0 #0000;
  --tw-ring-shadow: 0 0 #0000;
  --tw-shadow: 0 0 #0000;
  --tw-shadow-colored: 0 0 #0000;
  --tw-blur:  ;
  --tw-brightness:  ;
  --tw-contrast:  ;
  --tw-grayscale:  ;
  --tw-hue-rotate:  ;
  --tw-invert:  ;
  --tw-saturate:  ;
  --tw-sepia:  ;
  --tw-drop-shadow:  ;
  --tw-backdrop-blur:  ;
  --tw-backdrop-brightness:  ;
  --tw-backdrop-contrast:  ;
  --tw-backdrop-grayscale:  ;
  --tw-backdrop-hue-rotate:  ;
  --tw-backdrop-invert:  ;
  --tw-backdrop-opacity:  ;
  --tw-backdrop-saturate:  ;
  --tw-backdrop-sepia:  ;
  --tw-contain-size:  ;
  --tw-contain-layout:  ;
  --tw-contain-paint:  ;
  --tw-contain-style:  ;
}

/*
! tailwindcss v3.4.19 | MIT License | https://tailwindcss.com
*/

/*
1. Prevent padding and border from affecting element width. (https://github.com/mozdevs/cssremedy/issues/4)
2. Allow adding a border to an element by just adding a border-width. (https://github.com/tailwindcss/tailwindcss/pull/116)
*/

*,
::before,
::after {
  box-sizing: border-box;
  /* 1 */
  border-width: 0;
  /* 2 */
  border-style: solid;
  /* 2 */
  border-color: #e5e7eb;
  /* 2 */
}

::before,
::after {
  --tw-content: '';
}

/*
1. Use a consistent sensible line-height in all browsers.
2. Prevent adjustments of font size after orientation changes in iOS.
3. Use a more readable tab size.
4. Use the user's configured `sans` font-family by default.
5. Use the user's configured `sans` font-feature-settings by default.
6. Use the user's configured `sans` font-variation-settings by default.
7. Disable tap highlights on iOS
*/

html,
:host {
  line-height: 1.5;
  /* 1 */
  -webkit-text-size-adjust: 100%;
  /* 2 */
  -moz-tab-size: 4;
  /* 3 */
  -o-tab-size: 4;
     tab-size: 4;
  /* 3 */
  font-family: Estedad, Vazirmatn, IRANSans, Segoe UI, system-ui, sans-serif;
  /* 4 */
  font-feature-settings: normal;
  /* 5 */
  font-variation-settings: normal;
  /* 6 */
  -webkit-tap-highlight-color: transparent;
  /* 7 */
}

/*
1. Remove the margin in all browsers.
2. Inherit line-height from `html` so users can set them as a class directly on the `html` element.
*/

body {
  margin: 0;
  /* 1 */
  line-height: inherit;
  /* 2 */
}

/*
1. Add the correct height in Firefox.
2. Correct the inheritance of border color in Firefox. (https://bugzilla.mozilla.org/show_bug.cgi?id=190655)
3. Ensure horizontal rules are visible by default.
*/

hr {
  height: 0;
  /* 1 */
  color: inherit;
  /* 2 */
  border-top-width: 1px;
  /* 3 */
}

/*
Add the correct text decoration in Chrome, Edge, and Safari.
*/

abbr:where([title]) {
  -webkit-text-decoration: underline dotted;
          text-decoration: underline dotted;
}

/*
Remove the default font size and weight for headings.
*/

h1,
h2,
h3,
h4,
h5,
h6 {
  font-size: inherit;
  font-weight: inherit;
}

/*
Reset links to optimize for opt-in styling instead of opt-out.
*/

a {
  color: inherit;
  text-decoration: inherit;
}

/*
Add the correct font weight in Edge and Safari.
*/

b,
strong {
  font-weight: bolder;
}

/*
1. Use the user's configured `mono` font-family by default.
2. Use the user's configured `mono` font-feature-settings by default.
3. Use the user's configured `mono` font-variation-settings by default.
4. Correct the odd `em` font sizing in all browsers.
*/

code,
kbd,
samp,
pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  /* 1 */
  font-feature-settings: normal;
  /* 2 */
  font-variation-settings: normal;
  /* 3 */
  font-size: 1em;
  /* 4 */
}

/*
Add the correct font size in all browsers.
*/

small {
  font-size: 80%;
}

/*
Prevent `sub` and `sup` elements from affecting the line height in all browsers.
*/

sub,
sup {
  font-size: 75%;
  line-height: 0;
  position: relative;
  vertical-align: baseline;
}

sub {
  bottom: -0.25em;
}

sup {
  top: -0.5em;
}

/*
1. Remove text indentation from table contents in Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=999088, https://bugs.webkit.org/show_bug.cgi?id=201297)
2. Correct table border color inheritance in all Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=935729, https://bugs.webkit.org/show_bug.cgi?id=195016)
3. Remove gaps between table borders by default.
*/

table {
  text-indent: 0;
  /* 1 */
  border-color: inherit;
  /* 2 */
  border-collapse: collapse;
  /* 3 */
}

/*
1. Change the font styles in all browsers.
2. Remove the margin in Firefox and Safari.
3. Remove default padding in all browsers.
*/

button,
input,
optgroup,
select,
textarea {
  font-family: inherit;
  /* 1 */
  font-feature-settings: inherit;
  /* 1 */
  font-variation-settings: inherit;
  /* 1 */
  font-size: 100%;
  /* 1 */
  font-weight: inherit;
  /* 1 */
  line-height: inherit;
  /* 1 */
  letter-spacing: inherit;
  /* 1 */
  color: inherit;
  /* 1 */
  margin: 0;
  /* 2 */
  padding: 0;
  /* 3 */
}

/*
Remove the inheritance of text transform in Edge and Firefox.
*/

button,
select {
  text-transform: none;
}

/*
1. Correct the inability to style clickable types in iOS and Safari.
2. Remove default button styles.
*/

button,
input:where([type='button']),
input:where([type='reset']),
input:where([type='submit']) {
  -webkit-appearance: button;
  /* 1 */
  background-color: transparent;
  /* 2 */
  background-image: none;
  /* 2 */
}

/*
Use the modern Firefox focus style for all focusable elements.
*/

:-moz-focusring {
  outline: auto;
}

/*
Remove the additional `:invalid` styles in Firefox. (https://github.com/mozilla/gecko-dev/blob/2f9eacd9d3d995c937b4251a5557d95d494c9be1/layout/style/res/forms.css#L728-L737)
*/

:-moz-ui-invalid {
  box-shadow: none;
}

/*
Add the correct vertical alignment in Chrome and Firefox.
*/

progress {
  vertical-align: baseline;
}

/*
Correct the cursor style of increment and decrement buttons in Safari.
*/

::-webkit-inner-spin-button,
::-webkit-outer-spin-button {
  height: auto;
}

/*
1. Correct the odd appearance in Chrome and Safari.
2. Correct the outline style in Safari.
*/

[type='search'] {
  -webkit-appearance: textfield;
  /* 1 */
  outline-offset: -2px;
  /* 2 */
}

/*
Remove the inner padding in Chrome and Safari on macOS.
*/

::-webkit-search-decoration {
  -webkit-appearance: none;
}

/*
1. Correct the inability to style clickable types in iOS and Safari.
2. Change font properties to `inherit` in Safari.
*/

::-webkit-file-upload-button {
  -webkit-appearance: button;
  /* 1 */
  font: inherit;
  /* 2 */
}

/*
Add the correct display in Chrome and Safari.
*/

summary {
  display: list-item;
}

/*
Removes the default spacing and border for appropriate elements.
*/

blockquote,
dl,
dd,
h1,
h2,
h3,
h4,
h5,
h6,
hr,
figure,
p,
pre {
  margin: 0;
}

fieldset {
  margin: 0;
  padding: 0;
}

legend {
  padding: 0;
}

ol,
ul,
menu {
  list-style: none;
  margin: 0;
  padding: 0;
}

/*
Reset default styling for dialogs.
*/

dialog {
  padding: 0;
}

/*
Prevent resizing textareas horizontally by default.
*/

textarea {
  resize: vertical;
}

/*
1. Reset the default placeholder opacity in Firefox. (https://github.com/tailwindlabs/tailwindcss/issues/3300)
2. Set the default placeholder color to the user's configured gray 400 color.
*/

input::-moz-placeholder, textarea::-moz-placeholder {
  opacity: 1;
  /* 1 */
  color: #9ca3af;
  /* 2 */
}

input::placeholder,
textarea::placeholder {
  opacity: 1;
  /* 1 */
  color: #9ca3af;
  /* 2 */
}

/*
Set the default cursor for buttons.
*/

button,
[role="button"] {
  cursor: pointer;
}

/*
Make sure disabled buttons don't get the pointer cursor.
*/

:disabled {
  cursor: default;
}

/*
1. Make replaced elements `display: block` by default. (https://github.com/mozdevs/cssremedy/issues/14)
2. Add `vertical-align: middle` to align replaced elements more sensibly by default. (https://github.com/jensimmons/cssremedy/issues/14#issuecomment-634934210)
   This can trigger a poorly considered lint error in some tools but is included by design.
*/

img,
svg,
video,
canvas,
audio,
iframe,
embed,
object {
  display: block;
  /* 1 */
  vertical-align: middle;
  /* 2 */
}

/*
Constrain images and videos to the parent width and preserve their intrinsic aspect ratio. (https://github.com/mozdevs/cssremedy/issues/14)
*/

img,
video {
  max-width: 100%;
  height: auto;
}

/* Make elements with the HTML hidden attribute stay hidden by default */

[hidden]:where(:not([hidden="until-found"])) {
  display: none;
}

:root {
  /* --- Color tokens (RGB channels so Tailwind alpha modifiers work) --- */
  --color-bg-rgb: 11 11 12;
  /* #0B0B0C  page canvas            */
  --color-surface-rgb: 17 18 20;
  /* #111214  cards / header         */
  --color-surface-2-rgb: 21 22 26;
  /* #15161A  nested / hover surface */
  --color-border-rgb: 31 33 37;
  /* #1F2125  hairlines / dividers   */
  --color-text-rgb: 255 255 255;
  /* #FFFFFF  primary text           */
  --color-text-secondary-rgb: 167 170 176;
  /* #A7AAB0 secondary text      */
  --color-text-tertiary-rgb: 110 114 122;
  /* #6E727A faint labels        */
  --color-accent-rgb: 212 175 55;
  /* #D4AF37  gold accent            */
  --color-accent-glow-rgb: 228 195 90;
  /* #E4C35A  gold highlight / glow  */
  --color-success-rgb: 74 222 128;
  /* #4ADE80                         */
  --color-warning-rgb: 251 191 36;
  /* #FBBF24                         */
  --color-error-rgb: 239 68 68;
  /* #EF4444                         */
  /* --- Typography --- */
  --font-sans: "Estedad", "Vazirmatn", "IRANSans", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", sans-serif;
  --font-serif: "Newsreader", Georgia, "Times New Roman", serif;
  /* Latin display moments only */
  --fs-display: clamp(2.75rem, 6vw + 1rem, 6rem);
  --fs-h1: clamp(2rem, 3.5vw + 1rem, 3.5rem);
  --fs-h2: clamp(1.6rem, 2vw + 0.75rem, 2.5rem);
  --fs-h3: clamp(1.25rem, 1vw + 0.75rem, 1.75rem);
  --fs-body-lg: clamp(1.0625rem, 0.3vw + 1rem, 1.1875rem);
  /* --- Radii --- */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-pill: 999px;
  /* --- Layout --- */
  --container-max: 1440px;
  --container-wide: 1600px;
  --reading-measure: 42rem;
  /* --- Motion --- */
  --dur-fast: 150ms;
  --dur-base: 250ms;
  --dur-slow: 400ms;
  --dur-overlay: 500ms;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  /* --- Elevation --- */
  --shadow-card: 0 1px 0 rgb(255 255 255 / 0.02);
  --shadow-hover: 0 12px 40px -12px rgb(0 0 0 / 0.7), 0 0 0 1px rgb(var(--color-accent-rgb) / 0.24);
  /* --- Z-index scale --- */
  --z-header: 50;
  --z-progress: 60;
  --z-overlay: 80;
  --z-skip: 9999;
  color-scheme: dark;
}

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

html {
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
       text-size-adjust: 100%;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: rgb(var(--color-border-rgb)) transparent;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background-color: rgb(var(--color-bg-rgb));
  color: rgb(var(--color-text-rgb));
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.9;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Lock scroll when a fullscreen overlay is open (set by main.js). */

body.is-locked {
  overflow: hidden;
}

img, svg, video, canvas, picture {
  display: block;
  max-width: 100%;
  height: auto;
}

img, video {
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

::-moz-selection {
  background: rgb(var(--color-accent-rgb) / 0.3);
  color: #fff;
}

::selection {
  background: rgb(var(--color-accent-rgb) / 0.3);
  color: #fff;
}

/* Visible, consistent keyboard focus everywhere (gold, offset). */

:focus-visible {
  outline: 2px solid rgb(var(--color-accent-rgb));
  outline-offset: 2px;
  border-radius: 3px;
}

/* Custom scrollbar (WebKit). */

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgb(var(--color-border-rgb));
  border-radius: var(--radius-pill);
}

::-webkit-scrollbar-thumb:hover {
  background: rgb(var(--color-text-tertiary-rgb));
}

/* Respect users who prefer reduced motion (hard requirement). */

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

  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

.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;
  }
}

@media (min-width: 1792px) {
  .container {
    max-width: 1792px;
  }
}

/* ---- Layout containers --------------------------------------------- */

.container-myth {
  width: 100%;
  max-inline-size: var(--container-max);
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 3rem);
}

.container-wide {
  max-inline-size: var(--container-wide);
}

/* ---- Skip link ------------------------------------------------------ */

.skip-link {
  position: absolute;
  inset-block-start: -120px;
  inset-inline-start: 1rem;
  z-index: var(--z-skip);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  background: rgb(var(--color-accent-rgb));
  color: #0b0b0c;
  font-weight: 600;
  transition: inset-block-start var(--dur-base) var(--ease-out);
}

.skip-link:focus {
  inset-block-start: 1rem;
}

/* ---- Screen-reader-only text (works pre-build, mirrors Tailwind sr-only) */

.screen-reader-text,
  .sr-only {
  position: absolute !important;
  inline-size: 1px;
  block-size: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  word-wrap: normal !important;
}

.screen-reader-text:focus,
  .sr-only:focus {
  clip: auto !important;
  inline-size: auto;
  block-size: auto;
  display: block;
  padding: 0.75rem 1rem;
  background: rgb(var(--color-accent-rgb));
  color: #0b0b0c;
  border-radius: var(--radius-sm);
  z-index: var(--z-skip);
}

/* ---- Eyebrow / overline -------------------------------------------- */

/* NOTE: No character letter-spacing — it breaks Persian letter joining.
     The eyebrow reads as gold, small, weighted, with a leading scribe dot. */

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: rgb(var(--color-accent-rgb));
  line-height: 1.4;
}

.eyebrow::before {
  content: "";
  inline-size: 6px;
  block-size: 6px;
  border-radius: var(--radius-pill);
  background: rgb(var(--color-accent-rgb));
  flex: 0 0 auto;
}

/* ---- Threshold divider (signature scribe-mark rule) ----------------- */

.threshold {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  color: rgb(var(--color-accent-rgb) / 0.8);
}

.threshold::before,
  .threshold::after {
  content: "";
  flex: 1;
  block-size: 1px;
  background: linear-gradient(
      to inline-start,
      rgb(var(--color-border-rgb)) 0%,
      rgb(var(--color-border-rgb) / 0) 100%
    );
}

.threshold::after {
  transform: scaleX(-1);
}

.scribe-mark {
  display: inline-flex;
  color: rgb(var(--color-accent-rgb));
}

/* ---- Buttons -------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding-block: 0.85rem;
  padding-inline: 1.6rem;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1;
  text-decoration: none;
  transition: background-color var(--dur-base) var(--ease-out),
                color var(--dur-base) var(--ease-out),
                border-color var(--dur-base) var(--ease-out),
                box-shadow var(--dur-base) var(--ease-out),
                transform var(--dur-fast) var(--ease-out);
}

.btn:active {
  transform: translateY(1px);
}

.btn-gold {
  background: rgb(var(--color-accent-rgb));
  color: #0b0b0c;
}

.btn-gold:hover,
  .btn-gold:focus-visible {
  background: rgb(var(--color-accent-glow-rgb));
  box-shadow: 0 0 0 4px rgb(var(--color-accent-rgb) / 0.18);
}

.btn-ghost {
  background: transparent;
  color: rgb(var(--color-text-rgb));
  border-color: rgb(var(--color-border-rgb));
}

.btn-ghost:hover,
  .btn-ghost:focus-visible {
  border-color: rgb(var(--color-accent-rgb));
  color: #fff;
}

/* ---- Icon button (search, menu, close, etc.) ------------------------ */

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  inline-size: 44px;
  block-size: 44px;
  border-radius: var(--radius-pill);
  color: rgb(var(--color-text-rgb));
  transition: background-color var(--dur-fast) var(--ease-out),
                color var(--dur-fast) var(--ease-out);
}

.icon-btn:hover,
  .icon-btn:focus-visible {
  background: rgb(var(--color-surface-2-rgb));
  color: rgb(var(--color-accent-glow-rgb));
}

.icon-btn svg {
  inline-size: 22px;
  block-size: 22px;
}

/* ---- Glass header --------------------------------------------------- */

.glass-header {
  position: sticky;
  inset-block-start: 0;
  z-index: var(--z-header);
  background: rgb(var(--color-surface-rgb) / 0.62);
  backdrop-filter: blur(16px) saturate(140%);
  border-block-end: 1px solid transparent;
  transition: background-color var(--dur-base) var(--ease-out),
                border-color var(--dur-base) var(--ease-out);
}

.glass-header.is-scrolled {
  background: rgb(var(--color-bg-rgb) / 0.8);
  border-block-end-color: rgb(var(--color-border-rgb) / 0.85);
}

/* Header primary nav links */

.nav-link {
  position: relative;
  color: rgb(var(--color-text-secondary-rgb));
  font-size: 0.95rem;
  font-weight: 500;
  padding-block: 0.5rem;
  transition: color var(--dur-fast) var(--ease-out);
}

.nav-link::after {
  content: "";
  position: absolute;
  inset-block-end: 0;
  inset-inline: 0;
  block-size: 1px;
  background: rgb(var(--color-accent-rgb));
  transform: scaleX(0);
  transform-origin: inline-end;
  transition: transform var(--dur-base) var(--ease-out);
}

.nav-link:hover,
  .nav-link:focus-visible,
  .nav-link.current-menu-item,
  .nav-link[aria-current="page"] {
  color: #fff;
}

.nav-link:hover::after,
  .nav-link:focus-visible::after,
  .nav-link.current-menu-item::after,
  .nav-link[aria-current="page"]::after {
  transform: scaleX(1);
}

/* ---- Fullscreen overlays (menu + search) ---------------------------- */

/* Open via JS (.is-open) with :target as a no-JS CSS fallback. */

.\!overlay {
  position: fixed !important;
  inset: 0 !important;
  z-index: var(--z-overlay) !important;
  display: flex !important;
  flex-direction: column !important;
  overflow-y: auto !important;
  background: rgb(var(--color-bg-rgb) / 0.98) !important;
  backdrop-filter: blur(22px) !important;
  opacity: 0 !important;
  visibility: hidden !important;
  transition: opacity var(--dur-overlay) var(--ease-out),
                visibility var(--dur-overlay) var(--ease-out) !important;
}

.overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-overlay);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  background: rgb(var(--color-bg-rgb) / 0.98);
  backdrop-filter: blur(22px);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--dur-overlay) var(--ease-out),
                visibility var(--dur-overlay) var(--ease-out);
}

.\!overlay:target,
  .\!overlay.is-open {
  opacity: 1 !important;
  visibility: visible !important;
}

.overlay:target,
  .overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.\!overlay:target,
  .\!overlay.is-open {
  opacity: 1 !important;
  visibility: visible !important;
}

.overlay-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: clamp(1rem, 3vw, 1.75rem) clamp(1rem, 4vw, 3rem);
}

.overlay-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(1.5rem, 5vw, 4rem) clamp(1rem, 4vw, 3rem);
}

/* Menu links: large, staggered fade + lift (uses --i from markup). */

.menu-link {
  display: inline-flex;
  align-items: baseline;
  gap: 0.9rem;
  font-size: clamp(1.75rem, 5vw, 3rem);
  font-weight: 500;
  color: rgb(var(--color-text-rgb));
  line-height: 1.25;
  padding-block: 0.35rem;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity var(--dur-slow) var(--ease-out),
                transform var(--dur-slow) var(--ease-out),
                color var(--dur-fast) var(--ease-out);
  transition-delay: calc(var(--i, 0) * 55ms);
}

.\!overlay.is-open .menu-link,
  .\!overlay:target .menu-link {
  opacity: 1 !important;
  transform: none !important;
}

.overlay.is-open .menu-link,
  .overlay:target .menu-link {
  opacity: 1;
  transform: none;
}

.\!overlay.is-open .menu-link,
  .\!overlay:target .menu-link {
  opacity: 1 !important;
  transform: none !important;
}

.menu-link:hover,
  .menu-link:focus-visible {
  color: rgb(var(--color-accent-glow-rgb));
}

.menu-link .menu-index {
  font-size: 0.9rem;
  font-weight: 600;
  color: rgb(var(--color-accent-rgb) / 0.7);
}

/* ---- Search panel --------------------------------------------------- */

.search-field-wrap {
  position: relative;
}

.search-field {
  inline-size: 100%;
  background: transparent;
  border: none;
  border-block-end: 2px solid rgb(var(--color-border-rgb));
  color: #fff;
  font-family: var(--font-sans);
  font-size: clamp(1.5rem, 4vw, 2.75rem);
  font-weight: 400;
  padding-block: 0.75rem;
  padding-inline-end: 3rem;
  transition: border-color var(--dur-base) var(--ease-out);
}

.search-field::-moz-placeholder {
  color: rgb(var(--color-text-tertiary-rgb));
}

.search-field::placeholder {
  color: rgb(var(--color-text-tertiary-rgb));
}

.search-field:focus {
  outline: none;
  border-block-end-color: rgb(var(--color-accent-rgb));
}

.search-submit {
  position: absolute;
  inset-block-start: 50%;
  inset-inline-end: 0;
  transform: translateY(-50%);
  color: rgb(var(--color-accent-rgb));
}

.search-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-block-start: 1.75rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 1rem;
  border: 1px solid rgb(var(--color-border-rgb));
  border-radius: var(--radius-pill);
  color: rgb(var(--color-text-secondary-rgb));
  font-size: 0.85rem;
  transition: border-color var(--dur-fast) var(--ease-out),
                color var(--dur-fast) var(--ease-out);
}

.chip:hover,
  .chip:focus-visible {
  border-color: rgb(var(--color-accent-rgb));
  color: #fff;
}

/* ---- Card base ------------------------------------------------------ */

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: rgb(var(--color-surface-rgb));
  border: 1px solid rgb(var(--color-border-rgb));
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: border-color var(--dur-base) var(--ease-out),
                transform var(--dur-base) var(--ease-out),
                box-shadow var(--dur-base) var(--ease-out);
}

.card:hover,
  .card:focus-within {
  border-color: rgb(var(--color-accent-rgb) / 0.5);
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.card-media {
  position: relative;
  overflow: hidden;
  background: rgb(var(--color-surface-2-rgb));
}

.card-media img {
  inline-size: 100%;
  block-size: 100%;
  -o-object-fit: cover;
     object-fit: cover;
  transition: transform var(--dur-slow) var(--ease-out);
}

.card:hover .card-media img {
  transform: scale(1.03);
}

.card-square .card-media {
  aspect-ratio: 1 / 1;
}

.card-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  flex: 1;
}

/* Make an entire card clickable via a stretched link. */

.stretched-link::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}

/* ---- Article card --------------------------------------------------- */

.card-title {
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.5;
  color: rgb(var(--color-text-rgb));
}

/* Gold underline grows from the inline-start on hover. */

.card-title-underline {
  background-image: linear-gradient(rgb(var(--color-accent-rgb)), rgb(var(--color-accent-rgb)));
  background-repeat: no-repeat;
  background-size: 0% 1px;
  background-position: 100% 100%;
  transition: background-size var(--dur-base) var(--ease-out);
  padding-block-end: 2px;
}

.card:hover .card-title-underline {
  background-size: 100% 1px;
}

.card-excerpt {
  color: rgb(var(--color-text-secondary-rgb));
  font-size: 0.95rem;
  line-height: 1.85;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-block-start: auto;
  padding-block-start: 0.5rem;
  color: rgb(var(--color-text-tertiary-rgb));
  font-size: 0.8125rem;
}

.card-meta .dot {
  inline-size: 3px;
  block-size: 3px;
  border-radius: 999px;
  background: currentColor;
}

/* Line clamps */

.clamp-1, .clamp-2, .clamp-3 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.clamp-2 {
  -webkit-line-clamp: 2;
}

.clamp-3 {
  -webkit-line-clamp: 3;
}

/* ---- Podcast card --------------------------------------------------- */

.card-podcast {
  display: flex;
  gap: 1rem;
  align-items: stretch;
  padding: 1rem;
}

.card-podcast .pod-cover {
  flex: 0 0 auto;
  inline-size: clamp(72px, 22vw, 112px);
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: rgb(var(--color-surface-2-rgb));
}

.card-podcast .pod-cover img {
  inline-size: 100%;
  block-size: 100%;
  -o-object-fit: cover;
     object-fit: cover;
}

.card-podcast .pod-body {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-inline-size: 0;
}

.play-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  inline-size: 48px;
  block-size: 48px;
  border-radius: var(--radius-pill);
  border: 1px solid rgb(var(--color-accent-rgb));
  color: rgb(var(--color-accent-rgb));
  transition: background-color var(--dur-base) var(--ease-out),
                color var(--dur-base) var(--ease-out),
                transform var(--dur-fast) var(--ease-out);
}

.play-btn:hover,
  .play-btn:focus-visible {
  background: rgb(var(--color-accent-rgb) / 0.12);
  color: rgb(var(--color-accent-glow-rgb));
}

.play-btn:active {
  transform: scale(0.96);
}

/* ---- The Portal (collection / realm card — the signature) ----------- */

.portal {
  position: relative;
  display: block;
  aspect-ratio: 3 / 4;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: rgb(var(--color-surface-rgb));
  isolation: isolate;
}

.portal-img {
  position: absolute;
  inset: 0;
  inline-size: 100%;
  block-size: 100%;
  -o-object-fit: cover;
     object-fit: cover;
  z-index: 0;
  transition: transform var(--dur-slow) var(--ease-out);
}

.portal:hover .portal-img,
  .portal:focus-visible .portal-img {
  transform: scale(1.04);
}

/* Per-realm patina (atmosphere only; gold stays the sole accent). */

.portal-patina {
  position: absolute;
  inset: 0;
  z-index: 1;
  mix-blend-mode: overlay;
  opacity: 0.16;
  pointer-events: none;
}

.portal--greek      .portal-patina {
  background: linear-gradient(135deg, #ede7d8, #2e5e7e);
}

.portal--norse      .portal-patina {
  background: linear-gradient(135deg, #c7d2d8, #4a4f57);
}

.portal--egyptian   .portal-patina {
  background: linear-gradient(135deg, #1f3a93, #d4af37);
}

.portal--indian     .portal-patina {
  background: linear-gradient(135deg, #e7a33e, #8a1f2b);
}

.portal--persian    .portal-patina {
  background: linear-gradient(135deg, #2ea3a0, #b95c7e);
}

.portal--golden-bough .portal-patina {
  background: linear-gradient(135deg, #2f5d3a, #b9912e);
}

.portal--circe      .portal-patina {
  background: linear-gradient(135deg, #6e1f3a, #4a3a7e);
}

.portal--helen      .portal-patina {
  background: linear-gradient(135deg, #9a6b3a, #b97e6e);
}

.portal--witchcraft .portal-patina {
  background: linear-gradient(135deg, #1c2230, #b5532e);
}

/* Bottom-up scrim so titles always read. */

.portal::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(
      to top,
      rgb(var(--color-bg-rgb) / 0.94) 0%,
      rgb(var(--color-bg-rgb) / 0.25) 45%,
      rgb(var(--color-bg-rgb) / 0) 80%
    );
  transition: opacity var(--dur-base) var(--ease-out);
}

/* Hairline gold frame (the "doorway"). */

.portal-frame {
  position: absolute;
  inset: 0.75rem;
  z-index: 3;
  border: 1px solid rgb(var(--color-accent-rgb) / 0.35);
  border-radius: calc(var(--radius-lg) - 4px);
  pointer-events: none;
  transition: border-color var(--dur-base) var(--ease-out),
                box-shadow var(--dur-base) var(--ease-out);
}

.portal:hover .portal-frame,
  .portal:focus-visible .portal-frame {
  border-color: rgb(var(--color-accent-rgb));
  box-shadow: inset 0 0 40px rgb(var(--color-accent-rgb) / 0.12);
}

/* Threshold seal (scribe mark). */

.portal-seal {
  position: absolute;
  inset-block-start: 1.25rem;
  inset-inline-start: 1.25rem;
  z-index: 4;
  color: rgb(var(--color-accent-rgb) / 0.85);
  transition: color var(--dur-base) var(--ease-out);
}

.portal:hover .portal-seal {
  color: rgb(var(--color-accent-glow-rgb));
}

.portal-content {
  position: absolute;
  inset-block-end: 0;
  inset-inline: 0;
  z-index: 4;
  padding: clamp(1.25rem, 3vw, 2rem);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.portal-title {
  font-size: clamp(1.4rem, 2.5vw, 2rem);
  font-weight: 600;
  color: #fff;
  line-height: 1.2;
}

.portal-enter {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: rgb(var(--color-accent-glow-rgb));
  font-size: 0.85rem;
  font-weight: 600;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity var(--dur-base) var(--ease-out),
                transform var(--dur-base) var(--ease-out);
}

.portal:hover .portal-enter,
  .portal:focus-visible .portal-enter {
  opacity: 1;
  transform: none;
}

/* ---- Acast player shell -------------------------------------------- */

.player-shell {
  border: 1px solid rgb(var(--color-border-rgb));
  border-radius: var(--radius-md);
  background: rgb(var(--color-surface-rgb));
  padding: 1rem;
}

.player-shell-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-block-end: 0.85rem;
  color: rgb(var(--color-text-secondary-rgb));
  font-size: 0.8125rem;
  font-weight: 500;
}

.player-shell-label .scribe-mark svg {
  inline-size: 16px;
  block-size: 16px;
}

.player-shell iframe {
  inline-size: 100%;
  border: 0;
  border-radius: var(--radius-sm);
  display: block;
  /* Audio scrubber stays LTR by convention even inside an RTL page. */
  direction: ltr;
}

/* ---- Reading progress (RTL: fills from the inline-start / right) ---- */

.reading-progress {
  position: fixed;
  inset-block-start: 0;
  inset-inline: 0;
  block-size: 2px;
  z-index: var(--z-progress);
  background: transparent;
  pointer-events: none;
}

.reading-progress > span {
  display: block;
  block-size: 100%;
  background: linear-gradient(90deg, rgb(var(--color-accent-rgb)), rgb(var(--color-accent-glow-rgb)));
  transform: scaleX(var(--reading-progress, 0));
  transform-origin: right center;
  transition: transform 0.08s linear;
}

/* ---- Table of contents --------------------------------------------- */

.toc {
  border: 1px solid rgb(var(--color-border-rgb));
  border-radius: var(--radius-md);
  padding: 1.25rem 1.25rem 1.25rem 1rem;
  background: rgb(var(--color-surface-rgb));
}

.toc-title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: rgb(var(--color-accent-rgb));
  margin-block-end: 0.85rem;
}

.toc a {
  display: block;
  color: rgb(var(--color-text-secondary-rgb));
  font-size: 0.92rem;
  line-height: 1.6;
  padding-block: 0.35rem;
  padding-inline-start: 0.85rem;
  border-inline-start: 2px solid transparent;
  transition: color var(--dur-fast) var(--ease-out),
                border-color var(--dur-fast) var(--ease-out);
}

.toc a:hover,
  .toc a.is-active {
  color: #fff;
  border-inline-start-color: rgb(var(--color-accent-rgb));
}

.toc a.toc-h3 {
  padding-inline-start: 1.75rem;
  font-size: 0.85rem;
}

/* ---- Long-form reading (the article body) -------------------------- */

.prose-myth {
  color: rgb(var(--color-text-rgb) / 0.92);
  font-size: var(--fs-body-lg);
  line-height: 2.05;
}

.prose-myth > * + * {
  margin-block-start: 1.5rem;
}

.prose-myth h2 {
  font-size: var(--fs-h2);
  font-weight: 600;
  line-height: 1.25;
  color: #fff;
  margin-block-start: 2.75rem;
  scroll-margin-block-start: 6rem;
  /* offset for sticky header on anchor jumps */
}

.prose-myth h3 {
  font-size: var(--fs-h3);
  font-weight: 600;
  line-height: 1.35;
  color: #fff;
  margin-block-start: 2rem;
  scroll-margin-block-start: 6rem;
}

.prose-myth p {
  margin-block: 0;
}

.prose-myth strong, .prose-myth b {
  color: #fff;
  font-weight: 600;
}

.prose-myth a {
  color: rgb(var(--color-accent-glow-rgb));
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  text-decoration-color: rgb(var(--color-accent-rgb) / 0.5);
  transition: text-decoration-color var(--dur-fast) var(--ease-out),
                color var(--dur-fast) var(--ease-out);
}

.prose-myth a:hover {
  text-decoration-color: rgb(var(--color-accent-rgb));
  color: #fff;
}

.prose-myth ul, .prose-myth ol {
  padding-inline-start: 1.5rem;
  margin-block: 0;
}

.prose-myth ul {
  list-style: disc;
}

.prose-myth ol {
  list-style: decimal;
}

.prose-myth li {
  margin-block: 0.5rem;
}

.prose-myth li::marker {
  color: rgb(var(--color-accent-rgb));
}

.prose-myth blockquote {
  margin-inline: 0;
  margin-block: 2rem;
  padding-inline-start: 1.5rem;
  border-inline-start: 3px solid rgb(var(--color-accent-rgb));
  color: #fff;
  font-size: 1.2em;
  line-height: 1.9;
}

.prose-myth blockquote cite {
  display: block;
  margin-block-start: 0.75rem;
  font-size: 0.85rem;
  color: rgb(var(--color-text-secondary-rgb));
  font-style: normal;
}

.prose-myth figure {
  margin-block: 2.25rem;
}

.prose-myth figure img {
  inline-size: 100%;
  border-radius: var(--radius-md);
}

.prose-myth figcaption {
  margin-block-start: 0.75rem;
  text-align: center;
  color: rgb(var(--color-text-secondary-rgb));
  font-size: 0.8125rem;
  line-height: 1.6;
}

.prose-myth hr {
  border: 0;
  border-block-start: 1px solid rgb(var(--color-border-rgb));
  margin-block: 2.75rem;
}

.prose-myth code {
  background: rgb(var(--color-surface-2-rgb));
  padding: 0.15em 0.4em;
  border-radius: var(--radius-sm);
  font-size: 0.9em;
}

.prose-myth pre {
  background: rgb(var(--color-surface-rgb));
  border: 1px solid rgb(var(--color-border-rgb));
  border-radius: var(--radius-md);
  padding: 1.25rem;
  overflow-x: auto;
  direction: ltr;
  text-align: start;
}

.prose-myth pre code {
  background: none;
  padding: 0;
}

/* ---- Previous / Next post navigation -------------------------------- */

.post-nav {
  display: grid;
  gap: 1rem;
}

@media (min-width: 640px) {
  .post-nav {
    grid-template-columns: 1fr 1fr;
  }
}

.post-nav a {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 1.25rem 1.5rem;
  border: 1px solid rgb(var(--color-border-rgb));
  border-radius: var(--radius-md);
  background: rgb(var(--color-surface-rgb));
  transition: border-color var(--dur-base) var(--ease-out),
                transform var(--dur-base) var(--ease-out);
}

.post-nav a:hover {
  border-color: rgb(var(--color-accent-rgb) / 0.5);
  transform: translateY(-2px);
}

.post-nav .pn-dir {
  font-size: 0.8rem;
  color: rgb(var(--color-accent-rgb));
  font-weight: 600;
}

.post-nav .pn-title {
  color: #fff;
  font-weight: 500;
  line-height: 1.5;
}

.post-nav .pn-next {
  text-align: start;
}

.post-nav .pn-prev {
  text-align: end;
}

/* ---- Breadcrumbs ---------------------------------------------------- */

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: rgb(var(--color-text-secondary-rgb));
}

.breadcrumbs a {
  transition: color var(--dur-fast) var(--ease-out);
}

.breadcrumbs a:hover {
  color: rgb(var(--color-accent-glow-rgb));
}

.breadcrumbs .sep {
  color: rgb(var(--color-text-tertiary-rgb));
  transform: scaleX(-1);
  display: inline-flex;
}

.breadcrumbs [aria-current="page"] {
  color: #fff;
}

/* ---- Pagination ----------------------------------------------------- */

.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

.pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-inline-size: 44px;
  block-size: 44px;
  padding-inline: 0.75rem;
  border: 1px solid rgb(var(--color-border-rgb));
  border-radius: var(--radius-md);
  color: rgb(var(--color-text-secondary-rgb));
  transition: border-color var(--dur-fast) var(--ease-out),
                color var(--dur-fast) var(--ease-out),
                background-color var(--dur-fast) var(--ease-out);
}

.pagination .page-numbers:hover {
  border-color: rgb(var(--color-accent-rgb));
  color: #fff;
}

.pagination .page-numbers.current {
  background: rgb(var(--color-accent-rgb));
  border-color: rgb(var(--color-accent-rgb));
  color: #0b0b0c;
  font-weight: 600;
}

/* ---- Section heading block ----------------------------------------- */

.section-head {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.section-title {
  font-size: var(--fs-h2);
  font-weight: 600;
  color: #fff;
  line-height: 1.2;
}

.section-lead {
  color: rgb(var(--color-text-secondary-rgb));
  max-inline-size: 48ch;
}

/* ---- Empty state ---------------------------------------------------- */

.empty-state {
  text-align: center;
  padding-block: clamp(3rem, 8vw, 6rem);
  color: rgb(var(--color-text-secondary-rgb));
}

.empty-state .scribe-mark {
  justify-content: center;
  margin-inline: auto;
  margin-block-end: 1rem;
}

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

.site-footer {
  border-block-start: 1px solid rgb(var(--color-border-rgb));
  background: rgb(var(--color-bg-rgb));
}

.footer-link {
  color: rgb(var(--color-text-secondary-rgb));
  font-size: 0.95rem;
  line-height: 2.2;
  transition: color var(--dur-fast) var(--ease-out);
}

.footer-link:hover,
  .footer-link:focus-visible {
  color: rgb(var(--color-accent-glow-rgb));
}

.footer-heading {
  font-size: 0.8rem;
  font-weight: 600;
  color: rgb(var(--color-text-tertiary-rgb));
  margin-block-end: 1rem;
}

.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  inline-size: 42px;
  block-size: 42px;
  border-radius: var(--radius-pill);
  border: 1px solid rgb(var(--color-border-rgb));
  color: rgb(var(--color-text-secondary-rgb));
  transition: border-color var(--dur-fast) var(--ease-out),
                color var(--dur-fast) var(--ease-out),
                transform var(--dur-fast) var(--ease-out);
}

.social-link:hover,
  .social-link:focus-visible {
  border-color: rgb(var(--color-accent-rgb));
  color: rgb(var(--color-accent-glow-rgb));
  transform: translateY(-2px);
}

.social-link svg {
  inline-size: 18px;
  block-size: 18px;
}

.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;
}

.visible {
  visibility: visible;
}

.static {
  position: static;
}

.absolute {
  position: absolute;
}

.relative {
  position: relative;
}

.sticky {
  position: sticky;
}

.inset-0 {
  inset: 0px;
}

.isolate {
  isolation: isolate;
}

.z-10 {
  z-index: 10;
}

.z-\[2\] {
  z-index: 2;
}

.m-0 {
  margin: 0px;
}

.mx-auto {
  margin-left: auto;
  margin-right: auto;
}

.\!mt-0 {
  margin-top: 0px !important;
}

.mb-10 {
  margin-bottom: 2.5rem;
}

.mb-12 {
  margin-bottom: 3rem;
}

.mb-3 {
  margin-bottom: 0.75rem;
}

.mb-5 {
  margin-bottom: 1.25rem;
}

.mb-6 {
  margin-bottom: 1.5rem;
}

.mb-8 {
  margin-bottom: 2rem;
}

.mt-12 {
  margin-top: 3rem;
}

.mt-2 {
  margin-top: 0.5rem;
}

.mt-4 {
  margin-top: 1rem;
}

.mt-6 {
  margin-top: 1.5rem;
}

.mt-8 {
  margin-top: 2rem;
}

.block {
  display: block;
}

.inline {
  display: inline;
}

.flex {
  display: flex;
}

.grid {
  display: grid;
}

.contents {
  display: contents;
}

.hidden {
  display: none;
}

.h-full {
  height: 100%;
}

.min-h-\[66vh\] {
  min-height: 66vh;
}

.min-h-\[clamp\(16rem\2c 32vw\2c 24rem\)\] {
  min-height: clamp(16rem, 32vw, 24rem);
}

.w-fit {
  width: -moz-fit-content;
  width: fit-content;
}

.w-full {
  width: 100%;
}

.max-w-\[20ch\] {
  max-width: 20ch;
}

.max-w-reading {
  max-width: var(--reading-measure);
}

.max-w-wide {
  max-width: var(--container-wide);
}

.resize {
  resize: both;
}

.scroll-mt-24 {
  scroll-margin-top: 6rem;
}

.list-none {
  list-style-type: none;
}

.grid-cols-1 {
  grid-template-columns: repeat(1, minmax(0, 1fr));
}

.grid-cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.flex-col {
  flex-direction: column;
}

.flex-wrap {
  flex-wrap: wrap;
}

.items-center {
  align-items: center;
}

.justify-end {
  justify-content: flex-end;
}

.justify-center {
  justify-content: center;
}

.justify-between {
  justify-content: space-between;
}

.gap-1 {
  gap: 0.25rem;
}

.gap-10 {
  gap: 2.5rem;
}

.gap-2 {
  gap: 0.5rem;
}

.gap-3 {
  gap: 0.75rem;
}

.gap-4 {
  gap: 1rem;
}

.gap-5 {
  gap: 1.25rem;
}

.gap-6 {
  gap: 1.5rem;
}

.gap-7 {
  gap: 1.75rem;
}

.overflow-hidden {
  overflow: hidden;
}

.text-balance {
  text-wrap: balance;
}

.text-pretty {
  text-wrap: pretty;
}

.rounded-xl {
  border-radius: var(--radius-xl);
}

.border {
  border-width: 1px;
}

.border-border {
  --tw-border-opacity: 1;
  border-color: rgb(var(--color-border-rgb) / var(--tw-border-opacity, 1));
}

.bg-surface {
  --tw-bg-opacity: 1;
  background-color: rgb(var(--color-surface-rgb) / var(--tw-bg-opacity, 1));
}

.bg-gradient-to-t {
  background-image: linear-gradient(to top, var(--tw-gradient-stops));
}

.from-bg {
  --tw-gradient-from: rgb(var(--color-bg-rgb) / 1) var(--tw-gradient-from-position);
  --tw-gradient-to: rgb(var(--color-bg-rgb) / 0) var(--tw-gradient-to-position);
  --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);
}

.via-bg\/60 {
  --tw-gradient-to: rgb(var(--color-bg-rgb) / 0)  var(--tw-gradient-to-position);
  --tw-gradient-stops: var(--tw-gradient-from), rgb(var(--color-bg-rgb) / 0.6) var(--tw-gradient-via-position), var(--tw-gradient-to);
}

.via-bg\/65 {
  --tw-gradient-to: rgb(var(--color-bg-rgb) / 0)  var(--tw-gradient-to-position);
  --tw-gradient-stops: var(--tw-gradient-from), rgb(var(--color-bg-rgb) / 0.65) var(--tw-gradient-via-position), var(--tw-gradient-to);
}

.via-surface {
  --tw-gradient-to: rgb(var(--color-surface-rgb) / 0)  var(--tw-gradient-to-position);
  --tw-gradient-stops: var(--tw-gradient-from), rgb(var(--color-surface-rgb) / 1) var(--tw-gradient-via-position), var(--tw-gradient-to);
}

.to-bg\/10 {
  --tw-gradient-to: rgb(var(--color-bg-rgb) / 0.1) var(--tw-gradient-to-position);
}

.to-bg\/15 {
  --tw-gradient-to: rgb(var(--color-bg-rgb) / 0.15) var(--tw-gradient-to-position);
}

.to-surface-2 {
  --tw-gradient-to: rgb(var(--color-surface-2-rgb) / 1) var(--tw-gradient-to-position);
}

.object-cover {
  -o-object-fit: cover;
     object-fit: cover;
}

.p-0 {
  padding: 0px;
}

.p-\[clamp\(1\.5rem\2c 5vw\2c 3\.5rem\)\] {
  padding: clamp(1.5rem, 5vw, 3.5rem);
}

.p-\[clamp\(1\.5rem\2c 5vw\2c 4rem\)\] {
  padding: clamp(1.5rem, 5vw, 4rem);
}

.px-\[clamp\(1\.5rem\2c 5vw\2c 4rem\)\] {
  padding-left: clamp(1.5rem, 5vw, 4rem);
  padding-right: clamp(1.5rem, 5vw, 4rem);
}

.py-\[clamp\(2\.5rem\2c 6vw\2c 5rem\)\] {
  padding-top: clamp(2.5rem, 6vw, 5rem);
  padding-bottom: clamp(2.5rem, 6vw, 5rem);
}

.py-section {
  padding-top: clamp(4rem, 8vw, 10rem);
  padding-bottom: clamp(4rem, 8vw, 10rem);
}

.text-center {
  text-align: center;
}

.text-body-lg {
  font-size: clamp(1.0625rem, 0.3vw + 1rem, 1.1875rem);
  line-height: 2.05;
}

.text-display {
  font-size: clamp(2.75rem, 6vw + 1rem, 6rem);
  line-height: 1.08;
  font-weight: 400;
}

.text-h1 {
  font-size: clamp(2rem, 3.5vw + 1rem, 3.5rem);
  line-height: 1.15;
  font-weight: 500;
}

.text-h2 {
  font-size: clamp(1.6rem, 2vw + 0.75rem, 2.5rem);
  line-height: 1.2;
  font-weight: 600;
}

.text-sm {
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.font-medium {
  font-weight: 500;
}

.font-normal {
  font-weight: 400;
}

.font-semibold {
  font-weight: 600;
}

.leading-none {
  line-height: 1;
}

.text-accent {
  --tw-text-opacity: 1;
  color: rgb(var(--color-accent-rgb) / var(--tw-text-opacity, 1));
}

.text-accent\/30 {
  color: rgb(var(--color-accent-rgb) / 0.3);
}

.text-text-secondary {
  --tw-text-opacity: 1;
  color: rgb(var(--color-text-secondary-rgb) / var(--tw-text-opacity, 1));
}

.text-text-tertiary {
  --tw-text-opacity: 1;
  color: rgb(var(--color-text-tertiary-rgb) / var(--tw-text-opacity, 1));
}

.text-white {
  --tw-text-opacity: 1;
  color: rgb(255 255 255 / var(--tw-text-opacity, 1));
}

.filter {
  filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);
}

.transition-colors {
  transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
}

.duration-base {
  transition-duration: 250ms;
}

.text-balance {
  text-wrap: balance;
}

.text-pretty {
  text-wrap: pretty;
}

/* Scroll-reveal: elements start hidden, .is-visible is added by main.js. */

.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity var(--dur-slow) var(--ease-out),
                transform var(--dur-slow) var(--ease-out);
  will-change: opacity, transform;
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* Full-bleed escape hatch for edge-to-edge media inside a container. */

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ==========================================================================
   @layer base — design tokens, resets, element defaults, RTL setup
   ========================================================================== */

/* ==========================================================================
   @layer components — design-system components (plain CSS, no @apply)
   ========================================================================== */

/* ==========================================================================
   @layer utilities — small custom utilities (Tailwind utilities also apply)
   ========================================================================== */

.hover\:text-accent-glow:hover {
  --tw-text-opacity: 1;
  color: rgb(var(--color-accent-glow-rgb) / var(--tw-text-opacity, 1));
}

@media not all and (min-width: 1024px) {
  .max-lg\:hidden {
    display: none;
  }
}

@media (min-width: 640px) {
  .sm\:grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 768px) {
  .md\:mb-12 {
    margin-bottom: 3rem;
  }

  .md\:mb-16 {
    margin-bottom: 4rem;
  }

  .md\:mt-16 {
    margin-top: 4rem;
  }

  .md\:min-h-\[72vh\] {
    min-height: 72vh;
  }

  .md\:grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .md\:grid-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .md\:gap-5 {
    gap: 1.25rem;
  }

  .md\:gap-6 {
    gap: 1.5rem;
  }
}

@media (min-width: 1024px) {
  .lg\:block {
    display: block;
  }

  .lg\:grid {
    display: grid;
  }

  .lg\:grid-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .lg\:grid-cols-\[15rem_minmax\(0\2c 44rem\)_15rem\] {
    grid-template-columns: 15rem minmax(0,44rem) 15rem;
  }

  .lg\:justify-center {
    justify-content: center;
  }

  .lg\:gap-10 {
    gap: 2.5rem;
  }

  .lg\:gap-12 {
    gap: 3rem;
  }
}

@media (min-width: 1280px) {
  .xl\:grid-cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* --------------------------------------------------------------------------
   Custom logo sizing — appended post-build; mirrors the rule now in the
   style.css source, so a future `npm run build` keeps this automatically.
   Unlayered (outside @layer) so it reliably caps the logo image.
   -------------------------------------------------------------------------- */
.site-logo{display:inline-flex;align-items:center}
.site-logo img,.site-logo .custom-logo{block-size:40px;inline-size:auto;width:auto;height:40px;max-inline-size:220px;object-fit:contain}
.site-footer .site-logo img,.site-footer .site-logo .custom-logo{block-size:44px;height:44px;max-inline-size:240px}
