/* ══════════════════════════════════════════════════════════════════
   Onyr.net — "Prism" theme.
   Chromanaryl rainbow on a Nocturne skeleton. Cyan #47BED6 accent.
   Home is the eye-candy (rotating color-wheel logo); reading pages are
   calm with FIXED rainbow accents. One animated ribbon rides the nav.
   Fonts self-hosted (Inter + JetBrains Mono). No third-party requests.
   All motion is slow and freezes under prefers-reduced-motion.
   ══════════════════════════════════════════════════════════════════ */

/* ── Self-hosted fonts ─────────────────────────────────────────────── */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../font/Inter/InterVariable.woff2") format("woff2-variations");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../font/JetBrainsMono-2.304/JetBrainsMono-Regular.woff2") format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../font/JetBrainsMono-2.304/JetBrainsMono-Bold.woff2") format("woff2");
}

/* ── Tokens ────────────────────────────────────────────────────────── */
:root {
  color-scheme: light;
  --bg: #f6f5f0;
  --surface: #ffffff;
  --surface-2: #f1f0ea;
  --ink: #1c1740;          /* headings + body: the default title color */
  --mut: #5b5b7c;
  --div: rgba(28, 23, 64, 0.12);
  --shadow: 0 14px 34px rgba(25, 29, 54, 0.12);

  --accent: #47bed6;        /* cyan — brand fill (edited for contrast) */
  --accent-text: #0c7d96;   /* readable accent text on light bg */
  --on-accent: #04202a;     /* dark text on the accent fill */
  --edge: rgba(71, 190, 214, 0.34);
  --accent-glow: rgba(71, 190, 214, 0.30);

  --heart: #e11d48;

  /* the chromanaryl wheel — balanced, vivid; FIXED unless noted */
  --wheel: linear-gradient(90deg,
    #e11d48, #ea580c, #eab308, #16a34a, #0891b2, #2563eb, #7c3aed, #db2777, #e11d48);

  --radius: 18px;
  --radius-sm: 12px;
  --maxw: 1080px;
  --readw: 68ch;
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f1124;
  --surface: #1a1d3a;
  --surface-2: #161933;
  --ink: #edeffc;
  --mut: #9096bd;
  --div: rgba(237, 239, 252, 0.12);
  --shadow: 0 18px 44px rgba(0, 0, 0, 0.5);

  --accent: #47bed6;
  --accent-text: #6fd3e8;   /* brighter accent text on dark bg */
  --on-accent: #04202a;
  --edge: rgba(71, 190, 214, 0.32);
  --accent-glow: rgba(71, 190, 214, 0.34);

  --heart: #fb7185;

  --wheel: linear-gradient(90deg,
    #fb7185, #fb923c, #fde047, #4ade80, #22d3ee, #60a5fa, #a78bfa, #f472b6, #fb7185);
}

/* ── Base ──────────────────────────────────────────────────────────── */
* { box-sizing: border-box; }
html { font-size: 16px; scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

#general_main { flex: 1 0 auto; width: 100%; }

h1, h2, h3, h4 { line-height: 1.15; letter-spacing: -0.02em; font-weight: 700; color: var(--ink); }
p { overflow-wrap: break-word; }

.mono { font-family: var(--mono); }
.center { margin-left: auto; margin-right: auto; }
.bigger { font-size: 2.4rem; }
.curly { font-family: "Inter", cursive; font-style: italic; }

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

/* Content links: deep-teal text with a rainbow underline that sweeps in */
.prose a,
#content a:not(.a-nav):not(.no_decoration):not(.text_over):not(.btn):not(.tag-chip):not(.blog-item-link),
.footer-in a,
.see-all {
  color: var(--accent-text);
  background-image: var(--wheel);
  background-size: 0% 2px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  transition: background-size 0.2s ease;
  padding-bottom: 1px;
}
.prose a:hover,
#content a:not(.a-nav):not(.no_decoration):not(.text_over):not(.btn):not(.tag-chip):not(.blog-item-link):hover,
.footer-in a:hover,
.see-all:hover { background-size: 100% 2px; }

/* fixed rainbow hairline utility */
.rule { height: 3px; border: 0; border-radius: 3px; background: var(--wheel); }

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

/* ── Buttons ───────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  font-weight: 700; font-size: 0.95rem; padding: 11px 20px;
  border-radius: 999px; text-decoration: none; cursor: pointer; border: 0;
  transition: transform 0.14s ease, box-shadow 0.14s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: var(--on-accent); box-shadow: 0 8px 20px var(--accent-glow); }
.btn-ghost { background: color-mix(in srgb, var(--accent) 8%, transparent); color: var(--ink); border: 1px solid var(--edge); }

/* ══ Top bar: the one animated ribbon + nav ═════════════════════════ */
.topbar { position: sticky; top: 0; z-index: 100; }
.ribbon {
  height: 3px; width: 100%;
  background: var(--wheel); background-size: 220% 100%;
  animation: flow 20s linear infinite;
}
.nav {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 10px 22px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--div);
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-logo { height: 34px; width: 34px; }
.circle_bg { border-radius: 100%; }
.brand-text { font-weight: 800; font-size: 1.15rem; letter-spacing: -0.02em; color: var(--ink); }
.brand-text .dot { color: var(--accent); }
.brand-onyr { padding-right: 0.06em; }  /* so the hover gradient-clip covers the full "r" */
/* hover the brand: the "Onyr" part lights up in the chromanaryl gradient */
.brand:hover .brand-onyr {
  background: var(--wheel);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.nav-links { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.nav-link {
  font-size: 0.92rem; color: var(--mut); text-decoration: none;
  padding: 7px 13px; border-radius: 999px;
  transition: color 0.15s ease, background 0.15s ease;
}
.nav-link:hover { color: var(--ink); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.nav-link.active, .nav-link.current { color: var(--ink); background: color-mix(in srgb, var(--accent) 16%, transparent); }

#theme-toggle-button {
  display: inline-grid; place-items: center; width: 34px; height: 34px;
  border-radius: 999px; border: 1px solid var(--div); background: var(--surface);
  color: var(--ink); cursor: pointer; padding: 0; margin-left: 4px;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
#theme-toggle-button:hover { transform: translateY(-1px); border-color: var(--edge); }
#theme-toggle-button svg { width: 17px; height: 17px; fill: currentColor; }

/* ══ HOME hero ══════════════════════════════════════════════════════ */
/* Home only: a full-page chromanaryl glow behind everything — nav, hero,
   cards, and the footer — so the landing reads as the eye-candy page.
   Fixed and static; the only home motion stays the rotating logo. */
body.is-home::before {
  content: ""; position: fixed; inset: -15%; z-index: 0; pointer-events: none;
  background: conic-gradient(from 210deg, #e11d48, #ea580c, #eab308, #16a34a, #0891b2, #2563eb, #7c3aed, #db2777, #e11d48);
  filter: blur(120px); opacity: 0.16;
}
[data-theme="dark"] body.is-home::before { opacity: 0.26; }
/* Lift content above the glow; footer goes transparent so the glow shows through it. */
body.is-home #general_main,
body.is-home #general_footer { position: relative; z-index: 1; }
body.is-home #general_footer { background: transparent; }

.hero {
  max-width: var(--maxw); margin: 0 auto; width: 100%;
  padding: 54px 22px 40px;
  display: flex; align-items: center; justify-content: center; gap: 40px; flex-wrap: wrap;
  text-align: left;
}
.hero-copy { flex: 1 1 420px; min-width: 280px; }
.hero-logo { flex: 1 1 320px; display: flex; align-items: center; justify-content: center; }
.hero-kicker {
  font-family: var(--mono); font-size: 0.8rem; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--mut); margin: 0 0 12px;
}
.wordmark {
  font-size: clamp(64px, 12vw, 132px); font-weight: 800;
  line-height: 1.04; margin: 0; padding-bottom: 0.08em; width: max-content; max-width: 100%;
  background: var(--wheel);            /* FIXED — motion comes from the logo */
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
/* the ".net" suffix stays solid cyan while "Onyr" keeps the rainbow */
.wm-net { font-size: 0.5em; -webkit-text-fill-color: var(--accent); color: var(--accent); }
.hero-bar { height: 6px; width: 118px; border-radius: 4px; margin: 20px 0; background: var(--wheel); }
.hero-tag { font-size: clamp(17px, 2.2vw, 21px); color: var(--ink); opacity: 0.92; max-width: 34ch; }
.hero-tag p { margin: 0 0 0.4em; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 26px; }

/* rotating chromanaryl logo (kept from the original site) */
#front_logo_header {
  flex: 0 0 auto;
  display: grid; place-items: center;
  position: relative; z-index: 1;
  width: min(360px, 72vw); aspect-ratio: 1;
}
#front_logo_header > * { grid-area: 1 / 1; width: 100%; height: 100%; }
.main_logo_subelement { position: static; }
/* color wheel sits INSIDE the rotor rings — smaller than the full box */
#front_logo { grid-area: 1 / 1; place-self: center; width: 62%; height: 62%; display: grid; place-items: center; }
#front_logo img { width: 100%; height: 100%; object-fit: contain; border-radius: 50%; }
.logo_shape { width: 100%; height: 100%; object-fit: contain; animation: logoRotation 36s linear infinite; }
#mobile_shape_1 { will-change: transform; animation-delay: 0.6s; }
#mobile_shape_2 { animation-direction: reverse; animation-play-state: paused; }
#mobile_shape_3 { animation-duration: 20s; animation-delay: 0.5s; will-change: transform; }
#mobile_shape_4 { animation-play-state: paused; }
.stop_anim:hover { animation-play-state: paused; }
@keyframes logoRotation { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* Home: latest posts */
.home-latest { max-width: var(--maxw); margin: 0 auto; width: 100%; padding: 16px 22px 8px; }
.home-latest .head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.home-latest h2 { font-size: 1.35rem; margin: 0; }
.see-all { font-size: 0.85rem; font-weight: 600; }

.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.post-card {
  position: relative; overflow: hidden; display: block; text-decoration: none; color: inherit;
  background: var(--surface); border: 1px solid var(--div); border-radius: var(--radius);
  padding: 18px 18px 16px; box-shadow: var(--shadow);
  transition: transform 0.16s ease, border-color 0.16s ease;
}
.post-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--wheel); }
.post-card:hover { transform: translateY(-3px); border-color: var(--edge); }
.post-card .meta { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--mut); }
.post-card h3 { font-size: 1.1rem; margin: 8px 0; }
.post-card p { font-size: 0.9rem; color: var(--mut); margin: 0 0 12px; }
.post-card .read-more { font-family: var(--mono); font-size: 0.72rem; font-weight: 700; color: var(--accent-text); }

/* ══ Reading surface (#content: post, about, cv, blog, 404) ═════════ */
#content {
  box-sizing: border-box;
  width: min(100%, 780px);
  margin: 10px auto 0;
  padding: 22px 22px 0;
  position: relative;   /* anchor for cover-image posts */
}

/* Prose rhythm inside reading surfaces */
#content h1 { font-size: clamp(28px, 4.5vw, 40px); margin: 6px 0 0; }
#content > h1:first-child, .article-title { margin-top: 0; }
#content h2 { font-size: 1.5rem; margin: 2em 0 0.6em; }
#content h3 { font-size: 1.2rem; margin: 1.6em 0 0.5em; }
#content p, #content li { font-size: 1.05rem; }
#content p { margin: 0 0 1.2em; max-width: var(--readw); }
#content ul, #content ol { margin: 0 0 1.2em; padding-left: 1.4em; max-width: var(--readw); }
#content li { margin: 0.35em 0; }
#content img { max-width: 100%; height: auto; border-radius: var(--radius-sm); }
#content hr { border: 0; height: 2px; background: var(--div); margin: 2em 0; }

#content blockquote {
  margin: 1.6em 0; padding: 0.4em 0 0.4em 1.1em; color: var(--mut); font-style: italic;
  border-left: 3px solid transparent; border-image: var(--wheel) 1;
  max-width: var(--readw);
}

/* article header (post.html) */
.article-eyebrow { display: block; font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--mut); margin-bottom: 8px; }
.article-title { color: var(--ink); }               /* ink, never cyan/gradient */
.article-meta { font-family: var(--mono); font-size: 0.82rem; color: var(--mut); margin: 12px 0 0; display: flex; gap: 14px; flex-wrap: wrap; }
.article-rule { height: 4px; width: 72px; border-radius: 3px; margin: 18px 0 26px; background: var(--wheel); }
/* general-content page titles (Publications, Projects, About…) get the same rainbow separator as posts */
#content h1:not(.article-title)::after {
  content: ""; display: block; width: 72px; height: 4px; border-radius: 3px;
  margin: 18px 0 26px; background: var(--wheel);
}
.page-title { color: var(--ink); }
.title-rule { height: 4px; width: 68px; border-radius: 3px; margin: 16px 0 6px; background: var(--wheel); }

/* ── Code ──────────────────────────────────────────────────────────── */
code { font-family: var(--mono); font-size: 0.9em; }
:not(pre) > code {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--ink);
  padding: 0.12em 0.4em; border-radius: 6px;
}
pre, .highlight {
  position: relative; overflow-x: auto; margin: 0 0 1.4em;
  background: var(--surface-2); border: 1px solid var(--div); border-radius: var(--radius-sm);
}
pre { padding: 16px 18px; }
.highlight { padding: 16px 18px; }
.highlight pre { border: 0; background: transparent; margin: 0; padding: 0; }
/* single rainbow rule — only on the outermost box (no double line) */
pre::before, .highlight::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--wheel); }
.highlight pre::before { content: none; }
pre code { background: none; padding: 0; font-size: 0.85rem; line-height: 1.6; color: var(--ink); }

/* ══ BLOG filter UI (blog-filter.js hooks — do not rename) ══════════ */
.blog-filter { margin: 20px 0 8px; display: flex; flex-direction: column; gap: 14px; }
.blog-search {
  width: 100%; font: inherit; font-size: 0.95rem; color: var(--ink);
  background: var(--surface-2); border: 1px solid var(--div); border-radius: 999px;
  padding: 10px 16px;
}
.blog-search::placeholder { color: var(--mut); }
.blog-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-chip {
  font-family: var(--mono); font-size: 0.78rem; color: var(--mut); cursor: pointer;
  background: color-mix(in srgb, var(--accent) 7%, transparent);
  border: 1px solid var(--div); border-radius: 999px; padding: 5px 12px;
  transition: color 0.14s ease, border-color 0.14s ease, background 0.14s ease;
}
.tag-chip:hover { color: var(--ink); border-color: var(--edge); }
.tag-chip[aria-pressed="true"] { color: var(--on-accent); background: var(--accent); border-color: var(--accent); }
.tag-count { opacity: 0.6; }
.tag-chip--inline { text-decoration: none; padding: 2px 9px; font-size: 0.72rem; }
.blog-dates { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.blog-date-label { font-family: var(--mono); font-size: 0.78rem; color: var(--mut); display: inline-flex; align-items: center; gap: 8px; }
.blog-year, .blog-month {
  font: inherit; font-size: 0.85rem; color: var(--ink);
  background: var(--surface-2); border: 1px solid var(--div); border-radius: 10px; padding: 6px 10px;
}
.blog-clear {
  font-family: var(--mono); font-size: 0.78rem; color: var(--accent-text); cursor: pointer;
  background: none; border: 1px solid var(--edge); border-radius: 999px; padding: 6px 14px;
}
.blog-count, .blog-empty { font-family: var(--mono); font-size: 0.82rem; color: var(--mut); margin: 6px 0; }
.is-hidden { display: none !important; }

.blog-list { list-style: none; margin: 18px 0 0; padding: 0; border-top: 1px solid var(--div); }
.blog-item {
  display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 14px;
  padding: 18px 0; border-bottom: 1px solid var(--div);
}
.blog-item-link {
  font-size: 1.25rem; font-weight: 700; color: var(--ink); text-decoration: none;
  background-image: var(--wheel); background-size: 0% 2px; background-repeat: no-repeat; background-position: 0 100%;
  transition: background-size 0.2s ease; padding-bottom: 2px;
}
.blog-item-link:hover { background-size: 100% 2px; }
.blog-item-date { font-family: var(--mono); font-size: 0.8rem; color: var(--mut); }
.blog-item-tags { display: inline-flex; gap: 6px; flex-wrap: wrap; }

/* ══ ABOUT / CV extras ══════════════════════════════════════════════ */
.special-content { margin: 0.5em 0; border-radius: var(--radius-sm); padding: 1em; background: var(--surface-2); }
#content .profile-photo {
  display: block; width: 200px; height: 200px; margin: 8px auto 26px;
  border-radius: 50%; object-fit: cover;
  border: 1px solid var(--div); box-shadow: var(--shadow);
}

/* ══ Cover-image posts (simple-post layout) ════════════════════════ */
.cover-image {
  width: 100%; max-height: 520px; object-fit: cover;
  position: absolute; top: 0; left: 0; z-index: 1;
  border-top-left-radius: var(--radius); border-top-right-radius: var(--radius);
}
.post_img_title { position: relative; z-index: 10; color: #f6f5f0; }
.post_img_title h1 { font-size: clamp(32px, 6vw, 3em); line-height: 1.05; color: #fff; }
.post_img_title p { font-size: 1.2em; line-height: 1.1; }
.post_spacer { position: relative; max-width: 1200px; }

/* ══ Photos / media ═════════════════════════════════════════════════ */
.photo-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.photo-grid img { width: 100%; height: auto; object-fit: cover; border-radius: var(--radius-sm); }
#video_grotte_lourdes { width: 80vw; max-width: 1200px; height: auto; }

/* ══ Footer + beating heart ═════════════════════════════════════════ */
#general_footer { flex-shrink: 0; margin-top: 56px; border-top: 1px solid var(--div); background: var(--bg); }
#general_footer_container {
  max-width: var(--maxw); margin: 0 auto; padding: 26px 22px;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 18px;
  font-family: var(--mono); font-size: 0.82rem; color: var(--mut);
}
#general_footer_container p { margin: 0; }
.footer-nav { flex-basis: 100%; margin-bottom: 8px; }
.footer-nav a { color: var(--mut); text-decoration: none; padding: 0 2px; }
.footer-nav a:hover { color: var(--accent-text); }
.footer-icon { width: 15px; height: 15px; vertical-align: -2px; fill: currentColor; }

#heart { display: inline-block; color: var(--heart); transform-origin: center; }
.heartBeat { animation: heartBeat 1.5s ease-in-out infinite; }
@keyframes heartBeat {
  0%, 55%, 100% { transform: scale(1); }
  62% { transform: scale(1.28); }
  72% { transform: scale(1); }
  80% { transform: scale(1.16); }
  88% { transform: scale(1); }
}

/* ══ Responsive ═════════════════════════════════════════════════════ */
@media (max-width: 820px) {
  .card-grid { grid-template-columns: 1fr; }
  .hero { padding-top: 36px; }
}
@media (max-width: 560px) {
  .nav { padding: 8px 14px; }
  .brand-text { font-size: 1rem; }
}

/* ══ Motion — slow, ambient; freezes under reduced-motion ══════════ */
@keyframes flow { from { background-position: 0% 50%; } to { background-position: 220% 50%; } }

@media (prefers-reduced-motion: reduce) {
  .ribbon, .logo_shape, .heartBeat { animation: none !important; }
  html { scroll-behavior: auto; }
}
