/* ===================================================================
   Gerardo Manjani — Portfolio
   Theme variables, light + dark
   =================================================================== */

:root {
  --max-width: 1080px;
  --radius: 14px;
  --radius-sm: 8px;
  --transition: 0.25s ease;
  --font-sans: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;}

/* ---------- Dark theme (default) ----------
   The desk section is always dark, whatever the page theme is. */
[data-theme='dark'],
.hero {
  --bg: #080a0d;
  --bg-alt: #11161d;
  --surface: #161c25;
  --surface-2: #1c232e;
  --border: #232b36;
  --text: #e6edf3;
  --text-muted: #9aa7b4;
  --accent: #fbbf24;
  --accent-strong: #dda820;
  --accent-soft: rgba(251, 191, 36, 0.12);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

/* ---------- Light theme ---------- */
[data-theme='light'] {
  --bg: #ffffff;
  --bg-alt: #f6f8fa;
  --surface: #ffffff;
  --surface-2: #f0f3f6;
  --border: #e2e8f0;
  --text: #0f172a;
  --text-muted: #5b6675;
  --accent: #d97706;
  --accent-strong: #bf6905;
  --accent-soft: rgba(217, 119, 6, 0.10);
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

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

/* Reserve the scrollbar gutter so locking body scroll (the in-screen desktop)
   doesn't shift the whole page sideways. */
html { scroll-behavior: smooth; scroll-padding-top: 80px; scrollbar-gutter: stable; }

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background var(--transition), color var(--transition);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}

h1, h2, h3 { line-height: 1.2; font-weight: 700; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul { margin: 0; padding: 0; list-style: none; }

.container { width: 100%; max-width: var(--max-width); margin: 0 auto; padding: 0 24px; }

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 1000;
  background: var(--accent); color: #1c1203; padding: 10px 16px;
  border-radius: 0 0 var(--radius-sm) 0; font-weight: 600;
}
.skip-link:focus { left: 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 22px; border-radius: var(--radius-sm);
  font-weight: 600; font-size: 0.95rem; cursor: pointer;
  border: 1px solid transparent; transition: all var(--transition);
}
.btn--primary { background: var(--accent); color: #1c1203; }
.btn--primary:hover { background: var(--accent-strong); transform: translateY(-2px); }
.btn--ghost { background: transparent; border-color: var(--border); color: var(--text); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }
.btn--lg { padding: 15px 34px; font-size: 1.05rem; }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--accent);
  transition: border-color var(--transition), background var(--transition);
}
.nav__inner { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.nav__brand { font-size: 1.35rem; font-weight: 800; letter-spacing: -0.5px; }
.nav__brand-dot { color: var(--accent); }
.nav__links { display: flex; gap: 28px; }
.nav__links a {
  font-size: 0.92rem; font-weight: 500; color: var(--text-muted);
  position: relative; transition: color var(--transition);
}
.nav__links a::after {
  content: ''; position: absolute; left: 0; bottom: -6px; height: 2px; width: 0;
  background: var(--accent); transition: width var(--transition);
}
.nav__links a:hover { color: var(--text); }
.nav__links a:hover::after { width: 100%; }

.nav__actions { display: flex; align-items: center; gap: 12px; }
.theme-toggle {
  display: grid; place-items: center; width: 40px; height: 40px;
  border-radius: 50%; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); cursor: pointer;
  transition: all var(--transition);
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }
[data-theme='dark'] .icon-sun { display: block; }
[data-theme='dark'] .icon-moon { display: none; }
[data-theme='light'] .icon-sun { display: none; }
[data-theme='light'] .icon-moon { display: block; }

.nav__toggle {
  display: none; flex-direction: column; gap: 5px; width: 40px; height: 40px;
  align-items: center; justify-content: center; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer;
}
.nav__toggle span { width: 20px; height: 2px; background: var(--text); transition: all var(--transition); }
.nav__toggle[aria-expanded='true'] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav__toggle[aria-expanded='true'] span:nth-child(2) { opacity: 0; }
.nav__toggle[aria-expanded='true'] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero { position: relative; min-height: 100svh; overflow: hidden; background: var(--bg); color: var(--text); }
/* Desk canvas fills the landing and is interactive (clickable objects) */
.hero__canvas {
  position: absolute; inset: 0; width: 100%; height: 100%;
  z-index: 0; pointer-events: auto; display: block;
}
/* Minimal name, top-left — doesn't block desk clicks */
.hero__brand {
  position: absolute; z-index: 2; top: clamp(18px, 4vw, 34px); left: clamp(18px, 5vw, 48px);
  margin: 0; pointer-events: none; font-weight: 700; font-size: clamp(1rem, 2.4vw, 1.4rem);
  letter-spacing: -0.3px; text-shadow: 0 2px 20px var(--bg);
}
.hero__brand span { color: var(--text-muted); font-weight: 500; font-size: 0.78em; }

/* Floating theme toggle (replaces the one that lived in the nav) */
.theme-toggle--float { position: fixed; top: 18px; right: 18px; z-index: 50; box-shadow: var(--shadow); }

/* Floating label when hovering a desk object */
.desk-tooltip {
  position: absolute; z-index: 3; transform: translate(14px, -120%);
  pointer-events: none; white-space: nowrap;
  font-family: var(--font-mono); font-size: 0.8rem; font-weight: 500;
  color: var(--bg); background: var(--accent);
  padding: 5px 11px; border-radius: 999px;
  opacity: 0; transition: opacity 0.18s ease;
}
.desk-tooltip.is-on { opacity: 1; }

/* Scroll / interaction hint */
.desk-hint {
  position: absolute; z-index: 2; left: 50%; bottom: 26px; transform: translateX(-50%);
  margin: 0; font-family: var(--font-mono); font-size: 0.82rem; color: var(--text-muted);
  pointer-events: none; text-align: center;
  opacity: 0; transition: opacity 0.6s ease;
}
/* Fade on the <p>, pulse on the span, so dismissing can transition out */
.desk-hint.is-on { opacity: 1; }
.desk-hint.is-on span { animation: hintPulse 2.6s ease-in-out infinite; }
@keyframes hintPulse { 0%, 100% { opacity: 0.45; } 50% { opacity: 0.9; } }

/* Touch: a label pinned above each clickable prop (desk.js moves them) */
.desk-pins { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.desk-pin {
  position: absolute; left: 0; top: 0; pointer-events: auto; cursor: pointer;
  margin: 0; translate: -50% calc(-100% - 8px);
  font-family: var(--font-mono); font-size: 0.72rem; font-weight: 500; white-space: nowrap;
  color: var(--text); background: var(--surface);
  border: 1px solid var(--accent); border-radius: 999px; padding: 6px 11px;
  opacity: 0; animation: pinIn 0.5s ease 0.3s forwards;
}
.desk-pin::before { content: ''; position: absolute; inset: -8px; } /* bigger tap target */
.desk-pin::after {
  content: ''; position: absolute; left: 50%; top: 100%;
  width: 1px; height: 8px; background: var(--accent);
}
@keyframes pinIn { to { opacity: 0.92; } }
body.is-zoomed .desk-pins { visibility: hidden; }

/* Fallback when WebGL is unavailable: hide canvas chrome, keep text hero */
body.no-3d .hero__canvas, body.no-3d .desk-hint, body.no-3d .desk-tooltip, body.no-3d .desk-pins { display: none; }
body.no-3d .hero { min-height: auto; }
@media (prefers-reduced-motion: reduce) {
  .desk-hint.is-on span { animation: none; }
  .desk-pin { animation: none; opacity: 0.92; }
}
.hero__eyebrow { font-family: var(--font-mono); color: var(--accent); font-size: 0.95rem; margin: 0 0 14px; }
.hero__name { font-size: clamp(2.6rem, 7vw, 4.6rem); font-weight: 800; letter-spacing: -2px; margin: 0; }
.hero__role { font-size: clamp(1.3rem, 4vw, 2.2rem); color: var(--text-muted); margin: 6px 0 22px; font-weight: 600; }
.hero__desc { font-size: 1.12rem; color: var(--text-muted); max-width: 620px; margin: 0 0 14px; }
.hero__desc strong { color: var(--text); }
.hero__location { font-size: 0.98rem; color: var(--text-muted); margin: 0 0 30px; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 34px; }
.hero__socials { display: flex; gap: 18px; }
.hero__socials a {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--border); color: var(--text-muted);
  background: var(--surface); transition: all var(--transition);
}
.hero__socials a:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-3px); }

/* ---------- Sections ---------- */
.section { padding: clamp(60px, 9vw, 100px) 0; }
.section--alt { background: var(--bg-alt); }
.section__title {
  font-size: clamp(1.6rem, 4vw, 2.1rem); margin: 0 0 12px;
  display: flex; align-items: baseline; gap: 12px;
}
.section__num { font-family: var(--font-mono); color: var(--accent); font-size: 1.1rem; font-weight: 500; }
.section__lead, .section__title + .section__lead { color: var(--text-muted); margin: 0 0 38px; max-width: 620px; }
.section__title { margin-bottom: 40px; }
.section__lead { margin-top: -28px; }

/* ---------- About ---------- */
.about { display: grid; grid-template-columns: 1.7fr 1fr; gap: 40px; align-items: start; }
.about__text p { color: var(--text-muted); margin: 0 0 18px; }
.about__text strong { color: var(--text); }
.about__card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow);
}
.about__card h3 { margin: 0 0 18px; font-size: 1.1rem; }
.about__card ul { display: grid; gap: 16px; }
.about__card li { display: flex; align-items: center; gap: 14px; font-size: 0.98rem; font-weight: 500; }
.fact__icon {
  width: 38px; height: 38px; flex: none; border-radius: 10px;
  background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center;
}
.ico {
  width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.fact__text { display: flex; flex-direction: column; }
.about__card li span {
  color: var(--text-muted); font-size: 0.72rem; margin-bottom: 2px;
  text-transform: uppercase; letter-spacing: 0.08em;
}

/* ---------- Skills ---------- */
.skills { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 22px; }
.skill-group {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px; transition: all var(--transition);
}
.skill-group:hover { border-color: var(--accent); transform: translateY(-4px); box-shadow: var(--shadow); }
.skill-group h3 { font-size: 1.05rem; margin: 0 0 16px; color: var(--accent); }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tags li {
  font-family: var(--font-mono); font-size: 0.8rem; padding: 6px 12px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 999px; color: var(--text-muted);
}
.tags--sm li { font-size: 0.72rem; padding: 4px 10px; }

/* ---------- Timeline ---------- */
.timeline { position: relative; padding-left: 28px; }
.timeline::before {
  content: ''; position: absolute; left: 5px; top: 6px; bottom: 6px; width: 2px; background: var(--border);
}
.timeline__item { position: relative; padding-bottom: 38px; }
.timeline__item:last-child { padding-bottom: 0; }
.timeline__dot {
  position: absolute; left: -28px; top: 6px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft);
}
.timeline__content {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px 24px; transition: all var(--transition);
}
.timeline__content:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.timeline__head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px; align-items: baseline; }
.timeline__head h3 { font-size: 1.12rem; margin: 0; }
.timeline__date { font-family: var(--font-mono); font-size: 0.8rem; color: var(--accent); white-space: nowrap; }
.timeline__org { color: var(--text-muted); font-size: 0.92rem; margin: 4px 0 14px; }
.timeline__content ul { display: grid; gap: 8px; }
.timeline__content li { position: relative; padding-left: 20px; color: var(--text-muted); font-size: 0.95rem; }
.timeline__content li::before { content: '▹'; position: absolute; left: 0; color: var(--accent); }

/* ---------- Projects ---------- */
.projects { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 22px; }
.project-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 26px; display: flex; flex-direction: column;
  transition: all var(--transition);
}
.project-card:hover { transform: translateY(-6px); border-color: var(--accent); box-shadow: var(--shadow); }
.project-card__top { margin-bottom: 16px; }
.project-card__icon { color: var(--accent); }
.project-card h3 { font-size: 1.2rem; margin: 0 0 10px; }
.project-card p { color: var(--text-muted); font-size: 0.95rem; margin: 0 0 16px; flex-grow: 1; }
.project-card__org { font-family: var(--font-mono); font-size: 0.78rem !important; color: var(--accent) !important; margin: 14px 0 0 !important; flex-grow: 0 !important; }
.project-card--link { cursor: pointer; }
.project-card__top { display: flex; justify-content: space-between; align-items: flex-start; }
.project-card__badge {
  font-family: var(--font-mono); font-size: 0.66rem; text-transform: uppercase; letter-spacing: 1px;
  color: var(--accent); border: 1px solid var(--accent); padding: 3px 9px; border-radius: 999px;
}
.project-card__cta { font-family: var(--font-mono); font-size: 0.82rem !important; color: var(--accent) !important; margin: 14px 0 0 !important; flex-grow: 0 !important; font-weight: 600; transition: transform var(--transition); }
.project-card--link:hover .project-card__cta { transform: translateX(4px); }
.project-card--media { padding-top: 0; overflow: hidden; }
.project-card__thumb {
  display: block; width: calc(100% + 52px); max-width: none; height: 180px; object-fit: cover; object-position: center top;
  margin: 0 -26px 18px; border-bottom: 1px solid var(--border);
}

/* ---------- Game / Side Quest ---------- */
.game__name {
  background: linear-gradient(90deg, var(--accent), var(--accent-strong));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.game__layout { display: grid; grid-template-columns: 1.55fr 1fr; gap: 26px; align-items: stretch; }
.game__frame {
  position: relative; border-radius: var(--radius); overflow: hidden; align-self: start;
  border: 1px solid var(--border); aspect-ratio: 16 / 9; background: #f7f1e1;
}
/* Poster + Play button until clicked, then script.js swaps in the itch.io iframe */
.game__poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: saturate(0.9) brightness(0.8); transition: filter var(--transition); }
.game__frame:hover .game__poster { filter: none; }
.game__play {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 16px 28px; border: 0; border-radius: 999px; cursor: pointer;
  background: #63352d; color: #f7f1e1; font: 700 1.05rem var(--font-sans, inherit);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35); transition: transform var(--transition);
}
.game__play:hover, .game__play:focus-visible { transform: translate(-50%, -50%) scale(1.05); }
.game__play-icon { font-size: 1.4rem; line-height: 1; }
.game__play-hint { font-family: var(--font-mono); font-size: 0.72rem; font-weight: 500; opacity: 0.8; }
.game__frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.game__info {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 26px; display: flex; flex-direction: column;
}
.game__info h3 { margin: 0 0 12px; color: var(--accent); font-size: 1.1rem; }
.game__info > p { color: var(--text-muted); font-size: 0.95rem; margin: 0 0 18px; }
.game__facts { display: grid; gap: 10px; margin: 0 0 20px; }
.game__facts li { display: flex; align-items: flex-start; gap: 10px; font-size: 0.95rem; color: var(--text-muted); }
.game__facts .ico { color: var(--accent); margin-top: 0.2em; }
.game__title-icon { width: 0.9em; height: 0.9em; color: var(--accent); align-self: center; }
.game__facts strong { color: var(--text); }
.game__info .tags { margin-bottom: 22px; }
.game__ctas { margin-top: auto; display: flex; flex-wrap: wrap; gap: 12px; }
.game__ctas .btn { flex: 1 1 auto; justify-content: center; }

@media (max-width: 800px) { .game__layout { grid-template-columns: 1fr; } }

/* ---------- Contact ---------- */
.contact__inner { text-align: center; max-width: 640px; }
.contact .section__title { justify-content: center; }
.contact__lead { color: var(--text-muted); margin: 0 0 34px; font-size: 1.08rem; }
.contact__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; }
.contact__socials { display: flex; flex-wrap: wrap; justify-content: center; gap: 24px; margin-top: 40px; }
.contact__socials a { color: var(--text-muted); font-size: 0.92rem; transition: color var(--transition); }
.contact__socials a:hover { color: var(--accent); }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border); padding: 26px 0; }
.footer__inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.footer p { color: var(--text-muted); font-size: 0.85rem; margin: 0; }
.footer__credit { font-size: 0.78rem !important; margin-top: 4px !important; opacity: 0.85; }
.footer__credit a { color: var(--text-muted); text-decoration: underline; transition: color var(--transition); }
.footer__credit a:hover { color: var(--accent); }
.footer__top { color: var(--text-muted); font-family: var(--font-mono); font-size: 0.85rem; transition: color var(--transition); }
.footer__top:hover { color: var(--accent); }

/* ---------- Case study page ---------- */
.case-back {
  display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-mono);
  font-size: 0.85rem; color: var(--text-muted); margin-bottom: 26px; transition: color var(--transition);
}
.case-back:hover { color: var(--accent); }
.case-hero { padding: clamp(40px, 8vw, 70px) 0 0; }
.case-hero__eyebrow { font-family: var(--font-mono); color: var(--accent); font-size: 0.9rem; margin: 0 0 12px; }
.case-hero h1 { font-size: clamp(2rem, 5vw, 3.2rem); letter-spacing: -1.5px; margin: 0 0 16px; }
.case-hero__lead { font-size: 1.15rem; color: var(--text-muted); max-width: 680px; margin: 0 0 26px; }
.case__meta { display: flex; flex-wrap: wrap; gap: 28px; padding: 22px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); margin-bottom: 12px; }
.case__meta div { display: flex; flex-direction: column; }
.case__meta dt { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 4px; }
.case__meta dd { margin: 0; font-weight: 600; }
.case__actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 24px; }

.case-body h2 { font-size: 1.5rem; margin: 0 0 16px; }
.case-body h2 .section__num { font-size: 1rem; }
.case-body p { color: var(--text-muted); margin: 0 0 18px; max-width: 720px; }
.case-body p strong, .case-body li strong { color: var(--text); }
.case-body > .container > section { padding: clamp(40px, 7vw, 64px) 0; border-bottom: 1px solid var(--border); }
.case-body > .container > section:last-child { border-bottom: 0; }

.pipeline { display: grid; gap: 14px; counter-reset: step; max-width: 760px; }
.pipeline li {
  position: relative; padding: 16px 20px 16px 60px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); color: var(--text-muted);
}
.pipeline li strong { display: block; color: var(--text); margin-bottom: 2px; }
.pipeline li::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); font-family: var(--font-mono);
  font-weight: 600; font-size: 0.9rem;
}

.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; max-width: 820px; }
.feature-grid article { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.feature-grid h3 { font-size: 1.05rem; margin: 0 0 8px; color: var(--accent); }
.feature-grid p { font-size: 0.92rem; margin: 0; }

.code-block {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px 22px; overflow-x: auto; max-width: 760px; margin: 0 0 18px;
}
.code-block pre { margin: 0; font-family: var(--font-mono); font-size: 0.82rem; line-height: 1.7; color: var(--text); }
.code-block .c-com { color: var(--text-muted); }
.code-block .c-fn { color: var(--accent); }
.code-cap { font-size: 0.85rem; color: var(--text-muted); margin: 0 0 26px !important; }

.case-banner { display: block; width: 100%; max-width: 760px; height: auto; border-radius: var(--radius); margin: 0 0 22px; }
.case-game { max-width: 880px; margin: 8px 0 12px; }
/* PDF2EPUB before/after: the scan beside what OCR made of it */
.ocr-demo { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; max-width: 900px; margin: 8px 0 26px; }
.ocr-demo__scan { display: block; width: 100%; height: auto; border-radius: var(--radius); border: 1px solid var(--border); }
.ocr-demo__out { display: grid; gap: 12px; align-content: start; }
.ocr-demo__panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.ocr-demo__panel p { margin: 0 !important; font-family: Georgia, serif; font-size: 0.95rem; line-height: 1.6; color: var(--text); }
.ocr-demo__panel .ocr-demo__label { font-family: var(--font-mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); margin-bottom: 8px !important; }
.ocr-demo mark { color: inherit; border-radius: 3px; padding: 0 1px; }
.ocr-err { background: rgba(239, 68, 68, 0.28); }
.ocr-fix { background: rgba(34, 197, 94, 0.28); }
.ocr-demo__key { margin: 0 !important; font-family: var(--font-mono); font-size: 0.75rem; display: flex; gap: 10px; }
.ocr-demo figcaption { grid-column: 1 / -1; font-size: 0.85rem; color: var(--text-muted); max-width: 760px; }
@media (max-width: 760px) { .ocr-demo { grid-template-columns: 1fr; } }

/* Case studies opened inside the desk's browser window: no site nav, footer
   or links back to the home page (those would load the whole site in the frame). */
[data-embed] { scroll-padding-top: 16px; scrollbar-gutter: auto; }
[data-embed] .nav,
[data-embed] .footer,
[data-embed] .skip-link,
[data-embed] a[href^="../"] { display: none !important; }
[data-embed] .case-hero { padding-top: 28px; }

.case-figure { margin: 8px 0 26px; max-width: 760px; }
.case-figure--wide { max-width: 900px; }
.case-note {
  max-width: 720px; margin: 18px 0 0; padding: 12px 16px; font-size: 0.92rem; color: var(--text-muted);
  border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: var(--radius); background: var(--surface);
}
.case-note strong { color: var(--text); }
.case-sub { font-size: 1.1rem; margin: 30px 0 10px; color: var(--accent); }
.case-sub:first-of-type { margin-top: 6px; }
.case-credits { font-size: 0.8rem !important; margin-top: 8px !important; }
.case-figure img { display: block; width: 100%; height: auto; border-radius: var(--radius); border: 1px solid var(--border); }
.case-figure figcaption { font-size: 0.85rem; color: var(--text-muted); margin-top: 8px; }

.result-list { display: grid; gap: 10px; max-width: 720px; }
.result-list li { position: relative; padding-left: 26px; color: var(--text-muted); }
.result-list li::before { content: '✓'; position: absolute; left: 0; color: var(--accent); font-weight: 700; }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.is-visible { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 800px) {
  .about { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .nav__links {
    position: fixed; inset: 68px 0 auto 0; flex-direction: column; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--border);
    padding: 0; max-height: 0; overflow: hidden; transition: max-height var(--transition);
  }
  .nav__links.is-open { max-height: 340px; }
  .nav__links a { padding: 16px 24px; border-bottom: 1px solid var(--border); }
  .nav__links a::after { display: none; }
  .nav__toggle { display: flex; }
  .footer__inner { justify-content: center; text-align: center; }
}

/* ===================================================================
   View modes: the 3D desk scene, or the classic scrolling page
   =================================================================== */

[data-view='desk'] .section,
[data-view='desk'] .footer,
[data-view='desk'] .nav,
[data-view='desk'] .view-btn--enter { display: none; }

[data-view='classic'] .hero,
[data-view='classic'] .view-btn--exit { display: none; }

.view-btn {
  position: fixed; z-index: 20;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: 999px; cursor: pointer;
  font-family: var(--font-mono); font-size: 0.82rem; font-weight: 500;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-muted);
  box-shadow: var(--shadow);
  transition: color var(--transition), border-color var(--transition), transform var(--transition);
}
.view-btn:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-2px); }
.view-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.view-btn--exit { top: 20px; right: 20px; background: rgba(22, 28, 37, 0.72); backdrop-filter: blur(6px); }
.view-btn--enter { right: 20px; bottom: 20px; }
/* Leave room under the footer so the pinned desk button never covers "↑ Top" */
[data-view='classic'] .footer { padding-bottom: 84px; }

/* While zoomed into the monitor the taskbar owns the exits, so the scene
   control gets out of the way. */
body.is-zoomed .view-btn--exit { opacity: 0; pointer-events: none; }

@media (max-width: 560px) {
  .view-btn { padding: 9px 14px; font-size: 0.76rem; }
  .view-btn--exit { top: 12px; right: 12px; }
  .view-btn--enter { right: 12px; bottom: 12px; }
}

/* ===================================================================
   In-screen desktop — the OS behind the monitor glass

   desk.js zooms the camera onto the monitor and positions this panel
   over the projected screen quad (left/top/width/height + --su, the
   unit everything inside is sized from). --su keeps the layout
   readable whether the "screen" is 400px or 1400px wide on canvas.
   =================================================================== */

.screen {
  --su: 13px;
  --scr-bg: #0a1622;
  --scr-bg-2: #0e1e2d;
  --scr-line: #1e3a4e;
  --scr-text: #dbeafe;
  --scr-dim: #8fa8bd;
  --scr-accent: #2dd4bf;

  position: absolute; z-index: 5;
  left: 50%; top: 50%; width: 60%; height: 50%;
  display: flex; flex-direction: column;
  overflow: hidden;
  background: radial-gradient(120% 120% at 30% 0%, var(--scr-bg-2), var(--scr-bg) 70%);
  color: var(--scr-text);
  font-family: var(--font-mono);
  border-radius: calc(var(--su) * 0.3);
  box-shadow: 0 0 calc(var(--su) * 5) rgba(45, 212, 191, 0.14) inset;
  opacity: 0; transform: scale(0.985);
  transition: opacity 0.28s ease, transform 0.28s ease;
}
.screen[hidden] { display: none; }
.screen.is-on { opacity: 1; transform: scale(1); }

/* Scanlines + a soft vignette so it reads as a powered-on panel. */
.screen__crt {
  position: absolute; inset: 0; z-index: 4; pointer-events: none;
  background:
    repeating-linear-gradient(rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 3px),
    radial-gradient(130% 110% at 50% 50%, transparent 55%, rgba(0, 0, 0, 0.45));
}
.screen.is-on .screen__crt { animation: scrBoot 0.5s ease-out 1; }
@keyframes scrBoot {
  0%   { opacity: 0.1; filter: brightness(2.4); }
  18%  { opacity: 1;   filter: brightness(1.5); }
  100% { opacity: 1;   filter: brightness(1); }
}

/* ---------- Desktop surface ---------- */
.screen__desktop { position: relative; flex: 1; min-height: 0; overflow: hidden; }

.screen__icons {
  position: absolute; inset: calc(var(--su) * 1.1);
  display: flex; flex-direction: column; flex-wrap: wrap; align-content: flex-start;
  gap: calc(var(--su) * 0.5); z-index: 1;
}
.screen__icons li { width: calc(var(--su) * 6.6); }

.dicon {
  display: flex; flex-direction: column; align-items: center; gap: calc(var(--su) * 0.2);
  width: 100%; padding: calc(var(--su) * 0.45) calc(var(--su) * 0.2);
  background: none; border: 1px solid transparent; border-radius: calc(var(--su) * 0.25);
  color: var(--scr-text); font-family: inherit; font-size: calc(var(--su) * 0.78);
  cursor: pointer; text-align: center; line-height: 1.25;
}
.dicon:hover, .dicon:focus-visible {
  background: rgba(45, 212, 191, 0.14); border-color: rgba(45, 212, 191, 0.5);
  outline: none;
}
.dicon__glyph { font-size: calc(var(--su) * 1.7); line-height: 1; }
.dicon__name { word-break: break-word; }

/* ---------- Windows ---------- */
.win {
  position: absolute; z-index: 10;
  width: min(74%, calc(var(--su) * 34)); max-height: 82%;
  display: flex; flex-direction: column;
  background: var(--scr-bg-2);
  border: 1px solid var(--scr-line);
  border-radius: calc(var(--su) * 0.3);
  box-shadow: 0 calc(var(--su) * 0.6) calc(var(--su) * 1.6) rgba(0, 0, 0, 0.55);
  overflow: hidden;
}
.win[hidden] { display: none; }
.win.is-active { border-color: rgba(45, 212, 191, 0.55); }
.win.is-opening { animation: winIn 0.22s ease-out; }
@keyframes winIn { from { opacity: 0; transform: translateY(calc(var(--su) * 0.6)) scale(0.985); } }
.win.is-dragging { user-select: none; }
/* ---------- Browser window: case studies inside the desk ---------- */
.win--browser { width: 94%; height: 88%; max-height: 92%; }
.browser__chrome {
  display: flex; align-items: center; gap: calc(var(--su) * 0.35);
  padding: calc(var(--su) * 0.35) calc(var(--su) * 0.5);
  background: #0c1c28; border-bottom: 1px solid var(--scr-line);
}
.browser__btn {
  width: calc(var(--su) * 1.7); height: calc(var(--su) * 1.5); flex: none;
  display: grid; place-items: center; cursor: pointer;
  background: none; color: var(--scr-text); border: 1px solid transparent; border-radius: calc(var(--su) * 0.25);
  font: inherit; font-size: calc(var(--su) * 0.85);
}
.browser__btn:hover:not(:disabled) { border-color: var(--scr-line); background: rgba(45, 212, 191, 0.08); }
.browser__btn:disabled { opacity: 0.35; cursor: default; }
.browser__address {
  flex: 1; min-width: 0; margin: 0 !important; display: flex; gap: calc(var(--su) * 0.4); align-items: center;
  padding: calc(var(--su) * 0.25) calc(var(--su) * 0.7);
  background: var(--scr-bg); border: 1px solid var(--scr-line); border-radius: 99px;
  font-size: calc(var(--su) * 0.72); color: var(--scr-dim);
}
.browser__url { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.browser__bookmarks {
  display: flex; flex-wrap: wrap; gap: calc(var(--su) * 0.3);
  padding: calc(var(--su) * 0.3) calc(var(--su) * 0.5); border-bottom: 1px solid var(--scr-line);
}
.browser__bookmarks button {
  padding: calc(var(--su) * 0.15) calc(var(--su) * 0.55); cursor: pointer;
  background: none; color: var(--scr-dim); border: 1px solid transparent; border-radius: calc(var(--su) * 0.25);
  font: inherit; font-size: calc(var(--su) * 0.7);
}
.browser__bookmarks button:hover { color: var(--scr-text); border-color: var(--scr-line); }
.browser__bookmarks button.is-current { color: var(--scr-accent); border-color: rgba(45, 212, 191, 0.4); }
.browser__view { position: relative; flex: 1; min-height: 0; background: #0d1117; }
.browser__frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #0d1117; }
.browser__frame[hidden], .browser__home[hidden] { display: none; }
.browser__home { position: absolute; inset: 0; overflow-y: auto; padding: calc(var(--su) * 1.6); }
.browser__home-title { margin: 0 0 calc(var(--su) * 0.9) !important; color: var(--scr-text); font-size: calc(var(--su) * 1.1); }
.browser__tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(calc(var(--su) * 13), 1fr)); gap: calc(var(--su) * 0.7); }
.browser__tiles button {
  width: 100%; height: 100%; display: flex; flex-direction: column; gap: calc(var(--su) * 0.3); text-align: left; cursor: pointer;
  padding: calc(var(--su) * 0.9); background: var(--scr-bg-2); color: var(--scr-dim);
  border: 1px solid var(--scr-line); border-radius: calc(var(--su) * 0.35); font: inherit; font-size: calc(var(--su) * 0.75);
}
.browser__tiles button:hover { border-color: var(--scr-accent); }
.browser__tiles span[aria-hidden] { font-size: calc(var(--su) * 1.6); }
.browser__tiles strong { color: var(--scr-text); font-size: calc(var(--su) * 0.9); }

/* Windows with a lot of content (the full skills list) get more width. */
.win--wide { width: min(90%, calc(var(--su) * 52)); max-height: 86%; }
.win.is-max { left: 0 !important; top: 0 !important; width: 100%; max-height: 100%; height: 100%; border-radius: 0; }

.win__bar {
  display: flex; align-items: center; justify-content: space-between; gap: var(--su);
  padding: calc(var(--su) * 0.35) calc(var(--su) * 0.5);
  background: linear-gradient(var(--scr-line), #17303f);
  cursor: grab; touch-action: none;
}
.win.is-active .win__bar { background: linear-gradient(#1c4a52, #123b45); }
.win.is-dragging .win__bar { cursor: grabbing; }
.win__title {
  font-size: calc(var(--su) * 0.82); font-weight: 500; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.win__btns { display: flex; gap: calc(var(--su) * 0.2); flex: none; }
.win__btn {
  width: calc(var(--su) * 1.4); height: calc(var(--su) * 1.1);
  display: grid; place-items: center;
  background: #0c1c28; color: var(--scr-dim);
  border: 1px solid var(--scr-line); border-radius: calc(var(--su) * 0.2);
  font-family: inherit; font-size: calc(var(--su) * 0.7); line-height: 1; cursor: pointer;
}
.win__btn:hover { color: var(--scr-text); border-color: var(--scr-accent); }
.win__btn--x:hover { background: #7f1d1d; color: #fff; border-color: #b91c1c; }

.win__body {
  flex: 1; min-height: 0; overflow-y: auto;
  padding: calc(var(--su) * 0.9);
  font-size: calc(var(--su) * 0.8); line-height: 1.6; color: var(--scr-dim);
}
.win__body--center { text-align: center; }
.win__body strong { color: var(--scr-text); font-weight: 600; }
.win__body p { margin: 0 0 calc(var(--su) * 0.7); }
.win__body h4 {
  margin: calc(var(--su) * 0.8) 0 calc(var(--su) * 0.35);
  color: var(--scr-accent); font-size: calc(var(--su) * 0.8); font-weight: 600;
}
.win__body h4:first-child { margin-top: 0; }
.win__body a { color: var(--scr-accent); text-decoration: underline; text-underline-offset: 2px; }
.win__body::-webkit-scrollbar { width: calc(var(--su) * 0.5); }
.win__body::-webkit-scrollbar-thumb { background: var(--scr-line); border-radius: 99px; }

.win__facts { margin: 0; display: grid; gap: calc(var(--su) * 0.25); }
.win__facts div { display: flex; gap: calc(var(--su) * 0.5); }
.win__facts dt { color: var(--scr-accent); min-width: calc(var(--su) * 6); }
.win__facts dd { margin: 0; color: var(--scr-text); }
.win__more { margin-top: calc(var(--su) * 0.8) !important; }
.win__credit {
  margin: calc(var(--su) * 0.9) 0 0 !important;
  padding-top: calc(var(--su) * 0.6); border-top: 1px solid var(--scr-line);
  font-size: calc(var(--su) * 0.66); color: var(--scr-dim); line-height: 1.5;
}

/* Project rows with a case study are buttons (they open the desk's browser),
   so they must not look like buttons. */
.files li > button {
  display: flex; gap: calc(var(--su) * 0.55); align-items: flex-start;
  width: 100%; padding: 0; background: none; border: 0; color: inherit;
  font: inherit; text-align: left; cursor: pointer;
}

.chips { display: flex; flex-wrap: wrap; gap: calc(var(--su) * 0.3); }
.chips li {
  padding: calc(var(--su) * 0.12) calc(var(--su) * 0.45);
  background: rgba(45, 212, 191, 0.1); border: 1px solid rgba(45, 212, 191, 0.25);
  border-radius: 99px; font-size: calc(var(--su) * 0.72); color: var(--scr-text);
}

.job { margin-bottom: calc(var(--su) * 0.9); }
.job h4 { margin: 0; color: var(--scr-text); }
.job h4 span { color: var(--scr-accent); font-weight: 400; }
.job__date { margin: 0 0 calc(var(--su) * 0.2) !important; font-size: calc(var(--su) * 0.72); opacity: 0.8; }
.job__list { display: grid; gap: calc(var(--su) * 0.3); margin-top: calc(var(--su) * 0.3); }
.job__list li { position: relative; padding-left: calc(var(--su) * 0.9); }
.job__list li::before { content: '▹'; position: absolute; left: 0; color: var(--scr-accent); }
.job__list strong { color: var(--scr-text); }

.files { display: grid; gap: calc(var(--su) * 0.45); }
.files li, .files li > a { display: flex; gap: calc(var(--su) * 0.55); align-items: flex-start; }
.files li > a { text-decoration: none; width: 100%; }
.files li > div, .files li > a > div { min-width: 0; }
.files li { padding: calc(var(--su) * 0.4); border: 1px solid var(--scr-line); border-radius: calc(var(--su) * 0.25); }
.files li:hover { border-color: rgba(45, 212, 191, 0.45); background: rgba(45, 212, 191, 0.06); }
.files__ico { font-size: calc(var(--su) * 1.1); flex: none; }
.files strong { display: block; color: var(--scr-text); }
.files p { margin: 0 !important; font-size: calc(var(--su) * 0.72); }

.links { display: grid; gap: calc(var(--su) * 0.3); }
/* mewbrew.exe: the game fills the window, links sit in a strip below */
/* The screen is wide and short, so the window is sized from the desktop's
   height (cqh): the tallest 16:9 game that fits, plus title bar and strip. */
.screen__desktop { container-type: size; }
.win--game { width: min(94%, calc((80cqh - var(--su) * 3.6) * 16 / 9)); }
.play__frame { flex: none; align-self: stretch; aspect-ratio: 16 / 9; border: 0; border-radius: 0; font-size: calc(var(--su) * 0.9); }
.win--game.is-max .play__frame { flex: 1; min-height: 0; aspect-ratio: auto; }
.play__frame .game__play { padding: calc(var(--su) * 0.9) calc(var(--su) * 1.6); font-size: 1em; }
.play__frame .game__play-icon { font-size: 1.3em; }
.play__frame .game__play-hint { font-size: 0.7em; }
.play__bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: calc(var(--su) * 0.9);
  margin: 0; padding: calc(var(--su) * 0.45) calc(var(--su) * 0.7);
  border-top: 1px solid var(--scr-line); font-size: calc(var(--su) * 0.72); color: var(--scr-dim);
}
.play__bar span { flex: 1; min-width: 0; }
.play__bar a { color: var(--scr-accent); }

/* ---------- PDF2EPUB mock: wears the real app's Catppuccin palette ---------- */
.screen__icons--right {
  left: auto; right: calc(var(--su) * 1.1);
  align-items: flex-end; align-content: flex-start;
}
.screen__icons--right li { width: calc(var(--su) * 7); }
.screen__icons--right .dicon__name { overflow-wrap: anywhere; }

.dicon--new { animation: iconPop 0.5s ease-out, iconGlow 1.1s ease-in-out 3; }
@keyframes iconPop { from { transform: scale(0.6); opacity: 0; } }
@keyframes iconGlow {
  0%, 100% { background: transparent; }
  50% { background: rgba(166, 227, 161, 0.22); }
}

.win--app { width: min(80%, calc(var(--su) * 27)); }
.win--app .win__bar { background: linear-gradient(#313244, #232336); }
.win--app.is-active .win__bar { background: linear-gradient(#45475a, #313244); }

.app {
  position: relative;
  background: #1e1e2e; color: #cdd6f4;
  text-align: center; padding: calc(var(--su) * 1.1);
}
.app__title {
  margin: 0 0 calc(var(--su) * 0.8) !important;
  font-size: calc(var(--su) * 0.9); color: #cdd6f4; font-weight: 600;
}
.app__drop {
  display: block; width: 100%;
  padding: calc(var(--su) * 1.5) calc(var(--su) * 0.6);
  background: #313244; color: #cdd6f4;
  border: 1px dashed #585b70; border-radius: calc(var(--su) * 0.25);
  font: inherit; font-size: calc(var(--su) * 0.8); cursor: pointer;
  word-break: break-all;
}
.app__drop:hover { border-color: #89b4fa; color: #fff; }
.app__info {
  margin: calc(var(--su) * 0.7) 0 !important;
  font-size: calc(var(--su) * 0.72); color: #6c7086;
}
.app__info.is-set { color: #cdd6f4; }
.app__btn {
  padding: calc(var(--su) * 0.35) calc(var(--su) * 1.1);
  background: #89b4fa; color: #1e1e2e;
  border: 0; border-radius: calc(var(--su) * 0.2);
  font: inherit; font-size: calc(var(--su) * 0.8); font-weight: 700; cursor: pointer;
}
.app__btn:disabled { background: #45475a; color: #7f849c; cursor: default; }
.app__btn--ghost { background: transparent; color: #cdd6f4; border: 1px solid #45475a; font-weight: 400; }

.app__bar {
  height: calc(var(--su) * 0.7); margin: calc(var(--su) * 0.8) 0 calc(var(--su) * 0.4);
  background: #313244; border-radius: 99px; overflow: hidden;
}
.app__bar span { display: block; width: 0; height: 100%; background: #89b4fa; border-radius: 99px; }
.app__status {
  margin: 0 !important; min-height: calc(var(--su) * 1.2);
  font-size: calc(var(--su) * 0.72); color: #cdd6f4;
}
.app__status.is-busy { color: #f9e2af; }
.app__status.is-ok { color: #a6e3a1; }
.app__note {
  margin: calc(var(--su) * 0.8) 0 0 !important;
  font-size: calc(var(--su) * 0.64); color: #6c7086; line-height: 1.5;
}

/* Picker + message box, both live inside the app window */
.picker {
  position: absolute; inset: calc(var(--su) * 1.6) calc(var(--su) * 1.1) auto;
  background: #181825; border: 1px solid #45475a;
  border-radius: calc(var(--su) * 0.25); text-align: left; z-index: 2;
  box-shadow: 0 calc(var(--su) * 0.6) calc(var(--su) * 1.4) #000a;
}
.picker[hidden] { display: none; }
.picker__head {
  padding: calc(var(--su) * 0.3) calc(var(--su) * 0.6);
  background: #313244; font-size: calc(var(--su) * 0.75); color: #cdd6f4;
}
.picker__list { padding: calc(var(--su) * 0.4); display: grid; gap: calc(var(--su) * 0.3); }
.picker__list button {
  display: flex; align-items: center; gap: calc(var(--su) * 0.45); width: 100%;
  padding: calc(var(--su) * 0.35) calc(var(--su) * 0.5);
  background: #1e1e2e; color: #cdd6f4;
  border: 1px solid transparent; border-radius: calc(var(--su) * 0.2);
  font: inherit; font-size: calc(var(--su) * 0.74); cursor: pointer; text-align: left;
}
.picker__list button:hover { border-color: #89b4fa; background: #24243a; }
.picker__name { flex: 1; word-break: break-all; }
.picker__meta { color: #6c7086; font-size: calc(var(--su) * 0.68); flex: none; }
.picker__foot { padding: 0 calc(var(--su) * 0.4) calc(var(--su) * 0.4); text-align: right; }
.msgbox__text {
  margin: 0 !important; padding: calc(var(--su) * 0.6);
  font-size: calc(var(--su) * 0.74); color: #cdd6f4;
}
.msgbox__text code { color: #a6e3a1; word-break: break-all; }

/* The produced EPUB, styled like the stylesheet the converter injects */
.reader { background: #f7f3ec; color: #2b2a28; }
.reader__head {
  display: flex; align-items: center; justify-content: space-between;
  gap: calc(var(--su) * 0.6); margin-bottom: calc(var(--su) * 0.6);
}
.reader__meta {
  margin: 0 !important;
  font-family: var(--font-mono); font-size: calc(var(--su) * 0.66); color: #8a8378;
}
.reader__btn {
  flex: none; padding: calc(var(--su) * 0.2) calc(var(--su) * 0.6);
  background: #ece5d8; color: #4a453c;
  border: 1px solid #d5ccbb; border-radius: calc(var(--su) * 0.2);
  font-family: var(--font-mono); font-size: calc(var(--su) * 0.66); cursor: pointer;
}
.reader__btn:hover { background: #e2d9c8; border-color: #b9ae99; color: #2b2a28; }
.reader__btn[hidden] { display: none; }
.reader__title {
  margin: 0 0 calc(var(--su) * 0.6); font-family: Georgia, 'Times New Roman', serif;
  font-size: calc(var(--su) * 1); color: #2b2a28;
}
.reader p {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: calc(var(--su) * 0.82); line-height: 1.7; margin: 0 0 calc(var(--su) * 0.7);
}
.reader__note {
  font-family: var(--font-mono) !important;
  font-size: calc(var(--su) * 0.66) !important; color: #8a8378; font-style: italic;
  border-top: 1px solid #ddd6c9; padding-top: calc(var(--su) * 0.5);
}

/* ---------- Taskbar ---------- */
.screen__bar {
  flex: none; z-index: 3;
  display: flex; align-items: center; gap: calc(var(--su) * 0.35);
  padding: calc(var(--su) * 0.25) calc(var(--su) * 0.4);
  background: #0c1c28; border-top: 1px solid var(--scr-line);
}
.screen__tasks { flex: 1; min-width: 0; display: flex; gap: calc(var(--su) * 0.3); overflow: hidden; }
.screen__tasks li { min-width: 0; }
.taskbtn {
  display: flex; align-items: center; gap: calc(var(--su) * 0.25);
  max-width: calc(var(--su) * 10); padding: calc(var(--su) * 0.2) calc(var(--su) * 0.5);
  background: #12283a; color: var(--scr-dim);
  border: 1px solid var(--scr-line); border-radius: calc(var(--su) * 0.2);
  font-family: inherit; font-size: calc(var(--su) * 0.74); line-height: 1.5;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer;
}
.taskbtn:hover { color: var(--scr-text); border-color: var(--scr-accent); }
.taskbtn.is-active { color: var(--scr-text); background: #17414a; border-color: rgba(45, 212, 191, 0.5); }
.taskbtn--start { color: var(--scr-accent); font-weight: 600; }
.taskbtn--start[aria-expanded="true"] { background: #1c4a52; border-color: var(--scr-accent); }

/* Start menu: sits on the desktop just above the Start button */
.startmenu {
  position: absolute; left: calc(var(--su) * 0.4); bottom: calc(var(--su) * 0.3);
  display: flex; flex-direction: column; min-width: calc(var(--su) * 12);
  padding: calc(var(--su) * 0.35);
  background: var(--scr-bg-2); border: 1px solid var(--scr-line); border-radius: calc(var(--su) * 0.3);
  box-shadow: 0 calc(var(--su) * 0.6) calc(var(--su) * 1.6) rgba(0, 0, 0, 0.55);
  animation: winIn 0.16s ease-out;
}
.startmenu[hidden] { display: none; }
.startmenu button {
  display: flex; align-items: center; gap: calc(var(--su) * 0.55);
  padding: calc(var(--su) * 0.3) calc(var(--su) * 0.5); cursor: pointer; text-align: left;
  background: none; color: var(--scr-text); border: 0; border-radius: calc(var(--su) * 0.2);
  font: inherit; font-size: calc(var(--su) * 0.8);
}
.startmenu button:hover, .startmenu button:focus-visible { background: rgba(45, 212, 191, 0.12); outline: none; }
.startmenu__glyph { width: calc(var(--su) * 1.2); text-align: center; }
.startmenu hr { width: 100%; margin: calc(var(--su) * 0.3) 0; border: 0; border-top: 1px solid var(--scr-line); }
.taskbtn--exit:hover { background: #7f1d1d; color: #fff; border-color: #b91c1c; }
.screen__clock { font-size: calc(var(--su) * 0.74); color: var(--scr-dim); flex: none; }

/* ---------- While zoomed in ---------- */
body.is-screen-on { overflow: hidden; }
body.is-zoomed .desk-hint, body.is-zoomed .desk-tooltip { opacity: 0; pointer-events: none; }

/* Small viewports: the projected screen is too tiny to use, so the
   desktop takes over the hero as a centered panel instead. */
.screen--fallback {
  --su: 13px;
  left: 50% !important; top: 50% !important;
  transform: translate(-50%, -50%) scale(0.985);
  width: min(94vw, 720px) !important; height: min(80vh, 560px) !important;
  font-size: var(--su);
  border: 1px solid var(--scr-line);
}
.screen--fallback.is-on { transform: translate(-50%, -50%) scale(1); }

@media (max-width: 560px) {
  .screen--fallback { --su: 11px; }
  .screen__icons { flex-direction: row; align-content: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  .screen, .screen.is-on { transition: none; }
  .screen.is-on .screen__crt { animation: none; }
}
