/* ============================================================
   grace-portfolio — styles.css
   Organized by: base → layout → components → sections → utils
   ============================================================ */

/* ── Base reset ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f0e6f8;
  padding: 20px;
}

/* ============================================================
   LAYOUT
   ============================================================ */

.desktop {
  width: 100%;
  max-width: 900px;
  min-height: 640px;
  background: linear-gradient(135deg, #fce4f3 0%, #e8d5f5 40%, #d5e8f5 100%);
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(160, 120, 200, 0.25);
}

.window-area {
  padding: 16px;
  padding-bottom: 34px; /* room for status bar */
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  min-height: 580px;
}

.home-desktop {
  display: flex;
  flex-direction: column;
  max-width: 1160px;
  height: min(860px, calc(100dvh - 40px));
  min-height: 0;
}

.home-desktop .window-area { flex: 1; min-height: 0; padding-bottom: 16px; }
.home-desktop .main-window { display: flex; flex-direction: column; min-height: 0; }
.home-desktop .main-content { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
.home-desktop .titlebar, .home-desktop .menubar { flex-shrink: 0; }
.home-desktop .status-bar { position: static; flex-shrink: 0; }

/* ============================================================
   COMPONENTS — Window chrome
   ============================================================ */

.window {
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 0.5px solid rgba(200, 180, 220, 0.45);
  border-radius: 12px;
  overflow: hidden;
}

.main-window { min-width: 0; min-height: 500px; }

.titlebar {
  background: rgba(240, 230, 255, 0.7);
  border-bottom: 0.5px solid rgba(200, 180, 220, 0.3);
  padding: 7px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  user-select: none;
}

.dots { display: flex; gap: 9px; }

.dot {
  width: 14px;
  height: 14px;
  border: 0.5px solid rgba(0, 0, 0, 0.18);
  border-radius: 50%;
}

.dot-red    { background: #ff5c60; color: #802f31; }
.dot-yellow { background: #fac800; color: #7e640c; }
.dot-green  { background: #35c759; color: #1e632d; }

.window-control { position: relative; display: grid; place-items: center; flex-shrink: 0; padding: 0; cursor: default; }
.window-control > svg { display: block; width: 8px; height: 8px; pointer-events: none; }
/* Extend the hit areas without spreading the visible traffic lights apart. */
.window-control::before { content: ''; position: absolute; inset: -7px -4px; }
.window-restore-icon,
.window-control[aria-pressed="true"] .window-expand-icon { display: none; }
.window-control[aria-pressed="true"] .window-restore-icon { display: block; }

.titlebar-title {
  font-size: 12px;
  color: #5a4a6a;
  font-weight: 500;
  margin-left: 4px;
}

/* ── Menu bar ── */
.menubar {
  background: rgba(248, 246, 252, 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 0.5px solid rgba(180, 160, 200, 0.3);
  height: 28px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  gap: 18px;
  font-size: 13px;
  font-weight: 400;
  line-height: 1;
  color: #29262e;
  user-select: none;
}

.menubar-left         { display: flex; gap: 16px; align-items: center; }
.menubar-left span    { cursor: default; }
.menubar-brand        { font-weight: 700; }

.menubar-right {
  margin-left: auto;
  display: flex;
  gap: 14px;
  font-size: 12px;
  color: inherit;
  align-items: center;
}

.home-menubar { height: 28px; min-height: 28px; padding: 0 12px; gap: 14px; }
.section-nav { display: flex; align-self: stretch; min-width: 0; }
.section-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; }
.section-tabs .menubar-brand { font-weight: 700; }
.section-tabs .nav-item:focus-visible { outline-offset: -2px; border-radius: 0; }

/* ── Status bar ── */
.status-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 22px;
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-top: 0.5px solid rgba(200, 180, 220, 0.25);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 16px;
  font-size: 11px;
  color: #6b5a7d;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #a8e6cf;
  display: inline-block;
  margin-right: 4px;
}

.status-links        { margin-left: auto; display: flex; gap: 12px; }
.status-links a      { color: #6b5a7d; text-decoration: none; font-size: 11px; }
.status-links a:hover { color: #6a4a9a; }

/* ============================================================
   COMPONENTS — Profile and navigation
   ============================================================ */

.grace-intro { max-width: 640px; margin: clamp(8px, 4vw, 48px) auto; }
.grace-intro .profile-section { flex-wrap: wrap; }
.grace-intro .avatar { width: 80px; height: 80px; }
.grace-intro .section-title { font-size: clamp(24px, 3vw, 32px); }
.grace-intro .section-sub { margin: 18px 0 24px; line-height: 1.6; }
.grace-intro .about-bio { font-size: 14px; line-height: 1.85; }
.grace-intro .tag-row { margin-top: 24px; }

.profile-section {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}

.avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #e8c5f0, #c5d8f0);
  flex-shrink: 0;
  display: block;
  object-fit: cover;
  border: 2px solid rgba(200, 180, 220, 0.5);
}

.profile-role { font-size: 11px; color: #6b5a7d; margin-top: 2px; }

.nav-item {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  height: 100%;
  min-height: 0;
  border-radius: 0;
  cursor: default;
  font-size: 13px;
  line-height: 1;
  color: inherit;
  white-space: nowrap;
  transition: background 0.15s;
}

.nav-item:hover  { background: rgba(56, 43, 68, 0.08); }
.nav-item.active { background: rgba(56, 43, 68, 0.1); font-weight: 500; }

/* ============================================================
   COMPONENTS — Color utilities
   Applies to: project icons, tags, skill bars
   ============================================================ */

.icon-pink   { background: #fce4f3; }
.icon-purple { background: #ede4f5; }
.icon-blue   { background: #deeaf5; }
.icon-green  { background: #dff5ea; }

.tag { font-size: 12px; padding: 3px 10px; border-radius: 20px; font-weight: 500; }

.tag-pink   { background: #fce4f3; color: #a0508a; }
.tag-purple { background: #ede4f5; color: #6a4a9a; }
.tag-blue   { background: #deeaf5; color: #4a6a9a; }
.tag-green  { background: #dff5ea; color: #3a8a6a; }

.bar-pink   { background: linear-gradient(90deg, #f5c0e0, #e880b8); }
.bar-purple { background: linear-gradient(90deg, #d0b8f0, #9a70d0); }
.bar-blue   { background: linear-gradient(90deg, #b8d0f0, #6090d0); }
.bar-green  { background: linear-gradient(90deg, #b8e8d0, #60b890); }

/* ============================================================
   SECTION — Shared
   ============================================================ */

.main-content { padding: 20px; overflow-y: auto; }

.section        { display: none; }
.section.active { display: block; }

.section-title {
  font-size: 18px;
  font-weight: 600;
  color: #4a3f5c;
  margin-bottom: 4px;
}

.section-sub {
  font-size: 13px;
  color: #6b5a7d;
  margin-bottom: 18px;
}

/* ============================================================
   SECTION — About
   ============================================================ */

.about-bio { font-size: 13px; line-height: 1.7; color: #5a4a6a; margin-bottom: 14px; }

.tag-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }

.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }

.stat-card {
  background: rgba(240, 230, 255, 0.5);
  border: 0.5px solid rgba(200, 180, 220, 0.35);
  border-radius: 10px;
  padding: 12px;
  text-align: center;
}

.stat-num   { font-size: 20px; font-weight: 600; color: #6a4a9a; }
.stat-label { font-size: 11px; color: #6b5a7d; margin-top: 2px; }

/* ============================================================
   SECTION — Projects
   ============================================================ */

.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.project-card {
  min-width: 0;
  background: rgba(255, 255, 255, 0.55);
  border: 0.5px solid rgba(200, 180, 220, 0.4);
  border-radius: 10px;
  padding: 14px;
  transition: background 0.2s, box-shadow 0.2s;
  position: relative;
  cursor: pointer;
}

.project-card::after {
  content: '\2197';
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 12px;
  font-weight: 700;
  color: #6a4a9a;
  background: rgba(200, 180, 220, 0.3);
  border: 0.5px solid rgba(200, 180, 220, 0.5);
  border-radius: 5px;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, transform 0.15s;
}

.project-card:hover::after,
.project-card:focus-visible::after {
  background: rgba(200, 180, 220, 0.5);
  transform: translate(1px, -1px);
}

/* Purple lift on hover — ported from the original inline handlers so it
   also fires on keyboard focus and respects the transition above. */
.project-card:hover,
.project-card:focus-visible {
  background: rgba(230, 215, 245, 0.65);
  box-shadow: 0 4px 16px rgba(160, 120, 200, 0.18);
}

.project-gallery-subtitle:has(+ .project-gallery-hint:not([hidden])) { margin-bottom: 5px; }
.project-gallery-hint { margin-bottom: 18px; font-size: 11px; color: #6b5a7d; }

.project-hero {
  --hero-accent: #6a4a9a;
  --hero-surface: #f0e9f8;
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(0, 1fr);
  align-items: center;
  gap: 30px;
  padding: 36px 32px;
  background: linear-gradient(130deg, #fffafb, var(--hero-surface));
  color: #4a3f5c;
}

.project-hero-blue { --hero-accent: #315f8f; --hero-surface: #e6eff9; }
.project-hero-warm { --hero-accent: #9a4a32; --hero-surface: #f6eee2; }
.project-hero-teal { --hero-accent: #28655e; --hero-surface: #e4f2ee; }
.project-hero-rose { --hero-accent: #a34e70; --hero-surface: #fff0f3; }
.project-hero-copy { min-width: 0; }
.project-hero-kicker { color: var(--hero-accent); font-size: 10px; font-weight: 650; line-height: 1.5; letter-spacing: 1.4px; text-transform: uppercase; }
.project-hero h1 { margin: 12px 0; font: 500 clamp(32px, 4vw, 48px)/1.12 Georgia, serif; letter-spacing: -1.5px; overflow-wrap: anywhere; }
.project-hero-lede { margin-bottom: 14px; color: var(--hero-accent); font: 24px/1.35 Georgia, serif; }
.project-hero-summary { max-width: 440px; font-size: 13px; line-height: 1.8; color: #5a4a6a; }
.project-hero-status { display: inline-block; margin-top: 18px; padding: 7px 10px; border: 1px solid rgba(140, 110, 150, 0.18); border-radius: 8px; background: rgba(255, 255, 255, 0.5); color: var(--hero-accent); font-size: 10px; line-height: 1.5; }
.project-hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin-top: 20px; }
.project-hero-button { display: inline-flex; align-items: center; justify-content: center; gap: 12px; min-height: 48px; padding: 12px 18px; border: 1px solid var(--hero-accent); border-radius: 12px; background: var(--hero-accent); color: #fff; font-size: 12px; line-height: 1.5; font-weight: 600; text-decoration: none; }
.project-hero-button:hover { filter: brightness(0.9); }
.project-hero-link { display: inline-flex; align-items: center; min-height: 36px; color: var(--hero-accent); font-size: 12px; line-height: 1.5; text-underline-offset: 4px; }
.project-hero-art { min-width: 0; overflow: hidden; border-radius: 20px; }
.project-hero-art > img { display: block; width: 100%; height: auto; }
.project-hero .hero { width: 100%; height: 300px; margin: 0; }
.project-hero .hero-inner { padding: 18px; gap: 14px; }
.project-hero .hero-shot { width: calc((100% - 28px) / 3); height: auto; max-height: 240px; object-fit: contain; }
.project-hero .hero-phone { flex: 1 1 0; min-width: 0; max-width: 110px; }
.project-hero .hero-stage { gap: 14px; padding: 24px; }
.project-hero .siri-orb { width: 72px; height: 72px; border-width: 9px; }
.project-hero .agent-sheet { flex: 1; min-width: 0; max-width: 280px; }

@media (max-width: 760px) {
  .project-hero { grid-template-columns: minmax(0, 1fr); gap: 24px; padding: 28px 22px; }
  .project-hero h1 { font-size: 36px; }
  .project-hero-lede { font-size: 22px; }
  .project-hero-art { width: 100%; max-width: 480px; justify-self: center; }
}

.project-window {
  width: min(1100px, calc(100vw - 40px));
  max-width: none;
  height: min(860px, calc(100dvh - 40px));
  max-height: calc(100dvh - 40px);
  margin: auto;
  padding: 0;
  border: 1px solid rgba(200, 180, 220, 0.6);
  border-radius: 14px;
  background: #f7f1fb;
  color: #5a4a6a;
  box-shadow: 0 24px 85px rgba(90, 60, 120, 0.3);
  overflow: hidden;
}

.project-window[open] { display: flex; flex-direction: column; }
.project-window.is-maximized { width: 100vw; height: 100dvh; max-height: 100dvh; border: 0; border-radius: 0; }
.project-window::backdrop { background: rgba(75, 55, 95, 0.32); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); }
body:has(.project-window[open]) { overflow: hidden; }
.project-window-titlebar { flex-shrink: 0; }
.project-window-controls { flex-shrink: 0; }
.project-window-titlebar .titlebar-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-window-body { flex: 1; min-height: 0; display: flex; }
.project-window-frame { display: block; flex: 1; width: 100%; min-width: 0; height: 100%; border: 0; }
.project-window-frame[hidden] { display: none; }
.project-window-status { padding: 14px 20px; font-size: 13px; line-height: 1.5; background: #fce4f3; }
.project-window-hint { flex-shrink: 0; padding: 9px 16px; border-top: 1px solid rgba(200, 180, 220, 0.3); font-size: 11px; line-height: 1.5; }

.project-dock { align-self: center; flex-shrink: 0; display: flex; align-items: center; gap: 8px; max-width: calc(100% - 24px); margin: 0 12px 12px; padding: 8px; border: 1px solid rgba(200, 180, 220, 0.6); border-radius: 14px; background: rgba(250, 243, 255, 0.94); box-shadow: 0 8px 30px rgba(90, 60, 120, 0.2); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
.project-dock[hidden] { display: none; }
.project-dock-label { padding-inline: 4px; color: #6b5a7d; font-size: 10px; }
.project-dock-items { display: flex; gap: 6px; min-width: 0; overflow-x: auto; padding: 3px; }
.project-dock-item { flex-shrink: 0; max-width: 180px; min-height: 44px; padding: 8px 12px; border: 1px solid rgba(200, 180, 220, 0.45); border-radius: 8px; background: #ede4f5; color: #5a4a6a; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.project-dock-item[hidden] { display: none; }
.project-dock-item:hover { background: #e2d3ef; }

.project-thumb,
.project-thumb-placeholder {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: contain;
  border-radius: 8px;
  margin-bottom: 14px;
  background: #f0e9f8;
}

.project-thumb-placeholder { opacity: 0.5; }
.project-preview-blue { background: #e6eff9; }
.project-preview-rose { background: #fff0f3; }
.project-preview-warm { background: #f6eee2; }
.project-preview-teal { background: #e4f2ee; }
.project-screens { position: relative; overflow: hidden; }
.project-screens-row { position: absolute; inset: clamp(10px, 1.5vw, 20px); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(6px, 1vw, 12px); }
.project-screens img { display: block; width: 100%; height: 100%; min-width: 0; min-height: 0; object-fit: contain; filter: drop-shadow(0 5px 8px rgba(20, 25, 45, 0.15)); }

.project-thumb-placeholder.icon-purple { background: linear-gradient(135deg, #ede4f5, #d0b8f0); }
.project-thumb-placeholder.icon-blue   { background: linear-gradient(135deg, #deeaf5, #b8d0f0); }
.project-thumb-placeholder.icon-green  { background: linear-gradient(135deg, #dff5ea, #b8e8d0); }

.siri-agent-thumb {
  background:
    radial-gradient(circle at 18% 22%, rgba(70, 205, 235, 0.95), transparent 30%),
    radial-gradient(circle at 80% 20%, rgba(243, 87, 148, 0.9), transparent 34%),
    radial-gradient(circle at 72% 88%, rgba(243, 181, 70, 0.85), transparent 34%),
    #17243d;
}

.project-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.project-name { font-size: 15px; font-weight: 600; color: #4a3f5c; margin-bottom: 6px; }
.project-desc { font-size: 13px; color: #6b5a7d; line-height: 1.5; margin-bottom: 10px; }
.project-tags { display: flex; gap: 4px; flex-wrap: wrap; }
.project-tag  { font-size: 11px; padding: 2px 7px; border-radius: 10px; background: #ede4f5; color: #6a4a9a; }

.game-player { margin-bottom: 20px; }
.game-player [hidden] { display: none; }
.game-player-toolbar { display: flex; align-items: center; gap: 12px; min-height: 44px; margin-bottom: 8px; }
.game-player-status { min-width: 0; font-size: 12px; color: #6b5a7d; }
.game-player-tools { display: flex; gap: 8px; margin-left: auto; }

.game-start,
.game-control {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 16px;
  border: 0.5px solid rgba(200, 180, 220, 0.5);
  border-radius: 6px;
  background: #ede4f5;
  color: #4a3f5c;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
  cursor: pointer;
}
.game-control { width: 44px; height: 44px; padding: 0; font-size: 22px; }
.game-start:hover,
.game-control:hover { background: #e4d5f0; }
.game-start:focus-visible,
.game-control:focus-visible { outline: 2px solid #6a4a9a; outline-offset: 3px; }
.game-start:disabled { opacity: 0.6; cursor: wait; }

.game-player-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 6px;
  background: #faf7fe;
}
.game-player-stage > img { display: block; width: 100%; height: 100%; object-fit: cover; }
.game-player-stage > iframe { position: absolute; inset: 0; display: block; width: 100%; height: 100%; border: 0; }
.game-player.is-playing .game-player-stage { aspect-ratio: auto; height: min(75vh, 760px); min-height: min(420px, 70vh); }

.game-player:fullscreen { display: flex; flex-direction: column; width: 100%; height: 100%; margin: 0; background: #faf7fe; }
.game-player:fullscreen .game-player-toolbar { flex: none; margin: 0; padding: 8px 12px; }
.game-player:fullscreen .game-player-stage { flex: 1; aspect-ratio: auto; height: auto; min-height: 0; border-radius: 0; }

.game-case-study {
  --case-ink: #4a3f5c;
  --case-muted: #6b5a7d;
  --case-accent: #6a4a9a;
  --case-line: rgba(200, 180, 220, 0.35);
  --case-surface: rgba(240, 230, 255, 0.4);
}
.game-case-study .window-area { grid-template-columns: minmax(0, 1fr); }
.game-case-study .main-window { min-width: 0; min-height: auto; }
.game-case-study .main-content { padding: 0; }
.game-back-link { display: inline-flex; align-items: center; gap: 6px; margin: 18px 28px 0; color: var(--case-muted); font-size: 12px; text-decoration: none; }
.game-back-link:hover { color: var(--case-accent); }
.game-back-link:focus-visible { outline: 2px solid var(--case-accent); outline-offset: 4px; }
.game-case-study .game-player { margin: 0; }
.game-case-study .game-player-toolbar { margin: 0; padding: 4px 12px; background: var(--case-surface); border-top: 0.5px solid var(--case-line); }
.game-case-study .game-player-stage { border-radius: 0; }
.game-case-study .game-player:not(:fullscreen).is-playing .game-player-stage { height: min(65vh, 620px); }

.game-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 18px 28px;
  gap: 16px;
  background: var(--case-surface);
  border-block: 0.5px solid var(--case-line);
}
.game-facts dt { margin-bottom: 5px; color: var(--case-muted); font-size: 10px; text-transform: uppercase; }
.game-facts dd { color: var(--case-ink); font-size: 12px; font-weight: 500; line-height: 1.5; }
.game-case-body { padding: 28px; color: #5a4a6a; }
.game-case-section + .game-case-section { margin-top: 32px; }
.game-case-section h2 {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 0.5px solid var(--case-line);
  color: var(--case-ink);
  font-size: 15px;
  line-height: 1.5;
  font-weight: 600;
}
.game-section-number { color: var(--case-accent); font-size: 10px; font-variant-numeric: tabular-nums; }
.game-case-section h3 { margin-bottom: 6px; color: var(--case-ink); font-size: 13px; font-weight: 600; line-height: 1.5; }
.game-case-section p { margin-bottom: 12px; font-size: 13px; line-height: 1.75; }
.game-case-section p:last-child { margin-bottom: 0; }
.game-design-note { margin: 16px 0; padding: 14px 18px; border-left: 3px solid #c5b8f0; background: var(--case-surface); }
.game-design-note strong { color: var(--case-accent); }
.game-case-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }

.game-loop {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  list-style: none;
  counter-reset: game-step;
}
.game-loop li { counter-increment: game-step; padding: 14px; border: 0.5px solid var(--case-line); border-radius: 8px; background: rgba(255, 255, 255, 0.6); }
.game-loop li::before { content: '0' counter(game-step); display: block; margin-bottom: 8px; color: var(--case-accent); font-size: 10px; font-weight: 600; }
.game-loop p { font-size: 12px; line-height: 1.6; }
.game-design-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.game-design-grid > div { padding-top: 12px; border-top: 3px solid #c5d8f0; }
.game-design-grid > div:nth-child(2) { border-top-color: #b8e8d0; }
.game-design-grid > div:nth-child(3) { border-top-color: #f5c0e0; }
.game-design-grid p { font-size: 12px; line-height: 1.7; }
.game-scope { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 18px 0; padding-block: 16px; border-block: 0.5px solid var(--case-line); }
.game-scope dt { color: var(--case-accent); font-size: 20px; line-height: 1.3; font-weight: 600; font-variant-numeric: tabular-nums; }
.game-scope dd { margin-top: 4px; color: var(--case-muted); font-size: 11px; line-height: 1.5; }

@media (max-width: 600px) {
  .game-case-body { padding: 22px 16px; }
  .game-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 16px; }
  .game-loop { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .game-design-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .game-scope { gap: 10px; }
}

/* ============================================================
   SECTION — Skills
   ============================================================ */

.skills-group { margin-bottom: 18px; }

.skills-label {
  font-size: 11px;
  font-weight: 600;
  color: #6b5a7d;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.skill-row    { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.skill-name   { font-size: 12px; color: #5a4a6a; width: 80px; flex-shrink: 0; }
.skill-pct    { font-size: 11px; color: #6b5a7d; width: 32px; text-align: right; }

.skill-bar-bg {
  flex: 1;
  height: 6px;
  border-radius: 10px;
  background: rgba(200, 180, 220, 0.25);
  overflow: hidden;
}

.skill-bar-fill { height: 100%; border-radius: 10px; }

/* ============================================================
   SECTION — Resume
   ============================================================ */

.resume-section       { margin-bottom: 20px; }

.resume-section-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6b5a7d;
  border-bottom: 0.5px solid rgba(200, 180, 220, 0.35);
  padding-bottom: 6px;
  margin-bottom: 12px;
}

.resume-item { margin-bottom: 14px; display: flex; gap: 12px; }

.resume-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, #e8c5f0, #c5d8f0);
  border: 1.5px solid rgba(200, 180, 220, 0.6);
  margin-top: 5px;
  flex-shrink: 0;
}

.resume-item-title { font-size: 13px; font-weight: 600; color: #4a3f5c; }
.resume-item-sub   { font-size: 12px; color: #6b5a7d; margin-top: 1px; }
.resume-item-desc  { font-size: 13px; color: #5a4a6a; margin-top: 4px; line-height: 1.5; }

.download-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(200, 180, 220, 0.3);
  border: 0.5px solid rgba(200, 180, 220, 0.5);
  border-radius: 8px;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 500;
  color: #6a4a9a;
  cursor: pointer;
  margin-top: 6px;
  text-decoration: none;
  transition: background 0.15s;
}

.download-btn:hover { background: rgba(200, 180, 220, 0.45); }

/* ============================================================
   SECTION — Grace: Faith
   ============================================================ */

.grace-faith { margin-top: 32px; padding-top: 24px; border-top: 0.5px solid rgba(200, 180, 220, 0.45); }
.grace-faith .section-title { font-size: 20px; }
.grace-faith .section-sub { margin: 6px 0 20px; }

.faith-block {
  background: rgba(252, 228, 243, 0.35);
  border-left: 3px solid #e8a0c8;
  border-radius: 0 10px 10px 0;
  padding: 14px 18px;
  margin-bottom: 16px;
}

.faith-verse {
  font-size: 13px;
  font-style: italic;
  color: #5a4a6a;
  line-height: 1.7;
}

.faith-ref {
  font-size: 12px;
  color: #6b5a7d;
  margin-top: 6px;
  font-weight: 500;
}

/* ============================================================
   SECTION — Thoughts
   ============================================================ */

.thoughts-section { container: thoughts / inline-size; }

.main-content:has(.thoughts-section.active) { padding: 0; }

.thoughts-toolbar {
  position: relative;
  z-index: 3;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 19px 29px 0;
}

.thoughts-heading {
  position: relative;
  z-index: 3;
  padding: 34px 24px 28px;
  text-align: center;
}

.thoughts-path {
  font: 9px/1.5 ui-monospace, 'SFMono-Regular', monospace;
  color: #80566e;
  letter-spacing: 0.02em;
}

.thoughts-heading .thoughts-eyebrow { margin-bottom: 16px; font-size: 8px; letter-spacing: 0.17em; }
.thoughts-heading .section-title { color: #654553; font-size: clamp(32px, 4.8cqw, 43px); line-height: 1.13; font-weight: 550; letter-spacing: -0.058em; }
.thoughts-heading .section-title > span { display: block; color: #a0508a; font-weight: 400; }
.thoughts-heading .section-sub { margin: 18px 0 19px; font-size: 11px; line-height: 1.8; color: #795c70; }

.thoughts-read-latest {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 10px 15px;
  min-height: 35px;
  border: 1px solid #ffffff9c;
  border-radius: 6px;
  color: #fffafd;
  background: linear-gradient(125deg, #a0508a, #975074);
  font-size: 10px;
  box-shadow: 0 5px 15px #a0508a26, inset 0 1px 0 #ffffff2e;
  cursor: pointer;
}

.thoughts-read-latest:hover { background: linear-gradient(125deg, #904577, #894365); }

.thoughts-motion {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid #ffffffa8;
  border-radius: 20px;
  background: #ffffff4f;
  color: #80566e;
  font-size: 9px;
  white-space: nowrap;
  cursor: pointer;
}

.thoughts-motion[hidden], .thoughts-pagination[hidden], .thoughts-read-latest[hidden] { display: none; }
.thoughts-motion:disabled { cursor: default; }
.thoughts-motion-dot { width: 5px; height: 5px; background: #ad98a4; border-radius: 50%; }
.thoughts-motion[aria-pressed="true"] .thoughts-motion-dot { background: #759684; }

.thoughts-canvas {
  position: relative;
  background: radial-gradient(ellipse at 9% 26%, #f5c0e0ad, transparent 55%),
              radial-gradient(ellipse at 86% 26%, #f9d9e8bd, transparent 54%),
              radial-gradient(ellipse at 85% 88%, #fce4f3b8, transparent 51%),
              radial-gradient(ellipse at 38% 79%, #ffe3dc66, transparent 49%),
              linear-gradient(145deg, #fff3f8, #fce4f3 52%, #fbe7ef);
  overflow: hidden;
  isolation: isolate;
}

.thoughts-light {
  position: absolute;
  inset: -25%;
  z-index: -1;
  background: radial-gradient(ellipse at 60% 35%, #ffffffad, transparent 49%);
  pointer-events: none;
}

.thoughts-light::before {
  content: '';
  position: absolute;
  inset: -25% 25% -25% 38%;
  background: linear-gradient(90deg, transparent, #ffffffa3, transparent);
  border-radius: 48%;
  filter: blur(22px);
  transform: rotate(24deg);
}

.thoughts-scene { position: relative; min-width: 0; min-height: 484px; }
.thoughts-code {
  position: absolute;
  left: 28px;
  top: -265px;
  bottom: 42px;
  width: 252px;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  opacity: 0.88;
  mask-image: linear-gradient(90deg, #000 77%, transparent);
  -webkit-mask-image: linear-gradient(90deg, #000 77%, transparent);
}

.thoughts-code-scan {
  display: block;
  width: 100%;
  height: 100%;
}

.thoughts-portrait {
  position: absolute;
  z-index: 1;
  top: -23px;
  left: 50%;
  width: 450px;
  transform: translateX(-50%);
  pointer-events: none;
  mask-image: radial-gradient(ellipse 53% 53% at 50% 40%, #000 32%, #000000c9 48%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 53% 53% at 50% 40%, #000 32%, #000000c9 48%, transparent 80%);
}

.thoughts-portrait img {
  display: block;
  width: 100%;
  height: auto;
  filter: saturate(0.8) contrast(0.97);
  opacity: 0.93;
}

.thoughts-scene-caption {
  position: absolute;
  z-index: 2;
  left: 20px;
  right: 20px;
  bottom: 22px;
  color: #80566e;
  font-size: 9px;
  line-height: 1.6;
  text-align: center;
}

.thoughts-journal { min-width: 0; position: relative; z-index: 2; width: 238px; margin: 0 28px 0 auto; padding-top: 24px; }
.thoughts-journal-heading { display: flex; justify-content: space-between; align-items: center; gap: 7px; margin: 1px 0 13px; }
.thoughts-eyebrow { font-size: 8px; letter-spacing: 0.13em; color: #8c5275; text-transform: uppercase; }
.thoughts-journal-heading h2 { font-size: 12px; font-weight: 500; margin-top: 5px; letter-spacing: -0.015em; color: #80506a; }
.thoughts-entry-count { font: 8px/1.5 ui-monospace, 'SFMono-Regular', monospace; color: #80566e; white-space: nowrap; }
.thoughts-covers { display: grid; gap: 9px; list-style: none; margin: 0; padding: 0; min-height: 331px; align-content: start; }
.thoughts-covers li:nth-child(2) { margin-left: 9px; }
.thoughts-covers li:nth-child(3) { margin-left: 18px; }

.thought-cover {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 105px;
  padding: 12px 13px 11px;
  border: 1px solid #ffffffd1;
  border-radius: 10px;
  background: linear-gradient(125deg, #fff8fcba, #f5c0e078);
  box-shadow: 0 7px 24px #a0508a14, inset 0 1px 0 #ffffffd9, inset 0 -1px 0 #ffffff33;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  text-align: left;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s, border-color 0.2s;
  color: #68465a;
}

.thoughts-covers li:nth-child(2) .thought-cover { background: linear-gradient(125deg, #fff7fbb8, #f8d0dc85); }
.thoughts-covers li:nth-child(3) .thought-cover { background: linear-gradient(125deg, #fffafbba, #fce4f388); }
.thought-cover:hover { border-color: #e8a0c8; box-shadow: 0 7px 24px #a0508a26, inset 0 1px 0 #fff; }
.thought-cover-top { display: flex; align-items: center; gap: 6px; color: #b0759a; }
.thought-cover-icon { width: 18px; height: 18px; padding: 1px; border-radius: 4px; background: #ffffff80; flex-shrink: 0; }
.thought-cover time { font: 8px/1.5 ui-monospace, 'SFMono-Regular', monospace; color: #80566e; }
.thought-cover-number { margin-left: auto; font: 8px/1.5 ui-monospace, 'SFMono-Regular', monospace; color: #b38a9f; }
.thought-cover-title { display: block; margin: 10px 0 12px; font-size: 14px; font-weight: 500; letter-spacing: -0.025em; line-height: 1.35; overflow-wrap: anywhere; }
.thought-cover-bottom { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px; margin-top: auto; }
.thought-cover-category { color: #80566e; font-size: 8px; line-height: 1.5; }
.thought-cover-open { font-size: 8px; color: #8a4d73; white-space: nowrap; }

.thoughts-pagination { display: flex; justify-content: space-between; align-items: center; gap: 7px; margin-top: 9px; }
.thoughts-pagination button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 34px; color: #80566e; font-size: 14px; padding: 5px 7px; border-radius: 6px; cursor: pointer; }
.thoughts-pagination button > span { font-size: 10px; }
.thoughts-pagination button:hover:not(:disabled) { background: #ffffff80; }
.thoughts-pagination button:disabled { color: #ae9aa5; cursor: default; }
#thoughts-page-status { color: #805f72; font: 9px/1.5 ui-monospace, 'SFMono-Regular', monospace; white-space: nowrap; }
.thoughts-noscript { font-size: 12px; line-height: 1.7; color: #795c70; }

.thoughts-footnote { display: flex; justify-content: space-between; gap: 14px; padding: 14px 28px; border-top: 1px solid #ffffffa8; background: linear-gradient(110deg, #fce4f3b0, #fff1f5b0); font-size: 9px; line-height: 1.7; color: #80566e; }
.thoughts-footnote span:last-child { color: #86587f; white-space: nowrap; }

.thoughts-section button:focus,
.thought-reader button:focus { outline-color: #a0508a; }

.thought-reader {
  width: min(540px, calc(100% - 32px));
  max-height: calc(100dvh - 48px);
  margin: auto;
  padding: 0;
  overflow-y: auto;
  color: #654553;
  background: linear-gradient(145deg, #fff7fbeb, #fce4f3eb 55%, #fff0f3eb);
  border: 1px solid #ffffffdc;
  border-radius: 13px;
  box-shadow: 0 24px 85px #68435640;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}

.thought-reader::backdrop { background: #72516252; backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); }
body:has(.thought-reader[open]) { overflow: hidden; }
.thought-reader-titlebar { background: #fce4f3cc; border-bottom-color: #e8a0c859; }
.thought-reader-titlebar .titlebar-title { font-size: 10px; overflow-wrap: anywhere; color: #795c70; }
.thought-reader-body { padding: 30px 30px 26px; }
.thought-reader-body h2 { margin: 14px 0 10px; font-size: 27px; line-height: 1.25; font-weight: 500; letter-spacing: -0.045em; overflow-wrap: anywhere; }
#thought-reader-date { color: #805d71; font: 10px/1.6 ui-monospace, 'SFMono-Regular', monospace; }
.thought-reader-copy { margin-top: 26px; }
.thought-reader-copy p { font-size: 16px; line-height: 1.9; color: #644e5c; margin: 0 0 14px; overflow-wrap: anywhere; }
.thought-reader-signature { display: flex; justify-content: space-between; align-items: center; margin-top: 29px; padding-top: 18px; border-top: 1px solid #e8c6d7; color: #895f77; font-size: 10px; }
.thought-reader-signature span:first-child { font: italic 24px/1.3 Georgia, serif; color: #a0508a; }

.thoughts-section.active[data-motion="on"] .thoughts-portrait img { animation: thoughts-breathe 12s ease-in-out infinite; }
.thoughts-section.active[data-motion="on"] .thoughts-light { animation: thoughts-light 16s ease-in-out infinite alternate; }
.thoughts-section.active[data-motion="on"] .thought-cover { animation: thoughts-reveal 0.4s ease both; }
.thoughts-section.active[data-motion="on"] .thoughts-covers li:nth-child(2) .thought-cover { animation-delay: 0.06s; }
.thoughts-section.active[data-motion="on"] .thoughts-covers li:nth-child(3) .thought-cover { animation-delay: 0.12s; }
.thoughts-section[data-motion="off"] .thought-cover { transition: none; }

@keyframes thoughts-breathe {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-4px) scale(1.012); }
}
@keyframes thoughts-light {
  from { transform: translate(-15px, 0); opacity: 0.6; }
  to { transform: translate(25px, -15px); opacity: 1; }
}
@keyframes thoughts-reveal {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}

@container thoughts (max-width: 800px) and (min-width: 681px) {
  .thoughts-code { left: 21px; width: 215px; mask-image: linear-gradient(90deg, #000 62%, transparent); -webkit-mask-image: linear-gradient(90deg, #000 62%, transparent); }
  .thoughts-journal { width: 212px; margin-right: 20px; }
  .thought-cover-title { font-size: 13px; }
  .thought-cover-category, .thought-cover-open { font-size: 7.5px; }
}

@container thoughts (max-width: 680px) {
  .thoughts-toolbar { padding: 17px 20px 0; }
  .thoughts-heading { padding: 34px 20px 25px; }
  .thoughts-heading .section-title { font-size: clamp(28px, 6.2cqw, 35px); }
  .thoughts-heading .section-sub { font-size: 11px; }
  .thoughts-scene { min-height: 0; padding: 388px 24px 55px; }
  .thoughts-code { left: 18px; width: 36%; opacity: 0.7; mask-image: linear-gradient(90deg, #000 65%, transparent); -webkit-mask-image: linear-gradient(90deg, #000 65%, transparent); }
  .thoughts-portrait { top: -26px; width: clamp(340px, 72cqw, 430px); }
  .thoughts-journal { position: relative; width: min(390px, 100%); margin: 0 auto; padding-top: 0; }
  .thoughts-journal-heading { margin-bottom: 14px; }
  .thoughts-journal-heading h2 { font-size: 14px; }
  .thought-cover { min-height: 105px; }
  .thought-cover-title { font-size: 16px; }
  .thought-cover time, .thought-cover-category, .thought-cover-open { font-size: 9px; }
  .thoughts-footnote { flex-wrap: wrap; gap: 2px 12px; padding: 13px 20px; }
}

/* ============================================================
   ACCESSIBILITY
   ============================================================ */

/* Visible keyboard focus for every interactive element.
   :focus-visible keeps the ring off mouse clicks. */
a:focus-visible,
button:focus-visible,
.nav-item:focus-visible,
.project-card:focus-visible {
  outline: 2px solid #6a4a9a;
  outline-offset: 2px;
  border-radius: 8px;
}

/* Fallback for browsers without :focus-visible */
a:focus,
button:focus {
  outline: 2px solid #6a4a9a;
  outline-offset: 2px;
}
a:focus:not(:focus-visible),
button:focus:not(:focus-visible) {
  outline: none;
}

/* Reset UA button styling so semantic buttons keep the current look */
button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
}

/* Skip link — first tab stop, hidden until focused */
.skip-link {
  position: absolute;
  left: 8px;
  top: -48px;
  z-index: 999;
  background: #fff;
  color: #4a3f5c;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid rgba(160, 120, 200, 0.5);
  text-decoration: none;
  transition: top 0.15s;
}
.skip-link:focus { top: 8px; }

/* Screen-reader-only text */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Honour reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .thoughts-section *,
  .thoughts-section *::before,
  .thoughts-section *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* ============================================================
   RESPONSIVE
   Breakpoints: 900px (tablet) → 768px (compact spacing) → 600px (phone)
   ============================================================ */

/* Let the desktop shell grow past its fixed height on small screens */
@media (max-width: 900px) {
  body { padding: 12px; align-items: flex-start; }
  .desktop { min-height: 0; }
  .home-desktop { height: min(860px, calc(100dvh - 24px)); }
}

/* Compact window spacing */
@media (max-width: 768px) {
  body { padding: 8px; }

  .desktop { border-radius: 12px; }
  .home-desktop { height: calc(100dvh - 16px); }
  .home-desktop .window-area { padding-bottom: 12px; }

  .window-area {
    grid-template-columns: 1fr;
    padding: 12px;
    padding-bottom: 34px;
    min-height: 0;
    gap: 10px;
  }

  .main-window { min-height: 0; }

  .home-menubar { gap: 10px; }
  .home-menubar .menubar-right > span:first-child { display: none; }

  /* Standalone case studies keep only the brand and status. */
  .menubar-left span:not(.menubar-brand) { display: none; }

  .main-content { padding: 16px; }

  /* Standalone case studies scroll with the page. */
  .main-content { overflow-y: visible; }
}

/* Phone */
@media (max-width: 600px) {
  .home-menubar { height: 32px; min-height: 32px; gap: 0; padding: 0 10px; }
  .home-menubar .menubar-right { display: none; }
  .section-nav { flex-basis: 100%; }
  .section-tabs .nav-item { padding-inline: 6px; font-size: 12px; }

  .projects-grid { grid-template-columns: 1fr; }

  .stat-row { grid-template-columns: 1fr; }

  .section-title { font-size: 17px; }

  .status-bar {
    position: static;
    height: auto;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 16px;
  }

  .window-area { padding-bottom: 12px; }

  .status-links { margin-left: 0; width: 100%; }

  .faith-block { padding: 12px 14px; }
  .thought-reader-body { padding: 25px 23px; }
  .project-window { width: calc(100vw - 16px); height: calc(100dvh - 24px); max-height: calc(100dvh - 24px); border-radius: 12px; }
  .project-dock-label { display: none; }
}

/* Very small phones */
@media (max-width: 400px) {
  .menubar { gap: 10px; padding: 0 10px; }
  .menubar-right span:not(#clock) { display: none; }
  .home-menubar { gap: 0; padding: 0 10px; }
}

/* ============================================================
   SEMANTIC ELEMENT NORMALIZATION
   Nav items are <button>, project cards are <a>. These rules keep
   the original visual design while restoring native semantics.
   ============================================================ */

.nav-item {
  text-align: left;
  font-family: inherit;
  background: none;
  border: none;
}

.project-card {
  display: block;
  text-decoration: none;
  color: inherit;
  font-family: inherit;
}

/* Children became <span>, so restore block flow */
.project-name { display: block; }
.project-desc { display: block; }
.project-tags { display: flex; }

/* Hidden panels must not render even when .active is absent */
.section[hidden] { display: none !important; }

/* Faith blockquote/figure reset */
.faith-block figure,
figure.faith-block { margin: 0 0 16px; }
.faith-verse { margin: 0; }

html.project-embedded body { display: block; padding: 0; }
html.project-embedded body .desktop { max-width: none; min-height: 100vh; border-radius: 0; box-shadow: none; }
html.project-embedded body .window-area { display: block; min-height: 0; padding: 0; }
html.project-embedded body .main-window { min-height: 0; border: 0; border-radius: 0; }
html.project-embedded body .main-content { max-height: none; overflow: visible; }
html.project-embedded .desktop > .menubar,
html.project-embedded .main-window > .titlebar,
html.project-embedded .desktop > .status-bar,
html.project-embedded .back-link,
html.project-embedded .cc-back,
html.project-embedded .game-back-link { display: none; }
