/* ──────────────────────────────────────────────────────────────────────────
   Portfolio: Frutiger Aero stage + Windows XP (Luna) windows
   ────────────────────────────────────────────────────────────────────────── */

:root {
  --ink: #1f2329;
  --ink-2: #5a606a;
  --bg: #ffffff;
  --bg-floor: #e4e5e9;
  --focus: #0a58d0;

  --font-ui: "Lucida Grande", "Lucida Sans Unicode", "Lucida Sans", Geneva, Verdana, sans-serif;
  --font-xp: var(--font-ui);
  --font-xp-title: var(--font-ui);

  --ease-out: cubic-bezier(.2, .8, .2, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);

  color-scheme: light;
}

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

html { -webkit-text-size-adjust: 100%; background: var(--bg); }

body {
  margin: 0;
  min-height: 100dvh;
  overflow-x: hidden;
  font: 400 16px/1.5 var(--font-ui);
  color: var(--ink);
  background: var(--bg) linear-gradient(0deg, var(--bg-floor) 0%, #f1f2f4 28%, var(--bg) 62%) fixed;
  -webkit-font-smoothing: antialiased;
}

body.is-dragging-window { user-select: none; -webkit-user-select: none; cursor: grabbing; }

img { max-width: 100%; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: fixed; left: 16px; top: -100px; z-index: 1000;
  padding: 10px 16px; border-radius: 10px;
  background: #fff; color: var(--ink); font-weight: 700; text-decoration: none;
  box-shadow: 0 6px 20px rgba(0, 40, 100, .25);
  transition: top .2s var(--ease-out);
}
.skip-link:focus { top: 12px; }

/* ── Header: name top-left, nav top-right ──────────────────────────────────── */

.site-header {
  position: fixed; z-index: 50;
  top: max(24px, env(safe-area-inset-top));
  left: max(28px, env(safe-area-inset-left));
  right: max(28px, env(safe-area-inset-right));
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px;
  pointer-events: none; /* the empty middle shouldn't block the page */
}
.site-header > * { pointer-events: auto; }
.site-name {
  margin: 0;
  font: 700 24px/1.1 var(--font-ui); letter-spacing: -.02em;
  color: var(--ink);
}
.site-header nav { margin-left: auto; }

.nav-list { display: flex; gap: 6px; margin: 0; padding: 0; list-style: none; }

/* Glossy Aero pill button, tinted light grey */
.aero-btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  min-height: 30px; padding: 0 12px;
  border: 1px solid #c4c7cd; border-radius: 999px;
  font: 700 12px/1 var(--font-ui); color: #2b2f36; text-decoration: none;
  background: linear-gradient(180deg, #ffffff 0%, #f7f7f8 46%, #e7e8eb 50%, #f2f3f5 100%);
  box-shadow: inset 0 1px 0 #fff, inset 0 -2px 5px rgba(0, 0, 0, .04), 0 1px 3px rgba(0, 0, 0, .1);
  cursor: pointer;
  transition: box-shadow .2s var(--ease-out), translate .2s var(--ease-out), background .2s;
}
.aero-btn:hover {
  translate: 0 -1px;
  background: linear-gradient(180deg, #ffffff 0%, #fafafa 46%, #eceef1 50%, #f7f8f9 100%);
  box-shadow: inset 0 1px 0 #fff, 0 0 0 3px rgba(0, 0, 0, .05), 0 4px 10px rgba(0, 0, 0, .1);
}
.aero-btn:active { translate: 0 1px; box-shadow: inset 0 2px 4px rgba(0, 0, 0, .14); }
.aero-btn svg { flex: none; color: #5a606a; }

/* ── Stage ─────────────────────────────────────────────────────────────────── */

.stage {
  position: relative; z-index: 1;
  height: 100dvh; min-height: 560px;
  overflow: hidden;
}

.platform {
  position: absolute; left: var(--rcx); top: var(--rcy);
  width: calc(2 * var(--rrx) + var(--orb-w) * 1.3);
  height: calc(2 * var(--rry) + var(--orb-h) * 1.1);
  translate: -50% -42%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(40, 48, 60, .045), rgba(40, 48, 60, .02) 62%, rgba(40, 48, 60, 0));
}
/* The orbit track itself */
.platform::before {
  content: ''; position: absolute; left: 50%; top: 42%;
  width: calc(2 * var(--rrx)); height: calc(2 * var(--rry));
  translate: -50% -50%; border-radius: 50%;
  border: 1.5px solid rgba(40, 48, 60, .1);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .9), inset 0 1px 0 rgba(255, 255, 255, .9);
}

.mascot-shadow {
  position: absolute; left: var(--mx); top: calc(var(--rcy) - var(--rry) * .15);
  width: calc(var(--ms) * .55); height: calc(var(--ms) * .09);
  translate: -50% -50%; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(20, 24, 30, .2), rgba(20, 24, 30, 0));
}

.mascot {
  position: absolute; z-index: 5;
  left: var(--mx); top: var(--my);
  width: var(--ms); height: var(--ms);
  translate: -50% -50%;
  pointer-events: none;
}
.mascot-poster {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: contain;
  transition: opacity .6s var(--ease-out);
  will-change: transform;
}
.mascot-canvas {
  position: absolute; left: 50%; top: 50%;
  width: var(--cs); height: var(--cs);
  translate: -50% -50%;
  opacity: 0;
  transition: opacity .6s var(--ease-out);
}
.mascot.is-3d .mascot-canvas { opacity: 1; }
.mascot.is-3d .mascot-poster { opacity: 0; }

.mascot-hit {
  position: absolute; left: 20%; top: 4%; width: 60%; height: 90%;
  border: 0; border-radius: 50%; padding: 0;
  background: transparent; cursor: pointer;
  pointer-events: auto;
}

/* ── Speech bubble ─────────────────────────────────────────────────────────── */

.speech {
  position: absolute; z-index: 30;
  padding: 20px 44px 14px 20px;
  border-radius: 26px;
  background: linear-gradient(180deg, #ffffff 0%, #f5fbff 52%, #e2f3ff 100%);
  border: 1px solid #8ccaf0;
  box-shadow:
    inset 0 1px 0 #fff,
    0 0 0 5px rgba(255, 255, 255, .45),
    0 18px 36px -12px rgba(10, 70, 140, .4);
  color: var(--ink);
  cursor: pointer;
  opacity: 0; scale: .7;
  transition: opacity .22s var(--ease-out), scale .35s var(--ease-spring);
}
.speech[data-tail="left"] { transform-origin: -10px 46px; }
.speech[data-tail="down"] { transform-origin: 50% calc(100% + 14px); }
.speech.is-visible { opacity: 1; scale: 1; }

/* top gloss */
.speech::before {
  content: ''; position: absolute; left: 14px; right: 14px; top: 3px; height: 42%;
  border-radius: 22px 22px 50% 50% / 22px 22px 16px 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .95), rgba(255, 255, 255, 0));
  pointer-events: none;
}
/* tail */
.speech::after {
  content: ''; position: absolute; width: 22px; height: 22px;
  border: 1px solid #8ccaf0; border-top: 0; border-right: 0;
}
.speech[data-tail="left"]::after {
  left: -12px; top: 36px; rotate: 45deg;
  background: #fbfdff;
}
.speech[data-tail="down"]::after {
  left: calc(50% - 11px); bottom: -12px; rotate: -45deg;
  background: #e4f4ff;
}

.speech-name {
  position: absolute; top: -14px; left: 18px;
  padding: 6px 12px; border-radius: 999px;
  font: 700 11px/1 var(--font-ui); letter-spacing: .06em; text-transform: uppercase;
  color: #fff;
  background: linear-gradient(180deg, #5cc4ff 0%, #1c8ae6 50%, #0a6ad0 51%, #1587e8 100%);
  border: 1px solid #0a5cb8;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6), 0 2px 6px rgba(0, 80, 160, .3);
  text-shadow: 0 1px 1px rgba(0, 40, 100, .4);
}

.speech-text { position: relative; display: grid; margin: 0; font: 400 17px/1.45 var(--font-ui); }
.speech-text > * { grid-area: 1 / 1; }
.speech-sizer { visibility: hidden; }
.speech-caret {
  display: inline-block; width: 2px; height: 1.05em; margin-left: 2px;
  vertical-align: -.15em; background: currentColor;
  opacity: 0;
}
.speech.is-typing .speech-caret { opacity: 1; animation: caret 1s steps(1) infinite; }
@keyframes caret { 50% { opacity: 0; } }

.speech-hint { display: block; min-height: 1.2em; margin-top: 6px; font-size: 13px; font-weight: 600; color: var(--ink-2); }

.speech-close {
  position: absolute; top: 6px; right: 6px;
  display: grid; place-items: center;
  width: 36px; height: 36px; padding: 0;
  border: 0; border-radius: 50%;
  background: transparent; color: var(--ink-2);
  cursor: pointer;
  transition: background .15s, color .15s;
}
.speech-close:hover { background: rgba(10, 100, 200, .1); color: var(--ink); }

/* ── Carousel ──────────────────────────────────────────────────────────────── */

/* No z-index here on purpose: orbs need to slot in front of / behind the mascot. */
.carousel { position: absolute; inset: 0; pointer-events: none; }
.carousel:focus { outline: none; }

.orbit-surface {
  position: absolute; z-index: 1;
  left: calc(var(--rcx) - var(--rrx) - var(--orb-w) * .6);
  top: calc(var(--rcy) - var(--rry) - var(--orb-h) * .6);
  width: calc(2 * var(--rrx) + var(--orb-w) * 1.2);
  height: calc(2 * var(--rry) + var(--orb-h) * 1.2 + 40px);
  border-radius: 50%;
  pointer-events: auto;
  touch-action: pan-y;
  cursor: grab;
}
.carousel.is-dragging .orbit-surface,
.carousel.is-dragging .orb-btn { cursor: grabbing; }

.orbit-list { margin: 0; padding: 0; list-style: none; }

.orbit-item {
  position: absolute; left: 0; top: 0;
  width: var(--orb-w); height: var(--orb-h);
  pointer-events: auto;
  touch-action: pan-y;
  will-change: transform, opacity;
}

.orb-btn {
  position: relative; display: block;
  width: 100%; height: 100%;
  margin: 0; padding: 0; border: 0; border-radius: 50%;
  background: none; font: inherit; color: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.orb-btn:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }

.orb {
  position: absolute; inset: 0; border-radius: 50%;
  background:
    radial-gradient(90% 70% at 50% 108%, rgba(255, 255, 255, .6), rgba(255, 255, 255, 0) 55%),
    linear-gradient(180deg, var(--c1) 0%, var(--c2) 100%);
  box-shadow:
    inset 0 -8px 16px rgba(0, 0, 0, .16),
    inset 0 2px 5px rgba(255, 255, 255, .6),
    inset 0 0 0 1.5px rgba(255, 255, 255, .5),
    0 0 0 1px rgb(0 0 0 / .08),
    0 16px 22px -12px var(--c2);
  transition: transform .3s var(--ease-spring), box-shadow .3s var(--ease-out);
}
/* glossy highlight across the top */
.orb::before {
  content: ''; position: absolute; z-index: 2;
  left: 13%; right: 13%; top: 5%; height: 47%;
  border-radius: 50% 50% 45% 45% / 62% 62% 38% 38%;
  background: linear-gradient(180deg, rgba(255, 255, 255, .95), rgba(255, 255, 255, .18) 78%, rgba(255, 255, 255, 0));
}
/* little caustic glint on the bottom rim */
.orb::after {
  content: ''; position: absolute; z-index: 2;
  left: 30%; right: 30%; bottom: 6%; height: 16%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 255, 255, .75), rgba(255, 255, 255, 0));
}
.orb-glyph {
  position: absolute; inset: 0; z-index: 1;
  display: grid; place-items: center; padding-top: 10%;
  color: #fff;
  filter: drop-shadow(0 1.5px 1.5px rgba(0, 30, 60, .45));
}
.orb-glyph svg { width: 42%; height: auto; }

.orb-btn:hover .orb,
.orb-btn:focus-visible .orb {
  transform: translateY(-5px) scale(1.07);
  box-shadow:
    inset 0 -8px 16px rgba(0, 0, 0, .16),
    inset 0 2px 5px rgba(255, 255, 255, .6),
    inset 0 0 0 1.5px rgba(255, 255, 255, .6),
    0 0 0 1px rgb(0 0 0 / .08),
    0 0 28px 6px color-mix(in srgb, var(--c1) 70%, transparent),
    0 20px 26px -12px var(--c2);
}
.orb-btn:active .orb { transform: scale(.96); transition-duration: .1s; }

.orb-label {
  position: absolute; top: calc(100% + 10px); left: 50%; translate: -50% 0;
  width: max-content; max-width: 210px;
  padding: 5px 12px; border-radius: 999px;
  font: 700 13px/1.25 var(--font-ui); text-align: center; color: var(--ink);
  background: linear-gradient(180deg, #fff, #f4f5f7);
  border: 1px solid #dfe1e5;
  box-shadow: 0 3px 10px rgba(0, 0, 0, .07);
  opacity: var(--label-o, 1);
  pointer-events: none;
}
.orbit-item.is-front .orb-label { box-shadow: 0 0 0 2px color-mix(in srgb, var(--c1) 55%, transparent), 0 6px 14px rgba(0, 0, 0, .1); }

.orbit-hint {
  position: absolute; z-index: 40;
  right: max(24px, env(safe-area-inset-right)); bottom: max(20px, env(safe-area-inset-bottom));
  margin: 0;
  font-size: 14px; font-weight: 600; color: var(--ink-2);
}

/* ── Windows XP ────────────────────────────────────────────────────────────── */

.windows-layer { position: fixed; inset: 0; z-index: 100; pointer-events: none; }

.xp-window {
  position: absolute; left: 0; top: 0;
  width: min(var(--win-w, 560px), calc(100vw - 16px));
  max-height: calc(100dvh - 24px);
  display: flex; flex-direction: column;
  padding: 0 0 3px;
  border-radius: 8px 8px 0 0;
  background: #ece9d8;
  box-shadow:
    inset -1px -1px #00138c, inset 1px 1px #0831d9,
    inset -2px -2px #001ea0, inset 2px 2px #166aee,
    inset -3px -3px #003bda, inset 3px 3px #0855dd,
    0 22px 50px -14px rgba(0, 25, 80, .55);
  font: 14px/1.55 var(--font-xp);
  color: #000;
  pointer-events: auto;
  -webkit-font-smoothing: auto;
}
.xp-window:focus { outline: none; }
.xp-window:focus-visible .xp-titlebar { outline: 2px dotted #fff; outline-offset: -4px; }
.xp-window:not(.is-active) {
  box-shadow:
    inset -1px -1px #6582d2, inset 1px 1px #758fdb,
    inset -2px -2px #7b95dd, inset 2px 2px #8aa3e3,
    inset -3px -3px #7890db, inset 3px 3px #7d97de,
    0 14px 36px -14px rgba(0, 25, 80, .4);
}

.xp-titlebar {
  flex: none;
  display: flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 5px 0 7px;
  border-radius: 8px 7px 0 0;
  background: linear-gradient(180deg, #0997ff, #0053ee 8%, #0050ee 40%, #06f 88%, #06f 93%, #005bff 95%, #003dd7 96%, #003dd7);
  cursor: grab;
  touch-action: none;
  user-select: none; -webkit-user-select: none;
}
.xp-window.is-dragging .xp-titlebar { cursor: grabbing; }
.xp-window:not(.is-active) .xp-titlebar {
  background: linear-gradient(180deg, #7697e7, #7e9ee3 3%, #94afe8 6%, #97b4e9 8%, #82a5e4 14%, #7c9fe2 17%, #7996de 25%, #7b99e1 56%, #82a9e9 81%, #80a5e7 89%, #7b96e1 94%, #7a93df 97%, #abbae3);
}

.xp-title {
  flex: 1; min-width: 0; margin: 0;
  font: 700 14px/1 var(--font-xp-title);
  color: #fff; text-shadow: 1px 1px #0f1089;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.xp-window:not(.is-active) .xp-title { color: #e2eafb; text-shadow: none; }

.xp-controls { display: flex; gap: 2px; }
.xp-ctl {
  position: relative;
  display: grid; place-items: center;
  width: 23px; height: 23px; padding: 0;
  border: 1px solid #fff; border-radius: 3px;
  cursor: pointer;
  box-shadow: inset 0 -1px 2px rgba(0, 0, 0, .2);
}
/* bigger hit area than the drawn button */
.xp-ctl::before { content: ''; position: absolute; inset: -6px -2px; }
.xp-ctl--max { background: radial-gradient(circle at 90% 90%, #0054e9 0%, #2263d5 55%, #4479e4 70%, #a3bbec 90%, #fff 100%); }
.xp-ctl--close { background: radial-gradient(circle at 90% 90%, #cc4600 0%, #dc6527 55%, #cd7546 70%, #ffccb2 90%, #fff 100%); margin-left: 2px; }
.xp-ctl:hover { filter: brightness(1.15); }
.xp-ctl:active { filter: brightness(.85); }
.xp-ctl:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }
.xp-window:not(.is-active) .xp-ctl { opacity: .8; }

.xp-body {
  flex: 1 1 auto; min-height: 0;
  margin: 0 3px;
  overflow: auto;
  overscroll-behavior: contain;
  background: #ece9d8;
}

.xp-statusbar {
  flex: none;
  display: flex; gap: 2px;
  margin: 0 3px; padding: 2px;
  font: 12px/1.3 var(--font-xp); color: #222;
  background: #ece9d8;
  border-top: 1px solid #fff;
  box-shadow: 0 -1px #a7a598;
}
.xp-statusbar span {
  padding: 3px 6px;
  box-shadow: inset -1px -1px #fff, inset 1px 1px #a7a598;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.xp-statusbar span:first-child { flex: 1; }

.xp-window.is-max {
  translate: none !important;
  width: 100vw; height: 100dvh; max-height: none;
  border-radius: 0;
}
.xp-window.is-max .xp-titlebar { border-radius: 0; cursor: default; }

/* XP-style scrollbars */
.xp-body::-webkit-scrollbar { width: 17px; height: 17px; }
.xp-body::-webkit-scrollbar-track { background: #f5f4ef; box-shadow: inset 1px 0 #e9e7de; }
.xp-body::-webkit-scrollbar-thumb {
  background: linear-gradient(90deg, #c8d6fb, #bacdfa 50%, #aec3f5);
  border: 1px solid #fff; border-radius: 3px;
  box-shadow: inset -1px -1px #8ba6e6, inset 1px 1px #e3ebff;
}
@supports not selector(::-webkit-scrollbar) {
  .xp-body { scrollbar-color: #b7cafa #f5f4ef; }
}

/* Small glossy orb used in title bars, banners and link lists */
.mini-orb {
  flex: none; position: relative;
  display: inline-grid; place-items: center;
  width: 18px; height: 14px; border-radius: 50%;
  color: #fff;
  background: linear-gradient(180deg, var(--c1), var(--c2));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .55), 0 1px 2px rgba(0, 0, 0, .3);
}
.mini-orb::before {
  content: ''; position: absolute; left: 14%; right: 14%; top: 6%; height: 45%;
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(255, 255, 255, .9), rgba(255, 255, 255, .1));
}
.mini-orb svg { position: relative; filter: drop-shadow(0 1px 0 rgba(0, 0, 0, .35)); }
.mini-orb--md { width: 40px; height: 30px; }
.mini-orb--lg { width: 64px; height: 46px; box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .6), 0 4px 10px rgba(0, 0, 0, .25); }
.mini-orb--lg svg { margin-top: 3px; }

/* Explorer-style layout for project windows */
.xp-explorer {
  display: grid; grid-template-columns: 208px minmax(0, 1fr);
  min-height: 100%;
}
.xp-tasks {
  order: -1;
  display: flex; flex-direction: column; gap: 12px;
  padding: 12px 10px;
  background: linear-gradient(180deg, #7ba2e7 0%, #6375d6 100%);
}
.xp-taskpane-title {
  margin: 0; padding: 7px 10px;
  font: 700 13px/1.2 var(--font-xp); color: #10408f;
  background: linear-gradient(90deg, #fff 0%, #c6d3f7 100%);
  border-radius: 5px 5px 0 0;
}
.xp-taskpane-body {
  margin: 0; padding: 10px 11px;
  background: #d6dff7;
  border: 1px solid #fff; border-top: 0;
  font-size: 13px;
}
.xp-facts div + div { margin-top: 8px; }
.xp-facts dt { font-weight: 700; color: #10408f; font-size: 12px; }
.xp-facts dd { margin: 0; }
.xp-links { list-style: none; display: grid; gap: 6px; }
.xp-links a {
  display: flex; align-items: center; gap: 7px;
  min-height: 28px;
  color: #10408f; text-decoration: none;
}
.xp-links a:hover { color: #2b6ef0; text-decoration: underline; }

.xp-doc {
  min-width: 0;
  padding: 18px 20px 24px;
  background: #fff;
  box-shadow: inset 1px 0 #7f9db9;
}

.proj-banner {
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px;
  border-radius: 10px;
  color: #fff;
  background:
    linear-gradient(90deg, rgba(0, 20, 50, .28), rgba(0, 20, 50, 0) 75%),
    linear-gradient(90deg, var(--c2), var(--c1));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6), inset 0 0 0 1px rgba(0, 0, 0, .08);
}
.proj-banner::before {
  content: ''; position: absolute; left: 0; right: 0; top: 0; height: 50%;
  background: linear-gradient(180deg, rgba(255, 255, 255, .45), rgba(255, 255, 255, .08));
  pointer-events: none;
}
.proj-banner > * { position: relative; }
.proj-kicker {
  margin: 0 0 2px;
  font: 700 12px/1.2 var(--font-ui); letter-spacing: .08em; text-transform: uppercase;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .45);
}
.proj-title {
  margin: 0;
  font: 700 24px/1.15 var(--font-ui); letter-spacing: -.01em;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .35);
}

.proj-summary { margin: 16px 0 0; font-size: 15px; }
/* Justified body text in project windows and About Me */
.xp-doc .proj-summary,
.xp-doc .xp-group p,
.about > p { text-align: justify; }
/* "Full project" sidebar pane: stacked, full-width download / website buttons */
.proj-actions { display: flex; flex-direction: column; gap: 6px; }
.proj-actions .xp-button { width: 100%; min-width: 0; justify-content: flex-start; padding: 6px 10px; text-align: left; }
.proj-actions .xp-button svg { flex: none; }
.proj-btn-text { display: flex; flex-direction: column; gap: 1px; line-height: 1.25; }
.proj-size { font-size: 11px; color: #555; }

/* Lead image */
.proj-hero {
  display: block; width: 100%;
  margin: 16px 0 0; padding: 0;
  border: 1px solid #7f9db9; background: #f1f3f7;
  cursor: zoom-in;
}
.proj-hero img { display: block; width: 100%; height: auto; max-height: 460px; object-fit: contain; }

/* Masonry-style gallery: keeps portrait photos and landscape pages uncropped */
.gallery { columns: 3 160px; column-gap: 12px; }
.gallery-item { break-inside: avoid; margin: 0 0 14px; }
.gallery-btn {
  display: block; width: 100%; padding: 0;
  border: 1px solid #7f9db9; background: #eef3fa;
  cursor: zoom-in;
}
.gallery-btn img { display: block; width: 100%; height: auto; }
.gallery-btn:hover, .proj-hero:hover { outline: 2px solid #316ac5; outline-offset: 1px; }
.gallery-item figcaption { margin-top: 5px; font-size: 12px; line-height: 1.35; color: #333; }
.proj-credit { margin: 18px 0 0; font-size: 12px; color: #555; }

.gallery--empty { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 16px; }
.gallery-ph {
  display: grid; place-items: center; align-content: center; gap: 6px;
  aspect-ratio: 4 / 5;
  border: 1px dashed #97b0d4; border-radius: 4px;
  background: repeating-linear-gradient(45deg, #f5f8fd 0 10px, #edf3fb 10px 20px);
  color: #4d6a8d; font-size: 12px; text-align: center; line-height: 1.35;
}

/* XP "Picture Viewer" window */
.xp-window--viewer .xp-body { display: flex; flex-direction: column; background: #fff; }
.viewer { display: flex; flex-direction: column; min-height: 0; flex: 1; }
/* Fixed-height stage so the window's size is known before the image arrives.
   The image is absolutely centred so its max-width/height always resolve against
   the stage: tall images shrink to fit instead of spilling under the toolbar. */
.viewer-stage {
  --pad: 14px;
  position: relative; overflow: hidden;
  flex: none; height: min(calc(100dvh - 150px), 760px);
  background: linear-gradient(180deg, #fbfcfe, #eef2f9);
}
.viewer-img {
  position: absolute; left: 50%; top: 50%; translate: -50% -50%;
  display: block; width: auto; height: auto;
  max-width: calc(100% - 2 * var(--pad)); max-height: calc(100% - 2 * var(--pad));
  box-shadow: 0 2px 10px rgba(0, 0, 0, .18);
  transition: filter .2s;
}
.xp-window--viewer.is-loading .viewer-img { filter: blur(1px); }
.xp-window--viewer.is-max .viewer-stage { flex: 1; height: auto; min-height: 0; }
.viewer-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px;
  border-top: 1px solid #c9d6ea;
  background: linear-gradient(180deg, #f6f8fc, #dfe7f5);
}
.viewer-btn {
  flex: none; display: grid; place-items: center;
  width: 34px; height: 34px; padding: 0;
  border: 1px solid #1e6b1e; border-radius: 50%;
  color: #fff; cursor: pointer;
  background: radial-gradient(circle at 50% 30%, #b8f09a 0%, #5cc245 45%, #2f8f2f 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7), 0 1px 3px rgba(0, 0, 0, .25);
}
.viewer-btn svg { filter: drop-shadow(0 1px 0 rgba(0, 0, 0, .35)); }
.viewer-btn:hover { filter: brightness(1.08); }
.viewer-btn:active { filter: brightness(.9); }
.viewer-btn:disabled { opacity: .45; cursor: default; }
.viewer-count { flex: none; min-width: 58px; font-size: 12px; color: #333; text-align: center; }
.viewer-caption { flex: 1; min-width: 0; margin: 0; font-size: 13px; color: #111; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* XP group box */
.xp-group {
  position: relative;
  margin: 24px 0 0; padding: 16px 14px 12px;
  border: 1px solid #d0d0bf; border-radius: 4px;
}
.xp-group > h3 {
  position: absolute; top: -.8em; left: 9px;
  margin: 0; padding: 0 5px;
  font: 700 14px/1.4 var(--font-xp); color: #0046d5;
  background: #fff;
}
.xp-group p { margin: 0; }

.xp-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.xp-tags li {
  padding: 3px 10px; border-radius: 999px;
  font-size: 12.5px; line-height: 1.4; color: #123a78;
  background: linear-gradient(180deg, #fff, #e3ecfb);
  border: 1px solid #9db7e0;
}

.xp-pane {
  margin: 8px; padding: 18px 20px 20px;
  background: #fff;
  border: 1px solid #7f9db9;
}
.xp-pane > p { margin: 0 0 10px; }

.xp-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 18px; }

/* XP push button */
.xp-button {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 32px; min-width: 90px; padding: 5px 16px;
  font: 13px/1.2 var(--font-xp); color: #000; text-decoration: none;
  border: 1px solid #003c74; border-radius: 3px;
  background: linear-gradient(180deg, #fff 0%, #ecebe6 86%, #d6d0c5 100%);
  cursor: pointer;
}
.xp-button:hover {
  box-shadow: inset -1px 1px #fff0cf, inset 1px 2px #fdd889, inset -2px 2px #fbc761, inset 2px -2px #e5a01a;
}
.xp-button:active {
  background: linear-gradient(180deg, #cdcac3 0%, #e3e3db 8%, #e5e5de 94%, #f2f2f1 100%);
  box-shadow: none;
}
.xp-button--default { box-shadow: inset -1px 1px #cee7ff, inset 1px 2px #98b8ea, inset -2px 2px #bcd4f6, inset 1px -1px #89ade4, inset 2px -2px #89ade4; }
.xp-button--sm { min-width: 0; min-height: 30px; padding: 4px 10px; font-size: 12px; }

/* About */
.about-head { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; }
.xp-userpic {
  flex: none; width: 80px; height: 80px; overflow: hidden;
  border: 3px solid #fff; border-radius: 9px;
  background: linear-gradient(135deg, #d5ecff, #7fb6ee);
  box-shadow: 0 0 0 1px #5a7edc, 0 3px 8px rgba(0, 0, 0, .25);
}
.xp-userpic img { width: 100%; height: 100%; object-fit: contain; }
.about-hello { margin: 0; font: 700 21px/1.2 var(--font-ui); color: #0b3d91; }
.about-role { margin: 3px 0 0; color: #4a5f7a; }
.edu-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.edu-list li { display: flex; gap: 10px; align-items: flex-start; }
.edu-list svg { flex: none; margin-top: 2px; color: #0046d5; }
.edu-list strong, .edu-list span { display: block; }
.edu-list span { font-size: 13px; color: #4a5f7a; }

/* Contact */
.contact-list { display: grid; gap: 8px; margin: 14px 0 0; padding: 0; list-style: none; }
.contact-list li {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border: 1px solid #c9d6ea; border-radius: 6px;
  background: linear-gradient(180deg, #fff, #f2f6fc);
}
.contact-text { flex: 1; min-width: 0; }
.contact-label { display: block; font-size: 12px; color: #4a5f7a; }
.contact-text a { color: #0b4fc4; font-weight: 700; overflow-wrap: anywhere; }
.contact-text a:hover { color: #2b6ef0; }

.noscript {
  position: fixed; left: 50%; bottom: 24px; translate: -50% 0; z-index: 200;
  padding: 12px 18px; border-radius: 12px; background: #fff; color: var(--ink);
  box-shadow: 0 8px 24px rgba(0, 40, 100, .25);
}

/* ── Touch & small screens ─────────────────────────────────────────────────── */

@media (pointer: coarse) {
  .aero-btn::after { content: ''; position: absolute; inset: -7px -3px; } /* 44px touch target */
  .xp-ctl { width: 30px; height: 26px; }
  .xp-titlebar { height: 38px; }
  .xp-button { min-height: 44px; }
  .xp-links a { min-height: 40px; }
}

@media (max-width: 720px) {
  .site-header { top: max(18px, env(safe-area-inset-top)); left: max(18px, env(safe-area-inset-left)); right: max(18px, env(safe-area-inset-right)); }
  .site-name { font-size: 19px; }
  .orbit-hint { display: none; }
  .orb-label { font-size: 12px; padding: 4px 9px; max-width: 124px; }
  .gallery { columns: 2 130px; }
  .viewer-caption { white-space: normal; font-size: 12px; }
  .viewer-stage { height: min(calc(100dvh - 190px), 520px); --pad: 8px; }
  .speech { padding: 18px 42px 12px 18px; }
  .speech-text { font-size: 16px; }

  .xp-explorer { grid-template-columns: minmax(0, 1fr); }
  .xp-tasks { order: 0; }
  .xp-doc { box-shadow: none; padding: 14px 14px 18px; }
  .proj-title { font-size: 21px; }
  /* narrow columns: hyphenate so justified lines don't open up big gaps */
  .xp-doc .proj-summary, .xp-doc .xp-group p, .about > p { -webkit-hyphens: auto; hyphens: auto; }
  .mini-orb--lg { width: 52px; height: 38px; }
}

@media (max-width: 440px) {
  .nav-list .aero-btn svg { display: none; }
}

/* ── Reduced motion ────────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  .speech, .aero-btn, .orb, .skip-link { transition: none; }
  .speech-caret { animation: none !important; }
}
