/* v1.0 FINAL maintenance — 2026-01-14: prevent underline on icon links across pages (Safari-safe) */
/* psychoSocial — Base CSS (v1.0)
   Global tokens, resets, typography.
*/
/* v1.07.2 — Tokens moved to css/tokens.css (single source of truth).
   Keep base.css focused on resets + layout primitives.
*/

/* v1.04 a11y: screen-reader-only utility */
.srOnly{
  position:absolute !important;
  width:1px !important;
  height:1px !important;
  padding:0 !important;
  margin:-1px !important;
  overflow:hidden !important;
  clip:rect(0,0,0,0) !important;
  white-space:nowrap !important;
  border:0 !important;
}



*{ box-sizing:border-box; }

/* v1.06.6 — HTML [hidden] must be the single source of truth across the whole site.
   Some modules rely on toggling the boolean attribute, so we force it to win over
   any author display rules.
*/
:where([hidden]){ display:none !important; }

html{
  
  scrollbar-gutter: stable;
}

body{
  margin:0;
  min-height:100vh;
  overflow-y: scroll;
  /* v1.06.8 — site background artwork (test: black variants)
     Uses separate assets for portrait (mobile) vs landscape (desktop).
     Safe fallback remains the theme background color.
  */
  background-color:var(--bg);
  background-image:var(--site-bg-image, none);
  background-repeat:no-repeat;
  background-position:center top;
  background-size:cover;
  color:var(--fg);
  font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
}

/* v1.07.2 — Background asset tokens moved to css/tokens.css */

.wrap{ max-width:var(--pageW); margin:0 auto; padding:14px var(--gutter) 40px; }
.wrap.narrow{ max-width:var(--pageW-narrow); }

/* v1.07.2 — Apply header offset ONLY when the header is actually fixed (desktop).
   On mobile the header is static and already takes space in normal flow.
*/
@media (min-width: 900px){
  body.hasFixedHeader .wrap{
    padding-top: calc(14px + var(--fixedHeaderH, 0px));
  }
}

.fixedHeader{
  /* Mobile: NOT fixed (more reading space). Desktop will re-enable fixed via media query. */
  position:static;
  z-index:40;
  display:flex;
  flex-direction:column;
  align-items:stretch;
  pointer-events:none;
}

/* Desktop: keep header fixed while scrolling */
@media (min-width: 900px){
  body.hasFixedHeader .fixedHeader{
    position:fixed;
    top:0;
    left:0;
    right:0;
  }
}


.fixedHeader .topBar,
.fixedHeader .prefsBar{
  pointer-events:none;
}
.fixedHeader .topBarInner,
.fixedHeader .prefsBarInner{
  pointer-events:auto;
}


.fixedHeader .topBar,
.fixedHeader .prefsBar{ pointer-events:none; }
.fixedHeader .topBarInner,
.fixedHeader .prefsBarInner{ pointer-events:auto; }


.topBar{
  padding:10px var(--gutter) 12px;
}

.topBarInner{
  
  max-width:calc(var(--pageW) - (var(--gutter) * 2));
  width:100%;
  margin:0 auto;
  display:flex;
  align-items:center;
  justify-content:flex-start;
  gap:12px;
  padding:12px 14px;
  border-radius:26px;
  border:1px solid rgba(255,255,255,.12);
  background:rgba(0,0,0,.58);
  backdrop-filter: blur(8px);
  box-shadow:0 12px 30px rgba(0,0,0,.55);
}

.topLeft{
  display:flex;
  align-items:center;
  gap:12px;
  min-width:0;
}

.brandImg{
  height:48px;
  width:auto;
  max-width:52%;
  flex-shrink:0;
  display:block;
  object-fit:contain;
  opacity:.95;
}


.prefsInline{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:12px;
  flex-wrap:wrap;
}


body[data-page="home"] .topBarInner:not(.topBarInnerStack){
  display:flex;
  align-items:center;
  justify-content:flex-start;
}

@media (max-width:520px){
  
  body[data-page="home"] .topBarInner:not(.topBarInnerStack){
    display:flex;
    flex-wrap:wrap;
    row-gap:10px;
  }
}


@media (max-width:520px){
  .topBarInner{
    padding:10px 12px;
    border-radius:22px;
    display:grid;
    grid-template-columns: 76px 1fr;
    grid-template-rows: auto auto;
    column-gap:12px;
    row-gap:8px;
    align-items:center;
    justify-content:stretch;
  }

  
  .topLeft{ display:contents; }

  
  .topBarInner .sigilImg{
    grid-column:1;
    grid-row:1 / span 2;
    width:76px;
    height:76px;
    border-radius:18px;
  }

  
  .topBarInner .sigilBtns{
    grid-column:2;
    grid-row:1;
    justify-self:start;
    display:flex;
    gap:10px;
    flex-wrap:wrap;
  }

  
  .topBarInner .brandImg{
    grid-column:2;
    grid-row:2;
    justify-self:start;
    height:28px;
    max-width:100%;
  }

  
  body[data-page="home"] .topBarInner:not(.topBarInnerStack){
    display:grid;
    grid-template-columns:76px repeat(4, minmax(0, 1fr));
    
    grid-template-rows:48px 48px;
    column-gap:10px;
    row-gap:8px;
    align-items:center;
    justify-content:stretch;
  }

  body[data-page="home"] .topBarInner:not(.topBarInnerStack) .sigilImg{
    grid-column:1;
    grid-row:1 / span 2;
    width:76px;
    height:76px;
    border-radius:18px;
  }

  
  body[data-page="home"] .topBarInner:not(.topBarInnerStack) .sigilBtns{
    grid-column:2 / span 4;
    grid-row:1;
    display:grid;
    grid-template-columns:repeat(4, minmax(0, 1fr));
    gap:10px;
    align-items:center;
    justify-items:center;
  }

  
  body[data-page="home"] .topBarInner:not(.topBarInnerStack) .prefsInline{
    grid-column:2 / span 4;
    grid-row:2;
    display:grid;
    grid-template-columns:repeat(4, minmax(0, 1fr));
    gap:10px;
    align-items:center;
  }

  body[data-page="home"] .topBarInner:not(.topBarInnerStack) .prefsInline .themeSwitch{
    grid-column:1 / span 2;
    display:grid;
    grid-template-columns:repeat(2, 1fr);
    gap:10px;
    padding:0;
    border-radius:18px;
    height:46px;
    justify-items:center;
    align-items:center;
  }

  body[data-page="home"] .topBarInner:not(.topBarInnerStack) .prefsInline .langSwitch{
    grid-column:3 / span 2;
    display:grid;
    grid-template-columns:repeat(2, 1fr);
    gap:10px;
    padding:0;
    border-radius:18px;
    height:46px;
    justify-items:center;
    align-items:center;
  }

  
  body[data-page="home"] .topBarInner:not(.topBarInnerStack) .prefsInline .themeOpt,
  body[data-page="home"] .topBarInner:not(.topBarInnerStack) .prefsInline .langOpt{
    width:42px;
    height:42px;
    padding:0;
    border-radius:14px;
  }

  
  body[data-page="home"] .topBarInner:not(.topBarInnerStack) .sigilBtns .iconBtn{
    width:46px;
    height:46px;
    padding:0;
    border-radius:15px;
    font-size:20px;
  }

  
  body[data-page="home"] .topBarInner:not(.topBarInnerStack) .prefsInline .themeOpt,
  body[data-page="home"] .topBarInner:not(.topBarInnerStack) .prefsInline .langOpt{
    background:transparent;
    border-color:transparent;
    opacity:.72;
  }
  body[data-page="home"] .topBarInner:not(.topBarInnerStack) .prefsInline .themeOpt.isActive,
  body[data-page="home"] .topBarInner:not(.topBarInnerStack) .prefsInline .langOpt.isActive{
    opacity:1;
    border-color:rgba(255,255,255,.18);
    background:rgba(255,255,255,.10);
  }
  html[data-theme="light"] body[data-page="home"] .topBarInner:not(.topBarInnerStack) .prefsInline .themeOpt.isActive,
  html[data-theme="light"] body[data-page="home"] .topBarInner:not(.topBarInnerStack) .prefsInline .langOpt.isActive{
    border-color:rgba(0,0,0,.12);
    background:rgba(0,0,0,.06);
  }


}

.ritualTopFixed{
  margin:0;
  padding:12px 10px;
  border-top:0;
  border-bottom:1px solid rgba(0,0,0,.15);
}

.ritualTopFixed .ritualInner{
  width:100%;
  max-width:860px;
  margin:0 auto;
  padding:0 14px;
}

.sigilFixed{
  padding:10px 14px 12px;
}

.sigilFixedInner{
  max-width:860px;
  margin:0 auto;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:12px;
  padding:12px 14px;
  border-radius:26px;
  border:1px solid rgba(255,255,255,.12);
  background:rgba(0,0,0,.58);
  backdrop-filter: blur(8px);
  box-shadow:0 12px 30px rgba(0,0,0,.55);
}

@media (max-width:420px){
  .sigilFixedInner{ padding:10px 12px; border-radius:22px; }
}

.card{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:16px;
}

.btn{
  padding:12px 14px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.14);
  background:rgba(255,255,255,.08);
  color:var(--fg);
  font-size:14px;
  cursor:pointer;
  text-decoration:none;
  display:inline-flex;
  align-items:center;
  gap:8px;
}
.btn:hover{ background:rgba(255,255,255,.12); }

.mailFooter{
  margin-top:26px;
  display:flex;
  justify-content:center;
  opacity:.72;
}
.mailFooter a{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:10px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.15);
  background:rgba(255,255,255,.04);
  transition:opacity .15s ease, transform .1s ease, background .15s ease;
}


button:not(:disabled),
[role="button"],
.pageTag,
.pageTagLink,
.splashSkip{
  cursor:pointer;
}

.mailFooter a:hover{
  opacity:1;
  background:rgba(255,255,255,.08);
  transform:scale(1.05);
}
.mailFooter img{
  width:26px;
  height:26px;
  filter:invert(1) contrast(1.2);
  opacity:.9;
  display:block;
}

.nav{ display:flex; gap:10px; flex-wrap:wrap; margin-bottom:12px; }

.topbar{
  position:relative;
  display:flex;
  align-items:center;
  justify-content:flex-start;
  gap:10px;
  margin-bottom:12px;
  min-height:42px;
}

.topbarCenter{
  position:absolute;
  left:50%;
  transform:translateX(-50%);
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  flex-wrap:nowrap;
  white-space:nowrap;
  max-width:calc(100% - 80px);
}

.iconBtn{
  width:42px;
  height:42px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.14);
  background:rgba(255,255,255,.08);
  color:var(--fg);
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size:18px;
  line-height:1;
  transition:background .15s ease, transform .06s ease;
}

/* Text variant for icon-style buttons (e.g., HOME). Keeps the same look but
   allows the label to stay inside the pill without overflow. */
.iconBtn.textBtn{
  width:auto;
  padding:0 14px;
  font-size:13px;
  letter-spacing:.12em;
  text-transform:uppercase;
}
.iconBtn.textBtn{ min-width:64px; }
.iconBtn:hover{ background:rgba(255,255,255,.12); }
.iconBtn:active{ transform:scale(.99); }



html[data-theme="light"] .topBarInner,
html[data-theme="light"] .sigilFixedInner{
  border:1px solid rgba(0,0,0,.14);
  background:rgba(255,255,255,.72);
  box-shadow:0 12px 30px rgba(0,0,0,.18);
}

html[data-theme="light"] .btn,
html[data-theme="light"] .iconBtn,
html[data-theme="light"] .mailFooter a{
  border:1px solid rgba(0,0,0,.14);
  background:rgba(0,0,0,.03);
}
html[data-theme="light"] .btn:hover,
html[data-theme="light"] .iconBtn:hover,
html[data-theme="light"] .mailFooter a:hover{
  background:rgba(0,0,0,.06);
}

html[data-theme="light"] .pageTag{
  border:1px solid rgba(0,0,0,.14);
  background:rgba(0,0,0,.03);
  color:rgba(0,0,0,.82);
  box-shadow:0 0 0 1px rgba(0,0,0,.06) inset;
}
html[data-theme="light"] .pageTagAlt{
  color:rgba(0,0,0,.82);
  border-color:rgba(0,0,0,.16);
  background:rgba(0,0,0,.02);
  box-shadow:0 0 0 1px rgba(0,0,0,.05) inset;
}


html[data-theme="light"] .sectionScroller::-webkit-scrollbar-track{ background:rgba(0,0,0,.06); }
html[data-theme="light"] .sectionScroller::-webkit-scrollbar-thumb{ background:rgba(0,0,0,.18); border:2px solid rgba(255,255,255,.65); }

html[data-theme="light"] .post,
html[data-theme="light"] .resourceCard,
html[data-theme="light"] .resourceFull,
html[data-theme="light"] .media,
html[data-theme="light"] .quote{
  border-color:rgba(0,0,0,.14);
  background:rgba(255,255,255,.72);
}

html[data-theme="light"] .post:hover{ background:rgba(0,0,0,.03); }

html[data-theme="light"] .quote{ color:rgba(0,0,0,.84); }

html[data-theme="light"] .embedVideo{
  border-color:rgba(0,0,0,.14);
  background:rgba(255,255,255,.70);
  box-shadow:0 10px 24px rgba(0,0,0,.18);
}

html[data-theme="light"] .outLink{
  border-color:rgba(0,0,0,.18);
  background:rgba(255,255,255,.78);
  box-shadow:0 0 0 1px rgba(0,0,0,.06) inset, 0 10px 22px rgba(0,0,0,.18);
}
html[data-theme="light"] .outLink:hover{
  background:rgba(0,0,0,.03);
  border-color:rgba(0,0,0,.35);
}

html[data-theme="light"] .resourceToc{
  border-color:rgba(0,0,0,.12);
  background:rgba(255,255,255,.72);
}

html[data-theme="light"] .resourceList,
html[data-theme="light"] .resourceTocList{ color:var(--muted); }

html[data-theme="light"] .resourceList a,
html[data-theme="light"] .resourceTocList a{
  color:rgba(0,0,0,.84);
  border-bottom-color:rgba(0,0,0,.18);
}
html[data-theme="light"] .resourceList a:hover{
  color:rgba(0,0,0,.96);
  border-bottom-color:rgba(0,160,90,.45);
}
html[data-theme="light"] .resourceTocList a:hover{
  color:rgba(0,0,0,.96);
  border-bottom-color:rgba(0,0,0,.35);
}

html[data-theme="light"] .resourceLinks a{
  color:rgba(0,0,0,.84);
  border-bottom-color:rgba(0,0,0,.18);
}
html[data-theme="light"] .resourceLinks a:hover{
  color:rgba(0,0,0,.96);
  border-bottom-color:rgba(0,0,0,.35);
}

html[data-theme="light"] .langTab{
  border-color:rgba(0,0,0,.14);
  background:rgba(255,255,255,.70);
  color:rgba(0,0,0,.84);
}
html[data-theme="light"] .langTab:hover{ background:rgba(0,0,0,.03); }
html[data-theme="light"] .langTab.is-active{
  background:rgba(0,0,0,.05);
  border-color:rgba(0,0,0,.22);
  box-shadow:0 0 0 1px rgba(0,0,0,.06) inset;
}


.iconBtn svg{
  width:24px;
  height:24px;
  stroke:currentColor;
  fill:none;
  stroke-width:2.2;
  stroke-linecap:round;
  stroke-linejoin:round;
}



@view-transition {
  navigation: auto;
}


::view-transition-old(root),
::view-transition-new(root){
  animation-duration: 180ms;
}


*{
  scrollbar-width: thin;
  scrollbar-color: var(--accent) transparent;
}

*::-webkit-scrollbar{
  width: 8px;
  height: 8px;
}
*::-webkit-scrollbar-track{
  background: transparent;
}
*::-webkit-scrollbar-thumb{
  background-color: var(--accent);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
@supports (background: color-mix(in srgb, red, transparent)){
  *::-webkit-scrollbar-thumb{
    background-color: color-mix(in srgb, var(--accent) 65%, transparent);
  }
}


/* === Desktop refinement (v1.0 / 2026-01-14)
   Intent:
   - Keep mobile look identical (mobile-first).
   - Use extra horizontal space on desktop while preserving centered composition.
   Regression risk:
   - If a page looks “too wide” on ultra-wide screens, tune --pageW values below.
*/
@media (min-width:1100px){
  :root{
    --pageW:1080px;
    --gutter:18px;
  }
}

@media (min-width:1400px){
  :root{
    --pageW:1200px;
  }
}



/* --- Icon links: never underline (Safari/iOS safe) --- */
.iconBtn, .iconLink{ text-decoration:none; }
a.iconBtn, a.iconBtn:visited, a.iconBtn:hover, a.iconBtn:active, a.iconBtn:focus,
a.iconLink, a.iconLink:visited, a.iconLink:hover, a.iconLink:active, a.iconLink:focus{
  text-decoration:none !important;
}

/* v1.13.0-alpha3 — prefers-reduced-motion (global, CSS-only)
   Goal: keep UI identical, but reduce motion intensity when the OS asks for it.
   Strategy:
   - Keep final states (fade-in etc.) by collapsing durations to ~0.
   - Stop continuous tickers/noise explicitly.
*/
@media (prefers-reduced-motion: reduce){
  html:focus-within{ scroll-behavior:auto; }

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

  /* Continuous animations (ticker/noise) should stop completely. */
  #messageBarTrack,
  #msgTrack,
  .noise{
    animation:none !important;
    transform:none !important;
  }
}
