:root {
  /* DARK MODE (DEFAULT) */
  --bg0: #050505;
  --bg1: #0a0a0f;
  /* HEAVY GLASS (The Skeet Look) */
  --glass: rgba(20, 20, 25, 0.60); 
  --edge: rgba(255, 255, 255, 0.12);
  --edge-top: rgba(255, 255, 255, 0.20); /* Top lip highlight */
  --txt: rgba(240, 240, 240, 0.95);
  --muted: rgba(240, 240, 240, 0.65);
  --soft: rgba(240, 240, 240, 0.4);
  --accent: #D4AF37;
  --nav-pill: rgba(255, 255, 255, 0.15);
}

/* LIGHT MODE OVERRIDES */
[data-theme="light"] {
  --bg0: #e0e0e0;
  --bg1: #f0f0f0;
  --glass: rgba(255, 255, 255, 0.65);
  --edge: rgba(0, 0, 0, 0.08);
  --edge-top: rgba(255, 255, 255, 0.9);
  --txt: #111;
  --muted: #444;
  --soft: #777;
  --accent: #b08d2b;
  --nav-pill: rgba(0, 0, 0, 0.1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

body {
  background: var(--bg0);
  color: var(--txt);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  overflow: hidden;
  transition: background 0.8s ease, color 0.8s ease;
}

/* =========================================
   BACKGROUND SYSTEM (Orb + Smoke + Grain)
   ========================================= */
#background-system {
  position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden;
}

/* 1. The Soul Orb (Color & Life) */
#soul-orb {
  position: absolute; top: 50%; left: 50%; width: 120vw; height: 120vh;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle at center, rgba(212, 175, 55, 0.18), rgba(40, 50, 80, 0.25), transparent 70%);
  filter: blur(80px);
  opacity: 0.8;
  animation: breathe 14s ease-in-out infinite alternate;
}
@keyframes breathe {
  0% { transform: translate(-50%, -50%) scale(0.9) rotate(0deg); opacity: 0.7; }
  50% { transform: translate(-50%, -55%) scale(1.1) rotate(5deg); opacity: 0.9; }
  100% { transform: translate(-50%, -50%) scale(0.9) rotate(0deg); opacity: 0.7; }
}

/* 2. The Smoke Layers (Motion & Haze) */
.smoke-layer {
  position: absolute; top: -50%; left: -50%; width: 200%; height: 200%;
  mix-blend-mode: overlay;
  opacity: 0.3;
}
.smoke1 {
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='f'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.005' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23f)' opacity='0.5'/%3E%3C/svg%3E");
  animation: drift 80s linear infinite;
}
.smoke2 {
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='f'%3E%3CfeTurbulence type='turbulence' baseFrequency='0.01' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23f)' opacity='0.5'/%3E%3C/svg%3E");
  animation: drift 60s linear infinite reverse;
}
@keyframes drift { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* 3. The Grain (Texture) */
#grain {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: 0.12;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

/* =========================================
   GLASSMORPHISM
   ========================================= */
.glass, .card, .segmented, .theme-toggle-btn {
  background: var(--glass);
  backdrop-filter: blur(50px); -webkit-backdrop-filter: blur(50px);
  border: 1px solid var(--edge);
  border-top: 1px solid var(--edge-top); /* The "Light Catching" Top Edge */
  box-shadow: 
    0 40px 80px rgba(0,0,0,0.4), 
    inset 0 1px 0 rgba(255,255,255,0.05);
  transition: transform 0.3s, background 0.3s;
}

/* --- HEADER --- */
.header { position: fixed; top: 24px; left: 24px; right: 24px; display: flex; justify-content: space-between; align-items: center; z-index: 50; }
.brand { font-size: 0.8rem; letter-spacing: 0.15em; text-transform: uppercase; color: var(--txt); font-weight: 600; opacity: 0.9; }
.nav a { color: var(--muted); text-decoration: none; font-size: 0.8rem; margin-left: 20px; text-transform: uppercase; letter-spacing: 0.05em; transition: color 0.3s; }
.nav a:hover { color: var(--txt); text-shadow: 0 0 8px rgba(255,255,255,0.4); }

/* --- PAGE STRUCTURE --- */
.page body { overflow-y: auto; }
.page-shell { min-height: 100%; padding: 110px 18px 120px; position: relative; z-index: 10; }
.content { width: min(900px, 94vw); margin: 0 auto; display: grid; grid-template-columns: 1.3fr 0.7fr; gap: 24px; }
@media (max-width: 800px) { .content { grid-template-columns: 1fr; } }
.card { padding: 28px; border-radius: 24px; }

/* --- TYPOGRAPHY --- */
.h1 { font-size: 1.8rem; letter-spacing: -0.02em; margin-bottom: 8px; color: var(--txt); font-weight: 500; }
.p { font-size: 0.95rem; line-height: 1.6; color: var(--muted); margin-bottom: 14px; }
hr.sep { border: none; height: 1px; background: var(--edge); margin: 24px 0; }
.meta { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--soft); margin-bottom: 12px; }

/* --- LINKS / LISTS (Glowing) --- */
.list { display: flex; flex-direction: column; gap: 10px; }
.link-item {
  display: flex; align-items: center; text-decoration: none; color: inherit;
  padding: 12px 16px; border-radius: 16px;
  background: rgba(255, 255, 255, 0.03); border: 1px solid transparent;
  transition: all 0.3s ease;
}
.link-item:hover {
  background: rgba(255, 255, 255, 0.08); border-color: rgba(255,255,255,0.1);
  box-shadow: 0 0 30px rgba(212, 175, 55, 0.15); /* Gold Haze */
  transform: translateY(-2px);
}
.icon-row { display: flex; align-items: center; gap: 14px; width: 100%; }
.icon { width: 24px; height: 24px; color: var(--soft); transition: color 0.3s; }
.link-item:hover .icon { color: var(--txt); }
.item-title { font-size: 0.95rem; font-weight: 500; color: var(--txt); }
.item-sub { font-size: 0.75rem; color: var(--soft); margin-top: 2px; }

/* --- NAVIGATION --- */
.segmented {
  position: fixed; bottom: 40px; left: 50%; transform: translateX(-50%); z-index: 100;
  display: flex; gap: 4px; padding: 6px; border-radius: 32px;
}
.segmented button {
  position: relative; z-index: 2; background: transparent; border: none;
  padding: 10px 18px; min-width: 80px; font-size: 0.8rem; color: var(--soft); font-weight: 500;
  cursor: pointer; transition: color 0.3s;
}
.segmented button.active { color: var(--txt); text-shadow: 0 0 10px rgba(255,255,255,0.3); }
#indicator {
  position: absolute; top: 6px; bottom: 6px; left: 0; width: 0;
  background: var(--nav-pill); border-radius: 26px;
  transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), width 0.2s;
  pointer-events: none; opacity: 0; box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

/* --- THEME TOGGLE --- */
.theme-toggle-btn {
  position: fixed; bottom: 45px; right: 40px; z-index: 100;
  width: 38px; height: 38px; border-radius: 50%;
  color: var(--soft); cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all 0.3s;
}
.theme-toggle-btn:hover { color: var(--txt); transform: rotate(15deg); box-shadow: 0 0 20px rgba(255,255,255,0.2); }

/* --- INDEX SPECIFIC --- */
.center { height: 100%; display: flex; align-items: center; justify-content: center; padding: 0 18px; }
.stack { width: min(500px, 90vw); position: relative; z-index: 10; }
.panel { padding: 32px; border-radius: 28px; }
.panel-top { display:flex; align-items:baseline; justify-content:space-between; margin-bottom: 24px; }
.panel-title { font-size:0.85rem; letter-spacing:0.1em; text-transform:uppercase; color: var(--soft); }
.panel-sub { font-size: 0.8rem; color: var(--muted); }
.input-wrap { position:relative; padding: 10px 0 4px; }
input:not(.form-input) { 
  width:100%; background:transparent; border:none; 
  border-bottom:1px solid rgba(255,255,255,0.2); padding: 14px 0 12px; 
  color: var(--txt); font-size: 1.15rem; outline:none; text-align: center;
  transition: border-color 0.3s, text-shadow 0.3s;
}
input:not(.form-input):focus { border-bottom: 1px solid var(--txt); text-shadow: 0 0 12px rgba(255,255,255,0.2); }
input::placeholder { color: var(--soft); opacity: 0.3; letter-spacing: 0.05em; }
.softReply { margin-top: 20px; font-size: 0.8rem; color: var(--soft); height: 1.2em; text-align: center; font-family: "Consolas", monospace; }

/* --- UTILS --- */
.badge { font-size: 0.65rem; padding: 4px 8px; border-radius: 4px; border: 1px solid var(--edge); color: var(--soft); display: inline-block; margin-right: 4px; }
.status-tag { font-family: "Consolas", monospace; font-size: 0.7rem; color: var(--accent); opacity: 0.8; letter-spacing: 0.05em; }
.blog-post { margin-bottom: 25px; padding-bottom: 25px; border-bottom: 1px solid var(--edge); }
.blog-post:last-child { border-bottom: none; }
.blog-date { font-size: 0.75rem; color: var(--soft); margin-bottom: 4px; font-family: "Consolas", monospace; }
