/* =========================================================================
   furayoshi.com — main stylesheet
   -------------------------------------------------------------------------
   Custom design system, fully replacing Bulma. Friendly, colourful.

   Three themes (cycle: black → dark → light → black):

     - black  (default). True #000 background, with purple and pink as
              the headline accents. Cool, vivid, a little synthwave.
     - dark   Warm aubergine-black with the gold / sky-blue / lilac / coral
              personality palette from the previous pass. A bit cosier
              than black, a bit softer.
     - light  Warm cream with the orange / deep-blue / lilac palette.

   Design notes:
   - All colours live as CSS variables on :root, so the whole theme is a
     data-theme change on <html>. The toggle button cycles through the
     three modes.
   - Links are colourful by default, with a thin underline. On hover the
     underline darkens and thickens. Cards, breadcrumbs, footer, etc. use
     per-component styles.
   - Tags (.tag.is-warning) are soft translucent pills that fill in to
     the full accent colour on hover.
   - Post lists use .post-list / .post-list-item — a clean, no-bullet
     list. The lang-switch row (EN / IT / FEED) is a single flex row.
   - The starry sky is theme-aware via --sky-bg; stars.js picks the
     matching palette at runtime. In light mode the sky is warm cream
     with near-black stars; in dark/black modes it’s black with
     near-white stars.
   ========================================================================= */

/* -------------------------------------------------------------------------
   1. Design tokens

   Each theme is a complete :root[data-theme="..."] block that redefines
   the variables. The body and downstream components never hardcode
   colours — they always read a variable.
   ------------------------------------------------------------------------- */

/* ——— BLACK (default) ——— pitch black, purple & pink */
:root,
:root[data-theme="black"] {
  /* surfaces: pure black, with a touch of warmth via the card tint */
  --surface-page: #000000;
  --surface-card: rgba(28, 12, 40, 0.78);            /* purple-tinted translucent */
  --surface-card-strong: rgba(36, 16, 50, 0.96);
  --surface-overlay: rgba(10, 4, 18, 0.65);
  --surface-soft: rgba(255, 255, 255, 0.05);

  /* text — cool white with a hint of pink */
  --text-primary: #f3eaf5;
  --text-secondary: #b8a3c4;
  --text-tertiary: #786784;
  --text-inverse: #0c0410;

  /* lines */
  --line: rgba(255, 255, 255, 0.10);
  --line-strong: rgba(255, 255, 255, 0.22);

  /* personality: PURPLE + PINK (with a touch of sky for variety) */
  --accent: #d76bff;                       /* bright violet-purple */
  --accent-soft: rgba(215, 107, 255, 0.18);
  --accent-strong: #f2a8ff;
  --secondary: #ff7ab8;                    /* hot pink */
  --secondary-soft: rgba(255, 122, 184, 0.18);
  --coral: #ff5b8a;                        /* a slightly warmer pink for danger */
  --coral-soft: rgba(255, 91, 138, 0.18);
  --mint: #8eefd0;                        /* mint for success */
  --mint-soft: rgba(142, 239, 208, 0.18);
  --lilac: #b08bf5;                       /* soft purple for primary */
  --lilac-soft: rgba(176, 139, 245, 0.18);

  /* status colors */
  --warn: #d76bff;
  --info: #7fc8ff;
  --primary: #b08bf5;
  --light: #f3eaf5;
  --danger: #ff5b8a;
  --success: #8eefd0;

  /* link colour in body text */
  --link: #f2a8ff;
  --link-strong: #ffd4f0;

  /* starry sky paint */
  --sky-bg: #000000;
  --sky-mode: dark;

  /* effects */
  --shadow-card: 0 1px 0 rgba(255, 255, 255, 0.04) inset,
                 0 16px 40px -22px rgba(0, 0, 0, 0.7);
  --radius-card: 10px;
  --radius-pill: 999px;

  /* type */
  --font-serif: "Iowan Old Style", "Apple Garamond", "Palatino Linotype",
                "Hoefler Text", "Times New Roman", Georgia, serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI",
               "Helvetica Neue", "Liberation Sans", Arial, sans-serif;
  --font-mono: "SF Mono", "Menlo", "Consolas", "Liberation Mono",
               "DejaVu Sans Mono", monospace;
}

/* ——— DARK (warm aubergine) ——— */
:root[data-theme="dark"] {
  --surface-page: #0e0c14;
  --surface-card: rgba(34, 28, 48, 0.78);
  --surface-card-strong: rgba(44, 36, 60, 0.95);
  --surface-overlay: rgba(20, 16, 30, 0.65);
  --surface-soft: rgba(255, 255, 255, 0.04);

  --text-primary: #f4ecdc;
  --text-secondary: #b8ad9a;
  --text-tertiary: #7d7363;
  --text-inverse: #1a1620;

  --line: rgba(255, 255, 255, 0.10);
  --line-strong: rgba(255, 255, 255, 0.22);

  --accent: #ffb86c;
  --accent-soft: rgba(255, 184, 108, 0.18);
  --accent-strong: #ffd29a;
  --secondary: #7fc8ff;
  --secondary-soft: rgba(127, 200, 255, 0.18);
  --coral: #ff8a8a;
  --coral-soft: rgba(255, 138, 138, 0.18);
  --mint: #7ee0b8;
  --mint-soft: rgba(126, 224, 184, 0.18);
  --lilac: #c9a7ff;
  --lilac-soft: rgba(201, 167, 255, 0.18);

  --warn: #ffb86c;
  --info: #7fc8ff;
  --primary: #c9a7ff;
  --light: #f4ecdc;
  --danger: #ff8a8a;
  --success: #7ee0b8;

  --link: #ffd29a;
  --link-strong: #ffe5b8;

  --sky-bg: #0e0c14;
  --sky-mode: dark;

  --shadow-card: 0 2px 0 rgba(255, 255, 255, 0.04) inset,
                 0 16px 40px -22px rgba(0, 0, 0, 0.7);
}

/* ——— LIGHT (warm cream) ——— */
:root[data-theme="light"] {
  --surface-page: #fdf8ef;
  --surface-card: rgba(255, 251, 244, 0.85);
  --surface-card-strong: rgba(255, 255, 252, 0.98);
  --surface-overlay: rgba(255, 250, 240, 0.7);
  --surface-soft: rgba(20, 14, 36, 0.04);

  --text-primary: #1f1a2c;
  --text-secondary: #595068;
  --text-tertiary: #8a8298;
  --text-inverse: #fdf8ef;

  --line: rgba(20, 14, 36, 0.10);
  --line-strong: rgba(20, 14, 36, 0.22);

  --accent: #d97a1e;
  --accent-soft: rgba(217, 122, 30, 0.14);
  --accent-strong: #b85f10;
  --secondary: #2978b5;
  --secondary-soft: rgba(41, 120, 181, 0.14);
  --coral: #c84a4a;
  --coral-soft: rgba(200, 74, 74, 0.14);
  --mint: #2c8e6c;
  --mint-soft: rgba(44, 142, 108, 0.14);
  --lilac: #6b46c1;
  --lilac-soft: rgba(107, 70, 193, 0.14);

  --warn: #d97a1e;
  --info: #2978b5;
  --primary: #6b46c1;
  --light: #1f1a2c;
  --danger: #c84a4a;
  --success: #2c8e6c;

  --link: #b85f10;
  --link-strong: #8c470a;

  --sky-bg: #fdf8ef;
  --sky-mode: light;

  --shadow-card: 0 1px 0 rgba(255, 255, 255, 0.7) inset,
                 0 10px 32px -20px rgba(31, 26, 44, 0.18);
}

/* -------------------------------------------------------------------------
   2. Reset + base
   ------------------------------------------------------------------------- */

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

html {
  background-color: var(--surface-page) !important;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}

@media (max-width: 672px) { html { font-size: 15.5px; } }

body {
  background: transparent !important;
  color: var(--text-primary);
  margin: 0;
  min-height: 100vh;
  transition: color 240ms ease, background-color 240ms ease;
}

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

::selection { background: var(--accent); color: var(--text-inverse); }

/* -------------------------------------------------------------------------
   3. Typography
   ------------------------------------------------------------------------- */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-sans);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
  letter-spacing: -0.015em;
  margin: 2em 0 0.55em;
}

h1, h2 { position: relative; padding-bottom: 0.35em; }
h1::after, h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 56px;
  height: 3px;
  border-radius: 3px;
  /* Theme-aware gradient: secondary colour differs per theme, so the
     heading bar naturally shifts (purple/pink in black, gold/blue in
     dark, orange/blue in light). */
  background: linear-gradient(90deg,
              var(--accent) 0%,
              var(--secondary) 100%);
  opacity: 0.7;
}
h2::after { width: 42px; height: 2px; opacity: 0.5; }

h1 { font-size: 2.2rem; }
h2 { font-size: 1.7rem; }
h3 { font-size: 1.35rem; }
h4 { font-size: 1.15rem; }
h5 { font-size: 0.95rem; text-transform: uppercase; letter-spacing: 0.10em;
     font-weight: 700; color: var(--secondary); }
h6 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.12em;
     font-weight: 600; color: var(--text-tertiary); }

p { margin: 0 0 1.1em; }

/* -------------------------------------------------------------------------
   Hyperlinks — colourful and distinct by default.
   ------------------------------------------------------------------------- */
a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-decoration-color: var(--accent-soft);
  text-underline-offset: 0.18em;
  transition: color 180ms ease, text-decoration-color 180ms ease,
              background-color 180ms ease;
}
a:hover, a:focus-visible {
  color: var(--link-strong);
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
}
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

.has-text-gray { color: var(--text-secondary) !important; }
.is-italic { font-style: italic; color: var(--text-secondary); }

code, kbd, pre, samp {
  font-family: var(--font-mono);
  font-size: 0.92em;
}

:not(pre) > code {
  padding: 0.12em 0.5em;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 600;
}

pre {
  padding: 1.1rem 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--surface-card-strong);
  overflow-x: auto;
  line-height: 1.55;
  color: var(--text-primary);
  box-shadow: var(--shadow-card);
}
pre code { background: transparent; border: 0; padding: 0; color: inherit; font-weight: 400; }

blockquote {
  margin: 1.6em 0;
  padding: 0.4em 0 0.4em 1.2em;
  border-left: 3px solid var(--coral);
  color: var(--text-secondary);
  font-style: italic;
}

hr {
  border: 0;
  height: 1px;
  background: var(--line);
  margin: 2.4rem 0;
}

/* -------------------------------------------------------------------------
   4. Markdown content lists (.content, used by Markdown pages)
   ------------------------------------------------------------------------- */

.content ul, .content ol { padding-left: 1.4em; margin: 0 0 1.1em; }
.content li { margin: 0.35em 0; }
.content li > ul, .content li > ol { margin: 0.35em 0; }

/* -------------------------------------------------------------------------
   5. Post list (used by blog/feed/ai/pubs/tags/support)
   -------------------------------------------------------------------------
   Replaces the broken Bulma-era <ul class="grid"> pattern. Each item
   is a clean <li> with no bullet, a title link, an optional brief, the
   tag pills, and a divider.
   ------------------------------------------------------------------------- */

ul.post-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
li.post-list-item {
  list-style: none;
  margin: 0;
  padding: 1.1rem 0 1.4rem;
  position: relative;
}
/* The tag row sits at the top of the list item. We give it a small
   bottom margin so the title underneath doesn't crowd it. */
li.post-list-item .tag-row {
  display: block;
  margin-bottom: 0.4rem;
  line-height: 1.6;
}
/* A single divider after each item, drawn as a ::after on the list
   item so it sits BELOW the content. The line is only 25% of the
   list item's width and flush to the left edge, so the rest of the
   row stays open and the page doesn't feel like a ruled worksheet. */
li.post-list-item::after {
  content: "";
  position: absolute;
  left: 2%;
  bottom: -1px;
  width: 25%;
  height: 1px;
  background: var(--line);
}
li.post-list-item:first-child { padding-top: 0.4rem; }
/* The last item doesn't get a divider below it (clean bottom edge). */
li.post-list-item:last-child::after  { display: none; }

a.post-list-title {
  display: inline-block;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
  background: none;
  margin-bottom: 0.2rem;
  transition: color 180ms ease;
}
a.post-list-title:hover,
a.post-list-title:focus-visible {
  color: var(--accent);
  text-decoration: none;
  text-decoration-thickness: 0;
}

p.post-list-brief {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin: 0.2rem 0 0.55rem;
}

/* -------------------------------------------------------------------------
   6. Lang switch (EN / IT / FEED on the blog and feed listings)
   -------------------------------------------------------------------------
   A single flex row of small pill links. Sits at the top of the
   listing, above the post list. A 25%-width divider sits below the
   row, matching the post-list rhythm.
   ------------------------------------------------------------------------- */

.lang-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  justify-content: flex-end;
  margin: 0 0 0.5rem;
}
a.lang-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.85rem;
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid transparent;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-decoration: none;
  background-image: none;
  transition: background-color 180ms ease, color 180ms ease,
              border-color 180ms ease, transform 180ms ease;
}
a.lang-pill:hover,
a.lang-pill:focus-visible {
  background: var(--accent);
  color: var(--text-inverse);
  border-color: var(--accent);
  transform: translateY(-1px);
}

/* -------------------------------------------------------------------------
   7. Tags — soft translucent pills that solidify on hover
   ------------------------------------------------------------------------- */

.tag {
  display: inline-block;
  padding: 0.22rem 0.7rem;
  margin: 0 0.25rem 0.4rem 0;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid transparent;
  text-decoration: none !important;
  text-underline-offset: 0;
  transition: background-color 180ms ease, color 180ms ease,
              border-color 180ms ease, transform 180ms ease;
}
.tag:hover, .tag:focus-visible {
  background: var(--accent);
  color: var(--text-inverse);
  border-color: var(--accent);
  transform: translateY(-1px);
}
.tag:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.tag.is-warning  { background: var(--accent-soft);     color: var(--accent); }
.tag.is-warning:hover  { background: var(--accent); color: var(--text-inverse); }
.tag.is-info     { background: var(--secondary-soft);  color: var(--secondary); }
.tag.is-info:hover     { background: var(--secondary); color: var(--text-inverse); }
.tag.is-primary  { background: var(--lilac-soft);      color: var(--lilac); }
.tag.is-primary:hover  { background: var(--lilac); color: var(--text-inverse); }
.tag.is-danger   { background: var(--coral-soft);      color: var(--coral); }
.tag.is-danger:hover   { background: var(--coral); color: var(--text-inverse); }
.tag.is-success  { background: var(--mint-soft);       color: var(--mint); }
.tag.is-success:hover  { background: var(--mint); color: var(--text-inverse); }

/* -------------------------------------------------------------------------
   8. Layout primitives
   ------------------------------------------------------------------------- */

.section { padding: 2.5rem 0; }
.is-paddingless-horizontal { padding-left: 0; padding-right: 0; }

.container {
  width: 100%;
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.grid {
  display: grid;
  grid-template-columns:
    [xl-start] 1fr 1.5rem [md-start] minmax(0, 1024px) [md-end] 1.5rem 1fr [xl-end];
}
.grid * { grid-column: md; }
.grid-xl { grid-column: xl; }

/* -------------------------------------------------------------------------
   9. Cards (replaces Bulma's "notification" boxes)
   ------------------------------------------------------------------------- */

.notification {
  background: var(--surface-card);
  backdrop-filter: blur(10px) saturate(130%);
  -webkit-backdrop-filter: blur(10px) saturate(130%);
  border: 1px solid var(--line);
  border-left-width: 3px;
  border-radius: var(--radius-card);
  padding: 1.3rem 1.5rem;
  margin: 0 0 1.2rem;
  box-shadow: var(--shadow-card);
  color: var(--text-primary);
  transition: border-color 200ms ease, transform 200ms ease;
}
.notification.is-warning  { border-left-color: var(--accent); }
.notification.is-info     { border-left-color: var(--secondary); }
.notification.is-primary  { border-left-color: var(--lilac); }
.notification.is-light    { border-left-color: var(--line-strong); }
.notification.is-danger   { border-left-color: var(--coral); }
.notification.is-success  { border-left-color: var(--mint); }
.notification.is-black    { border-left-color: var(--text-primary);
                            background: var(--surface-card-strong);
                            color: var(--text-primary); }

.notification a, .notification a:visited {
  color: var(--text-primary);
  text-decoration: none;
  border-bottom: 1.5px solid var(--line-strong);
  padding-bottom: 1px;
  transition: color 180ms ease, border-color 180ms ease;
}
.notification a:hover { color: var(--accent); border-bottom-color: var(--accent); }
.notification hr { margin: 1rem 0; background: var(--line); }

/* "title" / "center" helpers used on the homepage */
.title { font-weight: 700; color: var(--text-primary); margin: 0 0 0.5em;
         line-height: 1.15; letter-spacing: -0.015em;
         font-family: var(--font-sans); }
.title.is-2 { font-size: 2.2rem; }
.title.is-size-2 { font-size: 2rem; }
.subtitle { font-size: 1rem; color: var(--text-secondary); margin: 0 0 1em; }
.subtitle.is-6 { font-size: 0.95rem; }

.center { display: flex; justify-content: center; align-items: center; text-align: center; }

/* Homepage pill — subtle, fills to flavour colour on hover */
.title.center.notification {
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  padding: 0.7rem 1.1rem;
  margin: 0.4rem 0;
  border-radius: var(--radius-pill);
  border-left-width: 1px;
  background: var(--surface-soft);
  color: var(--text-primary);
  text-transform: none;
  text-decoration: none;
  transition: background-color 180ms ease, color 180ms ease,
              border-color 180ms ease, transform 180ms ease;
}
.title.center.notification a,
.title.center.notification a:visited {
  color: inherit; background: none; border: 0; padding: 0; text-decoration: none;
}
.title.center.notification:hover { background: var(--accent); color: var(--text-inverse); border-color: var(--accent); transform: translateY(-1px); }
.title.center.notification:hover a { color: inherit; }
.title.center.notification.is-info:hover     { background: var(--secondary); color: var(--text-inverse); border-color: var(--secondary); }
.title.center.notification.is-primary:hover  { background: var(--lilac);     color: var(--text-inverse); border-color: var(--lilac); }
.title.center.notification.is-warning:hover  { background: var(--accent);    color: var(--text-inverse); border-color: var(--accent); }
.title.center.notification.is-danger:hover   { background: var(--coral);     color: var(--text-inverse); border-color: var(--coral); }
.title.center.notification.is-light:hover    { background: var(--surface-card-strong); color: var(--accent); border-color: var(--accent); }
.title.center.notification.is-black:hover    { background: var(--text-primary); color: var(--text-inverse); border-color: var(--text-primary); }

.has-text-warning { color: var(--accent) !important; }
.has-text-primary { color: var(--lilac) !important; }
.has-text-info    { color: var(--secondary) !important; }
.has-text-light   { color: var(--text-primary) !important; }
.has-text-white   { color: var(--text-primary) !important; }
.has-text-grey-light, .has-text-grey-lighter { color: var(--text-secondary) !important; }
.has-text-right { text-align: right; }
.has-text-left  { text-align: left; }
.has-text-centered { text-align: center; }

/* -------------------------------------------------------------------------
   10. Hero (homepage top section)
   ------------------------------------------------------------------------- */

.hero { padding: 5rem 0 2.5rem; text-align: center; }
.hero .title { font-size: clamp(1.8rem, 4.5vw, 3.1rem); margin: 0; padding-bottom: 0; }
.hero .title::after { display: none; }
.hero .title .accent    { color: var(--accent); }
.hero .title .secondary { color: var(--secondary); }
.hero .divider {
  width: 140px; height: 3px; border-radius: 3px;
  margin: 1.5rem auto 0;
  background: linear-gradient(90deg,
              var(--accent) 0%, var(--lilac) 50%, var(--secondary) 100%);
  opacity: 0.85;
}
.hero-body.columns { display: flex; align-items: center; justify-content: center; gap: 2rem; flex-wrap: wrap; }
.hero-body.columns .column { flex: 1 1 320px; text-align: center; }

/* -------------------------------------------------------------------------
   11. Nav (breadcrumb)
   ------------------------------------------------------------------------- */

nav.breadcrumb { font-size: 0.9rem; padding: 1.1rem 0 0.3rem; }
.breadcrumb ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; color: var(--text-secondary); }
.breadcrumb li { display: inline-flex; align-items: center; gap: 0.5rem; }
.breadcrumb li + li::before { content: "›"; color: var(--accent); font-size: 1.1rem; line-height: 1; font-weight: 700; }
.breadcrumb a { color: var(--text-secondary); text-decoration: none; border-bottom: 1.5px solid transparent; transition: color 180ms ease, border-color 180ms ease; }
.breadcrumb a:hover { color: var(--accent); border-bottom-color: var(--accent); }
.breadcrumb li.is-active a { color: var(--text-primary); }

/* -------------------------------------------------------------------------
   12. Table of contents
   ------------------------------------------------------------------------- */

aside.section.menu-label {
  margin: 1.5rem 0 2rem;
  padding: 1.1rem 1.4rem;
  background: var(--surface-card);
  backdrop-filter: blur(10px) saturate(130%);
  -webkit-backdrop-filter: blur(10px) saturate(130%);
  border: 1px solid var(--line);
  border-left: 3px solid var(--secondary);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
}
aside.section.menu-label h2.menu-label, .menu-label {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--secondary);
  margin: 0 0 0.6rem;
}
aside.section.menu-label #TableOfContents ul { list-style: none; padding-left: 0; margin: 0; }
aside.section.menu-label #TableOfContents li { margin: 0.3rem 0; }
aside.section.menu-label #TableOfContents a {
  color: var(--text-secondary);
  text-decoration: none;
  border-bottom: 1.5px solid transparent;
  font-size: 0.95rem;
  transition: color 180ms ease, border-color 180ms ease;
}
aside.section.menu-label #TableOfContents a:hover { color: var(--secondary); border-bottom-color: var(--secondary); }

/* -------------------------------------------------------------------------
   13. Footer
   ------------------------------------------------------------------------- */

footer, footer.section { padding: 2.5rem 0 3rem; color: var(--text-secondary); font-size: 0.92rem; }
footer p { margin: 0.4em 0; }
footer img { vertical-align: middle; opacity: 0.85; }
footer a { color: var(--text-secondary); text-decoration: underline; text-decoration-color: var(--accent-soft); text-underline-offset: 0.18em; transition: color 180ms ease, text-decoration-color 180ms ease; }
footer a:hover { color: var(--accent); text-decoration-color: var(--accent); }

/* -------------------------------------------------------------------------
   14. Theme toggle (top-right) — cycles through 3 modes
   -------------------------------------------------------------------------
   The icon shown depends on the CURRENT theme:
     black  → moon (click to go darker? actually we cycle to dark next)
     dark   → sun  (click to go lighter, to light)
     light  → star (click to go back to black)
   We use a moon for the deepest mode, a sun for the warm mode, and a
   star for the light one. The aria-label always reads "Switch theme
   → [next]".
   ------------------------------------------------------------------------- */

#theme-toggle {
  position: fixed;
  top: 1.1rem;
  right: 1.1rem;
  z-index: 50;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line-strong);
  background: var(--surface-card-strong);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  color: var(--accent);
  cursor: pointer;
  padding: 0;
  box-shadow: var(--shadow-card);
  transition: transform 180ms ease, color 180ms ease, border-color 180ms ease, background-color 180ms ease;
}
#theme-toggle:hover { transform: translateY(-1px); color: var(--secondary); border-color: var(--secondary); background: var(--surface-card); }
#theme-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#theme-toggle svg { width: 20px; height: 20px; display: block; transition: opacity 200ms ease, transform 300ms ease; }

/* Three icons, three modes. The CSS shows the icon that matches the
   *current* theme. JS sets data-theme on click; CSS picks the icon. */
:root[data-theme="black"] #theme-toggle .icon-star  { display: none;  }
:root[data-theme="black"] #theme-toggle .icon-sun   { display: none;  }
:root[data-theme="black"] #theme-toggle .icon-moon  { display: block; }
:root[data-theme="dark"]  #theme-toggle .icon-moon  { display: none;  }
:root[data-theme="dark"]  #theme-toggle .icon-star  { display: none;  }
:root[data-theme="dark"]  #theme-toggle .icon-sun   { display: block; }
:root[data-theme="light"] #theme-toggle .icon-sun   { display: none;  }
:root[data-theme="light"] #theme-toggle .icon-moon  { display: none;  }
:root[data-theme="light"] #theme-toggle .icon-star  { display: block; }

@media (max-width: 480px) {
  #theme-toggle { top: 0.7rem; right: 0.7rem; width: 38px; height: 38px; }
}

/* -------------------------------------------------------------------------
   15. PGP key block (shortcode)
   ------------------------------------------------------------------------- */

.pgp-key-block {
  margin: 1.4rem 0;
  border: 1px solid var(--line);
  border-left: 3px solid var(--lilac);
  border-radius: var(--radius-card);
  background: var(--surface-card);
  box-shadow: var(--shadow-card);
}
.pgp-key-summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.9rem 1.2rem; gap: 1rem;
  border-radius: calc(var(--radius-card) - 2px);
  transition: background 180ms ease, color 180ms ease;
}
.pgp-key-summary::-webkit-details-marker { display: none; }
.pgp-key-summary::before {
  content: "▸"; display: inline-block; margin-right: 0.55rem;
  color: var(--lilac); transition: transform 180ms ease, color 180ms ease;
  font-size: 0.9em; font-weight: 700;
}
.pgp-key-block[open] > .pgp-key-summary::before { transform: rotate(90deg); color: var(--accent); }
.pgp-key-summary:hover { background: var(--lilac-soft); color: var(--lilac); }
.pgp-key-summary-label { font-weight: 600; color: var(--text-primary); }
.pgp-key-summary-hint { color: var(--text-tertiary); font-size: 0.85rem; font-style: italic; }
.pgp-key-container { position: relative; padding: 0 1.2rem 1.2rem; }
.pgp-copy-btn {
  position: absolute; top: 0.6rem; right: 0.6rem;
  border: 1px solid var(--line-strong);
  background: var(--surface-card-strong);
  color: var(--secondary);
  border-radius: var(--radius-pill);
  padding: 0.35rem 0.9rem;
  font-size: 0.85rem; font-weight: 600; cursor: pointer;
  transition: color 180ms ease, border-color 180ms ease, background-color 180ms ease;
}
.pgp-copy-btn:hover { color: var(--text-inverse); background: var(--secondary); border-color: var(--secondary); }
.pgp-copy-btn.copied { color: var(--text-inverse); background: var(--mint); border-color: var(--mint); }
.pgp-key-pre { font-size: 0.78rem; max-height: 360px; overflow: auto; background: transparent; border: 0; padding: 0.5rem 0 0; margin: 0; }

/* -------------------------------------------------------------------------
   16. Author block (at the end of blog posts)
   -------------------------------------------------------------------------
   Right-aligned in the page rail. Photo on the right, text to the left
   of the photo. Text is right-aligned so it sits flush against the
   photo. Visual: |------tp--|
   ------------------------------------------------------------------------- */

.author-block {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1.1rem;
  margin: 1.5rem 0 1rem;
  padding: 0.6rem 0;
}

.author-photo {
  flex: 0 0 auto;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  background: var(--surface-card);
  box-shadow: var(--shadow-card);
}
.author-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.author-info {
  flex: 0 1 auto;
  text-align: right;
  min-width: 0;
}

.author-name {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-primary);
  margin: 0 0 0.15rem;
}

.author-links {
  margin: 0 0 0.25rem;
  font-size: 0.92rem;
  color: var(--text-secondary);
}
.author-links a {
  color: var(--text-secondary);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding: 0 0.1em;
  transition: color 180ms ease, border-color 180ms ease;
}
.author-links a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.author-bio {
  margin: 0;
  font-size: 0.9rem;
  font-style: italic;
  color: var(--text-tertiary);
}

/* On very small screens, stack the photo above the text so the right-
   alignment doesn't get cramped. */
@media (max-width: 420px) {
  .author-block {
    flex-direction: column-reverse;
    align-items: flex-end;
  }
  .author-info { text-align: right; }
}

/* -------------------------------------------------------------------------
   17. Misc
   ------------------------------------------------------------------------- */

.image.is-rounded img { border-radius: 50%; }
.image.is-64x64 { width: 64px; height: 64px; }
.image.is-64x64 img { width: 100%; height: 100%; object-fit: cover; }

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