/* =========================
   WINDOWS 98 + XP LUNA UI
   ========================= */

@font-face {
  font-family: "MS Sans Serif Web";
  src: local("MS Sans Serif"), local("Microsoft Sans Serif");
  ascent-override: 88%;
  descent-override: 20%;
  line-gap-override: 0%;
}

:root {
  /* ---------- Windows 98 ---------- */
  --98-desktop:     #008080;   /* teal */
  --98-work:        #c0c0c0;   /* app gray */
  --98-text:        #000000;
  --98-muted:       #222;
  --98-btn:         #dfdfdf;
  --98-btntext:     #000;
  --98-hi:          #ffffff;
  --98-sh:          #808080;
  --98-dsh:         #404040;
  --98-caption:     #000080;   /* titlebar blue */
  --98-link:        #0000ee;
  --98-taskbar:     #c0c0c0;
  --98-task-h:      32px;
  --98-titlebar-h:  26px;

  /* ---------- Windows XP Luna (Blue) ---------- */
  --xp-desktop:     #3a6ea5;
  --xp-work:        #e7eff8;
  --xp-text:        #102a43;
  --xp-muted:       #4c5d70;
  --xp-btn:         #f3f6fb;
  --xp-btntext:     #0a2540;
  --xp-hi:          #ffffff;
  --xp-sh:          #8aa6c1;
  --xp-dsh:         #2d4e73;
  --xp-caption-start:#3f89d9;
  --xp-caption-end:  #2b5ba9;
  --xp-link:         #0a58ca;
  --xp-start-start:  #46c556;
  --xp-start-end:    #2f9f3a;
  --xp-start-border: #1e7d2b;
  --xp-taskbar:      #245aa5;
  --xp-task-h:       36px;
  --xp-titlebar-h:   30px;
}

/* ---------- Active theme mapping ---------- */
html[data-style="win98"] {
  --bg: var(--98-desktop);
  --work: var(--98-work);
  --text: var(--98-text);
  --muted: var(--98-muted);
  --btn: var(--98-btn);
  --btntext: var(--98-btntext);
  --hi: var(--98-hi);
  --sh: var(--98-sh);
  --dsh: var(--98-dsh);
  --caption-bg: var(--98-caption);
  --link: var(--98-link);
  --taskbar-bg: var(--98-taskbar);
  --task-h: var(--98-task-h);
  --titlebar-h: var(--98-titlebar-h);
  --start-bg: var(--98-btn);
  --start-border: var(--98-sh);
  --start-text: #000;
  --radius: 0px;
  --soft-radius: 0px;
  --font-ui: "MS Sans Serif Web", "Microsoft Sans Serif", Tahoma, Arial, sans-serif;
}

html[data-style="xp"] {
  --bg: var(--xp-desktop);
  --work: var(--xp-work);
  --text: var(--xp-text);
  --muted: var(--xp-muted);
  --btn: var(--xp-btn);
  --btntext: var(--xp-btntext);
  --hi: var(--xp-hi);
  --sh: var(--xp-sh);
  --dsh: var(--xp-dsh);
  --caption-bg: linear-gradient(180deg, var(--xp-caption-start), var(--xp-caption-end));
  --link: var(--xp-link);
  --taskbar-bg: var(--xp-taskbar);
  --task-h: var(--xp-task-h);
  --titlebar-h: var(--xp-titlebar-h);
  --start-bg: linear-gradient(180deg, var(--xp-start-start), var(--xp-start-end));
  --start-border: var(--xp-start-border);
  --start-text: #fff;
  --radius: 10px;
  --soft-radius: 8px;
  --font-ui: Tahoma, "Microsoft Sans Serif", Arial, sans-serif;
}

/* ===== Base / Layout ===== */
html, body {
  height: 100%;
  overflow: hidden;
}
body {
  margin: 0;
  background:
    radial-gradient(circle at 12px 12px, rgba(255,255,255,.08) 1px, transparent 1px),
    var(--bg);
  background-size: 24px 24px, auto;
  color: var(--text);
  font-family: var(--font-ui);
  display: grid;
  place-items: center;
  min-height: 100svh;
  overflow: hidden;      /* prevent page scrollbar on mobile */
  overscroll-behavior: none;
}

.desktop {
  width: 100%;
  max-width: 880px;
  padding: 12px 8px calc(var(--task-h) + 12px);
}

.menu-icon,
.title-icon {
  display: inline-block;
  position: relative;
  flex: 0 0 auto;
}
.title-icon {
  background: #c0c0c0;
  border: 2px solid #fff;
  box-shadow: inset -2px -2px 0 #404040, inset 2px 2px 0 #dfdfdf;
}
.title-icon::before {
  content: "";
  position: absolute;
  left: 5px;
  right: 5px;
  top: 4px;
  bottom: 8px;
  background: #000080;
}
.title-icon {
  width: 16px;
  height: 14px;
}
.title-icon::before {
  left: 3px;
  right: 3px;
  top: 3px;
  bottom: 4px;
}

.window {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  top: 16px;
  width: min(880px, 96vw);
  max-height: calc(min(100svh, 100dvh) - var(--task-h) - 20px);
  background: var(--work);
  border: 2px solid var(--sh);
  border-radius: var(--radius);
  box-shadow:
    inset -1px -1px 0 var(--dsh),
    inset  1px  1px 0 var(--hi),
    inset -2px -2px 0 var(--sh),
    inset  2px  2px 0 var(--btn);
  overflow: hidden;
  z-index: 10;
  touch-action: none;
  display: flex;
  flex-direction: column;
}

.titlebar {
  height: var(--titlebar-h);
  display: flex; align-items: center; justify-content: space-between;
  background: var(--caption-bg);
  color: #fff; padding: 4px 8px; font-weight: 700; letter-spacing: .2px;
  cursor: move;
  user-select: none;
  flex: 0 0 auto;
}
.titlebar .title { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; }
.titlebar .controls { display: inline-flex; gap: 4px; }
.winbtn {
  width: 18px; height: 16px; background: var(--btn); color: var(--btntext);
  border: 2px solid var(--sh);
  border-radius: var(--soft-radius);
  box-shadow: inset -1px -1px 0 var(--dsh), inset 1px 1px 0 var(--hi);
  display: grid; place-items: center; font-size: 11px; line-height: 1; cursor: default;
}
.winbtn:active { box-shadow: inset 1px 1px 0 var(--dsh), inset -1px -1px 0 var(--hi); }

/* Scrollable container */
.content {
  padding: 16px;
  display: grid; gap: 16px;
  overflow: auto;
  flex: 1 1 auto;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
}
.addressbar,
.statusbar {
  border: 2px solid var(--sh);
  box-shadow: inset -1px -1px 0 var(--hi), inset 1px 1px 0 var(--dsh);
  background: var(--work);
}
.addressbar {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px;
  align-items: center;
  padding: 4px;
  font-size: 12px;
}
.addressbar span {
  color: var(--muted);
  padding-left: 4px;
}
.addressbar strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: #fff;
  border: 2px inset var(--sh);
  padding: 3px 6px;
  font-weight: 400;
}

header { text-align: center; display: grid; gap: 6px; position: relative; }
.profile {
  width: clamp(72px, 12vw, 92px); height: clamp(72px, 12vw, 92px);
  border-radius: 50%; object-fit: cover; margin: 0 auto 8px;
  border: 2px solid var(--sh);
  box-shadow: inset -1px -1px 0 var(--dsh), inset 1px 1px 0 var(--hi);
}

h1 { margin: 0; font-size: clamp(18px, 4vw, 22px); }
.subtle { color: var(--muted); font-size: 13px; }
.born { font-weight: 600; }
.notice-box {
  border: 2px solid var(--sh);
  border-radius: var(--soft-radius);
  box-shadow: inset -1px -1px 0 var(--dsh), inset 1px 1px 0 var(--hi);
  background: var(--work);
  color: var(--text);
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.4;
  text-align: center;
}

.topright { position: absolute; top: 0; right: 0; display: flex; gap: 6px; }
.pill {
  color: var(--text); background: var(--btn);
  border: 2px solid var(--sh);
  border-radius: var(--soft-radius);
  box-shadow: inset -1px -1px 0 var(--dsh), inset 1px 1px 0 var(--hi);
  padding: 4px 8px; font-size: 12px; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; cursor: default;
}
.pill:active { box-shadow: inset 1px 1px 0 var(--dsh), inset -1px -1px 0 var(--hi); }
.sep { opacity: .5; }

/* Mobile: controls not over profile */
@media (max-width: 520px) {
  .topright {
    position: static;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 8px;
  }
  header { padding-top: 0; }
}

.group {
  border: 2px solid var(--sh);
  border-radius: var(--soft-radius);
  box-shadow: inset -1px -1px 0 var(--dsh), inset 1px 1px 0 var(--hi);
  background: var(--btn); padding: 10px; display: grid; gap: 10px;
}
.label {
  display: inline-block; padding: 2px 6px; font-size: 12px;
  border: 2px solid var(--sh);
  border-radius: var(--soft-radius);
  box-shadow: inset -1px -1px 0 var(--dsh), inset 1px 1px 0 var(--hi);
  background: var(--work); width: max-content;
}

.game {
  border: 2px solid var(--sh);
  border-radius: var(--soft-radius);
  box-shadow: inset -1px -1px 0 var(--dsh), inset 1px 1px 0 var(--hi);
  background: var(--work); padding: 10px; display: grid; gap: 10px;
}
.games-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
@media (min-width: 700px) {
  .games-grid { grid-template-columns: 1fr 1fr; }
}
.game h3 { margin: 0; font-size: 14px; }
.game-desc {
  margin: 0;
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.4;
}
.project-art {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 2px solid var(--sh);
  box-shadow: inset -1px -1px 0 var(--dsh), inset 1px 1px 0 var(--hi);
  background:
    linear-gradient(135deg, rgba(255,255,255,.36), rgba(0,0,0,.18)),
    repeating-linear-gradient(45deg, #c0c0c0 0 10px, #dfdfdf 10px 20px);
  background-image:
    linear-gradient(135deg, rgba(255,255,255,.18), rgba(0,0,0,.14)),
    var(--art),
    repeating-linear-gradient(45deg, #c0c0c0 0 10px, #dfdfdf 10px 20px);
  background-size: cover, cover, auto;
  background-position: center;
  text-decoration: none;
}
.project-art:hover {
  outline: 1px dotted var(--text);
  outline-offset: -5px;
}
.inline-art {
  width: 100%;
  margin: 0 0 8px;
  flex: 0 0 auto;
}
.art-maffiosi { --art: url("../img/maffiosi.png"); }
.art-my-maffiosi { --art: url("../img/my-maffiosi.png"); }
.art-party-maffiosi { --art: url("../img/party-maffiosi.png"); }
.art-mall-manager { --art: url("../img/mall-manager.png"); }
.art-millennium-dawn { --art: url("../img/millennium-dawn.png"); }
.art-reneleblancfans { --art: url("../img/reneleblancfans.png"); }
.art-whwg { --art: url("../img/whwg.png"); }
.art-claimiro { --art: url("../img/claimiro.png"); }
.art-joxaro { --art: url("../img/joxaro.png"); }
.art-towerprotect { --art: url("../img/towerprotect.png"); }
.art-eartherbox { --art: url("../img/eartherbox.png"); }
.art-geotown { --art: url("../img/geotown.png"); }

.actions { display: grid; gap: 8px; }
@media (min-width: 560px) { .actions { grid-template-columns: 1fr 1fr; } }

.link {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-decoration: none; color: var(--btntext);
  background: var(--btn);
  border: 2px solid var(--sh);
  border-radius: var(--soft-radius);
  box-shadow: inset -1px -1px 0 var(--dsh), inset 1px 1px 0 var(--hi);
  min-height: 40px; font-weight: 700; font-size: 13px; padding: 8px; cursor: default; text-align: center;
}
.link:hover,
.pill:hover,
.btn:hover {
  outline: 1px dotted var(--text);
  outline-offset: -5px;
}
.link:active { box-shadow: inset 1px 1px 0 var(--dsh), inset -1px -1px 0 var(--hi); }
.link .small { font-weight: 400; font-size: 11px; margin-top: 2px; opacity: .9; }

/* Brand styling */
.link.nexus   { background: #E05F1A; color:#fff; }
.link.website { background: #000080; color:#fff; }
.link.email   { background: #fff; color:#000; }

footer { text-align: center; font-size: 12px; color: var(--muted); }
.socials { display: flex; justify-content: center; gap: 12px; margin: 8px 0 10px; }
.socials a { color: var(--link); text-decoration: underline; }

.stack { display: grid; gap: 12px; }
.statusbar {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 4px;
  padding: 3px;
  font-size: 12px;
  flex: 0 0 auto;
}
.statusbar span {
  border: 1px inset var(--sh);
  padding: 2px 6px;
  min-width: 58px;
}

/* ===== Taskbar ===== */
.taskbar {
  position: fixed; bottom: 0; left: 0; right: 0; height: var(--task-h);
  background: var(--taskbar-bg);
  border-top: 2px solid var(--sh);
  box-shadow: inset 0 2px var(--hi);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 6px; color: #fff;
  z-index: 1000;
  user-select: none;
}
.taskbar-app {
  margin-left: 8px;
  margin-right: auto;
  height: 24px;
  min-width: 0;
  max-width: min(340px, 44vw);
  padding: 2px 10px 2px 6px;
  color: var(--btntext);
  background: var(--btn);
  border: 2px solid var(--sh);
  box-shadow: inset 1px 1px 0 var(--hi), inset -1px -1px 0 var(--dsh);
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  overflow: hidden;
  white-space: nowrap;
}
.start {
  background: var(--start-bg);
  border: 2px solid var(--start-border);
  border-radius: calc(var(--soft-radius) + 8px);
  color: var(--start-text);
  font-family: var(--font-ui); font-size: 13px; font-weight: bold;
  padding: 3px 14px; display: flex; align-items: center; gap: 8px; cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.6),
    inset 0 -1px 0 rgba(0,0,0,.15);
}
html[data-style="win98"] .start {
  border-radius: 0; box-shadow: inset -1px -1px 0 var(--dsh), inset 1px 1px 0 var(--hi);
}
.start:active { filter: brightness(0.95); }
.tray {
  font-family: monospace;
  font-size: 13px;
  color: var(--btntext);
  background: var(--work);
  border: 2px inset var(--sh);
  padding: 3px 8px;
}

/* ===== Start Menu ===== */
.start-menu {
  position: fixed;
  bottom: var(--task-h);
  left: 6px;
  width: min(320px, 92vw);
  background: var(--work);
  border: 2px solid var(--sh);
  border-radius: var(--soft-radius);
  box-shadow: 0 6px 18px rgba(0,0,0,.25),
              inset -1px -1px 0 var(--dsh),
              inset  1px  1px 0 var(--hi);
  display: none;
  z-index: 1001;
  max-height: calc(min(100svh, 100dvh) - var(--task-h) - 12px);
  overflow: auto;
}
.start-menu.open { display: block; }
.start-menu .cap {
  background: var(--caption-bg);
  color: #fff;
  padding: 6px 8px;
  font-weight: 700;
  border-top-left-radius: var(--soft-radius);
  border-top-right-radius: var(--soft-radius);
  position: sticky; top: 0;
  min-height: 54px;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  text-align: right;
  letter-spacing: 1px;
}
.start-menu .body {
  padding: 12px;
  color: var(--text);
  font-size: 13px;
  display: grid; gap: 8px;
  background: var(--work);
}
.start-menu .body a {
  color: var(--text);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  padding: 3px 4px;
}
.start-menu .body a:hover {
  background: #000080;
  color: #fff;
}
.menu-icon {
  width: 18px;
  height: 18px;
}
.menu-icon.monitor {
  background: #c0c0c0;
  border: 1px solid #404040;
}
.menu-icon.folder {
  background: #f3d15b;
  border: 1px solid #7a5d00;
}
.menu-icon.globe {
  border-radius: 50%;
  background: #2f80ed;
  border: 1px solid #fff;
}
.menu-separator {
  height: 2px;
  border-top: 1px solid var(--sh);
  border-bottom: 1px solid var(--hi);
}
.start-menu .actions {
  padding: 8px 12px 12px;
  display: flex; justify-content: flex-end; gap: 8px;
}
.btn {
  background: var(--btn);
  color: var(--btntext);
  border: 2px solid var(--sh);
  border-radius: var(--soft-radius);
  box-shadow: inset -1px -1px 0 var(--dsh), inset 1px 1px 0 var(--hi);
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
}
.btn:active { box-shadow: inset 1px 1px 0 var(--dsh), inset -1px -1px 0 var(--hi); }

/* XS tweaks */
@media (max-width: 360px) {
  .content { padding: 12px; gap: 12px; }
  .actions { gap: 6px; }
  .link { padding: 6px; font-size: 12px; min-height: 36px; }
  .label { font-size: 11px; }
}

@media (max-width: 760px) {
  .taskbar-app { max-width: 36vw; }
}

/* ===== Professional portfolio layout ===== */
:root {
  --status-released: #18733c;
  --status-beta: #2b5ba9;
  --status-demo: #9a4b00;
}

html {
  scroll-behavior: smooth;
}

.desktop {
  max-width: 1100px;
}

.window {
  width: min(1100px, 96vw);
  touch-action: auto;
}

.titlebar {
  touch-action: none;
}

.content {
  gap: 18px;
  padding: clamp(14px, 2.4vw, 24px);
}

.addressbar {
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.language-switcher {
  display: flex;
  align-items: center;
  gap: 6px;
}

.language-switcher > a {
  min-width: 26px;
  padding: 5px 6px;
  border: 2px solid var(--sh);
  border-radius: var(--soft-radius);
  box-shadow: inset -1px -1px 0 var(--dsh), inset 1px 1px 0 var(--hi);
  background: var(--btn);
  color: var(--btntext);
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}

.language-switcher > a[aria-current="page"] {
  color: #fff;
  background: var(--caption-bg);
}

.language-switcher .pill {
  white-space: nowrap;
}

.profile-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: clamp(16px, 3vw, 30px);
  align-items: center;
  padding: clamp(18px, 3vw, 30px);
  border: 2px solid var(--sh);
  border-radius: var(--soft-radius);
  box-shadow: inset -1px -1px 0 var(--dsh), inset 1px 1px 0 var(--hi);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .75), rgba(255, 255, 255, 0) 62%),
    var(--work);
  text-align: left;
}

.profile-header .profile {
  width: clamp(92px, 12vw, 118px);
  height: clamp(92px, 12vw, 118px);
  margin: 0;
}

.profile-copy {
  min-width: 0;
}

.profile-copy h1 {
  margin: 2px 0 8px;
  font-size: clamp(25px, 5vw, 40px);
  line-height: 1.05;
}

.eyebrow,
.section-kicker {
  margin: 0;
  color: var(--link);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.summary {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  font-size: clamp(13px, 1.8vw, 15px);
  line-height: 1.6;
}

.contact-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.button-link {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  padding: 2px 14px;
  color: var(--btntext);
  background: var(--btn);
  border: 2px solid var(--sh);
  border-radius: var(--soft-radius);
  box-shadow: inset -1px -1px 0 var(--dsh), inset 1px 1px 0 var(--hi);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.button-link.primary {
  background: var(--caption-bg);
  color: #fff;
}

.button-link:hover,
.project-link:hover,
.publication-card:hover,
.text-link:hover,
.language-switcher > a:hover {
  outline: 1px dotted currentColor;
  outline-offset: -5px;
}

.group {
  gap: 16px;
  padding: clamp(13px, 2vw, 18px);
}

.section-heading {
  display: flex;
  gap: 20px;
  align-items: end;
  justify-content: space-between;
}

.section-heading h2 {
  margin: 3px 0 0;
  font-size: clamp(17px, 3vw, 22px);
  line-height: 1.2;
}

.section-heading > p {
  max-width: 520px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  text-align: right;
}

.skill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.skill-list span,
.tech-list li {
  border: 1px solid var(--sh);
  border-radius: calc(var(--soft-radius) / 2);
  background: var(--work);
  color: var(--text);
  box-shadow: inset 1px 1px 0 var(--hi);
  font-size: 10.5px;
  font-weight: 700;
}

.skill-list span {
  padding: 6px 8px;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.project-card {
  min-width: 0;
  overflow: hidden;
  border: 2px solid var(--sh);
  border-radius: var(--soft-radius);
  box-shadow: inset -1px -1px 0 var(--dsh), inset 1px 1px 0 var(--hi);
  background: var(--work);
}

.project-card .project-art {
  border: 0;
  border-bottom: 2px solid var(--sh);
  box-shadow: none;
}

.project-card-body {
  display: flex;
  min-height: 190px;
  flex-direction: column;
  gap: 10px;
  padding: 13px;
}

.project-title-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  justify-content: space-between;
}

.project-title-row h3 {
  margin: 1px 0 0;
  font-size: 15px;
  line-height: 1.25;
}

.status {
  flex: 0 0 auto;
  padding: 4px 6px;
  border: 1px solid currentColor;
  border-radius: 999px;
  background: #fff;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .045em;
  line-height: 1;
  text-transform: uppercase;
}

.status-released { color: var(--status-released); }
.status-beta { color: var(--status-beta); }
.status-demo { color: var(--status-demo); }

.project-card-body > p {
  flex: 1 1 auto;
  margin: 0;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.55;
}

.tech-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tech-list li {
  padding: 4px 6px;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-weight: 600;
}

.project-link,
.text-link {
  width: max-content;
  max-width: 100%;
  color: var(--link);
  font-size: 11px;
  font-weight: 800;
  text-decoration: underline;
}

.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 14px;
  align-items: center;
}

.contribution-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.metric-card {
  display: grid;
  gap: 4px;
  padding: 14px;
  border: 2px solid var(--sh);
  border-radius: var(--soft-radius);
  background: var(--work);
  box-shadow: inset -1px -1px 0 var(--dsh), inset 1px 1px 0 var(--hi);
}

.metric-value {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: clamp(24px, 5vw, 38px);
  font-weight: 900;
  line-height: 1;
}

.metric-label {
  color: var(--muted);
  font-size: 11px;
}

.year-history {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}

.year-stat {
  display: flex;
  min-width: 0;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 8px;
  border: 1px solid var(--sh);
  background: var(--work);
  font-size: 10.5px;
}

.year-stat strong {
  overflow: hidden;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 12px;
  text-overflow: ellipsis;
}

.loading-message,
.github-note {
  margin: 0;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.45;
}

.github-widget {
  display: grid;
  gap: 10px;
}

.live-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.live-product-card {
  display: grid;
  align-content: start;
  gap: 13px;
  min-width: 0;
  padding: 13px;
  border: 2px solid var(--sh);
  border-radius: var(--soft-radius);
  background: var(--work);
  box-shadow: inset -1px -1px 0 var(--dsh), inset 1px 1px 0 var(--hi);
}

.live-product-heading,
.live-product-heading > div {
  display: flex;
  align-items: center;
}

.live-product-heading {
  gap: 10px;
  justify-content: space-between;
}

.live-product-heading > div {
  min-width: 0;
  gap: 7px;
}

.live-product-heading h3 {
  overflow: hidden;
  margin: 0;
  font-size: 13px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-product-heading a {
  flex: 0 0 auto;
  color: var(--link);
  font-size: 10px;
  font-weight: 700;
}

.live-indicator {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border: 1px solid #075b2d;
  border-radius: 50%;
  background: #20a85a;
  box-shadow: 0 0 0 2px rgba(32, 168, 90, .14);
}

.live-product-card.is-stale .live-indicator {
  border-color: #8a4a00;
  background: #e78b1d;
  box-shadow: none;
}

.live-product-card.is-unavailable .live-indicator {
  border-color: #666;
  background: #999;
  box-shadow: none;
}

.live-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  margin: 0;
}

.live-metrics.single {
  grid-template-columns: 1fr;
}

.live-metrics > div {
  display: flex;
  min-width: 0;
  flex-direction: column-reverse;
  justify-content: flex-end;
  gap: 4px;
  padding: 8px 6px;
  border: 1px solid var(--sh);
  background: var(--btn);
  text-align: center;
}

.live-metrics dt {
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.25;
  text-overflow: ellipsis;
}

.live-metrics dd {
  overflow: hidden;
  margin: 0;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: clamp(14px, 2.3vw, 20px);
  font-weight: 900;
  line-height: 1;
  text-overflow: ellipsis;
}

.verified-author {
  display: flex;
  align-items: center;
  gap: 6px;
  width: max-content;
  max-width: 100%;
  padding: 5px 7px;
  border: 1px solid #886800;
  border-radius: 999px;
  background: #fff5b8;
  color: #4e3a00;
  font-size: 10px;
  font-weight: 800;
}

.verified-author span {
  display: grid;
  width: 15px;
  height: 15px;
  place-items: center;
  border-radius: 50%;
  background: #b58d00;
  color: #fff;
  font-size: 10px;
}

.verified-author[hidden] {
  display: none;
}

.live-stats-note {
  text-align: right;
}

.publication-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.publication-card {
  display: grid;
  gap: 5px;
  padding: 14px;
  border: 2px solid var(--sh);
  border-radius: var(--soft-radius);
  background: var(--work);
  box-shadow: inset -1px -1px 0 var(--dsh), inset 1px 1px 0 var(--hi);
  color: var(--text);
  text-decoration: none;
}

.publication-card strong {
  font-size: 14px;
}

.publication-card span {
  color: var(--muted);
  font-size: 11.5px;
}

.publication-card small {
  margin-top: 5px;
  color: var(--link);
  font-weight: 700;
}

footer {
  display: grid;
  justify-items: center;
  padding: 20px 10px 8px;
}

footer > strong {
  color: var(--text);
  font-size: 16px;
}

footer > p {
  max-width: 600px;
  margin: 6px 0 0;
  line-height: 1.5;
}

footer .contact-row {
  justify-content: center;
  margin: 12px 0 18px;
}

.menu-icon.mail {
  background: #fff;
  border: 1px solid #404040;
}

@media (min-width: 1020px) {
  .projects-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .project-card-body {
    min-height: 210px;
  }
}

@media (max-width: 680px) {
  .addressbar {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .language-switcher {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }

  .profile-header {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .profile-copy {
    display: grid;
    justify-items: center;
  }

  .section-heading {
    display: grid;
    gap: 8px;
    align-items: start;
  }

  .section-heading > p {
    text-align: left;
  }

  .projects-grid,
  .publication-grid,
  .live-stats-grid {
    grid-template-columns: 1fr;
  }

  .year-history {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 380px) {
  .contribution-summary {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
