@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&display=swap");
@import url("https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;700&display=swap");

:root {
	--bg:#06060c;
	--fg:#f5f7ff;
	--muted:#92a1bb;
	--card:#10131b;
	--panel:#0b0e16;
	--border:#1d2333;
	--brand:#ff9248;
	--brand-alt:#6f7dff;
	--ring:#2a9df4;
	--tone-code:#2a9df4;
	--tone-game:#ff6fb7;
	--tone-art:#ffb347;
	--tone-music:#9c8cff;
	--tone-research:#ff9248;
	--tone-writing:#7dd87c;
    --font-mono: "JetBrains Mono", monospace;
    --gradient-omni: linear-gradient(90deg, var(--tone-code), var(--tone-game), var(--tone-art), var(--tone-music), var(--tone-research));

    /* Terminal Colors (Default Dark) */
    --terminal-bg: #0c0c0c;
    --terminal-header: #1a1a1a;
    --terminal-border: #333;
    --terminal-text: #ccc;
    --terminal-tab-bg: #0c0c0c;
    --terminal-tab-text: #eee;

    --grid-color: rgba(255, 255, 255, 0.03);
}

:root[data-theme="light"],
:root:not([data-theme])[data-prefers="light"] {
	--bg:#f5f5f7; /* Softer off-white background */
	--fg:#111321;
	--muted:#546072;
	--card:#ffffff;
	--panel:#f4f6ff;
	--border:#dce2f2;

    /* Darker tones for better contrast on light backgrounds */
    --tone-code:#0066cc;
	--tone-game:#d10069;
	--tone-art:#d97700;
	--tone-music:#6200ea;
	--tone-research:#cc5500;
	--tone-writing:#008000;

    /* Terminal Colors (Light Mode) */
    --terminal-bg: #ffffff;
    --terminal-header: #eef0f5;
    --terminal-border: #dce2f2;
    --terminal-text: #546072;
    --terminal-tab-bg: #ffffff;
    --terminal-tab-text: #111321;

    --grid-color: rgba(0, 0, 0, 0.04);
}

:root[data-theme="dark"] {
	--bg:#06060c;
	--fg:#f5f7ff;
	--muted:#92a1bb;
	--card:#10131b;
	--panel:#0b0e16;
	--border:#1d2333;
}

@media (prefers-color-scheme: light) {
	:root:not([data-theme]) {
		--bg:#fbfbff;
		--fg:#111321;
		--muted:#546072;
		--card:#ffffff;
		--panel:#f4f6ff;
		--border:#dce2f2;
	}
}

*{box-sizing:border-box}
html {
    overflow-x: hidden; /* Prevent horizontal scroll on mobile */
}
body{
	margin:0;
	background:var(--bg);
	background-image:
		linear-gradient(var(--grid-color) 1px, transparent 1px),
		linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
	background-size: 20px 20px;
	color:var(--fg);
	font:16px/1.6 "Space Grotesk",system-ui,-apple-system,Segoe UI,Roboto;
	min-height:100vh;
	transition:background-color .3s ease,color .3s ease;
    /* Sticky Footer Setup */
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}



.wrap{max-width:1100px;margin:auto;padding:32px 24px; flex: 1; width: 100%;}
.nav{display:flex;gap:24px;align-items:flex-end;justify-content:space-between;padding:12px 24px 0;border-bottom:1px solid var(--border);position:sticky;top:0;background:rgba(6,6,12,.9);backdrop-filter:blur(14px);z-index:10; min-height: 60px; box-sizing: border-box;}
.nav::after {
    content: "";
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--gradient-omni);
    opacity: 0.7;
}
:root[data-theme="light"] .nav,
:root:not([data-theme])[data-prefers="light"] .nav{background:rgba(251,251,255,.9)}
.nav-brand{display:flex;flex-direction:column;gap:4px; padding-bottom: 12px;}
.logo{font-family:var(--font-mono);font-weight:700;text-decoration:none;color:var(--fg);font-size:1.4rem; letter-spacing: -0.05em; line-height: 1;}
.nav-tagline{font-size:.85rem;color:var(--muted); display: block; margin-top: -2px;}
.nav-right{display:flex;align-items:flex-end;gap:16px; height: 100%;}
.menu{list-style:none;display:flex;gap:1px;padding:0;margin:0;flex-wrap:wrap;}
.menu.tabs {
    margin-bottom: -1px; /* Overlap border */
}
.menu a{
    color:var(--muted);
    text-decoration:none;
    font-weight:500;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    padding: 8px 12px 6px;
    background: rgba(255,255,255,0.02);
    border: 1px solid transparent;
    border-bottom: none;
    border-radius: 6px 6px 0 0;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.1s ease;
    position: relative;
    min-width: 100px; /* Ensure tabs have some width */
}
.menu a:hover{
    background: rgba(255,255,255,0.05);
    color: var(--fg);
}
.menu a.active {
    background: var(--panel); /* Match page background */
    color: var(--fg);
    border-color: var(--border);
    border-top-color: var(--brand); /* VS Code active tab indicator */
    border-bottom-color: var(--panel); /* Blend with page */
    z-index: 2;
}

/* LIGHT MODE TABS */
:root[data-theme="light"] .menu a,
:root:not([data-theme])[data-prefers="light"] .menu a {
    background: rgba(0,0,0,0.05);
    border-color: rgba(0,0,0,0.05);
    color: var(--muted);
}
:root[data-theme="light"] .menu a:hover,
:root:not([data-theme])[data-prefers="light"] .menu a:hover {
    background: rgba(0,0,0,0.08);
    color: var(--fg);
}
:root[data-theme="light"] .menu a.active,
:root:not([data-theme])[data-prefers="light"] .menu a.active {
    background: var(--panel);
    border-color: var(--border);
    border-bottom-color: var(--panel);
    border-top-color: var(--brand);
}

.menu a svg {
    opacity: 0.7;
    width: 14px;
    height: 14px;
}
.menu a:hover svg,
.menu a.active svg {
    opacity: 1;
    color: var(--brand);
}
.tab-close {
    margin-left: auto; /* Push to right */
    font-size: 1.2em;
    line-height: 0.8;
    opacity: 0;
    transition: opacity 0.2s;
    border-radius: 4px;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.menu a:hover .tab-close,
.menu a.active .tab-close {
    opacity: 0.7;
}
.tab-close:hover {
    background: rgba(255,255,255,0.1);
    opacity: 1 !important;
}

.theme-toggle{border:1px solid var(--border);background:var(--panel);color:var(--fg);border-radius:999px;padding:6px 12px;display:flex;align-items:center;gap:8px;cursor:pointer;font-weight:600; margin-bottom: 10px;}
.theme-toggle-track{display:flex;align-items:center;gap:6px}
.theme-toggle .icon{opacity:.8;transition:opacity .2s,transform .2s}
.theme-toggle[data-theme="light"] .icon-moon{opacity:.3}
.theme-toggle[data-theme="dark"] .icon-sun{opacity:.3}
.theme-toggle-label{font-size:.85rem}
.theme-toggle:hover{border-color:var(--brand);box-shadow:0 8px 18px rgba(0,0,0,.25)}

.icon{display:inline-flex;vertical-align:middle}
.icon + span{margin-left:6px}

.eyebrow{font-family:var(--font-mono);font-size:0.85rem;text-transform:uppercase;letter-spacing:.1em;color:var(--muted);margin:0 0 8px}
.lede{font-size:1.1rem;max-width:560px;color:var(--muted)}

.hero{display:grid;grid-template-columns:minmax(240px,300px) minmax(0,1fr);gap:32px;padding:32px 0 24px;align-items:flex-start}
.hero-left{background:var(--panel);border:1px solid var(--border);border-radius:8px;padding:24px;display:flex;flex-direction:column;gap:16px;box-shadow:0 30px 60px rgba(3,4,7,.4);align-items:center;text-align:center;}
.hero-profile h2{font-family:var(--font-mono);margin:12px 0 4px;font-size:1.8rem; letter-spacing: -0.03em;}
.hero-profile p{margin:0;color:var(--muted); line-height: 1.5;}
.hero-profile a, .hero-link a, .fold-highlights a {
    color: inherit;
    text-decoration: underline;
    text-decoration-color: var(--muted);
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
    transition: all 0.2s ease;
}
.hero-profile a:hover, .hero-link a:hover, .fold-highlights a:hover {
    color: var(--brand);
    text-decoration-color: var(--brand);
}
.hero-link{color:var(--muted);font-weight:500;font-size:.9rem;display:inline-block;margin-top:8px}

.hero-social-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  align-items: center;
}

.hero-social{display:flex;gap:12px;font-size:0; justify-content: center;}

.hero-social-divider {
  width: 40px;
  height: 2px;
  background: var(--border);
  border-radius: 2px;
}

.hero-social .multi-tone-btn {
  display: inline-flex;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: all 0.2s ease;
  
  /* Gradient Border Magic */
  border: 2px solid transparent;
  background-image: linear-gradient(var(--card), var(--card)), var(--btn-gradient);
  background-origin: border-box;
  background-clip: padding-box, border-box;
  
  /* Text Color */
  color: var(--btn-color);
  
  /* Subtle background tint based on primary color */
  box-shadow: inset 0 0 20px rgba(0,0,0,0.2); /* Inner shadow for depth */
}

.hero-social .multi-tone-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  filter: brightness(1.2);
}

.hero-social a:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  filter: brightness(1.2); /* Make it pop on hover */
}

.hero-social i {
  font-size: 1.25rem; /* approx 20px */
}
.hero-right{
  display:flex;
  flex-direction:column;
  gap:24px;
  align-items:flex-start;
}

.hero-highlights{display:flex;flex-direction:column;gap:24px;margin:16px 0 40px}
.hero-highlights > *{width:100%}



.hero-primary h1{font-size:clamp(2.2rem,5vw,3.8rem);margin:0 0 12px; line-height: 1.1;}
.hero-cta{display:flex;flex-wrap:wrap;gap:12px;margin:20px 0 16px}
.hero-tags{display:flex;flex-wrap:wrap;gap:8px;margin:16px 0 0;padding:0;list-style:none}
.hero-tags .chip{font-size:.82rem}
.hero-tags .chip svg{opacity:.9}

.chip{
	--chip-bg:rgba(255,255,255,.08);
	--chip-border:rgba(255,255,255,.25);
	--chip-color:var(--fg);
	display:inline-flex;
	align-items:center;
	gap:6px;
	padding:5px 12px;
	border-radius:4px;
	border:1px solid var(--chip-border);
	background:var(--chip-bg);
	color:var(--chip-color);
	font-weight:600;
	letter-spacing:.02em;
	text-transform:capitalize;
	transition:transform .15s ease, box-shadow .15s ease;
	backdrop-filter:blur(10px);
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 0.8rem;
}

.chip svg{width:14px;height:14px}
.chip:hover{transform:translateY(-1px);box-shadow:0 4px 12px rgba(0,0,0,.25); border-color: var(--chip-color);}
.chip[data-mode="code"]{
	--chip-bg:rgba(42,157,244,.18);
	--chip-border:rgba(42,157,244,.5);
	--chip-color:#a8dbff;
}
.chip[data-mode="game"]{
	--chip-bg:rgba(255,111,183,.18);
	--chip-border:rgba(255,111,183,.45);
	--chip-color:#ffd0e7;
}
.chip[data-mode="art"]{
	--chip-bg:rgba(255,179,71,.18);
	--chip-border:rgba(255,179,71,.5);
	--chip-color:#ffe3bf;
}
.chip[data-mode="music"]{
	--chip-bg:rgba(156,140,255,.22);
	--chip-border:rgba(156,140,255,.55);
	--chip-color:#e2dcff;
}
.chip[data-mode="research"]{
	--chip-bg:rgba(255,146,72,.2);
	--chip-border:rgba(255,146,72,.55);
	--chip-color:#ffe0cc;
}
.chip[data-mode="writing"]{
	--chip-bg:rgba(125,216,124,.22);
	--chip-border:rgba(125,216,124,.5);
	--chip-color:#edffe9;
}
.chip[data-mode="all"]{
	--chip-bg:rgba(255,255,255,.08);
	--chip-border:rgba(255,255,255,.45);
	--chip-color:var(--fg);
}
.hero-chip{font-size:.78rem;padding:5px 11px}
.hero-panel{
    background:var(--panel);
    border:1px solid var(--border);
    border-radius:6px;
    padding:24px;
    display:flex;
    flex-direction:row;
    align-items:flex-start;
    justify-content:space-between;
    gap:20px;
    box-shadow:0 40px 70px rgba(3,4,7,.45);
    position: relative;
    /* Ensure the VU meter doesn't get clipped */
    overflow: visible; 
}
.hero-panel > * { flex: 1; }

@media (max-width: 640px) {
    .hero-panel { flex-direction: column; }
}
.hero-panel::before {
    /* Terminal header bar - REMOVED for Now card */
    display: none;
}

/* Define the VU Meter Animation */
@keyframes vu-bounce {
    0% { background-size: 100% 100%, 4px 10%, 4px 15%; }
    25% { background-size: 100% 100%, 4px 60%, 4px 40%; }
    50% { background-size: 100% 100%, 4px 40%, 4px 80%; }
    75% { background-size: 100% 100%, 4px 90%, 4px 60%; }
    100% { background-size: 100% 100%, 4px 30%, 4px 40%; }
}

/* MUSIC ARTIFACT: VU Meter (FL Studio Mixer Style) */
/* DISABLED FOR NOW
.hero-panel::after {
    content: "";
    position: absolute;
    right: -16px; 
    top: 30px;
    bottom: 30px;
    width: 10px; 
    background-image: 
        repeating-linear-gradient(
            to top,
            rgba(0,0,0,0.8) 0px,
            rgba(0,0,0,0.8) 1px,
            transparent 1px,
            transparent 4px
        ),
        linear-gradient(to top, var(--tone-music) 0%, #a6e22e 60%, #f92672 100%),
        linear-gradient(to top, var(--tone-music) 0%, #a6e22e 60%, #f92672 100%);
    background-size: 100% 100%, 4px 20%, 4px 20%; 
    background-position: 0 0, 0 100%, 6px 100%; 
    background-repeat: no-repeat;
    
    border-radius: 1px;
    opacity: 0.6;
    border: 1px solid #111;
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
    
    animation: vu-bounce 1.2s infinite ease-in-out;
    transition: opacity 0.2s, filter 0.2s;
}
*/

/* INTERACTION: Hovering the panel "boosts" the signal */
/* DISABLED FOR NOW
.hero-panel:hover::after {
    opacity: 1;
    filter: brightness(1.2);
    animation-duration: 0.4s; 
}
*/
.portrait-frame{
  border-radius:8px;
  /* Removed overflow:hidden so the art handles can stick out */
  box-shadow:0 20px 40px rgba(0,0,0,0.4);
  position:relative;
  transform:none;
  transition:transform 140ms ease, box-shadow 140ms ease;
  background: var(--card);
  padding: 4px;
  border: 2px solid transparent;
  background-image: linear-gradient(var(--card), var(--card)), var(--gradient-omni);
  background-origin: border-box;
  background-clip: padding-box, border-box;
  
  /* INTERACTION: Change cursor to indicate tool usage */
  /* cursor: crosshair; */
}

/* ART ARTIFACT: Selection Handles (Like Clip Studio/Photoshop) */
/* DISABLED FOR NOW
.portrait-frame::before {
    content: "";
    position: absolute;
    inset: -8px; 
    border: 1px solid var(--tone-art);
    opacity: 0.6;
    pointer-events: none;
    border-radius: 0; 
    transition: all 0.2s ease;
}

.portrait-frame::after{
    content: "";
    position: absolute;
    inset: -11px; 
    background-image: 
        linear-gradient(var(--tone-art), var(--tone-art)), 
        linear-gradient(var(--tone-art), var(--tone-art)),
        linear-gradient(var(--tone-art), var(--tone-art)),
        linear-gradient(var(--tone-art), var(--tone-art)),
        linear-gradient(var(--tone-art), var(--tone-art)),
        linear-gradient(var(--tone-art), var(--tone-art)),
        linear-gradient(var(--tone-art), var(--tone-art)),
        linear-gradient(var(--tone-art), var(--tone-art)); 
    background-size: 6px 6px;
    background-repeat: no-repeat;
    background-position: 
        top left, top center, top right,
        center left, center right,
        bottom left, bottom center, bottom right;
    pointer-events: none;
    display: block;
    z-index: 10;
    box-shadow: inset 0 0 0 0 transparent; 
    transition: all 0.2s ease;
}
*/

/* INTERACTION: Hovering activates the "Transform Tool" */
/* DISABLED FOR NOW
.hero-left:hover .portrait-frame::before {
    opacity: 1;
    border-color: var(--fg); 
    border-style: dashed; 
}

.hero-left:hover .portrait-frame::after {
    transform: scale(1.05); 
    filter: brightness(1.5); 
}
*/

.hero-left:hover .portrait-frame{
  transform:translateY(-2px);
  box-shadow:0 25px 50px rgba(0,0,0,0.6);
}
.hero-left:hover .me-portrait-download { opacity: 1; }

.portrait-frame img{width:100%;height:100%;object-fit:cover;display:block; border-radius: 4px;}
.label{font-size:.75rem;text-transform:uppercase;letter-spacing:.18em;color:var(--muted);margin:0 0 6px}
.hero-panel .label::after {
    content: "_";
    display: inline-block;
    animation: blink 1s step-end infinite;
    color: var(--brand);
    margin-left: 4px;
}
.signal-label{display:flex;align-items:center;gap:6px}
.now-card p{margin:0 0 12px}

/* Timeline Styles */
.timeline-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.timeline-list li {
    display: flex;
    gap: 12px;
    font-size: 0.9rem;
    align-items: baseline;
    margin-bottom: 0;
}

.timeline-date {
    font-family: var(--font-mono);
    color: var(--muted);
    font-size: 0.8rem;
    min-width: 48px;
    flex-shrink: 0;
}

.timeline-link {
    color: var(--fg);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
    line-height: 1.4;
}

.timeline-link:hover {
    border-color: var(--brand);
}

.btn{
    display:inline-flex;
    align-items:center;
    gap:8px;
    border-radius:4px;
    padding:10px 18px;
    text-decoration:none;
    font-weight:600;
    font-size:.95rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    font-family: var(--font-mono);
    letter-spacing: -0.02em;
}
.btn.primary{background:var(--brand);color:#130600;border:1px solid transparent}
.btn.ghost{border:1px solid var(--border);color:var(--fg);background:transparent}
.btn.primary:hover{
    box-shadow:0 4px 12px rgba(255,146,72,.3);
    transform: translateY(-1px);
}
.btn.ghost:hover{
    border-color:var(--fg);
    transform: translateY(-1px);
}

.text-link{
    color:var(--brand);
    text-decoration:none;
    font-weight:600;
    position: relative;
    transition: color 0.2s ease;
    border-bottom: 1px solid transparent;
}
.text-link:hover{
    color: var(--fg);
    border-bottom-color: var(--brand);
}
.text-link::after {
    display: none;
}

/* Global Content Links */
.content a,
.me-page p a,
.me-page li a {
    color: inherit;
    text-decoration: underline;
    text-decoration-color: var(--muted);
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
    transition: all 0.2s ease;
}

.content a:hover,
.me-page p a:hover,
.me-page li a:hover {
    color: var(--brand);
    text-decoration-color: var(--brand);
}

.fold-card{
    margin:0;
    border:1px solid var(--border);
    border-radius:6px;
    background:var(--panel);
    box-shadow:0 40px 70px rgba(3,4,7,.45);
    padding:24px 28px;
    display:flex;
    flex-direction:column;
    gap:16px;
    position: relative;
    overflow: hidden;
}
.fold-card::before {
    /* Terminal header bar - Moved here */
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-omni);
    opacity: 1;
}
.fold-card-header{display:flex;flex-wrap:wrap;gap:18px;align-items:flex-start;justify-content:space-between}
.fold-card-header > div{flex:1 1 260px}
.fold-highlights{list-style:none;margin:0;padding:0;display:flex;flex-wrap:wrap;gap:18px}
.fold-highlights li{display:flex;flex-direction:column;gap:2px;min-width:180px}
.fold-highlights strong{font-size:1rem}
.fold-tagline{margin:0;color:var(--muted)}

.signal{margin:32px 0}
.signal-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:18px}
.signal-card{
    background:var(--card);
    border:1px solid var(--border);
    border-radius:6px;
    padding:20px;
    display:flex;
    flex-direction:column;
    gap:12px;
    min-height:200px;
    position:relative;
    overflow:hidden;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}
.signal-card::before {
    display: none;
}
.signal-card:nth-child(even)::before {
    display: none;
}
.signal-card::after{content:"";position:absolute;inset:0;border-radius:inherit;pointer-events:none;border:1px solid transparent}
.signal-card[data-tone="code"]::after{border-color:rgba(42,157,244,.35)}
.signal-card[data-tone="music"]::after{border-color:rgba(111,125,255,.35)}
.signal-card[data-tone="research"]::after{border-color:rgba(255,146,72,.35)}
.signal-link{display:flex;align-items:center;justify-content:space-between;text-decoration:none;color:var(--fg);font-weight:600;font-size:1.05rem}
.signal-link span:last-child{font-size:1.3rem}
.signal-summary{margin:0;color:var(--muted)}
.about-block{display:grid;grid-template-columns:repeat(auto-fit,minmax(280px,1fr));gap:28px;margin:48px 0;background:var(--panel);border:1px solid var(--border);border-radius:24px;padding:32px;box-shadow:0 35px 60px rgba(3,4,7,.35)}
.about-copy p{margin:0 0 12px}
.about-actions{display:flex;flex-wrap:wrap;gap:12px;margin-top:12px}
.about-facts{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:12px}
.fact-label{display:block;font-size:.75rem;color:var(--muted);letter-spacing:.1em;text-transform:uppercase;margin-bottom:4px}

.focus{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:20px;margin:40px 0}
.focus-column{background:var(--panel);border:1px solid var(--border);border-radius:20px;padding:20px;display:flex;flex-direction:column;gap:12px}
.focus-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:16px}
.focus-list li{display:flex;justify-content:space-between;gap:12px;border-bottom:1px solid var(--border);padding-bottom:12px}
.focus-list li:last-child{border-bottom:none;padding-bottom:0}
.plain-list{margin:0;padding-left:18px;color:var(--muted);display:flex;flex-direction:column;gap:8px}
.pill-links{display:flex;flex-wrap:wrap;gap:8px}
.pill-links .multi-tone-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 16px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s ease;
  gap: 6px;
  
  /* Gradient Border Magic */
  border: 2px solid transparent;
  background-image: linear-gradient(var(--card), var(--card)), var(--btn-gradient);
  background-origin: border-box;
  background-clip: padding-box, border-box;
  
  /* Text Color */
  color: var(--btn-color);
  
  /* Subtle background tint */
  box-shadow: inset 0 0 20px rgba(0,0,0,0.1);
}

.pill-links .multi-tone-pill:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  filter: brightness(1.1);
}

.skills-board{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:20px;margin:32px 0;background:var(--card);border:1px solid var(--border);border-radius:20px;padding:24px}
.pill-list{list-style:none;margin:0;padding:0;display:flex;flex-wrap:wrap;gap:10px}
.pill-list li{border:1px solid var(--border);border-radius:999px;padding:6px 12px;color:var(--muted);font-size:.9rem}

/* Skills Grid */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  margin-top: 1.5rem;
}

.skill-category h3 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 1rem;
}

.skill-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.skill-list li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1rem;
  color: var(--fg);
}

.skill-list li i {
  font-size: 1.2rem;
  width: 24px; /* Fixed width for alignment */
  text-align: center;
  color: var(--brand); /* Icon color */
}

/* Timeline Grid */
.timeline-grid {
  display: grid;
  grid-template-columns: 1fr 1fr; /* Two equal columns */
  gap: 4rem; /* Nice wide gap between them */
  margin-top: 2rem;
}

@media (max-width: 768px) {
  .timeline-grid {
    grid-template-columns: 1fr; /* Stack on mobile */
    gap: 3rem;
  }
}

.timeline-header {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 1.5rem;
  padding-left: 2rem; /* Align with content text */
}

.timeline-list {
  list-style: none;
  padding: 0;
  margin: 0;
  position: relative;
  border-left: 2px solid var(--border); /* The vertical line */
  margin-left: 0.5rem; /* Offset from container edge */
}

.timeline-item {
  position: relative;
  padding-left: 2rem; /* Space for the marker */
  margin-bottom: 2.5rem;
}

.timeline-item:last-child {
  margin-bottom: 0;
}

.timeline-marker {
  position: absolute;
  left: -5px; /* Center on the 2px line (1px center - 6px radius = -5px) */
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--bg); /* Cutout effect */
  border: 2px solid var(--muted);
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.timeline-item:hover .timeline-marker {
  background: var(--brand);
  border-color: var(--brand);
  transform: scale(1.2);
}

/* Color coding */
.timeline-item.type-Experience .timeline-marker { border-color: var(--tone-research); }
.timeline-item.type-Education .timeline-marker { border-color: var(--tone-code); }

.timeline-content h4 {
  margin: 0 0 0.25rem 0;
  font-size: 1.1rem;
  color: var(--fg);
}

.timeline-content .subtitle {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
  font-family: var(--font-mono);
}

.timeline-content .details {
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--fg);
  opacity: 0.8;
  margin: 0;
}

.me-page{display:flex;flex-direction:column;gap:32px}
.me-hero{background:var(--panel);border:1px solid var(--border);border-radius:28px;padding:32px;box-shadow:0 30px 60px rgba(3,4,7,.35)}

/* Me Hero: Portrait floated in the hero card */
.me-portrait-wrap {
  float: right;
  margin: 0 0 1rem 1.5rem;
}
@media (max-width: 768px) {
  .me-portrait-wrap {
    float: none;
    display: flex;
    justify-content: center;
    margin: 0 0 1.5rem 0;
  }
  .me-portrait-download { opacity: 0.7; }
  .me-portrait-download::after { display: none; }
}

.me-portrait-frame {
  position: relative;
  width: 180px;
  border-radius: 8px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  background: var(--card);
  padding: 4px;
  border: 2px solid transparent;
  background-image: linear-gradient(var(--card), var(--card)), var(--gradient-omni);
  background-origin: border-box;
  background-clip: padding-box, border-box;
  transition: transform 140ms ease, box-shadow 140ms ease;
}
.me-portrait-frame img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 4px;
}
.me-portrait-frame:hover {
  transform: translateY(-2px);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.6);
}

/* Download icon overlay on portrait */
.me-portrait-download {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.65);
  color: var(--fg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  text-decoration: none;
  opacity: 0;
  transition: opacity 0.2s ease, background 0.2s ease;
  backdrop-filter: blur(4px);
  z-index: 2;
}
.me-portrait-frame:hover .me-portrait-download { opacity: 1; }
.me-portrait-download:hover {
  background: var(--brand);
  color: var(--bg);
}
/* Tooltip */
.me-portrait-download::after {
  content: 'Download source (CSP) · CC0';
  position: absolute;
  right: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%);
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 4px 8px;
  border-radius: 4px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.me-portrait-download:hover::after { opacity: 1; }

/* Divider between professional and personal halves */
.me-divider {
  border: none;
  height: 1px;
  background: var(--gradient-omni);
  opacity: 0.5;
  margin: 0.5rem 0;
}

.me-meta{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:12px;margin:20px 0}
.me-section{background:var(--card);border:1px solid var(--border);border-radius:20px;padding:24px;box-shadow:0 16px 35px rgba(3,4,7,.25)}
.section-header{display:flex;flex-direction:column;gap:4px;margin-bottom:16px}
.me-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:16px}
.me-card{border:1px solid var(--border);border-radius:18px;padding:16px;background:var(--panel);display:flex;flex-direction:column;gap:8px}
.me-story{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:24px}
.story-copy p{margin:0 0 12px}
.me-details summary{cursor:pointer;font-weight:600;color:var(--brand);margin-bottom:8px}
.me-details summary::marker{display:none}
.me-details[open] summary{color:var(--fg)}
.story-side h3{margin:0 0 8px}
.story-side .pill-list{margin-bottom:16px}
.me-callouts{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:16px}
.callout{border:1px solid var(--border);border-radius:18px;padding:18px;background:var(--panel)}
.callout h3{margin:0 0 6px}
.me-timeline .timeline-rail{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:18px;position:relative}
.timeline-item{display:flex;gap:16px;align-items:flex-start}
.timeline-dot{width:14px;height:14px;border-radius:50%;background:var(--brand);margin-top:6px;border:2px solid var(--border)}
.timeline-item[data-kind="education"] .timeline-dot{background:var(--brand-alt)}
.timeline-kind{margin:0;font-size:.8rem;color:var(--muted);text-transform:uppercase;letter-spacing:.15em}
.timeline-item strong{display:block;margin:2px 0}
.timeline-item span{display:block;font-size:.9rem;color:var(--muted)}
.timeline-subtitle p { margin: 0; display: inline; }
.timeline-item p{margin:6px 0 0;color:var(--muted)}

.feed{margin:48px 0 24px}
.feed-header{display:flex;flex-wrap:wrap;justify-content:space-between;gap:16px;margin-bottom:20px}
.feed-header h2{margin:0 0 8px;font-size:1.9rem}
.muted{color:var(--muted);margin:0}

.modes{display:flex;gap:10px;flex-wrap:wrap;margin-top:12px}
.mode{border:none;background:none;padding:0;font:inherit;color:inherit;cursor:pointer}
.mode.chip{border:1px solid var(--chip-border);background:var(--chip-bg);color:var(--chip-color);padding:5px 12px}
.mode:focus-visible{outline:2px solid var(--ring);outline-offset:4px}
.mode.active{transform:translateY(-1px);box-shadow:0 14px 30px rgba(0,0,0,.35)}

.grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:16px}
.card{
	--card-border-start:var(--border);
	--card-border-end:var(--border);
	position:relative;
	border-radius:6px;
	background:var(--card);
	transition:transform .14s ease,box-shadow .14s ease;
	box-shadow:0 10px 25px rgba(4,5,8,.35);
	border:2px solid transparent;
	background-image:
		linear-gradient(var(--card),var(--card)),
		linear-gradient(130deg,var(--card-border-start),var(--card-border-end));
	background-origin:border-box;
	background-clip:padding-box,border-box;
}
.card:nth-child(3n+1) { transform: none; }
.card:nth-child(3n+2) { transform: none; }
.card:hover{transform:translateY(-4px);box-shadow:0 18px 35px rgba(4,5,8,.5); z-index: 5;}
.card-cover{width:100%;height:160px;object-fit:contain;display:block;background:var(--panel);padding:8px}
.card-cover.is-placeholder{object-fit:cover;filter:saturate(0.8) brightness(1.1)}
.card-link:not(:has(.card-cover))::before{
	content:"";
	width:100%;
	height:160px;
	display:block;
	background:linear-gradient(135deg,rgba(42,157,244,.15),rgba(255,146,72,.15));
	border-bottom:1px solid var(--border);
}
.card-body{padding:16px 18px}
.card-kicker{font-size:12px;color:var(--muted);letter-spacing:.15em;text-transform:uppercase;display:flex;align-items:center;gap:6px}
.card-kicker .icon{stroke-width:2.2}
.card-link{position:relative;color:inherit;text-decoration:none;display:flex;flex-direction:column;height:100%;background:var(--card);border-radius:inherit;overflow:hidden}
.card-title{margin:6px 0 10px}
.summary{margin:0 0 10px;color:var(--muted)}
.card-tags{display:flex;flex-wrap:wrap;gap:8px;margin:6px 0 10px}
.meta{font-size:12px;color:var(--muted)}

.footer-container {
    margin-top:64px;
    max-width: 1100px; 
    margin-left: auto; 
    margin-right: auto; 
    padding: 0 24px 32px;
}

.terminal-footer {
    background: var(--terminal-bg);
    border: 1px solid var(--terminal-border);
    border-radius: 6px;
    overflow: hidden;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    width: 100%;
}

.terminal-header {
    background: var(--terminal-header);
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--terminal-border);
    height: 32px;
    width: 100%;
}

.terminal-tab {
    background: var(--terminal-tab-bg);
    height: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 16px;
    border-right: 1px solid var(--terminal-border);
    font-size: 0.75rem;
    color: var(--terminal-tab-text);
}

.terminal-icon {
    color: var(--brand);
    font-weight: bold;
}

.terminal-controls {
    display: flex;
    height: 100%;
}

.control {
    width: 46px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    font-size: 0.9rem;
    cursor: default;
    transition: background 0.1s;
}
.control:hover { background: var(--terminal-header); filter: brightness(0.9); }
.control.close:hover { background: #e81123; color: white; }

.terminal-body {
    padding: 12px 16px;
    color: var(--terminal-text);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.terminal-line {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.prompt {
    color: var(--tone-writing);
}

.cmd {
    color: var(--fg);
}

.terminal-output {
    color: var(--muted);
    margin-bottom: 6px;
    line-height: 1.4;
    white-space: pre-wrap;
}

.social-output {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.terminal-link {
    color: var(--muted); /* Default color */
    text-decoration: none;
    transition: color 0.2s ease;
}
.terminal-link i {
    margin-right: 4px;
}
.terminal-link:hover {
    text-decoration: underline;
}
/* Terminal Link Color Coding (Always Visible) */
.terminal-link[data-tone="code"] { color: var(--tone-code); }
.terminal-link[data-tone="game"] { color: var(--tone-game); }
.terminal-link[data-tone="art"] { color: var(--tone-art); }
.terminal-link[data-tone="music"] { color: var(--tone-music); }
.terminal-link[data-tone="research"] { color: var(--tone-research); }
.terminal-link[data-tone="writing"] { color: var(--tone-writing); }

.cursor {
    display: inline-block;
    width: 8px;
    height: 1.2em;
    background: var(--muted);
    animation: blink 1s step-end infinite;
    vertical-align: middle;
}

.cmd-input {
    outline: none;
    border: none;
    background: transparent;
    color: var(--fg);
    min-width: 10px;
    display: inline-block;
    font-family: inherit;
    font-size: inherit;
}

.active-input {
    display: flex;
    align-items: center;
    gap: 8px;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}
/* PAGE GADGETS (Single View) */

.single-header {
    position: relative;
    /* Ensure gadgets are contained */
}

.page-gadgets {
    position: absolute;
    inset: -16px; /* Extend slightly outside the header content */
    pointer-events: none;
    z-index: 10;
    /* overflow: hidden;  <-- REMOVED to allow tabs to pop out top */
    border-radius: 8px;
}

/* 1. PAGE CODE: Line Numbers (Left Side of Header) */
.gadget-code-page {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 32px;
    border-right: 1px solid rgba(42,157,244,0.15);
    background: linear-gradient(to right, rgba(42,157,244,0.02), transparent);
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
    overflow: hidden; /* Keep the gradient inside the radius */
}
.gadget-code-page::before {
    content: "01\A 02\A 03\A 04\A 05\A 06\A 07\A 08\A 09\A 10";
    white-space: pre;
    position: absolute;
    top: 24px;
    left: 6px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    line-height: 1.8rem;
    color: var(--tone-code);
    opacity: 0.4;
}
/* Shift header content if code gadget is present */
.single[data-modes*="code"] .single-header h1,
.single[data-modes*="code"] .single-header .meta,
.single[data-modes*="code"] .single-header .hero-wrapper {
    padding-left: 40px;
}


/* 2. PAGE GAME: Transform (Top Right) */
.gadget-game-page {
    position: absolute;
    top: 16px;
    right: 16px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--tone-game);
    opacity: 0.8;
    background: rgba(0,0,0,0.6);
    padding: 6px 12px;
    border-radius: 4px;
    border: 1px solid rgba(255,111,183,0.4);
    display: flex;
    gap: 8px;
    backdrop-filter: blur(4px);
}
.gadget-game-page::before {
    content: "GAME_OBJECT";
    opacity: 0.7;
    font-weight: 600;
}
.gadget-game-page::after {
    content: "Active";
    color: #84c758;
}


/* 3. PAGE MUSIC: VU Meter (Bottom Right of Header) */
.gadget-music-page {
    position: absolute;
    bottom: 24px;
    right: 24px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: flex-end;
    gap: 3px;
    animation: eq-bounce 1.2s infinite ease-in-out alternate;
}
.gadget-music-page {
    background-image: 
        linear-gradient(to top, var(--tone-music) 0%, var(--tone-music) 100%),
        linear-gradient(to top, var(--tone-music) 0%, var(--tone-music) 100%),
        linear-gradient(to top, var(--tone-music) 0%, var(--tone-music) 100%),
        linear-gradient(to top, var(--tone-music) 0%, var(--tone-music) 100%);
    background-size: 4px 40%, 4px 70%, 4px 30%, 4px 60%;
    background-repeat: no-repeat;
    background-position: 0 bottom, 6px bottom, 12px bottom, 18px bottom;
}


/* 4. PAGE ART: Selection Outline (Around Header/Hero) */
.gadget-art-page {
    position: absolute;
    inset: 0;
    border: 2px dashed var(--tone-art);
    opacity: 0.5;
    border-radius: 8px;
    pointer-events: none;
}
.gadget-art-page::before, .gadget-art-page::after {
    content: "";
    position: absolute;
    width: 8px;
    height: 8px;
    background: var(--tone-art);
    border: 1px solid #000;
}
.gadget-art-page::before { top: -4px; left: -4px; }
.gadget-art-page::after { bottom: -4px; right: -4px; }


/* 5. PAGE RESEARCH: Figure Caption (Top Left) */
.gadget-research-page {
    position: absolute;
    top: 0; /* Move to very top */
    left: 0;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--tone-research);
    background: rgba(0,0,0,0.7);
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid rgba(255,146,72,0.3);
    backdrop-filter: blur(4px);
    letter-spacing: 0.05em;
    font-weight: 600;
    transform: translateY(-120%); /* Move completely above the header content */
}
.gadget-research-page::before {
    content: "FIG. 1.0";
}
/* Shift if code is present */
.single[data-modes*="code"] .gadget-research-page {
    left: 40px;
}
/* Add padding to header to accommodate the gadget above */
.single[data-modes*="research"] .single-header {
    margin-top: 32px;
}


/* 6. PAGE WRITING: Blinking Cursor (Top Left) */
.gadget-writing-page {
    position: absolute;
    top: 100px; /* Lift slightly above the border */
    left: 0;
    font-family: var(--font-mono);
    font-size: 1.4rem; 
    color: var(--tone-writing);
    font-weight: bold;
    text-shadow: 0 0 8px var(--tone-writing);
    animation: blink 1s step-end infinite;
    transform: translateY(-100%); /* Move above header */
    line-height: 1;
}
.gadget-writing-page::before {
    content: "█"; /* Block cursor is more visible than underscore */
}
.single[data-modes*="code"] .gadget-writing-page {
    left: 40px;
}
.single[data-modes*="research"] .gadget-writing-page {
    left: 90px; /* Move to the right of the research tag */
    top: 4px; /* Align visually */
    font-size: 1rem;
    transform: translateY(-120%);
}
/* Add padding if writing is present but research is not */
.single[data-modes*="writing"]:not([data-modes*="research"]) .single-header {
    margin-top: 32px;
}


.single .hero{max-height:420px;object-fit:cover}


.page-header{margin:8px 0 16px}
.tags{opacity:.9}

@media (max-width:900px){
	.nav{flex-direction:column;align-items:flex-start;gap:12px}
	.nav-right{width:100%;justify-content:space-between;flex-wrap:wrap}
	.hero{grid-template-columns:1fr}
	.hero-left{order:2;text-align:center;align-items:center}
	.hero-social{justify-content:center}
	.hero-right{grid-template-columns:1fr}
}

@media (max-width:640px){
	.hero{padding:8px 0}
	.hero-panel{padding:20px}
	.feed-header{flex-direction:column}
}

/* SUBTLE HINTS & DECORATIONS (MODULAR GADGETS) */

/* Container for gadgets to ensure they stay inside the card */
.card, .signal-card {
    position: relative;
    /* Ensure gadgets don't overflow if we don't want them to */
    overflow: hidden; 
}

.card-gadgets {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 10;
}

/* 1. CODE GADGET: Line Numbers (Left Gutter - Body Only) */
.gadget-code {
    position: absolute;
    left: 12px;
    top: 176px; /* Start below image (160px) + padding (16px) */
    bottom: 16px;
    width: 24px;
    border-right: 1px solid rgba(42,157,244,0.15);
    z-index: 20;
}
.gadget-code::before {
    content: "01\A 02\A 03\A 04\A 05\A 06";
    white-space: pre;
    position: absolute;
    top: 0;
    left: 0;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    line-height: 1.6rem;
    color: var(--tone-code);
    opacity: 0.5;
}
/* Adjust card padding when code gadget is present */
.card:has(.gadget-code) .card-body,
.signal-card:has(.gadget-code) {
    padding-left: 42px;
}
/* Fallback for browsers not supporting :has */
.card[data-modes*="code"] .card-body,
.signal-card[data-tone="code"] {
    padding-left: 42px;
}


/* 2. GAME GADGET: Transform Component (Top Right) */
.gadget-game {
    position: absolute;
    top: 12px;
    right: 12px;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--tone-game);
    opacity: 0.9;
    background: rgba(0,0,0,0.6);
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid rgba(255,111,183,0.4);
    display: flex;
    gap: 6px;
    backdrop-filter: blur(4px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.gadget-game::before {
    content: "TRNSFRM";
    opacity: 0.7;
    margin-right: 2px;
    font-weight: 600;
}
.gadget-game::after {
    content: "X:0 Y:0 Z:0";
}


/* 3. MUSIC GADGET: VU Meter (Bottom Right) */
@keyframes eq-bounce {
    0% { background-size: 4px 20%, 4px 90%, 4px 50%; }
    50% { background-size: 4px 60%, 4px 40%, 4px 80%; }
    100% { background-size: 4px 90%, 4px 30%, 4px 60%; }
}

.gadget-music {
    position: absolute;
    bottom: 16px;
    right: 16px;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: flex-end;
    gap: 2px;
    /* Animation applied directly, not just on hover */
    animation: eq-bounce 1.2s infinite ease-in-out alternate;
}
.gadget-music {
    background-image: 
        linear-gradient(to top, var(--tone-music) 0%, var(--tone-music) 100%),
        linear-gradient(to top, var(--tone-music) 0%, var(--tone-music) 100%),
        linear-gradient(to top, var(--tone-music) 0%, var(--tone-music) 100%);
    background-size: 4px 40%, 4px 70%, 4px 30%;
    background-repeat: no-repeat;
    background-position: 0 bottom, 6px bottom, 12px bottom;
}
/* Make it faster on hover */
.card:hover .gadget-music,
.signal-card:hover .gadget-music {
    animation-duration: 0.4s;
}


/* 4. ART GADGET: Selection Outline (Visible) */
.gadget-art {
    position: absolute;
    inset: 8px;
    border: 2px dashed var(--tone-art);
    opacity: 0.6;
    border-radius: 2px;
    pointer-events: none;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.2);
}
/* Corner Handles */
.gadget-art::before, .gadget-art::after {
    content: "";
    position: absolute;
    width: 6px;
    height: 6px;
    background: var(--tone-art);
    border: 1px solid #000;
}
.gadget-art::before {
    top: -4px;
    left: -4px;
    box-shadow: calc(100% + 8px + 100% + 200px) 0 0 0 var(--tone-art); /* Hacky way to get other corners? No, let's just do 2 corners */
}
.gadget-art::after {
    bottom: -4px;
    right: -4px;
}
/* Add the other two corners using box-shadow on the before element? 
   Actually, let's just use a background image for corners to be cleaner */
.gadget-art {
    background-image: 
        linear-gradient(var(--tone-art), var(--tone-art)),
        linear-gradient(var(--tone-art), var(--tone-art)), 
        linear-gradient(var(--tone-art), var(--tone-art)), 
        linear-gradient(var(--tone-art), var(--tone-art)); 
    background-position: top left, top right, bottom left, bottom right;
    background-size: 6px 6px;
    background-repeat: no-repeat;
}


/* 5. RESEARCH GADGET: Figure Caption (Top Left) */
.gadget-research {
    position: absolute;
    top: 12px;
    left: 12px;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--tone-research);
    background: rgba(0,0,0,0.7);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid rgba(255,146,72,0.3);
    backdrop-filter: blur(4px);
    letter-spacing: 0.05em;
    font-weight: 600;
}
.gadget-research::before {
    content: "FIG. 1";
}

.label{font-size:.75rem;text-transform:uppercase;letter-spacing:.18em;color:var(--muted);margin:0 0 6px}
.hero-panel .label::after {
    content: "_";
    display: inline-block;
    animation: blink 1s step-end infinite;
    color: var(--brand);
    margin-left: 4px;
}

/* 6. WRITING GADGET: Blinking Cursor (On Title) */
.gadget-writing {
    display: none; /* Hide the absolute gadget */
}

/* Apply cursor directly to the title for writing cards */
.card[data-modes*="writing"] .card-title::after {
    content: "_";
    display: inline-block;
    animation: blink 1s step-end infinite;
    color: var(--tone-writing);
    margin-left: 4px;
    font-weight: bold;
    text-shadow: 0 0 8px var(--tone-writing);
}





/* LIGHT MODE GADGET OVERRIDES */
:root[data-theme="light"] .gadget-game,
:root[data-theme="light"] .gadget-game-page,
:root[data-theme="light"] .gadget-research,
:root[data-theme="light"] .gadget-research-page {
    background: rgba(255,255,255,0.9);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

:root[data-theme="light"] .gadget-code::before,
:root[data-theme="light"] .gadget-code-page::before {
    opacity: 0.9;
    font-weight: 600;
}

:root[data-theme="light"] .gadget-art,
:root[data-theme="light"] .gadget-art-page {
    opacity: 0.8;
    border-width: 2px;
}

@media (prefers-color-scheme: light) {
    :root:not([data-theme]) .gadget-game,
    :root:not([data-theme]) .gadget-game-page,
    :root:not([data-theme]) .gadget-research,
    :root:not([data-theme]) .gadget-research-page {
        background: rgba(255,255,255,0.9);
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    }

    :root:not([data-theme]) .gadget-code::before,
    :root:not([data-theme]) .gadget-code-page::before {
        opacity: 0.9;
        font-weight: 600;
    }

    :root:not([data-theme]) .gadget-art,
    :root:not([data-theme]) .gadget-art-page {
        opacity: 0.8;
        border-width: 2px;
    }
}

/* LIGHT MODE CHIP OVERRIDES */
:root[data-theme="light"] .chip[data-mode="code"],
:root:not([data-theme])[data-prefers="light"] .chip[data-mode="code"] {
    --chip-color: var(--tone-code);
    --chip-bg: rgba(0, 102, 204, 0.1);
    --chip-border: rgba(0, 102, 204, 0.3);
}
:root[data-theme="light"] .chip[data-mode="game"],
:root:not([data-theme])[data-prefers="light"] .chip[data-mode="game"] {
    --chip-color: var(--tone-game);
    --chip-bg: rgba(209, 0, 105, 0.1);
    --chip-border: rgba(209, 0, 105, 0.3);
}
:root[data-theme="light"] .chip[data-mode="art"],
:root:not([data-theme])[data-prefers="light"] .chip[data-mode="art"] {
    --chip-color: var(--tone-art);
    --chip-bg: rgba(217, 119, 0, 0.1);
    --chip-border: rgba(217, 119, 0, 0.3);
}
:root[data-theme="light"] .chip[data-mode="music"],
:root:not([data-theme])[data-prefers="light"] .chip[data-mode="music"] {
    --chip-color: var(--tone-music);
    --chip-bg: rgba(98, 0, 234, 0.1);
    --chip-border: rgba(98, 0, 234, 0.3);
}
:root[data-theme="light"] .chip[data-mode="research"],
:root:not([data-theme])[data-prefers="light"] .chip[data-mode="research"] {
    --chip-color: var(--tone-research);
    --chip-bg: rgba(204, 85, 0, 0.1);
    --chip-border: rgba(204, 85, 0, 0.3);
}
:root[data-theme="light"] .chip[data-mode="writing"],
:root:not([data-theme])[data-prefers="light"] .chip[data-mode="writing"] {
    --chip-color: var(--tone-writing);
    --chip-bg: rgba(0, 128, 0, 0.1);
    --chip-border: rgba(0, 128, 0, 0.3);
}
:root[data-theme="light"] .chip[data-mode="all"],
:root:not([data-theme])[data-prefers="light"] .chip[data-mode="all"] {
    --chip-color: var(--fg);
    --chip-bg: rgba(0, 0, 0, 0.05);
    --chip-border: rgba(0, 0, 0, 0.2);
}

/* LIGHT MODE HERO PANEL SHADOW */
:root[data-theme="light"] .hero-panel,
:root:not([data-theme])[data-prefers="light"] .hero-panel {
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    border-style: solid;
}

.content img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    display: block;
    margin: 40px auto;
    
    /* Frame Effect */
    padding: 12px;
    background: var(--card);
    border: 1px solid rgba(255, 255, 255, 0.08);
    
    /* Deep Shadow */
    box-shadow: 
        0 0 0 1px rgba(0,0,0,0.2),
        0 20px 50px -10px rgba(0, 0, 0, 0.6);
}

/* RESOURCES SECTION */
.resources-container {
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1px dashed var(--border);
}

.resources-heading {
    font-family: var(--font-mono);
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.resource-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

/* Class to force a card to span the whole row (for videos/itch widgets) */
.resource-card.full-width-card {
    grid-column: 1 / -1;
    background: transparent;
    border: none;
    padding: 0;
    box-shadow: none;
    display: block; /* Reset flex display if set on .resource-card */
}
.resource-card.full-width-card:hover {
    transform: none;
    box-shadow: none;
    border-color: transparent;
}
.resource-card.full-width-card::before {
    display: none;
}

/* Responsive Video Container */
.video-card-wrapper {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.video-header {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.video-title {
    margin: 0;
    font-family: var(--font-mono);
    font-size: 1rem;
    font-weight: 600;
    color: var(--fg);
}

.video-description {
    margin: 0;
    font-size: 0.9rem;
    color: var(--muted);
    line-height: 1.5;
}

.video-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    height: 0;
    overflow: hidden;
    border-radius: 8px;
    background: #000;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Itch Widget Styling */
.resource-card iframe {
    width: 100%;
    max-width: 100%;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

.resource-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    text-decoration: none;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.resource-card:hover {
    border-color: var(--resource-tone);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}

.resource-card::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--resource-tone);
    opacity: 0.5;
    transition: opacity 0.2s;
}

.resource-card:hover::before {
    opacity: 1;
}

.resource-icon-box {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.03);
    border-radius: 6px;
    color: var(--resource-tone);
}

.resource-icon-box svg {
    width: 20px;
    height: 20px;
}

.resource-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0; /* Prevent text overflow */
}

.resource-title {
    font-weight: 600;
    color: var(--fg);
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.resource-desc {
    font-size: 0.85rem;
    color: var(--muted);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.resource-meta {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--muted);
    text-transform: uppercase;
}

.resource-tag {
    color: var(--resource-tone);
    font-weight: 600;
}

.resource-cta {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--muted);
    transition: color 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.resource-card:hover .resource-cta {
    color: var(--fg);
}

.resource-cta .arrow {
    transition: transform 0.2s;
    display: inline-block;
}

.resource-card:hover .resource-cta .arrow {
    transform: translateX(4px);
}

/* Story Styles */
.story-copy {
    /* Removed max-width to let text fill the card */
    font-size: 1.05rem;
}

.story-lead {
    font-size: 1.35rem;
    font-weight: 500;
    line-height: 1.5;
    color: var(--fg);
    margin-bottom: 2.5rem;
}

.story-copy p {
    line-height: 1.8;
    margin-bottom: 1.5rem;
    color: var(--fg); /* Use variable for light/dark mode support */
    opacity: 0.9;
}

/* Make the bold words pop */
.story-copy strong {
    color: var(--brand);
    font-weight: 600;
}

/* Manifesto / Terminal Style */
.manifesto-card {
  background: var(--terminal-bg);
  border: 1px solid var(--terminal-border);
  border-radius: 8px;
  overflow: hidden;
  font-family: var(--font-mono); /* Use the site's mono font */
}

.manifesto-header {
  background: var(--terminal-header);
  padding: 0.75rem 1.5rem;
  border-bottom: 1px solid var(--terminal-border);
}

.manifesto-header h3 {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
  font-family: inherit;
  font-weight: normal;
}

.manifesto-content {
  padding: 1.5rem;
}

.manifesto-line {
  margin-bottom: 1rem;
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--terminal-text);
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.manifesto-line .cmd-text {
    flex: 1; /* Allow text to take up remaining space */
    min-width: 0; /* Prevent flex item from overflowing */
}

.manifesto-line .cmd-text p {
    margin: 0; /* Remove default paragraph margins from markdownify */
    display: inline; /* Keep it inline if possible */
}

.manifesto-line:last-child {
  margin-bottom: 0;
}

.manifesto-line .prompt {
  color: var(--brand); /* Orange prompt */
  font-weight: bold;
  user-select: none; /* Don't select the prompt when copying text */
  flex-shrink: 0; /* Prevent prompt from shrinking */
}


/* README.md Style Card */
.readme-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--panel);
}

.readme-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--card);
  border-bottom: 2px solid var(--brand);
  border-right: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--fg);
}

.readme-icon {
  opacity: 0.6;
  display: flex;
  align-items: center;
}

.readme-filename {
  font-weight: 500;
}

.readme-body {
  padding: 2rem;
}

.readme-heading {
  font-family: var(--font-mono);
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--fg);
  margin: 0 0 1.5rem 0;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.readme-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.readme-list li {
  position: relative;
  padding-left: 1.5rem;
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--fg);
  opacity: 0.9;
}

.readme-list li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--brand);
  font-weight: 600;
}

.readme-list li p {
  margin: 0;
  display: inline;
}

.readme-list li strong,
.readme-list li em {
  color: var(--brand);
}

/* Full Timeline Page - Centered Design */
.timeline-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 40px 20px 80px;
}

.timeline-year {
    margin-bottom: 64px;
}

.year-label {
    font-family: var(--font-mono);
    font-size: 2rem;
    letter-spacing: 0.05em;
    color: var(--fg);
    margin: 0 0 48px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
}

.year-label::before,
.year-label::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border);
    opacity: 0.6;
}

.timeline-full-list {
    list-style: none;
    padding: 0;
    margin: 0;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Central Line */
.timeline-full-list::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 2px;
    background: var(--border);
    transform: translateX(-50%);
}

.timeline-entry {
    width: 50%;
    position: relative;
    padding-bottom: 48px;
    box-sizing: border-box;
    display: flex;
    align-items: flex-start;
}

/* Odd items on Left */
.timeline-entry:nth-child(odd) {
    align-self: flex-start;
    flex-direction: row-reverse;
    padding-right: 24px;
    padding-left: 0;
    text-align: right;
}

/* Even items on Right */
.timeline-entry:nth-child(even) {
    align-self: flex-end;
    flex-direction: row;
    padding-left: 24px;
    padding-right: 0;
    text-align: left;
}

/* Dots */
.timeline-entry::after {
    content: "";
    position: absolute;
    top: 28px; /* Align with card title */
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--bg);
    border: 2px solid var(--muted); /* More visible border */
    z-index: 2;
    transition: all 0.2s ease;
}

.timeline-entry:nth-child(odd)::after {
    right: -7px; /* Half of width (6px) + 1px adjustment */
}

.timeline-entry:nth-child(even)::after {
    left: -7px;
}

.timeline-entry:hover::after {
    background: var(--brand);
    border-color: var(--brand);
    box-shadow: 0 0 0 4px rgba(255, 146, 72, 0.25);
    transform: scale(1.2);
}

/* Date Label on the Line */
.timeline-entry .timeline-date {
    position: absolute;
    top: 24px;
    font-family: var(--font-mono);
    font-weight: 600;
    color: var(--muted);
    font-size: 0.85rem;
    white-space: nowrap;
    z-index: 1;
    opacity: 0.7;
    width: 80px;
}

/* Odd items (Left): Date on Right (Other side) */
.timeline-entry:nth-child(odd) .timeline-date {
    right: -90px;
    text-align: left;
    padding-left: 12px;
}

/* Even items (Right): Date on Left (Other side) */
.timeline-entry:nth-child(even) .timeline-date {
    left: -90px;
    text-align: right;
    padding-right: 12px;
}

.timeline-card {
    flex-grow: 1;
    background: linear-gradient(145deg, var(--card), rgba(255,255,255,0.03));
    border: 1px solid var(--border);
    border-radius: 16px; /* Softer corners */
    padding: 20px; /* More breathing room */
    display: flex;
    gap: 20px;
    align-items: center;
    text-align: left;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2); /* Deeper shadow */
}

.timeline-card::before {
    content: "";
    position: absolute;
    top: 0;
    width: 3px;
    height: 100%;
    background: var(--border);
    transition: background 0.3s ease, width 0.3s ease;
}

/* Odd items (Left side) - Line on Right */
.timeline-entry:nth-child(odd) .timeline-card::before {
    right: 0;
    left: auto;
}

/* Even items (Right side) - Line on Left */
.timeline-entry:nth-child(even) .timeline-card::before {
    left: 0;
    right: auto;
}

.timeline-card:hover {
    border-color: var(--brand);
    transform: translateY(-4px) scale(1.01);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
    z-index: 10;
}

.timeline-card:hover::before {
    background: var(--brand);
    width: 6px; /* Thicker accent on hover */
}

.timeline-thumb {
    width: 72px;
    height: 72px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    border: 1px solid var(--border);
    background: var(--bg);
}

.timeline-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.timeline-card:hover .timeline-thumb img {
    transform: scale(1.05);
}

.timeline-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.timeline-meta {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 4px;
    font-size: 0.75rem;
}

.timeline-summary {
    margin: 0;
    font-size: 0.9rem;
    color: var(--muted);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.timeline-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--fg);
    text-decoration: none;
    line-height: 1.2;
    font-family: var(--font-mono); /* Switch to mono for a techier feel? Or keep sans? Let's try sans for title, mono for meta */
    letter-spacing: -0.02em;
}

/* Make the whole card clickable via the title link */
.timeline-title::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
}

.timeline-title:hover {
    color: var(--brand);
    text-decoration: none; /* Remove underline, rely on color */
}

.timeline-type {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 3px 8px;
    border-radius: 4px;
    background: var(--panel);
    border: 1px solid var(--border);
    color: var(--muted);
    font-weight: 600;
}

/* Type Colors */
.tag-code { color: var(--tone-code); border-color: var(--tone-code); }
.tag-game { color: var(--tone-game); border-color: var(--tone-game); }
.tag-art { color: var(--tone-art); border-color: var(--tone-art); }
.tag-music { color: var(--tone-music); border-color: var(--tone-music); }
.tag-research { color: var(--tone-research); border-color: var(--tone-research); }
.tag-publications { color: var(--tone-research); border-color: var(--tone-research); }
.tag-writing { color: var(--tone-writing); border-color: var(--tone-writing); }

@media (max-width: 768px) {
    .timeline-container {
        padding: 24px 16px 60px;
    }

    .year-label {
        font-size: 1.5rem;
        gap: 16px;
        margin-bottom: 32px;
    }

    .timeline-full-list::before {
        left: 20px; /* Move line to left */
    }
    
    .timeline-entry {
        width: 100%;
        padding-left: 56px; /* Space for line */
        padding-right: 0;
        padding-bottom: 32px;
        text-align: left;
    }
    
    .timeline-entry:nth-child(odd),
    .timeline-entry:nth-child(even) {
        align-self: flex-start;
        padding-left: 56px;
        padding-right: 0;
        text-align: left;
    }
    
    .timeline-entry:nth-child(odd)::after,
    .timeline-entry:nth-child(even)::after {
        left: 13px; /* Center on 20px line */
        right: auto;
    }

    /* Mobile Date Positioning */
    .timeline-entry .timeline-date {
        position: static; /* Reset absolute positioning */
        display: block;
        margin-bottom: 8px;
        text-align: left !important;
        width: auto !important;
    }
    
    .timeline-entry:nth-child(odd) .timeline-date,
    .timeline-entry:nth-child(even) .timeline-date {
        right: auto;
        left: auto;
    }
}


/* Publication Single Layout */
.publication-single {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
}

.publication-header {
    margin-bottom: 40px;
    text-align: center;
}

.publication-meta-top {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--muted);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.publication-title {
    font-size: 2.2rem;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    color: var(--fg);
}

.publication-authors {
    font-size: 1.1rem;
    color: var(--fg);
    margin-bottom: 2rem;
}

.publication-authors .author.me {
    font-weight: 700;
    color: var(--brand);
    border-bottom: 2px solid var(--brand-alt);
}

.publication-links {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 2rem;
}

.publication-links .btn.small {
    padding: 6px 14px;
    font-size: 0.85rem;
}

.publication-abstract {
    background: linear-gradient(145deg, var(--panel), rgba(255,255,255,0.02));
    padding: 2.5rem;
    border-radius: 8px;
    margin-bottom: 3rem;
    border: 1px solid var(--border);
    border-left: 4px solid var(--brand);
    position: relative;
    box-shadow: 0 10px 30px -10px rgba(0,0,0,0.3);
}

.publication-abstract h3 {
    margin-top: 0;
    font-size: 0.8rem;
    color: var(--brand);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: 1.2rem;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
}

.publication-abstract h3::before {
    content: "";
    display: block;
    width: 20px;
    height: 2px;
    background: var(--brand);
    opacity: 0.5;
}

.publication-abstract p {
    margin: 0;
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--fg);
    font-style: italic;
    opacity: 0.9;
}

.publication-content {
    font-size: 1.1rem;
    line-height: 1.7;
    color: var(--fg);
    margin-bottom: 3rem;
}

.publication-tags {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.tag-pill {
    background: var(--panel);
    border: 1px solid var(--border);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--muted);
    font-family: var(--font-mono);
}


/* Publication Tags Header */
.publication-tags-header {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.publication-tags-header .tag-pill {
    background: var(--panel);
    border: 1px solid var(--border);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--muted);
    font-family: var(--font-mono);
    text-decoration: none;
    transition: all 0.2s ease;
}

.publication-tags-header .tag-pill:hover {
    border-color: var(--brand);
    color: var(--brand);
}

/* Publication Footer (Related Projects) */
.publication-footer {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px dashed var(--border);
}

.publication-footer h3 {
    margin-bottom: 1.5rem;
    font-family: var(--font-mono);
    text-transform: uppercase;
    font-size: 1rem;
    color: var(--muted);
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}


/* Art Single Layout */
.art-header {
    padding: 0.4rem 1rem;
    text-align: center;
    margin-bottom: 2rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.art-title {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--fg);
    line-height: 1.2;
}

.art-meta {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
}

.art-date {
    font-family: var(--font-mono);
    color: var(--muted);
    font-size: 0.85rem;
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
}

.art-date .label {
    text-transform: uppercase;
    font-size: 0.7rem;
    opacity: 0.7;
    letter-spacing: 0.05em;
    margin-top: 1px; /* Optical alignment */
}

.art-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
}

.tag-pill-art {
    background: rgba(255, 179, 71, 0.1); /* var(--tone-art) with opacity */
    border: 1px solid var(--tone-art);
    color: var(--tone-art);
    padding: 2px 10px;
    border-radius: 16px;
    font-size: 0.75rem;
    font-family: var(--font-mono);
    text-decoration: none;
    transition: all 0.2s ease;
}

.tag-pill-art:hover {
    background: var(--tone-art);
    color: var(--bg);
    box-shadow: 0 0 10px var(--tone-art);
}

.art-content {
    font-size: 1.05rem;
    line-height: 1.7;
}


/* Publication Gadget Override */
.publication-header {
    position: relative; /* Needed for absolute positioning of gadget */
}

.publication-header .gadget-research-page {
    transform: none; /* Reset the transform from the default style */
    top: -20px;
    left: 0;
    /* Ensure it's visible */
    display: block;
}


/* Tag Pills for other modes */
.tag-pill-code {
    background: rgba(42, 157, 244, 0.1);
    border: 1px solid var(--tone-code);
    color: var(--tone-code);
    padding: 2px 10px;
    border-radius: 16px;
    font-size: 0.75rem;
    font-family: var(--font-mono);
    text-decoration: none;
    transition: all 0.2s ease;
}
.tag-pill-code:hover {
    background: var(--tone-code);
    color: var(--bg);
    box-shadow: 0 0 10px var(--tone-code);
}

.tag-pill-game {
    background: rgba(255, 111, 183, 0.1);
    border: 1px solid var(--tone-game);
    color: var(--tone-game);
    padding: 2px 10px;
    border-radius: 16px;
    font-size: 0.75rem;
    font-family: var(--font-mono);
    text-decoration: none;
    transition: all 0.2s ease;
}
.tag-pill-game:hover {
    background: var(--tone-game);
    color: var(--bg);
    box-shadow: 0 0 10px var(--tone-game);
}

.tag-pill-music {
    background: rgba(156, 140, 255, 0.1);
    border: 1px solid var(--tone-music);
    color: var(--tone-music);
    padding: 2px 10px;
    border-radius: 16px;
    font-size: 0.75rem;
    font-family: var(--font-mono);
    text-decoration: none;
    transition: all 0.2s ease;
}
.tag-pill-music:hover {
    background: var(--tone-music);
    color: var(--bg);
    box-shadow: 0 0 10px var(--tone-music);
}

.tag-pill-writing {
    background: rgba(125, 216, 124, 0.1);
    border: 1px solid var(--tone-writing);
    color: var(--tone-writing);
    padding: 2px 10px;
    border-radius: 16px;
    font-size: 0.75rem;
    font-family: var(--font-mono);
    text-decoration: none;
    transition: all 0.2s ease;
}
.tag-pill-writing:hover {
    background: var(--tone-writing);
    color: var(--bg);
    box-shadow: 0 0 10px var(--tone-writing);
}

.tag-pill-research {
    background: rgba(255, 146, 72, 0.1);
    border: 1px solid var(--tone-research);
    color: var(--tone-research);
    padding: 2px 10px;
    border-radius: 16px;
    font-size: 0.75rem;
    font-family: var(--font-mono);
    text-decoration: none;
    transition: all 0.2s ease;
}
.tag-pill-research:hover {
    background: var(--tone-research);
    color: var(--bg);
    box-shadow: 0 0 10px var(--tone-research);
}

/* Project Single Layout */
.project-single {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 20px;
}
.project-header {
    margin-bottom: 40px;
    text-align: center;
}
.project-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--fg);
}
.project-meta {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 24px;
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 0.9rem;
}

/* Music Single Layout */
.music-single {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
}
.music-header {
    margin-bottom: 40px;
    text-align: center;
}
.music-title {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--tone-music), #fff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Post (Blog) Single Layout */
.post-single {
    max-width: 740px;
    margin: 0 auto;
    padding: 40px 20px;
}
.post-header {
    margin-bottom: 48px;
    text-align: left; /* Blog posts often look better left-aligned */
    border-bottom: 1px solid var(--border);
    padding-bottom: 32px;
}
.post-title {
    font-size: 2.5rem;
    line-height: 1.2;
    margin-bottom: 16px;
}
.post-meta {
    font-family: var(--font-mono);
    color: var(--muted);
    font-size: 0.9rem;
    display: flex;
    gap: 16px;
    align-items: center;
}


.tag-pill-research { color: var(--tone-research); border-color: var(--tone-research); }
.tag-pill-research:hover { background: var(--tone-research); color: var(--bg); }


/* CC0 Badge */
.cc0-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--panel);
    border: 1px solid var(--border);
    padding: 6px 12px;
    border-radius: 20px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--muted);
    text-decoration: none;
    transition: all 0.2s ease;
    margin-top: 12px;
}

.cc0-badge:hover {
    border-color: var(--fg);
    color: var(--fg);
    background: var(--bg);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.cc0-badge i {
    font-size: 1rem;
}


/* CC0 Page Styles */
.single.simple {
    max-width: 720px;
    margin: 0 auto;
    padding: 4rem 1rem;
}

.single.simple h1 {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 2.5rem;
}

.single.simple > p {
    text-align: center;
    font-size: 1.2rem;
    color: var(--muted);
    margin-bottom: 3rem;
}

.cc0-panel {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2rem;
    margin: 2rem 0;
    position: relative;
    overflow: hidden;
}

.cc0-panel h3 {
    margin-top: 0;
    color: var(--fg);
    font-size: 1.4rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.cc0-permissions {
    border-left: 4px solid var(--tone-writing);
    background: linear-gradient(to right, rgba(125, 216, 124, 0.05), transparent);
}

.cc0-permissions ul {
    list-style: none;
    padding: 0;
}

.cc0-permissions li {
    position: relative;
    padding-left: 2rem;
    margin-bottom: 1rem;
}

.cc0-permissions li::before {
    content: '\f00c'; /* FontAwesome check */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    left: 0;
    color: var(--tone-writing);
}

.cc0-philosophy {
    border-left: 4px solid var(--tone-art);
}

.cc0-legal {
    background: var(--panel);
    border: 1px dashed var(--border);
    opacity: 0.9;
}

.cc0-legal h3 {
    font-size: 1.1rem;
    color: var(--muted);
    border-bottom: none;
}


.cc0-closing {
    text-align: center;
    background: transparent;
    border: none;
    padding: 1rem 0;
    margin-top: 3rem;
}

.cc0-closing p {
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
    color: var(--fg);
}

.cc0-closing strong {
    color: var(--brand);
    font-weight: 700;
}

/* ── BibTeX Cite Modal ── */
.cite-modal-backdrop[hidden],
.cite-modal[hidden] {
    display: none;
}
.cite-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
}
.cite-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1001;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    width: min(680px, 92vw);
    box-shadow: 0 24px 60px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.cite-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--panel);
}
.cite-modal-title {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--tone-research);
    display: flex;
    align-items: center;
    gap: 8px;
}
.cite-modal-close {
    background: none;
    border: none;
    color: var(--muted);
    font-size: 1rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: color 0.2s, background 0.2s;
}
.cite-modal-close:hover {
    color: var(--fg);
    background: var(--border);
}
.cite-modal-content {
    margin: 0;
    padding: 20px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    line-height: 1.7;
    color: var(--fg);
    background: var(--bg);
    overflow-x: auto;
    white-space: pre;
    max-height: 50vh;
    overflow-y: auto;
}
.cite-modal-actions {
    display: flex;
    gap: 10px;
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    background: var(--panel);
}

/* ── Feed empty state ── */
.feed-empty {
    grid-column: 1 / -1;
    padding: 4rem 1rem;
    text-align: center;
}
.feed-empty-msg {
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 0.95rem;
}

/* ── Gallery / Slideshow ── */
.gallery-viewer {
    margin: 2rem 0;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
}

.gallery-main {
    position: relative;
    background: var(--bg);
}

.gallery-stage {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    overflow: hidden;
}

.gallery-slide {
    position: absolute;
    inset: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.gallery-slide.active {
    opacity: 1;
    pointer-events: auto;
}

.gallery-slide img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
    margin: 0 auto;
    border-radius: 0;
    cursor: zoom-in;
}

.gallery-slide figcaption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px 16px;
    background: linear-gradient(transparent, rgba(0,0,0,0.75));
    color: #f5f7ff;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    text-align: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.gallery-viewer:hover .gallery-slide.active figcaption {
    opacity: 1;
}

/* Nav buttons */
.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    background: rgba(0,0,0,0.5);
    border: 1px solid var(--border);
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    font-size: 1.4rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease, background 0.2s ease;
    backdrop-filter: blur(4px);
}

.gallery-viewer:hover .gallery-nav {
    opacity: 1;
}

.gallery-nav:hover {
    background: rgba(0,0,0,0.8);
}

.gallery-prev { left: 12px; }
.gallery-next { right: 12px; }

/* Counter */
.gallery-counter {
    position: absolute;
    bottom: 12px;
    right: 12px;
    z-index: 2;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: #ccc;
    background: rgba(0,0,0,0.5);
    padding: 2px 8px;
    border-radius: 4px;
    backdrop-filter: blur(4px);
}

/* Thumbnail strip */
.gallery-thumbs {
    display: flex;
    gap: 4px;
    padding: 8px;
    overflow-x: auto;
    background: var(--panel);
    border-top: 1px solid var(--border);
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.gallery-thumb {
    flex: 0 0 auto;
    width: 96px;
    height: 64px;
    border: 2px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s ease, border-color 0.2s ease;
    padding: 0;
    background: var(--card);
}

.gallery-thumb.active {
    border-color: var(--brand);
    opacity: 1;
}

.gallery-thumb:hover {
    opacity: 1;
}

.gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    margin: 0;
    border-radius: 0;
}

.gallery-slide img {
    margin: 0;
}

/* Lightbox */
.gallery-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0,0,0,0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
    backdrop-filter: blur(8px);
    animation: galleryFadeIn 0.2s ease;
}

.gallery-lightbox img {
    max-width: 95vw;
    max-height: 95vh;
    object-fit: contain;
    border-radius: 4px;
}

@keyframes galleryFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Responsive */
@media (max-width: 640px) {
    .gallery-stage {
        aspect-ratio: 4 / 3;
    }
    .gallery-nav {
        width: 32px;
        height: 32px;
        font-size: 1.1rem;
    }
    .gallery-prev { left: 6px; }
    .gallery-next { right: 6px; }
    .gallery-thumb {
        width: 72px;
        height: 48px;
    }
}

