:root{
  --bg: #0b0a10;
  --bg-2: #111018;
  --fg: #e7e7ea;
  --muted: #a4a2ad;
  --accent: #ff6ea1;          /* primary accent */
  --accent-2: #f2aac6;        /* lighter accent */
  --accent-04: rgba(255,110,161,0.04);
  --accent-20: rgba(255,110,161,0.20);
  --accent-35: rgba(255,110,161,0.35);
  --accent-40: rgba(255,110,161,0.40);
  --chip-bg: #ffd6e6;
  --danger: #ff3860;
  --success: #66ffcc;
  --shadow: rgba(255, 110, 161, 0.3);
  --sysbar-h: 56px;           /* fallback; updated via JS */
}

*{ box-sizing: border-box; }
html, body { height: 100%; }
body{
  margin:0;
  color:var(--fg);
  background: radial-gradient(circle at 20% 10%, var(--bg-2), var(--bg) 40%) no-repeat fixed;
  background-color: var(--bg);
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  cursor: crosshair;
}

.muted{ color: var(--muted); }
.glow{ color: var(--accent); text-shadow: 0 0 12px var(--shadow); }

/* dotted matrix background */
body::before{
  content:"";
  position: fixed; inset:0;
  background-image: radial-gradient(rgba(255,255,255,0.06) 1px, transparent 1px);
  background-size: 12px 12px;
  pointer-events:none; opacity:0.35;
}

#scanlines{ position: fixed; inset:0; pointer-events:none; mix-blend-mode: soft-light; opacity:.18;
  background: repeating-linear-gradient( to bottom, rgba(255,255,255,.11) 0, rgba(255,255,255,.11) 1px, transparent 2px, transparent 3px);
}
#noise{ position: fixed; inset:0; pointer-events:none; opacity:.06; background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="140" height="140" viewBox="0 0 140 140"><filter id="n"><feTurbulence type="fractalNoise" baseFrequency="0.9" numOctaves="2" stitchTiles="stitch"/></filter><rect width="100%" height="100%" filter="url(%23n)" opacity="0.4"/></svg>'); background-size: 240px; animation: hiss 6s steps(6) infinite; }
@keyframes hiss{ 50%{ opacity:.09 } }

.sysbar{
  position: sticky; top:0; z-index: 10; backdrop-filter: blur(4px);
  background: rgba(11,10,16,0.7); border-bottom: 1px solid var(--accent-35);
  display:flex; align-items:center; justify-content: space-between; gap: 16px; padding: 10px 14px;
}
.sysbar .nav a{ color:var(--fg); text-decoration:none; margin:0 8px; opacity:.9 }
.sysbar .nav a:hover{ color: var(--accent); text-shadow:0 0 6px var(--shadow) }
.status{ color: var(--muted); font-size: 0.9rem; }
.brand{ font-family: "VT323", monospace; font-size: 1.5rem; letter-spacing: 1px; }

/* Ensure anchored sections land fully below sticky nav */
main > section{ scroll-margin-top: calc(var(--sysbar-h) + 8px); }

.container{ max-width: 1100px; margin: 28px auto; padding: 0 16px; display: grid; gap: 26px; }

.window{ border: 1px solid var(--accent-35); background: linear-gradient(180deg, rgba(22,19,29,0.75), rgba(14,12,19,0.75)); box-shadow: 0 6px 40px -18px var(--shadow), inset 0 0 0 1px rgba(255,255,255,0.03); border-radius: 8px; overflow: hidden; }
.window-title{ display:flex; align-items:center; gap:10px; padding:8px 12px; border-bottom:1px dashed var(--accent-35); background: var(--accent-04); }
.window-title .title{ text-transform: lowercase; letter-spacing: 2px; color: var(--accent) }
.controls{ display:flex; gap:6px; }
.controls span{ width:10px; height:10px; border-radius:50%; display:inline-block; background: var(--accent); box-shadow: 0 0 8px var(--shadow); }
.controls span:nth-child(2){ background: var(--accent-2) }
.controls span:nth-child(3){ background: var(--chip-bg) }
.window-body{ padding: 16px; }

.hero-grid{ display:grid; grid-template-columns: 1fr 1.1fr; align-items:center; gap:16px; }
.ascii{ margin:0; color:#e1dfe8; opacity:.95; text-shadow: 0 0 10px rgba(255,255,255,.03), 0 0 12px var(--shadow); }
.clock-time{ font-family: "VT323", monospace; font-size: clamp(42px, 10vw, 120px); color: var(--accent); text-shadow: 0 0 18px var(--shadow); }
.clock-date{ color: var(--muted); margin-top: 2px; }

.about p{ margin: 0 0 10px 0; }

/* projects */
.grid{ display:grid; grid-template-columns: repeat(auto-fill, minmax(260px,1fr)); gap: 16px; }
.card{ position:relative; border:1px solid var(--accent-35); border-radius: 6px; overflow:hidden; background: rgba(18,15,23,0.8); transition: transform .12s ease, box-shadow .12s ease; }
.card:hover{ transform: translateY(-3px); box-shadow: 0 10px 40px -20px var(--shadow); }
.card .thumb{ aspect-ratio: 16/9; background: radial-gradient(circle at 30% 10%, color-mix(in srgb, var(--accent), transparent 80%), color-mix(in srgb, var(--accent), transparent 90%) 40%, transparent 60%), linear-gradient(135deg, var(--bg-2), var(--bg)); display:grid; place-items:center; color: var(--muted); font-size: 12px; letter-spacing:1px; }
.card .thumb img{ width:100%; height:100%; object-fit:cover; display:block; }
.card .thumb.hf-cover{ background: #0B0F19; background-image: url('../img/hf-logo.png'); background-repeat:no-repeat; background-position:center; background-size: auto 90%; }
.card .thumb .logo-square{ width:56%; aspect-ratio:1/1; border:1px solid var(--accent-35); border-radius:6px; background-color:#0B0F19; background-repeat:no-repeat; background-position:center; background-size:76% auto; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.03); }
.card .thumb .logo-square.hf{ background-image: url('../img/hf-logo.png'); }
.card .body{ padding: 12px; }
.card h3{ margin:0 0 6px 0; font-size: 1rem; color: var(--fg); }
.card p{ margin:0 0 10px 0; color: var(--muted); font-size: .95rem }
.tags{ list-style:none; margin:0; padding:0; display:flex; flex-wrap:wrap; gap:6px; }
.tag{ font-size:.72rem; color:#1a0f16; background: var(--chip-bg); padding: 2px 6px; border-radius: 4px; }
.card a.btn{ text-decoration:none; color: var(--accent); }

.links{ list-style:none; padding:0; display:flex; gap:14px; flex-wrap: wrap; }
.links a{ color: var(--fg); text-decoration:none; border-bottom: 1px dashed var(--accent-40); padding-bottom: 2px; }
.links a:hover{ color: var(--accent); text-shadow:0 0 6px var(--shadow) }

.footer{ max-width:1100px; margin: 18px auto 40px; padding: 0 16px; display:flex; justify-content: space-between; color: var(--muted) }

/* modal */
#help{ position: fixed; inset:0; display:grid; place-items:center; backdrop-filter: blur(2px); background: rgba(0,0,0,0.25); }
#help[hidden]{ display:none }
.modal{ width:min(680px, 92vw); }
.modal .window-body ul{ margin:0; padding-left: 18px; }

/* theme toggle: alt noir */
body.alt{
  --bg: #0a0c0b; 
  --bg-2:#0c0f0d; 
  --fg:#d0ffef; 
  --muted:#8dd9c2; 
  --accent:#66ffcc; 
  --accent-2:#aafbe3; 
  --chip-bg:#d8fff3;
  --accent-04: rgba(102,255,204,0.06);
  --accent-20: rgba(102,255,204,0.20);
  --accent-35: rgba(102,255,204,0.35);
  --accent-40: rgba(102,255,204,0.40);
  --shadow: rgba(102,255,204,.25);
}

/* small screens */
@media (max-width: 840px){
  .hero-grid{ grid-template-columns: 1fr; }
}

/* project detail layout */
.proj-hero{ display:grid; grid-template-columns: auto 1fr; gap:16px; align-items:start; }
.proj-logo{ width: 180px; max-width: 32vw; border:1px solid var(--accent-35); border-radius:6px; background: var(--accent-04); }
.video-embed{ position:relative; width:100%; aspect-ratio:16/9; border:1px solid var(--accent-35); border-radius:6px; overflow:hidden; background:#000; }
.video-embed iframe{ position:absolute; inset:0; width:100%; height:100%; }
.section{ margin-top: 16px; }
.section h3{ margin: 0 0 8px 0; color: var(--accent); letter-spacing: 1px; text-transform: lowercase; }
@media (max-width: 720px){
  .proj-hero{ grid-template-columns: 1fr; }
  .proj-logo{ justify-self: start; }
}

/* Hugging Face logo block (square with dark background) */
.proj-logo.hf{
  display:block;
  aspect-ratio: 1 / 1;
  background-color: #0B0F19;
  background-image: url('../img/hf-logo.png');
  background-repeat: no-repeat;
  background-position: center;
  background-size: 76% auto;
}