/* Shared theme tokens, type, reset, focus and navigation paint continuity. */
[hidden] { display: none !important; }

/* Cross-document page transition. Every existing and future page inherits it. */
@view-transition { navigation: auto; }
::view-transition-old(root),
::view-transition-new(root) { mix-blend-mode: normal; }
@media (prefers-reduced-motion: no-preference) {
  ::view-transition-old(root) { animation: page-exit 140ms ease-out both; }
  ::view-transition-new(root) { animation: page-enter 240ms cubic-bezier(.16,1,.3,1) both; }
}
@keyframes page-exit { to { opacity: 0; } }
@keyframes page-enter { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root),
  ::view-transition-new(root) { animation: none !important; }
}

/* Fallback fade for browsers without cross-document view transitions. */
body.page-leaving { opacity: 0; transition: opacity 140ms ease-out; }
@media (prefers-reduced-motion: no-preference) {
  @supports not (view-transition-name: none) {
    body:not(.page-leaving) { animation: page-enter 240ms cubic-bezier(.16,1,.3,1) both; }
  }
}
:root.theme-changing :is(body, .site-rail, .site-widgets, .profile-topnav, .profile-scene, .profile-details, .directory-popup__window, .directory-group__bar, .widget-card, .control-btn, .profile-page-footer, .intro-dialog) { transition: background-color 320ms cubic-bezier(.16,1,.3,1), color 320ms cubic-bezier(.16,1,.3,1), border-color 320ms cubic-bezier(.16,1,.3,1); }
.crt-stage__img { transition: opacity 320ms cubic-bezier(.16,1,.3,1); }
.intro-dialog { position: fixed; inset: 0; margin: 0; padding: 0; border: 0; background: var(--surface); color: var(--text); width: 100%; height: 100dvh; max-width: none; max-height: none; }
.intro-dialog::backdrop { background: transparent; }
.intro-card { min-height: 100%; padding: 32px; text-align: center; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.intro-wordmark { margin: 0; font: 900 clamp(4rem, 12vw, 8rem) 'Arial Black', Arial, sans-serif; letter-spacing: -.035em; }
.intro-wordmark span { color: #f2a93b; }
.intro-card .intro-message { color: var(--muted); font: 400 1rem var(--font-display); margin: 16px 0 0; }
.intro-dialog[open] .intro-card { animation: intro-enter 220ms cubic-bezier(.16,1,.3,1); }
@keyframes intro-enter { from { opacity: 0; } to { opacity: 1; } }
.intro-replay { border: 0; padding: 8px 0; background: transparent; color: var(--muted); font: inherit; text-decoration: underline; cursor: pointer; }
.intro-replay:hover { color: var(--accent); }

/* Optional internal navigation for content pages; links remain useful without JS. */
.page-tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--border); }
.page-tabs a { min-height: 44px; display: flex; align-items: center; padding: 10px 18px; color: var(--muted); text-decoration: none; font: 500 1.05rem var(--font-display); border: 1px solid transparent; border-bottom: 0; transition: color 180ms cubic-bezier(.16,1,.3,1); }
.page-tabs a:hover { color: var(--accent); text-decoration: underline; text-underline-offset: .2em; }
.page-tabs a[aria-selected="true"] { color: var(--accent); border-color: var(--border); background: var(--surface); }
.page-tab-panel[hidden] { display: none; }
.profile-section-copy { padding: clamp(22px, 4vw, 48px); border: 1px solid var(--border); background: var(--surface); min-height: 20rem; }
.profile-section-copy h2 { margin-top: 0; color: var(--accent); font-family: var(--font-display); }
@font-face {
  font-family: "Pixelify Sans";
  src: url("/assets/pixelify-sans.ttf") format("truetype");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #111317;
  --bg-elevated: #171a20;
  --surface: #1d2129;
  --surface-raised: #242934;
  --text: #eef1f5;
  --muted: #b1b8c4;
  --border: #6e798d;
  --border-strong: #94a0b8;
  --accent: #f2a93b;
  --accent-secondary: #a8d948;
  --focus: #ffd166;
  --stripe-bg: repeating-linear-gradient(
    -45deg,
    #252b37 0px,
    #252b37 6px,
    #1b2029 6px,
    #1b2029 12px
  );
  --group-bar-bg: #eef1f5;
  --group-bar-text: #111317;
  --checker-a: #181c23;
  --checker-b: #111317;
  --focal-x: 50%;
  --focal-y: 36%;
  --font-display: "Pixelify Sans", Verdana, sans-serif;
  --font-sans: Verdana, Tahoma, sans-serif;
  --font-mono: "Pixelify Sans", "Courier New", monospace;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: #e8e6e0;
    --bg-elevated: #dedbd3;
    --surface: #f7f5f0;
    --surface-raised: #ffffff;
    --text: #17191d;
    --muted: #4a515d;
    --border: #707887;
    --border-strong: #323741;
    --accent: #9a5400;
    --accent-secondary: #386300;
    --focus: #0f52ba;
    --stripe-bg: repeating-linear-gradient(
      -45deg,
      #d6d2c7 0px,
      #d6d2c7 6px,
      #ebe8df 6px,
      #ebe8df 12px
    );
    --group-bar-bg: #17191d;
    --group-bar-text: #f7f5f0;
    --checker-a: #dad7ce;
    --checker-b: #e8e6e0;
  }
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #e8e6e0;
  --bg-elevated: #dedbd3;
  --surface: #f7f5f0;
  --surface-raised: #ffffff;
  --text: #17191d;
  --muted: #4a515d;
  --border: #707887;
  --border-strong: #323741;
  --accent: #9a5400;
  --accent-secondary: #386300;
  --focus: #0f52ba;
  --stripe-bg: repeating-linear-gradient(
    -45deg,
    #d6d2c7 0px,
    #d6d2c7 6px,
    #ebe8df 6px,
    #ebe8df 12px
  );
  --group-bar-bg: #17191d;
  --group-bar-text: #f7f5f0;
  --checker-a: #dad7ce;
  --checker-b: #e8e6e0;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111317;
  --bg-elevated: #171a20;
  --surface: #1d2129;
  --surface-raised: #242934;
  --text: #eef1f5;
  --muted: #b1b8c4;
  --border: #6e798d;
  --border-strong: #94a0b8;
  --accent: #f2a93b;
  --accent-secondary: #a8d948;
  --focus: #ffd166;
  --stripe-bg: repeating-linear-gradient(
    -45deg,
    #252b37 0px,
    #252b37 6px,
    #1b2029 6px,
    #1b2029 12px
  );
  --group-bar-bg: #eef1f5;
  --group-bar-text: #111317;
  --checker-a: #181c23;
  --checker-b: #111317;
}

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

html {
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--bg);
  background-image:
    repeating-conic-gradient(var(--checker-a) 0% 25%, var(--checker-b) 0% 50%);
  background-size: 16px 16px;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.55;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--accent-secondary);
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 12px;
  z-index: 200;
  padding: 10px 16px;
  background: var(--surface-raised);
  color: var(--text);
  border: 2px solid var(--focus);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 700;
}

.skip-link:focus {
  top: 12px;
}

