/* ---- tokens ---------------------------------------------------------- */
/* early-2000s "terminal / underground homepage" aesthetic:
   black panels, monospace, neon accents, ascii-style dividers */
:root {
  --fg: #cfe6ff;             /* soft blue phosphor */
  --dim: #6f8fb0;
  --bright: #eaf4ff;
  --link: #7fdfff;           /* cyan links */
  --link-visited: #b48bff;
  --accent: #a8d4ff;         /* soft whitish-blue */
  --border-glow: #a8d4ff;    /* soft whitish-blue page border */
  --warn: #ff5f56;
  --panel: rgba(2, 6, 12, 0.82);
  --panel-alt: rgba(2, 6, 12, 0.55);
  --line: #274a66;

  /* nord palette for code blocks (container colors only) */
  --nord0: #2e3440;          /* polar night bg */
  --nord1: #3b4252;
  --nord3: #4c566a;          /* polar night border */
  --nord4: #d8dee9;          /* snow storm fg */
  --nord6: #eceff4;

  /* light scheme still leans dark-terminal but softens for daylight */
  --scrim: rgba(2, 6, 3, 0.72);

  --measure: 64rem;
  --mono: "Courier New", "Lucida Console", Consolas, Monaco, monospace;
}

@media (prefers-color-scheme: light) {
  :root {
    --scrim: rgba(6, 14, 8, 0.6);
    --panel: rgba(4, 12, 6, 0.85);
  }
}

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.55;
  color: var(--fg);
  background: #000;
  background-image: linear-gradient(var(--scrim), var(--scrim)), url("/Wallpaper.png");
  background-size: cover, cover;
  background-position: center, center;
  background-attachment: fixed, fixed;
  background-repeat: no-repeat, no-repeat;
}

a { color: var(--link); text-decoration: none; border-bottom: 1px dotted currentColor; }
a:visited { color: var(--link-visited); }
a:hover { color: var(--bright); background: rgba(168, 212, 255, 0.14); }
a:focus-visible { outline: 1px solid var(--accent); outline-offset: 2px; }

/* skip link — visually hidden until focused */
.skip {
  position: absolute;
  left: 8px;
  top: -40px;
  padding: 4px 10px;
  background: var(--panel);
  border: 1px solid var(--accent);
  z-index: 10;
  transition: top 100ms ease;
}
.skip:focus { top: 8px; }

/* ---- page shell ------------------------------------------------------ */
.page {
  max-width: var(--measure);
  margin: 1.5rem auto;
  background: var(--panel);
  border: 1px solid var(--border-glow);
  box-shadow: 0 0 0 1px #000, 0 0 18px rgba(168, 212, 255, 0.3);
}

/* ---- header + nav ---------------------------------------------------- */
.masthead {
  padding: 0.9rem 1.1rem 0.7rem;
  border-bottom: 1px solid var(--line);
}
.masthead h1 {
  margin: 0;
  font-size: 20px;
  letter-spacing: 2px;
  color: var(--accent);
  text-shadow: 0 0 8px rgba(168, 212, 255, 0.55);
}
/* blinking terminal cursor after the title */
.masthead h1::after {
  content: "_";
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
.masthead .tagline { margin: 0.2rem 0 0; color: var(--dim); font-size: 12px; }

.navbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  padding: 4px 8px;
  border-bottom: 1px solid var(--line);
  background: rgba(168, 212, 255, 0.06);
}
.navbar a {
  padding: 3px 14px;
  font-size: 13px;
  color: var(--fg);
  border: 0;
  border-right: 1px solid var(--line);
}
.navbar a::before { content: "["; color: var(--dim); }
.navbar a::after  { content: "]"; color: var(--dim); }
.navbar a:visited { color: var(--fg); }
.navbar a[aria-current="page"] { color: var(--accent); background: rgba(168, 212, 255, 0.14); }

/* ---- two-column body ------------------------------------------------- */
/* grid so the single now-playing element can top the right rail on desktop
   and jump above main when the columns stack (no js, no duplicate markup) */
.body {
  display: grid;
  grid-template-columns: 1fr 16rem;
  grid-template-areas:
    "main nowplaying"
    "main sidebar";
  align-content: start;
}
.main { grid-area: main; padding: 1.1rem; min-width: 0; }
/* now-playing and sidebar share the right rail; matching panel + left border
   makes the two grid cells read as one continuous column */
.nowplaying, .sidebar {
  border-left: 1px solid var(--line);
  background: var(--panel-alt);
}
.nowplaying { grid-area: nowplaying; padding: 1.1rem 1rem 0; }
/* it's a layout cell, not an in-sidebar box: drop .box's bottom margin so the
   gap to "Elsewhere" is just the sidebar cell's top padding, not both stacked */
.nowplaying.box { margin-bottom: 0; }
.sidebar { grid-area: sidebar; padding: 1.1rem 1rem; }

/* section heads styled like shell prompts */
h2 {
  margin: 0 0 0.7rem;
  font-size: 14px;
  color: var(--accent);
  letter-spacing: 1px;
}
h2::before { content: "// "; color: var(--dim); }
.main > section + section { margin-top: 1.6rem; }

/* ---- sidebar boxes --------------------------------------------------- */
.box { margin-bottom: 1.3rem; }
.box h3 {
  margin: 0 0 0.4rem;
  font-size: 12px;
  color: var(--dim);
  letter-spacing: 1px;
  border-bottom: 1px dashed var(--line);
  padding-bottom: 2px;
}
.box h3::before { content: "> "; }
.box ul { margin: 0; padding: 0; list-style: none; font-size: 12px; }
.box li { padding: 3px 0; }
.box li .net { color: var(--dim); font-size: 10px; }
.box li .net::before { content: "· "; }

/* now playing */
/* reserved height so a slow/empty svg fetch never shifts layout */
.now-playing__frame { min-height: 52px; display: flex; align-items: center; }
.now-playing__svg { max-width: 100%; height: auto; border: 1px solid var(--line); }
.now-playing__idle { color: var(--dim); font-size: 12px; }

/* ---- lists (portfolio + blog) --------------------------------------- */
.list { margin: 0; padding: 0; list-style: none; }
.list li { padding: 4px 0; border-bottom: 1px dashed var(--line); }
.list li::before { content: "* "; color: var(--dim); }

.entry { display: flex; justify-content: space-between; gap: 1rem; }
.entry time, .item .meta { color: var(--dim); font-size: 12px; white-space: nowrap; }
.item .desc { display: block; color: var(--dim); font-size: 12px; }

/* news: leading date label above each entry title */
.news .item time { display: block; color: var(--accent); font-size: 11px; letter-spacing: 0.5px; }
.news .item .title { display: block; }
.news-empty { color: var(--dim); font-size: 12px; }

/* ---- pagination ------------------------------------------------------ */
.pager { margin-top: 1.3rem; display: flex; justify-content: space-between; font-size: 13px; }
.pager .disabled { color: var(--dim); }

/* ---- post ------------------------------------------------------------ */
.post .meta { color: var(--dim); font-size: 12px; margin-bottom: 1.3rem; }

/* ---- header / banner image (optional on posts + projects) ------------ */
/* drop the .banner block to omit; layout is unchanged without it */
.banner { margin: 0 0 1.2rem; border: 1px solid var(--line); background: #000; }
.banner img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 1; object-fit: cover; }
.banner figcaption { padding: 4px 8px; font-size: 11px; color: var(--dim); border-top: 1px solid var(--line); }
.banner figcaption::before { content: "// "; }

/* ---- project detail -------------------------------------------------- */
/* status badge next to the project title */
.status { font-size: 11px; border: 1px solid var(--line); padding: 1px 8px; color: var(--accent); vertical-align: middle; }
.status::before { content: "● "; color: var(--accent); }

/* key/value fact grid (stack, language, license…) */
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 2px 1rem; margin: 0 0 1.2rem; font-size: 12px; }
.facts dt { color: var(--dim); }
.facts dt::before { content: "> "; }
.facts dd { margin: 0; }

/* fenced code / shell blocks — nord palette (polar night bg, snow storm fg) */
/* token coloring needs a highlighter; this is js-free so only container colors apply */
pre { overflow-x: auto; background: var(--nord0); border: 1px solid var(--nord3); border-radius: 3px; padding: 0.7rem 0.9rem; font-size: 12px; line-height: 1.5; color: var(--nord4); }
pre code { color: var(--nord4); }
:not(pre) > code { background: var(--nord1); color: var(--nord6); padding: 0 4px; font-size: 12px; }

/* feature list with check marks */
.feats { list-style: none; margin: 0; padding: 0; }
.feats li { padding: 3px 0 3px 1.2rem; position: relative; }
.feats li::before { content: "+"; position: absolute; left: 0; color: var(--accent); }

/* roadmap: done vs planned */
.roadmap { list-style: none; margin: 0; padding: 0; }
.roadmap li { padding: 3px 0 3px 1.4rem; position: relative; }
.roadmap li::before { content: "[ ]"; position: absolute; left: 0; color: var(--dim); }
.roadmap li.done::before { content: "[x]"; color: var(--accent); }
.roadmap li.done { color: var(--dim); }

/* ---- hero ------------------------------------------------------------ */
.hero { padding-bottom: 0.5rem; margin-bottom: 1.6rem; border-bottom: 1px dashed var(--line); }
.hero .role { color: var(--accent); font-size: 13px; letter-spacing: 1px; margin: 0 0 0.5rem; }
.hero .role::before { content: "$ "; color: var(--dim); }
.hero p { margin: 0 0 0.8rem; }
.hero .cta { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.hero .cta a {
  padding: 4px 12px;
  border: 1px solid var(--accent);
  border-radius: 0;
  font-size: 12px;
}
.hero .cta a:hover { background: rgba(168, 212, 255, 0.14); }

/* ---- project cards --------------------------------------------------- */
.cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.9rem; margin: 0; padding: 0; }
.card {
  list-style: none;
  border: 1px solid var(--line);
  background: var(--panel-alt);
  padding: 0.8rem 0.9rem;
}
.card h3 { margin: 0 0 0.35rem; font-size: 14px; }
.card h3::before { content: "> "; color: var(--dim); }
.card p { margin: 0 0 0.6rem; color: var(--fg); font-size: 12px; }
.card .actions { display: flex; gap: 0.75rem; font-size: 12px; }

/* featured post: single highlighted card, more prominent than list entries */
.feature {
  border: 1px solid var(--border-glow);
  background: var(--panel);
  box-shadow: 0 0 0 1px rgba(168, 212, 255, 0.15), 0 0 12px rgba(168, 212, 255, 0.12);
}
.feature__link { display: block; padding: 1rem 1.1rem; text-decoration: none; color: var(--fg); }
.feature__link:hover { background: rgba(168, 212, 255, 0.06); }
.feature__kicker { margin: 0; font-size: 11px; letter-spacing: 1px; color: var(--accent); text-transform: uppercase; }
.feature__kicker::before { content: "// "; color: var(--dim); }
.feature__title { margin: 0.25rem 0 0.1rem; font-size: 18px; color: var(--bright); }
.feature__date { display: block; font-size: 12px; color: var(--dim); }
.feature__excerpt { margin: 0.55rem 0 0; font-size: 13px; }
.feature__more { display: inline-block; margin-top: 0.7rem; font-size: 12px; color: var(--link); }
.feature__link:hover .feature__more { text-decoration: underline; }

/* ---- tags / badges --------------------------------------------------- */
.tags { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0.5rem 0 0; padding: 0; list-style: none; }
.tag {
  display: inline-block;
  padding: 1px 8px;
  font-size: 11px;
  color: var(--accent);
  border: 1px solid var(--line);
  text-decoration: none;
}
.tag::before { content: "#"; color: var(--dim); }
.tag:hover { background: rgba(168, 212, 255, 0.14); }
/* tag index: bigger tag = more posts */
.tagcloud .tag { font-size: 13px; }
.tagcloud .tag[data-weight="lg"] { font-size: 18px; }
.tagcloud .tag[data-weight="md"] { font-size: 15px; }

/* ---- in-post nav ----------------------------------------------------- */
.postnav {
  margin-top: 2rem;
  padding-top: 0.8rem;
  border-top: 1px dashed var(--line);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 12px;
}
.postnav .disabled { color: var(--dim); }

/* ---- footer (single row) --------------------------------------------- */
.footer {
  border-top: 1px solid var(--line);
  padding: 0.7rem 1.1rem;
  font-size: 11px;
  color: var(--dim);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem 1rem;
}
.footer nav { display: inline-flex; flex-wrap: wrap; gap: 0 0.9rem; }
.footer .sep { color: var(--line); }
.badge { border: 1px solid var(--line); padding: 1px 7px; font-size: 10px; letter-spacing: 0.5px; }
.webring { display: inline-flex; gap: 0.4rem; align-items: center; }

/* ---- responsive: stack columns --------------------------------------- */
@media (max-width: 40rem) {
  /* stack: now-playing below the menu, then main, then sidebar */
  .body {
    grid-template-columns: 1fr;
    grid-template-areas:
      "nowplaying"
      "main"
      "sidebar";
  }
  .nowplaying { border-left: 0; padding: 1.1rem 1rem; }
  .nowplaying .now-playing__svg { max-width: 220px; }
  .sidebar { border-left: 0; border-top: 1px solid var(--line); }
  .navbar { justify-content: center; }
  .cards { grid-template-columns: 1fr; }
}
