﻿/*
Theme Name:  Microtonalia
Theme URI:   https://giovannibiancofiore.com
Author:      Giovanni Biancofiore
Author URI:  https://giovannibiancofiore.com
Description: Minimalist WordPress theme replicating the Microtonalia site — black/white palette, Inter typography, microField animation, absolute navigation with mix-blend-mode on the homepage.
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: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: microtonalia
Tags:        minimal, dark, music, one-column
*/

/* ─── Reset ────────────────────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html { font-size: 16px; }

body {
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.8;
  color: #000;
  background: #fff;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

ul, ol { list-style: none; }

/* ─── Animations ────────────────────────────────────────────────────────────── */
@keyframes microField {
  0%   { filter: brightness(1)    contrast(1);     transform: translate(0, 0); }
  25%  { filter: brightness(1.08) contrast(1.03);  transform: translate(0.8px, -1px); }
  50%  { filter: brightness(1.04) contrast(1.02);  transform: translate(-0.6px, 0.5px); }
  75%  { filter: brightness(1.07) contrast(1.025); transform: translate(0.4px, -0.3px); }
  100% { filter: brightness(1)    contrast(1);     transform: translate(0, 0); }
}

@keyframes focusFade {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── Navigation ────────────────────────────────────────────────────────────── */
.site-header {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 9999;
  pointer-events: none;
}

.back-nav,
.subtle-nav {
  position: fixed;
  top: 4rem;
  pointer-events: all;
  z-index: 10000;
}

.back-nav { left: 5rem; }
.subtle-nav { right: 5rem; }

/* WordPress wraps nav items in <ul><li> — flatten visually */
.back-nav ul,
.subtle-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.subtle-nav ul {
  display: flex;
  gap: 2.5rem;
}

.back-nav li,
.subtle-nav li {
  display: block;
}

.back-nav a,
.subtle-nav a {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: #000;
  transition: opacity 0.3s ease;
  white-space: nowrap;
}

.back-nav a:hover,
.subtle-nav a:hover { opacity: 0.5; }

/* Homepage: hide back nav; white text for difference blend */
.home .back-nav,
.front-page .back-nav { display: none; }

.home .subtle-nav a,
.front-page .subtle-nav a { color: #fff; }

.home .subtle-nav ul,
.front-page .subtle-nav ul { gap: 3.5rem; }

/* ─── Navigation, narrow screens ─────────────────────────────────────────────── */
/* MENU and X buttons: hidden from 720px up, so from 1180px up nothing changes. */
.nav-toggle,
.nav-close { display: none; }

/* 720-1179px: compact single row, nothing cut off */
@media (max-width: 1179px) {
  .back-nav { left: 1.5rem; }
  .subtle-nav { right: 1.5rem; }
  .back-nav a,
  .subtle-nav a { font-size: 0.75rem; letter-spacing: 0.2em; }
  .subtle-nav ul,
  .home .subtle-nav ul,
  .front-page .subtle-nav ul { gap: 1.25rem; }
}

/* below 720px: MENU button + full-screen white panel (assets/nav-menu.js toggles body.nav-open) */
@media (max-width: 719px) {
  .back-nav { top: 1.5rem; left: 1rem; }
  .nav-toggle,
  .nav-close {
    appearance: none;
    background: none;
    border: 0;
    margin: 0;
    padding: 0 0.5rem;
    font: inherit;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.4em;
    text-transform: uppercase;
    white-space: nowrap;
    color: #000;
    min-width: 44px;
    min-height: 44px;
    cursor: pointer;
    pointer-events: all;
    z-index: 10000;
  }
  .nav-toggle { display: block; position: fixed; top: 1rem; right: 0.5rem; }
  .home .nav-toggle,
  .front-page .nav-toggle { color: #fff; }
  .subtle-nav { display: none; }

  html.nav-open,
  body.nav-open { overflow: hidden; }
  /* the white panel must not go through the homepage "difference" blend */
  body.nav-open .site-header { mix-blend-mode: normal; }
  body.nav-open .nav-toggle { visibility: hidden; }
  body.nav-open .subtle-nav {
    display: block;
    position: fixed;
    top: 0; right: 0; bottom: 0; left: 0;
    background: #fff;
    z-index: 10001;
    overflow-y: auto;
    padding: 5rem 1.5rem 2rem;
  }
  body.nav-open .subtle-nav ul { flex-direction: column; gap: 0; }
  body.nav-open .subtle-nav a {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 0.5rem 0;
    font-size: 1rem;
    letter-spacing: 0.4em;
    color: #000;
  }
  body.nav-open .subtle-nav a[aria-current="page"] { text-decoration: underline; text-underline-offset: 0.4em; }
  body.nav-open .nav-close { display: block; position: absolute; top: 1rem; right: 0.5rem; color: #000; }
}

/* ─── Homepage hero ──────────────────────────────────────────────────────────── */
.home body,
.front-page body {
  background: #000;
  overflow: hidden;
}

/* position:fixed makes .site-header a stacking context root;
   mix-blend-mode on the root itself blends the whole header group against the video.
   Children with color:#fff produce white-difference over the dark footage. */
.home .site-header,
.front-page .site-header {
  position: fixed;
  mix-blend-mode: difference;
}

#bg-video {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  object-fit: cover;
  object-position: center center;
  z-index: 0;
}

/* Portrait phones and tablets: anchor the blurpad video to the top so the title stays below the MENU button. */
@media (max-aspect-ratio: 1/1) and (max-width: 1024px) {
  #bg-video {
    object-position: 50% 0%;
  }
}

.video-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.05);
  z-index: 1;
  pointer-events: none;
}

/* ─── General page layout ────────────────────────────────────────────────────── */
.site-main {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8rem 2rem 6rem;
}

.content-wrap {
  width: 100%;
  max-width: 800px;
}

/* ─── Logo ───────────────────────────────────────────────────────────────────── */
.micro-logo {
  width: 450px;
  max-width: 90vw;
  height: auto;
  display: block;
  margin: 0 auto 3rem;
  animation: microField 14s ease-in-out infinite;
}

/* ─── Typography ─────────────────────────────────────────────────────────────── */
.section-label {
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: #888;
  margin-bottom: 1rem;
}

.entry-title {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 2rem;
}

.entry-content {
  font-size: 1rem;
  line-height: 2;
  color: #111;
}

.entry-content p        { margin-bottom: 1.5rem; }
.entry-content p:last-child { margin-bottom: 0; }

.entry-content h2 {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin: 3rem 0 1rem;
}

.entry-content h3 {
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin: 2rem 0 0.75rem;
}

.entry-content a {
  border-bottom: 1px solid #000;
  transition: opacity 0.3s ease;
}

.entry-content a:hover { opacity: 0.5; }

/* ─── Post list (archive / blog index) ──────────────────────────────────────── */
.post-list {
  width: 100%;
  max-width: 800px;
}

.post-list-item {
  border-bottom: 1px solid #f2f2f2;
}

.post-list-item:first-child {
  border-top: 1px solid #f2f2f2;
}

.post-list-item a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 2rem;
  padding: 2.5rem 0;
  color: #000;
  transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.post-list-item a:hover { opacity: 0.5; }

.post-list-title {
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.post-list-meta {
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #888;
  white-space: nowrap;
}

/* ─── Pagination ─────────────────────────────────────────────────────────────── */
.posts-navigation,
.pagination {
  width: 100%;
  max-width: 800px;
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid #eee;
}

.posts-navigation .nav-links,
.pagination .nav-links {
  display: flex;
  justify-content: space-between;
}

.posts-navigation a,
.pagination a,
.pagination span {
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #000;
  transition: opacity 0.3s ease;
}

.posts-navigation a:hover,
.pagination a:hover { opacity: 0.5; }

.pagination .current {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #888;
}

/* ─── Section navigation ─────────────────────────────────────────────────────── */
.section-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid #eee;
  padding-top: 2rem;
  margin-top: 4rem;
  width: 100%;
  max-width: 800px;
}

.section-nav a {
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #000;
  transition: opacity 0.3s ease;
}

.section-nav a:hover { opacity: 0.5; }

/* ─── Footer ─────────────────────────────────────────────────────────────────── */
.site-footer {
  width: 100%;
  text-align: center;
  padding: 2.5rem 0 3rem;
  z-index: 10;
}

.site-footer p {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: #888;
}

.home .site-footer,
.front-page .site-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  z-index: 10;
  mix-blend-mode: difference;
  color: #fff;
}

/* ─── Layout modifiers ───────────────────────────────────────────────────────── */
.site-main--centered  { justify-content: center; }
.site-main--tight     { padding: 6rem 2rem; justify-content: center; }
.site-main--research  { padding: 12rem 0; justify-content: center; }

/* ─── Research page ──────────────────────────────────────────────────────────── */
.research-container {
  display: flex;
  width: 100%;
  max-width: 1600px;
  gap: 8rem;
  padding: 0 4rem;
  box-sizing: border-box;
}

/* narrow screens: the two columns stack (side by side they made the page 592px wide) */
@media (max-width: 759px) {
  .research-container { flex-direction: column; gap: 3rem; padding: 0 1.5rem; }
}

.research-column {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  transition:
    opacity 1s cubic-bezier(0.16, 1, 0.3, 1),
    transform 1s cubic-bezier(0.16, 1, 0.3, 1),
    filter 1s cubic-bezier(0.16, 1, 0.3, 1);
  transform-origin: left center;
}

.research-column.focused {
  opacity: 1;
  transform: scale(1.04) translateX(6px);
  filter: none;
}

.research-column.dimmed {
  opacity: 0.12;
  transform: scale(0.94) translateX(-8px);
  filter: blur(0.5px);
  pointer-events: none;
}

.research-column.focused-right {
  opacity: 1;
  transform: scale(1.04) translateX(-6px);
  filter: none;
  transform-origin: right center;
}

.research-column.dimmed-right {
  opacity: 0.12;
  transform: scale(0.94) translateX(8px);
  filter: blur(0.5px);
  pointer-events: none;
  transform-origin: left center;
}

.title-group {
  border-left: 1px solid #000;
  padding-left: 1.5rem;
  margin-bottom: 2.5rem;
}

.column-title {
  font-size: 3.5rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-weight: 400;
  margin-bottom: 0.2rem;
  line-height: 1;
  color: #000;
  transition:
    font-size 1s cubic-bezier(0.16, 1, 0.3, 1),
    letter-spacing 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.focused .column-title,
.focused-right .column-title {
  font-size: 4rem;
  letter-spacing: 0.25em;
}

.column-header {
  font-size: 0.7rem;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: #666;
  font-weight: 500;
}

/* Research column section links */
.section-link {
  display: flex;
  align-items: center;
  padding: 2.5rem 0;
  text-decoration: none;
  color: #000;
  border-bottom: 1px solid #f2f2f2;
  transition: all 0.3s ease;
  width: 100%;
}

.section-link .section-text {
  font-size: 0.75rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  font-weight: 400;
}

.section-link:hover { background: #fafafa; color: #888; }

/* Application-style links: dark hover with padding shift */
.app-links {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  max-width: 600px;
  width: 100%;
  text-align: center;
}

.app-links .section-link {
  padding: 1.5rem 2rem;
  justify-content: center;
  border-bottom: 1px solid #f0f0f0;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.app-links .section-link .section-text {
  font-size: 0.85rem;
  letter-spacing: 0.15em;
  font-weight: 500;
  transition: all 0.4s ease;
}

.app-links .section-link:hover {
  background: #000;
  color: #fff;
  padding-left: 3rem;
}

.app-links .section-link:hover .section-text { letter-spacing: 0.25em; }

.app-links .section-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1px;
  background: #fff;
  transition: width 0.6s ease;
}

.app-links .section-link:hover::after { width: 100%; }

/* ─── Simple page content (work, contact, application) ───────────────────────── */
.page-intro {
  max-width: 600px;
  width: 100%;
  text-align: center;
  line-height: 2;
  letter-spacing: 0.05em;
  font-size: 0.95rem;
  color: #111;
}

.page-intro p              { margin-bottom: 2rem; }
.page-intro p:last-child   { margin-bottom: 0; }

.contact-links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.contact-email {
  display: inline-block;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1.3;
  color: #000;
  overflow-wrap: anywhere;
  transition: opacity 0.3s ease;
}

.contact-email:hover { opacity: 0.5; }

@media (max-width: 599px) {
  .contact-email { font-size: 1rem; }
}

.contact-icons {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(5, auto);
  justify-content: center;
  column-gap: 2rem;
  row-gap: 1rem;
  margin-top: 3rem;
}

@media (min-width: 760px) {
  .contact-icons { grid-template-columns: repeat(10, auto); margin-top: 4.5rem; }
}

/* 5 columns of 44px + 4 gaps of 2rem = 348px, wider than a 320px screen: gap 1rem under 380px */
@media (max-width: 379px) {
  .contact-icons { column-gap: 1rem; }
}

/* under 340px the email must stay on one line: less letter-spacing (size and weight unchanged) */
@media (max-width: 339px) {
  .contact-email { letter-spacing: 0.05em; }
}

.contact-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0 2px;
  color: #000;
  opacity: 0.55;
  transition: opacity 0.25s ease;
}

.contact-icon:hover,
.contact-icon:focus-visible { opacity: 1; }

.contact-icon:focus-visible { outline: 1px solid #000; outline-offset: 2px; }

.contact-icon svg { display: block; width: 28px; height: 28px; }

.contact-icon-txt {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 28px;
  font-weight: 700;
  text-transform: uppercase;
  line-height: 1;
}

.contact-icon-txt--am  { font-size: 8.5px; letter-spacing: 0.06em; gap: 2px; }
.contact-icon-txt--igi { font-size: 17px; letter-spacing: -0.01em; }

/* ─── PAF / MRSE section index list ──────────────────────────────────────────── */
.section-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  text-align: left;
  max-width: 600px;
  width: 100%;
  margin-bottom: 6rem;
}

.section-list a {
  text-decoration: none;
  color: #111;
  font-size: 0.9rem;
  letter-spacing: 0.1em;
  transition: opacity 0.3s ease;
}

.section-list a:hover { opacity: 0.5; }

/* ─── Section single ─────────────────────────────────────────────────────────── */
.section-header { text-align: center; max-width: 800px; width: 100%; }

.section-series {
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: #999;
  margin-bottom: 1rem;
}

.section-heading {
  font-size: 1.4rem;
  letter-spacing: 0.1em;
  font-weight: 700;
  color: #111;
  text-transform: uppercase;
}

.section-content {
  max-width: 800px;
  width: 100%;
  text-align: left;
  line-height: 1.8;
  font-size: 1rem;
  color: #111;
  margin-top: 4rem;
  margin-bottom: 4rem;
}

.section-content p            { margin-bottom: 1.5em; }
.section-content p:last-child { margin-bottom: 0; }

/* Cross-reference links inside long-form prose: underlined so they read as links against
   the justified black-on-white text; no other link on the site is affected. */
.section-content p a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}

/* Sub-headings: same gap below as between paragraphs (p margin-bottom is 1.5em = 24px) */
.section-content h3 { margin-bottom: 1.5rem; }
/* Offset for the fixed top nav bar (.site-header::before, 7rem tall) so a heading jumped
   to via #anchor isn't tucked underneath it. */
.section-content h3[id] { scroll-margin-top: 8rem; }
/* <strong> inside h3 would compute to 900 (bolder than 700); keep it at the h3 weight */
.section-content h3 strong { font-weight: inherit; }
/* h4 sub-sub-headings (e.g. on the Sessions page): breathing room above, same gap below as h3.
   Right after an h3 the top margin is dropped so the two don't stack. */
.section-content h4 { margin: 2rem 0 1.5rem; }
.section-content h3 + h4 { margin-top: 0; }

.section-content h2 {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin: 3rem 0 1rem;
}

/* Lists in long-form content (the global reset removes bullets and numbers) */
.section-content ul,
.section-content ol {
  margin: 0 0 1.5em;
  padding-left: 1.5em;
}
.section-content ul { list-style: disc; }
.section-content ol { list-style: decimal; }
.section-content li {
  margin-bottom: 0.5em;
  text-align: justify;
  -webkit-hyphens: auto;
  hyphens: auto;
}
.section-content li:last-child { margin-bottom: 0; }

/* Author line under the paper title (Abstract): same eyebrow look as .section-series,
   tucked under the h3 and kept left-aligned (excluded from the justified prose rule). */
.section-content p.paf-author {
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: #999;
  text-align: left;
  -webkit-hyphens: manual;
  hyphens: manual;
}
.section-content h3 + p.paf-author { margin-top: -1rem; }
.section-content li > ul,
.section-content li > ol { margin: 0.5em 0 0; }

/* Download section (Sessions page): one row per language, discreet text links.
   Typography follows .subtle-nav (Inter, uppercase, wide letter-spacing) at a smaller size. */
.work-downloads {
  width: 100%;
  max-width: 800px;
  border-top: 1px solid #eee;
  padding-top: 2rem;
  margin-top: 1rem;
}
.work-downloads .section-label { margin-bottom: 1rem; }
.work-downloads-list { display: flex; flex-direction: column; }
.work-download {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem 2rem;
  padding: 1.1rem 0;
  border-bottom: 1px solid #f0f0f0;
}
.work-download:last-child { border-bottom: 0; }
.work-download-lang {
  font-size: 0.85rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #888;
}
.work-download-actions { display: flex; gap: 2rem; }
.work-downloads a,
.work-downloads .pdf-view {
  background: none;
  border: 0;
  padding: 0;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: #000;
  cursor: pointer;
  transition: opacity 0.3s ease;
}
.work-downloads a:hover,
.work-downloads .pdf-view:hover { opacity: 0.5; }
.work-downloads a:focus-visible,
.work-downloads .pdf-view:focus-visible { outline: 1px solid #000; outline-offset: 4px; }

/* ─── System page ────────────────────────────────────────────────────────────── */
.site-main--centered { justify-content: center; }

.research-question {
  font-size: 2.2rem;
  line-height: 1.4;
  max-width: 900px;
  width: 100%;
  text-align: center;
  letter-spacing: 0.02em;
  font-weight: 300;
  color: #000;
  animation: focusFade 2s ease-out forwards;
  margin-bottom: 6rem;
  padding: 0 2rem;
}

.system-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  width: 100%;
  max-width: 1200px;
  padding: 0 2rem;
  box-sizing: border-box;
}

.card-wrap {
  position: relative;
  min-height: 12rem;
}

canvas.cv {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}

.system-btn {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 1px solid #000;
  text-decoration: none;
  color: #000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #fff;
  overflow: hidden;
  opacity: 0;
  transition: background 0.5s cubic-bezier(0.19, 1, 0.22, 1),
              color 0.5s cubic-bezier(0.19, 1, 0.22, 1);
}

.system-btn:hover { background: #000; color: #fff; }

.system-btn .acronym {
  font-size: 1.5rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
  transition: opacity 0.3s ease;
}

.system-btn .full-text {
  position: absolute;
  width: 100%;
  padding: 0 1.5rem;
  box-sizing: border-box;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-weight: 500;
  opacity: 0;
  transition: opacity 0.3s ease;
  text-align: center;
  line-height: 1.4;
}

.system-btn:hover .acronym   { opacity: 0; }
.system-btn:hover .full-text { opacity: 1; }

/* ─── Accessibility ──────────────────────────────────────────────────────────── */
.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  padding: 0.5rem 1rem;
  background: #000;
  color: #fff;
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  z-index: 99999;
  transition: top 0.2s;
}

.skip-link:focus { top: 1rem; }

/* ─── Opaque text blocks over the wave background ────────────────────────────────
   #wave-bg (fixed, z-index 0) draws behind .site-main (z-index 2). Text blocks get
   a solid white background so the animated lines only show in the gaps between them.
   :where() keeps specificity at one class so existing hover rules still win.
   .system-btn is already #fff; .card-wrap is left transparent on purpose so the
   bgIn assembly animation in page-system.php still works. */
:where(.wave-wrap) .section-header,
:where(.wave-wrap) .section-content,
:where(.wave-wrap) .section-nav,
:where(.wave-wrap) .research-question,
:where(.wave-wrap) .page-intro,
:where(.wave-wrap) .section-label,
:where(.wave-wrap) .contact-links,
:where(.wave-wrap) .app-links,
:where(.wave-wrap) .content-wrap,
:where(.wave-wrap) .work-downloads,
:where(.wave-wrap) .title-group,
:where(.wave-wrap) .section-link {
  background: #ffffff;
}

/* Nav and footer on inner pages: solid white so the wave lines don't cross them. Skipped
   on the homepage, where header and footer rely on mix-blend-mode: difference over the video. */
body:not(.home):not(.front-page) .back-nav,
body:not(.home):not(.front-page) .subtle-nav,
body:not(.home):not(.front-page) .site-footer {
  background: #ffffff;
}

/* The footer is static, so its z-index is ignored and the fixed wave canvas would paint over it. */
body:not(.home):not(.front-page) .site-footer {
  position: relative;
}

/* Justified long-form prose. Short/centered text (page intros, headings, nav, cards,
   footer), .paf-part labels and the .paf-ref bibliography are left as they are. */
.section-content p:not(.paf-part):not(.paf-ref):not(.paf-author):not(.paper-line),
.entry-content p {
  text-align: justify;
  -webkit-hyphens: auto;
  hyphens: auto;
}

/* Full-width white bar behind the whole nav strip on inner pages (not only behind the
   words). .back-nav and .subtle-nav are separate fixed elements, so the bar is drawn by
   .site-header::before: fixed, z-index -1 inside the header's stacking context (z 9999),
   i.e. above page content and below the nav links (z 10000). */
body:not(.home):not(.front-page) .site-header::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 7rem;
  background: #ffffff;
  z-index: -1;
  pointer-events: auto;
}

/* ─── Return-to-text button (cross-reference trial, injected by assets/crossref-return.js) ─── */
@keyframes crossrefBackIn { from { opacity: 0; } to { opacity: 1; } }
.crossref-back {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 2rem;
  margin: 0 auto;
  width: max-content;
  z-index: 10000;
  padding: 0.7rem 1.4rem;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  white-space: nowrap;
  color: #000;
  background: #fff;
  border: 1px solid #000;
  animation: crossrefBackIn 0.6s ease both;
  transition: opacity 0.3s ease;
}
.crossref-back:hover { opacity: 0.5; }
@media (max-width: 600px) {
  .crossref-back { bottom: 1.25rem; padding: 0.6rem 1.1rem; letter-spacing: 0.2em; }
}

/* Brief background cue on the paragraph the reader left from (assets/crossref-return.js):
   the tint is switched on without a transition, then fades to transparent. No border, no movement. */
.crossref-mark { background-color: #efebdc; }
.crossref-mark.crossref-mark-out {
  background-color: transparent;
  transition: background-color 6s linear;
}

/* Title block at the top of each paper's Abstract (identical for PAF and MRSE). */
.section-content .paper-front { margin: 0 0 3rem; }
.section-content .paper-front h3 {
  font-size: 1.6rem;
  line-height: 1.25;
  margin-bottom: 1.5rem;
}
.section-content .paper-front p.paper-line {
  margin: 0 0 0.35rem;
  text-align: left;
  -webkit-hyphens: manual;
  hyphens: manual;
}
.section-content .paper-front .paper-name { font-size: 1.05rem; font-weight: 500; }
.section-content .paper-front .paper-affil,
.section-content .paper-front .paper-year { font-size: 0.95rem; color: #555; }
.section-content .paper-front .paper-site { margin-bottom: 1.25rem; }
.section-content .paper-front .paper-companion,
.section-content .paper-front .paper-cite,
.section-content .paper-front .paper-copy {
  font-size: 0.8rem;
  line-height: 1.6;
  color: #666;
}
.section-content .paper-front .paper-cite { margin-top: 0.75rem; overflow-wrap: anywhere; }
.section-content .paper-front .paper-copy { margin-top: 0.75rem; }
.section-content .paper-front a { color: inherit; border-bottom: 1px solid currentColor; }

/* Weight 600 is not usable on this site: the Inter face WordPress declares for 100-900 does not render (see HANDOFF.md, font 404), so the "semibold" items use 700.
   Paper title block, layout "A" (Abstract of PAF and MRSE): kicker, title, by-line, meta line;
   citation block ("Cite this paper") after the Keywords. Scoped so the older .paper-front
   rules above stay valid until every post uses this markup. */
.section-content .paper-front.paper-front--a { margin: 0 0 2.5rem; }
.section-content .paper-front.paper-front--a p.paper-line {
  text-align: left;
  -webkit-hyphens: manual;
  hyphens: manual;
}
.section-content .paper-front--a p.paper-kicker {
  margin: 0 0 1rem;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: #999;
}
.section-content .paper-front--a h3.paper-title {
  font-size: 40px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 1.5rem;
}
.section-content .paper-front--a p.paper-by {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 1rem;
  margin: 0 0 0.75rem;
}
.section-content .paper-front--a .paper-name { font-size: 22px; font-weight: 700; line-height: 1.3; }
.section-content .paper-front--a .paper-role { font-size: 15px; color: #6b6b6b; line-height: 1.4; }
.section-content .paper-front--a p.paper-meta {
  margin: 0;
  font-size: 13px;
  line-height: 1.7;
  color: #6b6b6b;
}
.section-content .paper-front.paper-front--a a {
  color: #555;
  border-bottom: 0;
  text-decoration: none;
}
.section-content .paper-front.paper-front--a a:hover,
.section-content .paper-front.paper-front--a a:focus-visible { text-decoration: underline; }
.section-content .paper-front--a .paper-sep { margin: 0 0.35rem; }

.section-content .paper-cite-block {
  margin: 3rem 0 0;
  padding-top: 1.25rem;
  border-top: 1px solid #dcdcdc;
}
.section-content .paper-cite-block p.paper-line { text-align: left; -webkit-hyphens: manual; hyphens: manual; }
.section-content .paper-cite-block p.paper-cite-label { margin: 0 0 0.5rem; font-size: 13px; font-weight: 700; }
.section-content .paper-cite-block p.paper-cite { margin: 0 0 0.75rem; font-size: 12px; line-height: 1.6; color: #666; overflow-wrap: anywhere; }
.section-content .paper-cite-block p.paper-copy { margin: 0; font-size: 11px; color: #888; }

@media (max-width: 600px) {
  .section-content .paper-front--a h3.paper-title { font-size: 28px; }
  .section-content .paper-front--a p.paper-by { display: block; }
  .section-content .paper-front--a .paper-name,
  .section-content .paper-front--a .paper-role { display: block; }
}

/* ── Anti-copy (deterrent only; text stays real DOM text) ───────────────────── */
html, body {
	-webkit-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
	user-select: none;
	-webkit-touch-callout: none;
}
input, textarea, [contenteditable], [contenteditable] *,
.entry-content form, .entry-content form *,
.contact-email {
	-webkit-user-select: text;
	-moz-user-select: text;
	-ms-user-select: text;
	user-select: text;
	-webkit-touch-callout: default;
}
.paper-cite, .paper-cite * {
	-webkit-user-select: text;
	-moz-user-select: text;
	-ms-user-select: text;
	user-select: text;
	-webkit-touch-callout: default;
}
