:root{
  --bg0:#070814;
  --bg1:#0b0f2a;
  --card: rgba(255,255,255,0.06);
  --card2: rgba(255,255,255,0.085);
  --stroke: rgba(255,255,255,0.10);
  --text: rgba(255,255,255,0.92);
  --muted: rgba(255,255,255,0.68);
  --muted2: rgba(255,255,255,0.55);
  --shadow: 0 18px 60px rgba(0,0,0,0.45);
  --radius: 18px;
  --radius2: 14px;
  --maxw: 1120px;

  /* Added: readable measures + focus color */
  --measure: 70ch;     /* target line length for prose */
  --lyricsw: 60ch;     /* target line length for lyrics */
  --focus: rgba(149,92,255,0.85); /* fits your existing purple accent */
}

*{box-sizing:border-box}
html,body{height:100%}
html{color-scheme: dark}

body{
  margin:0;
  color:var(--text);
  position: relative;
  isolation: isolate;

  /* System font stack: no external font loading */
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial,
               "Apple Color Emoji","Segoe UI Emoji";

  background: var(--bg0);
}

body::before{
  /* Fixed atmosphere layer so long pages don't show gradient resets */
  content:"";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(1200px 800px at 10% 0%, rgba(149,92,255,0.22), transparent 60%),
    radial-gradient(1200px 800px at 90% 20%, rgba(0,255,209,0.11), transparent 55%),
    radial-gradient(1000px 700px at 60% 110%, rgba(255,92,168,0.10), transparent 55%),
    linear-gradient(180deg, var(--bg0), var(--bg1));
}

body::after{
  /* subtle star/noise layer */
  content:"";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.18;
  background:
    radial-gradient(2px 2px at 12% 22%, rgba(255,255,255,0.35), transparent 60%),
    radial-gradient(1px 1px at 72% 18%, rgba(255,255,255,0.25), transparent 60%),
    radial-gradient(1px 1px at 44% 78%, rgba(255,255,255,0.18), transparent 60%),
    radial-gradient(2px 2px at 88% 66%, rgba(255,255,255,0.22), transparent 60%),
    radial-gradient(1px 1px at 30% 50%, rgba(255,255,255,0.12), transparent 60%),
    radial-gradient(1px 1px at 60% 35%, rgba(255,255,255,0.10), transparent 60%);
}

/* A11y: keyboard focus (visible, consistent) */
:focus{outline:none}
:focus-visible{
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 12px;
}

/* A11y: skip link (add in HTML near top of body)
   <a class="skip-link" href="#main">Skip to content</a>
   and give your main wrapper id="main"
*/
.skip-link{
  position: absolute;
  left: 18px;
  top: 14px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255,255,255,0.92);
  color: rgba(0,0,0,0.92);
  text-decoration: none;
  transform: translateY(-150%);
  transition: transform 140ms ease;
  z-index: 9999;
}
.skip-link:focus-visible{
  transform: translateY(0);
}

/* Anchor targets shouldn't hide under sticky header */
[id]{
  scroll-margin-top: 88px;
}

/* Safety: images should never overflow their containers */
img{
  max-width: 100%;
  height: auto;
}

a{color:inherit; text-decoration:none}
a:hover{opacity:0.98}
code{
  background:rgba(255,255,255,0.08);
  padding:0.15rem 0.35rem;
  border-radius:8px
}

.container{
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 26px 18px 56px;
}

/* Header */
.site-header{
  position: sticky;
  top: 0;
  z-index: 50;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
  padding: 14px 18px;
  backdrop-filter: blur(10px);
  background: rgba(5,6,18,0.55);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.brand{
  display:flex;
  align-items:center;
  gap:10px;
  font-weight:750;
  letter-spacing:0.2px;
}
.brand-mark{
  display:inline-flex;
  width:34px; height:34px;
  align-items:center; justify-content:center;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(149,92,255,0.35), rgba(0,255,209,0.12));
  border: 1px solid rgba(255,255,255,0.14);
}
.brand-name{font-size: 0.98rem}

.nav{
  display:flex;
  gap: 14px;
}
.nav a{
  padding: 10px 10px;
  border-radius: 12px;
  color: var(--muted);
}
.nav a:hover{
  background: rgba(255,255,255,0.06);
  color: var(--text);
}

.nav-toggle{
  display:none;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 12px;
}

/* Hero */
.hero {
  grid-template-columns: 1fr !important;
}

.hero-card.hero-card-wide {
  width: 100% !important;
  max-width: none !important;
  grid-column: 1 / -1;
  flex: 1 1 auto !important;
}

.kicker{
  color: var(--muted2);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
  margin-bottom: 10px;
}

.hero h1{
  margin:0 0 12px;
  font-size: 2.05rem;
  line-height: 1.06;
  letter-spacing: 0.2px;
}

.lead{
  margin: 0 0 16px;
  color: var(--muted);
  line-height: 1.58;
  max-width: 66ch;
}

.pill-row{
  display:flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 16px;
}
.pill{
  border-radius: 999px;
  padding: 7px 10px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.05);
  color: var(--muted);
  font-size: 0.92rem;
}

.cta-row{
  display:flex;
  flex-wrap:wrap;
  gap: 10px;
  margin: 12px 0 16px;
}

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding: 11px 14px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(149,92,255,0.44), rgba(0,255,209,0.16));
  border: 1px solid rgba(255,255,255,0.14);
  color: var(--text);
  font-weight: 700;
}
.btn:hover{filter:brightness(1.05)}
.btn svg,.footer-social-link svg{width:1.1em;height:1.1em;flex-shrink:0;fill:currentColor}
.btn.ghost{
  background: rgba(255,255,255,0.06);
  font-weight: 650;
}
.btn.tiny{
  padding: 8px 11px;
  border-radius: 12px;
  font-size: 0.92rem;
}

.social-row{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}
.chip{
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.05);
  color: var(--muted);
}
.chip:hover{color:var(--text)}

.fineprint{
  margin-top: 12px;
  font-size: 0.95rem;
  max-width: 70ch;
}

/* Aside visual */
.hero-aside{
  display:flex;
  flex-direction: column;
  gap: 12px;
  align-self: start;
}

.hero-visual{
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.04);
  box-shadow: var(--shadow);
  min-height: 320px;
  display:block;
}

.hero-visual img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display:block;
  transform: scale(1.02);
  filter: saturate(1.08) contrast(1.06);
}

.hero-visual-overlay{
  position:absolute;
  inset: 0;
  display:flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 14px;
  background: linear-gradient(180deg, rgba(0,0,0,0.10), rgba(0,0,0,0.55));
}

.hero-visual-title{
  font-weight: 800;
  font-size: 1.15rem;
  margin: 6px 0 4px;
  letter-spacing: 0.2px;
}

.hero-visual-cta{
  display:flex;
  justify-content: flex-end;
}

.glass{
  border-radius: var(--radius);
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
  box-shadow: var(--shadow);
  padding: 18px;
}

.glass.compact{padding: 16px}
.glass h2{margin:0 0 10px}

.muted{color:var(--muted)}
.small{font-size:0.92rem}

/* Sections */
.section{margin-top: 28px}
.section-head{
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.section-head h2{margin:0}
.text-link{color:var(--muted)}
.text-link:hover{color:var(--text)}
.page-head{margin-top: 8px}
.page-head h1{margin:0 0 8px; font-size: 1.9rem}

/* Page typography helpers */
.prose{
  max-width: var(--measure); /* changed from 78ch for consistency/readability */
}
.prose h2{
  margin: 22px 0 10px;
}
.prose p{line-height: 1.6}
.prose li{line-height: 1.6}
.prose ol, .prose ul{padding-left: 1.25rem}

/* Keep underline for links in longform text (accessibility + scanability) */
.prose a{
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 2px;
}
.prose a:hover{opacity: 0.95}

/* Prose with decorative aside (Transparency / Method pages) */
.prose-with-aside{
  display: grid;
  grid-template-columns: minmax(0, var(--measure)) minmax(200px, 1fr);
  gap: 28px;
  align-items: start;
}
.prose-aside{
  max-width: 260px;
  justify-self: end;
  position: sticky;
  top: 88px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.04);
  box-shadow: var(--shadow);
}
.prose-aside img{
  width: 100%;
  height: auto;
  display: block;
}

/* Code blocks used on Method page */
.codebox{
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.05);
  border-radius: var(--radius2);
  padding: 14px;
  overflow:auto;
}
.codebox pre{
  margin:0;
  white-space: pre;
}
.codebox code{
  background: transparent;
  padding:0;
}

/* Grids and cards */
.grid{
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.card{
  display:block;
  border-radius: var(--radius);
  overflow:hidden;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.05);
  box-shadow: 0 14px 40px rgba(0,0,0,0.35);
  transform: translateY(0);
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}
.card:hover{
  transform: translateY(-2px);
  background: rgba(255,255,255,0.07);
  border-color: rgba(255,255,255,0.16);
}
.card-img{
  aspect-ratio: 16 / 9;
  overflow:hidden;
  background: rgba(255,255,255,0.03);
}
.card-img img{
  width:100%;
  height:100%;
  object-fit: cover;
  display:block;
}
.card-body{
  padding: 14px 14px 16px;
}
.card-title{
  font-weight: 800;
  letter-spacing: 0.1px;
  margin-bottom: 4px;
}
.card-meta{
  color: var(--muted2);
  font-size: 0.92rem;
  margin-bottom: 10px;
}
.card-text{
  font-size: 0.98rem;
  line-height: 1.5;
}

.empty{
  border-radius: var(--radius);
  border: 1px dashed rgba(255,255,255,0.18);
  padding: 18px;
  background: rgba(255,255,255,0.03);
}

/* Two-column content blocks */
.split{
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

/* Song page */
.song-flow::after{
  content: "";
  display: block;
  clear: both;
}
.song-hero{
  display:block;
  margin-top: 18px;
}
.song-hero-img{
  float: right;
  width: min(100%, 420px);
  margin: 0 0 18px 18px;
  border-radius: var(--radius);
  overflow:hidden;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.04);
  box-shadow: var(--shadow);
}

/* Avoid the cramped in-between state on medium screens */
@media (max-width: 1060px){
  .song-hero-img{
    float: none;
    width: 100%;
    max-width: 520px;
    margin: 0 0 14px;
  }
}
.song-hero-img img{
  width:100%;
  height:auto;
  display:block;
}
.song-hero-motion{
  margin-top: 16px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius2);
  background: rgba(255,255,255,0.03);
  overflow: hidden;
}
.song-hero-motion img{
  width:100%;
  height:auto;
  display:block;
}
.song-hero-body h1{margin: 0 0 8px}

/* Added: keep song body text readable without shrinking the whole column */
.song-hero-body p,
.song-hero-body ul,
.song-hero-body ol{
  max-width: var(--measure);
}
.song-copy{
  width: min(100%, var(--lyricsw));
  max-width: none;
}
.song-copy .glass,
.song-copy .lyrics,
.song-copy .empty{
  width: 100%;
  max-width: none;
}
.song-copy > h2{margin: 0 0 12px}
.song-copy .glass{margin-bottom: 16px}

.btn-row{
  display:flex;
  flex-wrap:wrap;
  gap: 10px;
  margin: 12px 0 24px;
}

/* Updated lyrics: poem-like (no monospace, calmer card feel) */
.lyrics{
  white-space: pre-wrap;
  overflow-wrap: anywhere;

  width: min(100%, var(--lyricsw));
  max-width: none;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial,
               "Apple Color Emoji","Segoe UI Emoji";
  font-size: 1.05rem;
  line-height: 1.85;

  border-radius: var(--radius2);
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.035);
  padding: 18px 18px;

  overflow: visible;
}

/* Optional: accordion styling if you use <details><summary> blocks on song pages */
details{
  margin-top: 12px;
  border-radius: var(--radius2);
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
}
summary{
  cursor: pointer;
  padding: 12px 14px;
  list-style: none;
  color: var(--text);
  font-weight: 750;
}
summary::-webkit-details-marker{display:none}
summary::after{
  content: "›";
  float: right;
  transform: rotate(90deg);
  opacity: 0.85;
}
details[open] summary::after{
  transform: rotate(-90deg);
}
details > *:not(summary){
  padding: 0 14px 14px 14px;
  color: var(--muted);
}

/* Tabs + wallpaper gallery */
.tabs{
  display:flex;
  gap: 8px;
  margin: 14px 0 12px;
  padding: 6px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
  width: fit-content;
}
.tab{
  border: 0;
  cursor: pointer;
  padding: 10px 14px;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}
.tab:hover{color: var(--text)}
.tab.active{
  background: rgba(255,255,255,0.12);
  color: var(--text);
}

.tab-panel{display:none}
.tab-panel.active{display:block}

/* Wallpaper thumbnail aspect ratios (prevents “thin strip” crops on single-column grids) */
.tab-panel[data-panel="desktop"] .wall{aspect-ratio: 16 / 9;}
.tab-panel[data-panel="mobile"] .wall{aspect-ratio: 9 / 16;}

/* On large screens, keep mobile wallpapers from becoming gigantic by limiting column width */
@media (min-width: 900px){
  .tab-panel[data-panel="mobile"] .wall-grid{
    grid-template-columns: repeat(auto-fit, minmax(220px, 320px));
    justify-content: center;
  }
}

.wall-grid{
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.wall{
  position: relative;
  display:block;
  width:100%;
  aspect-ratio: 16 / 9;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.03);
  border-radius: var(--radius2);
  overflow:hidden;
  padding: 0;
  cursor:pointer;
  text-align:left;
}
.wall:hover{border-color: rgba(255,255,255,0.18)}
.wall img{
  width:100%;
  height:100%;
  object-fit: cover;
  display:block;
}
.wall-label{
  position:absolute;
  left: 10px;
  bottom: 10px;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(0,0,0,0.55);
  border: 1px solid rgba(255,255,255,0.10);
  color: rgba(255,255,255,0.92);
  font-size: 0.92rem;
}

/* Lightbox */
[hidden]{display:none !important}

.lightbox{
  position: fixed;
  inset: 0;
  z-index: 200;
  display:flex;
  align-items:center;
  justify-content:center;
  padding: 18px;
}
.lightbox-backdrop{
  position:absolute;
  inset:0;
  background: rgba(0,0,0,0.72);
}
.lightbox-card{
  position: relative;
  z-index: 1;
  width: min(980px, 100%);
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(10,12,34,0.92);
  box-shadow: var(--shadow);
  overflow:hidden;
}
.lightbox-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
  padding: 12px 12px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.lightbox-x{
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  padding: 8px 10px;
  border-radius: 12px;
  cursor:pointer;
}
.lightbox-x:hover{background: rgba(255,255,255,0.08)}
.lightbox-img{
  width:100%;
  height: auto;
  display:block;
}

/* Footer */
.site-footer{
  margin-top: 46px;
  padding: 26px 0 36px;
  border-top: 1px solid rgba(255,255,255,0.08);
  background: rgba(5,6,18,0.35);
}
.footer-grid{
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 18px 10px;
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.footer-title{
  font-weight: 800;
  margin-bottom: 8px;
}
.site-footer p{margin: 0}
.site-footer a{
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.site-footer a:hover{color: var(--text)}
.site-footer .small{
  max-width: var(--maxw);
  margin: 12px auto 0;
  padding: 0 18px;
}

/* Reduced motion: keep things calm for users who request it */
@media (prefers-reduced-motion: reduce){
  *{
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
}

/* Responsive */
@media (max-width: 860px){
  .hero{grid-template-columns: 1fr}
  .split{grid-template-columns: 1fr}
  .song-hero{display:block}
  .song-hero-img{
    float: none;
    width: 100%;
    max-width: 520px;
    margin: 0 0 14px;
  }
  .footer-grid{grid-template-columns: 1fr}
  .prose-with-aside{grid-template-columns: 1fr}
  .prose-aside{display: none}

  .nav{
    display:none;
    position:absolute;
    top: 62px;
    right: 18px;
    flex-direction: column;
    gap: 6px;
    padding: 10px;
    border-radius: 14px;
    background: rgba(10,12,34,0.95);
    border: 1px solid rgba(255,255,255,0.12);
    box-shadow: var(--shadow);
    min-width: 190px;
  }
  .nav.open{display:flex}
  .nav a{padding: 10px 12px}
  .nav-toggle{display:inline-flex}
}
