/* ============================================================
   ShinsakuOS — stylesheet
   Sections: reset · theme vars · wallpaper · boot · menu bar ·
   desktop icons · windows · app content · dock · animations ·
   responsive
   ============================================================ */

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue",
    "Hiragino Sans", "Noto Sans JP", sans-serif;
  color: var(--text);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-user-select: none;
  user-select: none;
  position: fixed;
  inset: 0;
}
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
a { color: inherit; text-decoration: none; }
svg { display: block; }

/* ---------- theme variables ---------- */
:root {
  --accent: #0a84ff;
  --accent-2: #5e5ce6;
  --text: #f5f5f7;
  --text-dim: rgba(235, 235, 245, 0.72);
  --window-bg: rgba(28, 28, 38, 0.72);
  --window-head: rgba(52, 52, 64, 0.72);
  --menu-bg: rgba(22, 22, 30, 0.45);
  --dock-bg: rgba(50, 50, 62, 0.42);
  --stroke: rgba(255, 255, 255, 0.12);
  --stroke-soft: rgba(255, 255, 255, 0.07);
  --chip-bg: rgba(255, 255, 255, 0.08);
  --shadow: 0 34px 90px rgba(0, 0, 0, 0.55), 0 10px 28px rgba(0, 0, 0, 0.4);
  --radius: 12px;
}
:root[data-theme="light"] {
  --accent: #007aff;
  --accent-2: #5e5ce6;
  --text: #1d1d1f;
  --text-dim: rgba(52, 52, 60, 0.86);
  --window-bg: rgba(250, 250, 252, 0.82);
  --window-head: rgba(240, 240, 244, 0.72);
  --menu-bg: rgba(255, 255, 255, 0.5);
  --dock-bg: rgba(255, 255, 255, 0.42);
  --stroke: rgba(0, 0, 0, 0.12);
  --stroke-soft: rgba(0, 0, 0, 0.06);
  --chip-bg: rgba(0, 0, 0, 0.06);
  --shadow: 0 34px 90px rgba(0, 0, 0, 0.28), 0 10px 28px rgba(0, 0, 0, 0.16);
}

/* ---------- wallpaper ---------- */
body {
  background:
    radial-gradient(1200px 820px at 14% 8%, rgba(94, 92, 230, 0.5), transparent 60%),
    radial-gradient(1000px 720px at 88% 16%, rgba(255, 92, 140, 0.32), transparent 55%),
    radial-gradient(1500px 950px at 62% 116%, rgba(255, 159, 67, 0.3), transparent 55%),
    linear-gradient(158deg, #0a0f26 0%, #131a40 45%, #241748 78%, #3a1c46 100%);
  background-attachment: fixed;
}
:root[data-theme="light"] body {
  background:
    radial-gradient(1000px 720px at 18% 6%, rgba(120, 150, 255, 0.55), transparent 60%),
    radial-gradient(1000px 720px at 86% 12%, rgba(255, 170, 195, 0.6), transparent 55%),
    radial-gradient(1300px 850px at 60% 116%, rgba(255, 205, 140, 0.55), transparent 55%),
    linear-gradient(158deg, #cfe0ff 0%, #e8dcff 52%, #ffe6cf 100%);
  background-attachment: fixed;
}

/* ============================================================
   BOOT SCREEN
   ============================================================ */
#boot-screen {
  position: fixed; inset: 0; z-index: 9999;
  background: #000; color: #f5f5f7;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 34px;
  transition: opacity 0.7s ease;
}
#boot-screen.done { opacity: 0; pointer-events: none; }
.boot-logo { opacity: 0; animation: bootLogo 0.9s ease forwards; }
.boot-bar { width: 180px; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, 0.18); overflow: hidden; }
.boot-bar-fill { display: block; height: 100%; width: 0; border-radius: 3px; background: #f5f5f7; animation: bootFill 1.9s ease forwards 0.35s; }
.boot-hint { font-size: 12px; color: rgba(255, 255, 255, 0.55); letter-spacing: 0.02em; opacity: 0; animation: fadeIn 0.5s ease forwards 1.4s; }
@keyframes bootLogo { from { opacity: 0; transform: scale(0.9); } to { opacity: 0.95; transform: scale(1); } }
@keyframes bootFill { to { width: 100%; } }

/* ============================================================
   MENU BAR
   ============================================================ */
.menu-bar {
  position: fixed; top: 0; left: 0; right: 0; height: 28px; z-index: 500;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 10px;
  background: var(--menu-bg);
  backdrop-filter: blur(22px) saturate(180%);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  border-bottom: 1px solid var(--stroke-soft);
  font-size: 13px;
}
.menu-left, .menu-right { display: flex; align-items: center; gap: 2px; height: 100%; }
.menu-item {
  display: inline-flex; align-items: center; height: 22px; padding: 0 9px;
  border-radius: 6px; color: var(--text); white-space: nowrap;
  transition: background 0.12s ease;
}
.menu-item:hover { background: rgba(255, 255, 255, 0.16); }
:root[data-theme="light"] .menu-item:hover { background: rgba(0, 0, 0, 0.08); }
.menu-item.bold { font-weight: 700; }
.menu-item.apple { padding: 0 8px; }
.menu-item.icon-only { padding: 0 7px; }
#menubar-date { font-variant-numeric: tabular-nums; }
.i-sun { display: none; }
:root[data-theme="light"] .i-moon { display: none; }
:root[data-theme="light"] .i-sun { display: block; }

/* ============================================================
   DESKTOP + shortcut icons
   ============================================================ */
/* full viewport so window top/left are viewport coords (drag math relies on this;
   windows still sit below the fixed menu bar via the 28px clamp in js) */
#desktop { position: fixed; inset: 0; }
.desktop-icons {
  position: absolute; top: 40px; right: 14px;
  display: flex; flex-direction: column; gap: 6px;
}
.desktop-icon {
  width: 92px; padding: 8px 4px; border-radius: 8px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  transition: background 0.12s ease;
}
.desktop-icon:hover, .desktop-icon:focus-visible { background: rgba(120, 160, 255, 0.22); outline: none; }
.di-glyph { width: 46px; height: 40px; filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.35)); }
.di-glyph.folder { background: linear-gradient(180deg, #7cc4ff, #3d9bff); border-radius: 7px; position: relative; }
.di-glyph.folder::before { content: ""; position: absolute; top: -5px; left: 5px; width: 22px; height: 9px; background: #3d9bff; border-radius: 4px 4px 0 0; }
.di-glyph.doc, .di-glyph.note { background: #fff; border-radius: 5px; position: relative; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08); }
.di-glyph.doc::after, .di-glyph.note::after {
  content: ""; position: absolute; inset: 8px 8px auto 8px; height: 3px; border-radius: 2px;
  background: #c9c9cf; box-shadow: 0 6px 0 #d6d6dc, 0 12px 0 #d6d6dc, 0 18px 0 #e2e2e8;
}
.di-glyph.note { background: linear-gradient(180deg, #fff6c9, #ffe98a); }
.di-label {
  font-size: 12px; color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
  padding: 1px 6px; border-radius: 4px; line-height: 1.3;
}
.desktop-icon:hover .di-label, .desktop-icon:focus-visible .di-label { background: var(--accent); text-shadow: none; }

/* ============================================================
   WINDOWS
   ============================================================ */
.window {
  position: absolute; top: 90px; left: 120px;
  width: min(560px, 92vw); max-width: 96vw;
  display: flex; flex-direction: column;
  background: var(--window-bg);
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  max-height: calc(100vh - 120px);
}
.window.wide { width: min(760px, 94vw); }
.window[hidden] { display: none; }
.window.maximized {
  top: 34px !important; left: 6px !important;
  width: calc(100vw - 12px) !important; height: calc(100vh - 120px) !important;
  max-height: none;
}
.window-titlebar {
  display: flex; align-items: center; gap: 10px;
  height: 40px; padding: 0 14px; flex-shrink: 0;
  background: var(--window-head);
  border-bottom: 1px solid var(--stroke-soft);
  cursor: grab; position: relative;
}
.window-titlebar.dark { background: rgba(38, 38, 46, 0.9); }
.window-titlebar:active { cursor: grabbing; }
.window-title {
  position: absolute; left: 0; right: 0; text-align: center;
  font-size: 13px; font-weight: 600; color: var(--text-dim);
  pointer-events: none; padding: 0 16px 0 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.traffic-lights { display: flex; gap: 8px; z-index: 2; }
.traffic {
  width: 12px; height: 12px; border-radius: 50%; position: relative;
  display: inline-flex; align-items: center; justify-content: center;
}
.traffic.close { background: #ff5f57; }
.traffic.min { background: #febc2e; }
.traffic.max { background: #28c840; }
.traffic::before { font-size: 9px; font-weight: 700; color: rgba(0, 0, 0, 0.5); opacity: 0; line-height: 1; }
.traffic-lights:hover .traffic.close::before { content: "×"; opacity: 1; }
.traffic-lights:hover .traffic.min::before { content: "–"; opacity: 1; }
.traffic-lights:hover .traffic.max::before { content: "+"; opacity: 1; font-size: 8px; }
.window-body { padding: 22px 24px 26px; overflow-y: auto; overflow-x: hidden; }
.body-lead { font-size: 14px; color: var(--text-dim); margin-bottom: 18px; }
.muted { color: var(--text-dim); font-size: 0.85em; }

/* generic buttons */
.btn {
  padding: 8px 16px; border-radius: 9px; font-size: 13.5px; font-weight: 600;
  background: var(--chip-bg); border: 1px solid var(--stroke); color: var(--text);
  transition: transform 0.1s ease, filter 0.15s ease, background 0.15s ease;
}
.btn:hover { filter: brightness(1.12); }
.btn:active { transform: scale(0.97); }
.btn.primary { background: var(--accent); border-color: transparent; color: #fff; }
.btn.ghost { background: transparent; }
.btn.ghost:hover { background: var(--chip-bg); }

/* ---------- About ---------- */
.about-hero { display: flex; gap: 18px; align-items: center; margin-bottom: 18px; }
.avatar {
  width: 78px; height: 78px; border-radius: 22px; flex-shrink: 0;
  display: grid; place-items: center; font-size: 28px; font-weight: 800; letter-spacing: 0.03em;
  color: #fff; background: linear-gradient(140deg, #5e5ce6, #0a84ff 55%, #64d2ff);
  box-shadow: 0 10px 26px rgba(10, 132, 255, 0.4);
}
.about-name { font-size: 26px; font-weight: 800; letter-spacing: -0.01em; }
.about-role { font-size: 15px; color: var(--text); margin-top: 2px; }
.about-jp { font-size: 13px; color: var(--text-dim); margin-top: 3px; }
.about-status { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--text-dim); margin-top: 8px; }
.about-status .dot { width: 8px; height: 8px; border-radius: 50%; background: #30d158; box-shadow: 0 0 0 3px rgba(48, 209, 88, 0.25); animation: pulse 2s infinite; }
.about-bio { font-size: 14.5px; line-height: 1.65; color: var(--text); opacity: 0.92; margin-bottom: 18px; }
.about-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px; margin-bottom: 20px; }
.fact { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; background: var(--chip-bg); border-radius: 10px; border: 1px solid var(--stroke-soft); }
.fact-k { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-dim); }
.fact-v { font-size: 13.5px; font-weight: 600; }
.about-cta { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- Projects ---------- */
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.project {
  background: var(--chip-bg); border: 1px solid var(--stroke-soft); border-radius: 14px; padding: 16px;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.project:hover { transform: translateY(-4px); border-color: var(--stroke); box-shadow: 0 14px 30px rgba(0, 0, 0, 0.25); }
.project-thumb {
  width: 100%; height: 78px; border-radius: 10px; margin-bottom: 12px;
  display: grid; place-items: center; font-size: 26px; font-weight: 800; color: #fff;
}
.project-thumb.g1 { background: linear-gradient(135deg, #667eea, #764ba2); }
.project-thumb.g2 { background: linear-gradient(135deg, #11998e, #38ef7d); }
.project-thumb.g3 { background: linear-gradient(135deg, #f7971e, #ffd200); }
.project-thumb.g4 { background: linear-gradient(135deg, #ee0979, #ff6a00); }
.project-thumb.g5 { background: linear-gradient(135deg, #2193b0, #6dd5ed); }
.project-thumb.g6 { background: linear-gradient(135deg, #c471f5, #fa71cd); }
.project h3 { font-size: 15.5px; margin-bottom: 5px; }
.project p { font-size: 13px; line-height: 1.5; color: var(--text-dim); margin-bottom: 11px; }
.tags { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 12px; }
.tags span { font-size: 11px; padding: 3px 8px; border-radius: 6px; background: var(--chip-bg); border: 1px solid var(--stroke-soft); color: var(--text-dim); }
.project-links { display: flex; gap: 14px; }
.project-links a { font-size: 12.5px; font-weight: 600; color: var(--accent); }
.project-links a:hover { text-decoration: underline; }

/* ---------- Skills ---------- */
.skill-group { margin-bottom: 20px; }
.skill-group h3 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-dim); margin-bottom: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips span {
  font-size: 13px; padding: 6px 12px; border-radius: 8px; font-weight: 500;
  background: var(--chip-bg); border: 1px solid var(--stroke-soft);
}
.bars { display: flex; flex-direction: column; gap: 12px; }
.bar { display: grid; grid-template-columns: 160px 1fr; align-items: center; gap: 12px; }
.bar-label { font-size: 13px; color: var(--text-dim); }
.bar-track { height: 8px; border-radius: 5px; background: var(--chip-bg); overflow: hidden; }
.bar-track i { display: block; height: 100%; width: 0; border-radius: 5px; background: linear-gradient(90deg, var(--accent-2), var(--accent)); animation: grow 1.1s cubic-bezier(0.2, 0.8, 0.3, 1) forwards; }
@keyframes grow { to { width: var(--v); } }

/* ---------- Terminal ---------- */
.terminal-window { width: min(620px, 94vw); }
.terminal {
  background: rgba(12, 14, 20, 0.94); color: #d6e2d6;
  font-family: "SF Mono", ui-monospace, "JetBrains Mono", Menlo, Consolas, monospace;
  font-size: 13px; line-height: 1.55; padding: 16px 18px;
  min-height: 320px; max-height: 60vh;
}
:root[data-theme="light"] .terminal { background: rgba(20, 22, 28, 0.96); }
.terminal .prompt { color: #7CFC9B; margin-right: 8px; white-space: nowrap; }
.terminal .tilde { color: #64d2ff; }
.terminal-line { display: flex; align-items: baseline; }
.terminal-input-wrap { position: relative; flex: 1; display: inline-flex; align-items: baseline; }
#terminal-input {
  flex: 1; min-width: 4ch; background: transparent; border: none; outline: none; color: #eaeaea;
  font: inherit; caret-color: #7CFC9B; padding: 0; margin-left: 2px;
}
.caret { width: 8px; height: 15px; background: #7CFC9B; margin-left: 1px; animation: blink 1.1s step-end infinite; align-self: center; }
#terminal-output { white-space: pre-wrap; word-break: break-word; }
#terminal-output .out-cmd { color: #eaeaea; }
#terminal-output .out-cmd .prompt { color: #7CFC9B; }
#terminal-output .accent { color: #64d2ff; }
#terminal-output .green { color: #7CFC9B; }
#terminal-output .dim { color: #7d8a7d; }
#terminal-output .err { color: #ff6b6b; }
@keyframes blink { 0%, 50% { opacity: 1; } 50.01%, 100% { opacity: 0; } }

/* ---------- Contact ---------- */
.contact-body { padding-top: 0; }
.mail-field { display: flex; gap: 10px; padding: 11px 4px; border-bottom: 1px solid var(--stroke-soft); font-size: 13.5px; }
.mail-k { color: var(--text-dim); width: 62px; flex-shrink: 0; align-self: center; }
.mail-v { color: var(--text); font-weight: 500; }
.mail-input { flex: 1; min-width: 0; background: transparent; border: none; outline: none; color: var(--text); font: inherit; font-size: 13.5px; font-weight: 500; padding: 2px 0; }
.mail-input::placeholder { color: var(--text-dim); font-weight: 400; }
.mail-field:focus-within { border-bottom-color: var(--accent); }
.mail-compose { margin-top: 14px; }
.mail-compose textarea {
  width: 100%; min-height: 130px; resize: vertical; padding: 12px 14px;
  background: var(--chip-bg); border: 1px solid var(--stroke); border-radius: 10px;
  color: var(--text); font: inherit; font-size: 14px; line-height: 1.5;
}
.mail-compose textarea:focus { outline: none; border-color: var(--accent); }
.mail-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 14px; }
.social { font-size: 13px; font-weight: 600; padding: 8px 14px; border-radius: 9px; background: var(--chip-bg); border: 1px solid var(--stroke); }
.social:hover { border-color: var(--accent); color: var(--accent); }
.mail-note { font-size: 13px; color: #30d158; margin-top: 12px; font-weight: 600; }

/* ---------- Resume ---------- */
.resume-head { text-align: center; padding-bottom: 16px; border-bottom: 1px solid var(--stroke); margin-bottom: 16px; }
.resume-head h2 { font-size: 22px; font-weight: 800; }
.resume-head p { font-size: 13.5px; color: var(--text-dim); margin-top: 3px; }
.resume-sec { margin-bottom: 18px; }
.resume-sec h4 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--accent); margin-bottom: 10px; }
.resume-item { margin-bottom: 12px; font-size: 14px; }
.resume-item p { font-size: 13px; color: var(--text-dim); margin-top: 3px; line-height: 1.5; }

/* ============================================================
   DOCK
   ============================================================ */
#dock {
  position: fixed; bottom: 8px; left: 50%; transform: translateX(-50%); z-index: 400;
  max-width: calc(100vw - 16px);
}
.dock-inner {
  display: flex; align-items: flex-end; gap: 6px; padding: 7px 10px;
  background: var(--dock-bg);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border: 1px solid var(--stroke);
  border-radius: 22px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.45);
  overflow: visible;   /* let magnified icons + indicators escape the dock */
  scrollbar-width: none;
}
.dock-inner::-webkit-scrollbar { display: none; }
.dock-item {
  position: relative; flex-shrink: 0;
  transition: transform 0.18s cubic-bezier(0.2, 0.8, 0.3, 1);
  transform-origin: bottom center;
}
.dock-icon { display: block; }
.app-tile {
  width: 52px; height: 52px; border-radius: 13px;
  display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 18px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.a-about { background: linear-gradient(140deg, #5e5ce6, #0a84ff 55%, #64d2ff); }
.a-projects { background: linear-gradient(140deg, #48c6ef, #6f86d6); }
.a-skills { background: linear-gradient(140deg, #f857a6, #ff5858); }
.a-terminal { background: linear-gradient(140deg, #232526, #414345); }
.a-contact { background: linear-gradient(140deg, #2af598, #009efd); }
.a-resume { background: linear-gradient(140deg, #ff9a44, #fc6076); }
.a-github { background: linear-gradient(140deg, #333, #111); }
.a-linkedin { background: linear-gradient(140deg, #0a66c2, #004182); }
.a-trash { background: linear-gradient(140deg, #8e9eab, #5b6773); }
.dock-tooltip {
  position: absolute; bottom: calc(100% + 12px); left: 50%; transform: translateX(-50%) translateY(6px);
  padding: 4px 11px; border-radius: 8px; font-size: 12.5px; font-weight: 600; white-space: nowrap;
  background: rgba(30, 30, 40, 0.9); color: #fff; border: 1px solid var(--stroke);
  opacity: 0; pointer-events: none; transition: opacity 0.15s ease, transform 0.15s ease;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.dock-item:hover .dock-tooltip { opacity: 1; transform: translateX(-50%) translateY(0); }
.dock-indicator {
  position: absolute; bottom: -4px; left: 50%; transform: translateX(-50%);
  width: 4px; height: 4px; border-radius: 50%; background: var(--text);
  opacity: 0; transition: opacity 0.2s ease;
}
.dock-item.running .dock-indicator { opacity: 0.85; }
.dock-divider { width: 1px; height: 44px; margin: 0 4px; background: var(--stroke); align-self: center; flex-shrink: 0; }

/* ============================================================
   WINDOW OPEN / CLOSE ANIMATIONS
   ============================================================ */
.window.opening { animation: winOpen 0.28s cubic-bezier(0.2, 0.9, 0.3, 1); }
.window.closing { animation: winClose 0.2s ease forwards; }
.window.minimizing { animation: winMin 0.32s cubic-bezier(0.4, 0, 0.7, 0.4) forwards; }
@keyframes winOpen { from { opacity: 0; transform: scale(0.92); } to { opacity: 1; transform: scale(1); } }
@keyframes winClose { to { opacity: 0; transform: scale(0.94); } }
@keyframes winMin { to { opacity: 0; transform: scale(0.15) translateY(60vh); } }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 3px rgba(48, 209, 88, 0.25); } 50% { box-shadow: 0 0 0 5px rgba(48, 209, 88, 0.1); } }
@keyframes fadeIn { to { opacity: 1; } }

/* ============================================================
   FOCUS · SELECTION · SCROLLBARS
   ============================================================ */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.window:focus { outline: none; }   /* windows show focus via .focused, not a ring */
.traffic:focus-visible, .dock-item:focus-visible, .menu-item:focus-visible,
.btn:focus-visible, .social:focus-visible, .desktop-icon:focus-visible,
.project-links a:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 3px;
}
#terminal-input:focus-visible, .mail-compose textarea:focus-visible { outline: none; }
.mail-compose textarea:focus { box-shadow: 0 0 0 2px var(--accent); }

::selection { background: var(--accent); color: #fff; }

.window-body, .terminal { scrollbar-width: thin; scrollbar-color: var(--stroke) transparent; }
.terminal { scrollbar-color: rgba(255, 255, 255, 0.22) transparent; }
.window-body::-webkit-scrollbar, .terminal::-webkit-scrollbar { width: 10px; height: 10px; }
.window-body::-webkit-scrollbar-thumb, .terminal::-webkit-scrollbar-thumb {
  background: var(--stroke); border-radius: 6px; border: 2px solid transparent; background-clip: padding-box;
}
.terminal::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.22); background-clip: padding-box; }
.window-body::-webkit-scrollbar-thumb:hover { background: var(--text-dim); background-clip: padding-box; }

/* ============================================================
   RESPONSIVE — phones / tablets
   ============================================================ */
@media (max-width: 720px) {
  .hide-sm { display: none !important; }
  .desktop-icons { top: 34px; right: 8px; }
  .window {
    top: 40px !important; left: 50% !important;
    transform: translateX(-50%);
    width: calc(100vw - 16px) !important; max-width: none;
    max-height: calc(100vh - 150px);
  }
  .window.wide { width: calc(100vw - 16px) !important; }
  .window.maximized { transform: none; left: 6px !important; }
  .window-titlebar { cursor: default; height: 44px; }
  .traffic { width: 15px; height: 15px; }
  .traffic-lights { gap: 14px; }
  .menu-item { height: 26px; }
  .menu-item.icon-only, .menu-item.apple { padding: 0 10px; }
  .about-facts { grid-template-columns: 1fr; }
  .bar { grid-template-columns: 120px 1fr; }
  .app-tile { width: 46px; height: 46px; border-radius: 12px; }
  .dock-inner { gap: 4px; padding: 6px 8px; }
}

/* reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.05ms !important; }
  .boot-bar-fill { animation-duration: 0.4s !important; }
}

/* ============================================================
   PRINT — isolate the Resume window for a clean PDF export
   ============================================================ */
@media print {
  body {
    position: static; overflow: visible; background: #fff !important; color: #000 !important;
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }
  .menu-bar, #dock, .desktop-icons, #boot-screen, .about-cta { display: none !important; }
  .window { display: none !important; }
  .window[data-app="resume"] {
    display: block !important; position: static !important; transform: none !important;
    left: auto !important; top: auto !important; width: auto !important; max-width: 100% !important;
    height: auto !important; max-height: none !important;
    box-shadow: none !important; border: none !important;
    -webkit-backdrop-filter: none !important; backdrop-filter: none !important;
    background: #fff !important;
  }
  .window[data-app="resume"] .window-titlebar { display: none !important; }
  .window[data-app="resume"] * { color: #000 !important; }
  .resume-sec h4 { color: #444 !important; }
  .resume-head { border-color: #ccc !important; }
}

/* ============================================================
   NEW APP TILES + desktop icon variant
   ============================================================ */
.a-articles { background: linear-gradient(140deg, #36d1dc, #5b86e5); }
.a-games { background: linear-gradient(140deg, #7367f0, #ce9ffc); }
.di-glyph.folder.alt { background: linear-gradient(180deg, #c471f5, #7367f0); }
.di-glyph.folder.alt::before { background: #7367f0; }

/* ============================================================
   DESKTOP WALLPAPER ART — animated Japanese-style name
   ============================================================ */
.desktop-art { position: absolute; inset: 0; overflow: hidden; z-index: 0; pointer-events: none; }
.art-sun {
  position: absolute; right: -6vw; top: -7vw; width: 46vw; height: 46vw; max-width: 640px; max-height: 640px; border-radius: 50%;
  background: radial-gradient(circle at 42% 42%, rgba(255,110,120,.5), rgba(255,80,120,.14) 55%, transparent 72%);
  filter: blur(4px);
}
.art-grid {
  position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px);
  background-size: 66px 66px;
  -webkit-mask-image: radial-gradient(circle at 50% 62%, #000, transparent 74%);
  mask-image: radial-gradient(circle at 50% 62%, #000, transparent 74%);
}
:root[data-theme="light"] .art-grid { background-image: linear-gradient(rgba(20,20,50,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(20,20,50,.05) 1px, transparent 1px); }
.art-name { position: absolute; left: 5vw; top: 15vh; display: flex; flex-direction: column; line-height: .82; font-weight: 800; letter-spacing: -.03em; }
.art-name span {
  font-size: clamp(56px, 13vw, 188px);
  background: linear-gradient(180deg, rgba(255,255,255,.17), rgba(255,255,255,.03));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
:root[data-theme="light"] .art-name span { background: linear-gradient(180deg, rgba(30,30,60,.2), rgba(30,30,60,.04)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.art-name-2 { margin-left: .05em; }
.art-vertical { position: absolute; right: 6vw; top: 12vh; writing-mode: vertical-rl; font-size: clamp(17px, 2.4vw, 30px); letter-spacing: .38em; color: rgba(255,255,255,.14); font-weight: 600; }
:root[data-theme="light"] .art-vertical { color: rgba(30,30,60,.17); }
.art-sub { position: absolute; left: 5.4vw; bottom: 15vh; font-size: clamp(10px, 1.35vw, 15px); letter-spacing: .5em; color: rgba(255,255,255,.22); font-weight: 600; }
:root[data-theme="light"] .art-sub { color: rgba(30,30,60,.26); }
@media (prefers-reduced-motion: no-preference) {
  .art-name { animation: floaty 9s ease-in-out infinite; }
  .art-vertical { animation: floaty 12s ease-in-out infinite reverse; }
  .art-sun { animation: sunpulse 8s ease-in-out infinite; }
}
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }
@keyframes sunpulse { 0%,100% { transform: scale(1); opacity: .9; } 50% { transform: scale(1.06); opacity: 1; } }

/* ============================================================
   MENU-BAR DROPDOWNS
   ============================================================ */
.menu-dropdown {
  position: fixed; min-width: 216px; padding: 5px; z-index: 600;
  background: var(--window-bg); backdrop-filter: blur(24px) saturate(180%); -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--stroke); border-radius: 10px; box-shadow: var(--shadow);
}
.menu-dropdown[hidden] { display: none; }
.menu-dd-item { display: block; width: 100%; text-align: left; padding: 7px 12px; border-radius: 6px; font-size: 13.5px; color: var(--text); white-space: nowrap; }
.menu-dd-item:hover { background: var(--accent); color: #fff; }
.menu-sep { height: 1px; margin: 5px 8px; background: var(--stroke); }
.menu-item.menu-open { background: rgba(255,255,255,.16); }
:root[data-theme="light"] .menu-item.menu-open { background: rgba(0,0,0,.08); }

/* ============================================================
   SPOTLIGHT
   ============================================================ */
.spotlight { position: fixed; inset: 0; z-index: 800; display: flex; justify-content: center; align-items: flex-start; padding: 16vh 16px 16px; background: rgba(0,0,0,.28); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.spotlight[hidden] { display: none; }
.spotlight-box { width: min(560px, 94vw); background: var(--window-bg); backdrop-filter: blur(30px) saturate(180%); -webkit-backdrop-filter: blur(30px) saturate(180%); border: 1px solid var(--stroke); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; }
.spotlight-input-row { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--stroke-soft); color: var(--text-dim); }
#spotlight-input { flex: 1; background: none; border: none; outline: none; color: var(--text); font-size: 19px; }
.spotlight-results { list-style: none; max-height: 46vh; overflow-y: auto; padding: 6px; }
.spot-item { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 9px; cursor: pointer; }
.spot-item.active { background: var(--accent); color: #fff; }
.spot-icon { width: 22px; text-align: center; font-size: 15px; }
.spot-label { flex: 1; font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.spot-sub { font-size: 12px; opacity: .7; white-space: nowrap; flex-shrink: 0; }
.spot-item.active .spot-sub { opacity: .9; }
.spot-empty { padding: 18px; text-align: center; color: var(--text-dim); font-size: 14px; }

/* ============================================================
   TOAST + SLEEP
   ============================================================ */
.os-toast { position: fixed; bottom: 96px; left: 50%; transform: translateX(-50%) translateY(10px); z-index: 900; padding: 10px 18px; border-radius: 10px; background: rgba(20,20,28,.92); color: #fff; font-size: 13.5px; font-weight: 600; border: 1px solid var(--stroke); box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
.os-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.os-sleep { position: fixed; inset: 0; z-index: 9998; background: #000; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; color: #fff; opacity: 0; transition: opacity .5s; cursor: pointer; }
.os-sleep.show { opacity: 1; }
.os-sleep p { font-size: 13px; color: rgba(255,255,255,.5); }

/* ============================================================
   GAMES (Arcade)
   ============================================================ */
.games-body { display: flex; padding: 0; height: min(560px, 72vh); }
.games-nav { width: 152px; flex-shrink: 0; border-right: 1px solid var(--stroke-soft); padding: 12px 8px; display: flex; flex-direction: column; gap: 4px; overflow-y: auto; }
.games-nav-item { display: flex; align-items: center; gap: 9px; padding: 9px 11px; border-radius: 9px; font-size: 13.5px; font-weight: 500; color: var(--text); text-align: left; }
.games-nav-item:hover { background: var(--chip-bg); }
.games-nav-item.active { background: var(--accent); color: #fff; }
.gn-icon { font-size: 16px; width: 20px; text-align: center; }
.games-stage { flex: 1; overflow: auto; padding: 16px; display: flex; align-items: flex-start; justify-content: center; outline: none; }
.game-wrap { display: flex; flex-direction: column; align-items: center; gap: 12px; width: 100%; }
.game-bar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: center; width: 100%; }
.game-title { font-weight: 700; font-size: 15px; margin-right: auto; }
.game-score { font-size: 13px; color: var(--text-dim); }
.game-score b { color: var(--text); }
.game-btn { padding: 6px 12px; border-radius: 8px; background: var(--chip-bg); border: 1px solid var(--stroke); font-size: 12.5px; font-weight: 600; color: var(--text); }
.game-btn:hover { background: var(--accent); color: #fff; border-color: transparent; }
.game-btn.active { background: var(--accent); color: #fff; border-color: transparent; }
.ch-captured { display: flex; gap: 1px; flex-wrap: wrap; width: min(440px, 90vw); min-height: 26px; font-size: 21px; line-height: 1; align-items: center; }
.ch-cap-w { color: #f4f4f6; text-shadow: 0 1px 2px rgba(0,0,0,.6); }
.ch-cap-b { color: #2a2a2e; }
.ch-cap-score { margin-left: auto; font-size: 12px; color: var(--text-dim); font-weight: 600; }
.su-cell.hint { background: rgba(48,209,88,.22); color: #30d158; }
.game-select { padding: 5px 8px; border-radius: 8px; background: rgba(40, 40, 52, 0.9); border: 1px solid var(--stroke); color: var(--text); font-size: 12.5px; }
:root[data-theme="light"] .game-select { background: rgba(255, 255, 255, 0.9); }
.game-select option { background: #1e1e28; color: #f5f5f7; }
:root[data-theme="light"] .game-select option { background: #fff; color: #1d1d1f; }
.game-hint { font-size: 12px; color: var(--text-dim); text-align: center; max-width: 440px; line-height: 1.5; }
.game-canvas { border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.3); max-width: 100%; touch-action: none; background: #0d1020; }

/* 2048 */
.tf-board { position: relative; width: min(380px, 86vw); aspect-ratio: 1; display: grid; grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(4, 1fr); gap: 10px; padding: 10px; background: rgba(0,0,0,.18); border-radius: 12px; }
.tf-cell { display: grid; place-items: center; border-radius: 8px; background: rgba(255,255,255,.05); font-size: clamp(20px, 6vw, 34px); font-weight: 800; color: #fff; }
.tf-cell.v2 { background: #3a3f5c; } .tf-cell.v4 { background: #45507a; } .tf-cell.v8 { background: #e8a860; } .tf-cell.v16 { background: #e88b52; } .tf-cell.v32 { background: #e8724a; } .tf-cell.v64 { background: #e85a3a; } .tf-cell.v128 { background: #e0c25a; font-size: clamp(18px,5vw,30px); } .tf-cell.v256 { background: #e0b84a; } .tf-cell.v512 { background: #e0ae37; } .tf-cell.v1024 { background: #e0a422; font-size: clamp(15px,4.4vw,25px); } .tf-cell.v2048 { background: #e69b00; font-size: clamp(15px,4.4vw,25px); } .tf-cell.vbig { background: #12b886; font-size: clamp(15px,4.4vw,25px); }
.tf-over { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 12px; align-items: center; justify-content: center; background: rgba(10,12,20,.82); border-radius: 12px; color: #fff; font-size: 19px; font-weight: 700; text-align: center; }

/* Minesweeper */
.ms-board { position: relative; display: grid; grid-template-columns: repeat(var(--cols, 10), 1fr); gap: 3px; width: min(360px, 84vw); background: rgba(0,0,0,.18); padding: 8px; border-radius: 10px; }
.ms-cell { aspect-ratio: 1; border: none; border-radius: 4px; background: linear-gradient(180deg, rgba(255,255,255,.17), rgba(255,255,255,.06)); font-weight: 800; font-size: clamp(12px, 3.4vw, 16px); display: grid; place-items: center; color: #fff; }
.ms-cell.open { background: rgba(255,255,255,.05); cursor: default; }
.ms-cell.mine { background: #e8503a; }
.ms-cell.flag { background: linear-gradient(180deg, #ffd36e, #ffb347); }
.ms-cell[data-n="1"] { color: #5b9dff; } .ms-cell[data-n="2"] { color: #54d98c; } .ms-cell[data-n="3"] { color: #ff7a7a; } .ms-cell[data-n="4"] { color: #c58bff; } .ms-cell[data-n="5"] { color: #ffb84a; } .ms-cell[data-n="6"] { color: #4ad6d6; } .ms-cell[data-n="7"] { color: #ff9de0; } .ms-cell[data-n="8"] { color: #bbb; }

/* Sudoku */
.su-board { display: grid; grid-template-columns: repeat(9, 1fr); grid-template-rows: repeat(9, 1fr); width: min(400px, 88vw); aspect-ratio: 1; background: var(--stroke); border: 2px solid var(--text-dim); border-radius: 6px; overflow: hidden; }
.su-cell { border: 1px solid var(--stroke-soft); background: var(--window-bg); text-align: center; font-size: clamp(15px, 4.4vw, 20px); color: var(--accent); font-weight: 600; outline: none; min-width: 0; padding: 0; }
.su-cell.given { color: var(--text); font-weight: 800; background: var(--chip-bg); }
.su-cell.br { border-right: 2px solid var(--text-dim); }
.su-cell.bb { border-bottom: 2px solid var(--text-dim); }
.su-cell.bad { background: rgba(255,80,80,.28); color: #ff5a5a; }
.su-cell.good { color: #30d158; }
.su-cell:focus { background: rgba(10,132,255,.18); }
.su-msg { font-size: 13.5px; font-weight: 600; }
.su-msg.ok { color: #30d158; } .su-msg.no { color: #ff6b6b; }

/* Chess */
.ch-board { display: grid; grid-template-columns: repeat(8, 1fr); grid-template-rows: repeat(8, 1fr); width: min(440px, 90vw); aspect-ratio: 1; border-radius: 6px; overflow: hidden; box-shadow: 0 8px 24px rgba(0,0,0,.35); }
.ch-sq { border: none; display: grid; place-items: center; font-size: clamp(22px, 6.2vw, 36px); line-height: 1; cursor: pointer; position: relative; padding: 0; }
.ch-sq.light { background: #efe7d3; } .ch-sq.dark { background: #a97a54; }
.ch-sq.wp { color: #fff; text-shadow: 0 1px 1px rgba(0,0,0,.55), 0 0 2px rgba(0,0,0,.6); }
.ch-sq.bp { color: #17171a; text-shadow: 0 1px 1px rgba(255,255,255,.25); }
.ch-sq.sel { box-shadow: inset 0 0 0 3px #0a84ff; }
.ch-sq.move::after { content: ""; width: 26%; height: 26%; border-radius: 50%; background: rgba(10,132,255,.6); }
.ch-sq.cap { box-shadow: inset 0 0 0 3px #ff5a5f; }

/* ============================================================
   ARTICLES
   ============================================================ */
.articles-body { padding: 0; }
.articles-view { padding: 22px 24px 26px; }
.articles-head h2 { font-size: 22px; font-weight: 800; }
.articles-head .muted { display: block; margin: 3px 0 14px; }
.article-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.article-filter { padding: 5px 13px; border-radius: 20px; background: var(--chip-bg); border: 1px solid var(--stroke-soft); font-size: 12.5px; font-weight: 600; color: var(--text-dim); }
.article-filter.active { background: var(--accent); color: #fff; border-color: transparent; }
.articles-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(258px, 1fr)); gap: 16px; }
.article-card { text-align: left; padding: 18px; border-radius: 14px; background: var(--chip-bg); border: 1px solid var(--stroke-soft); transition: transform .18s, border-color .18s, box-shadow .18s; }
.article-card:hover { transform: translateY(-4px); border-color: var(--stroke); box-shadow: 0 14px 30px rgba(0,0,0,.22); }
.ac-cat { display: inline-block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--accent); margin-bottom: 8px; }
.article-card h3 { font-size: 15.5px; line-height: 1.3; margin-bottom: 7px; }
.article-card p { font-size: 13px; color: var(--text-dim); line-height: 1.5; margin-bottom: 12px; }
.ac-meta { font-size: 11.5px; color: var(--text-dim); }
.article-reader { padding: 24px 30px 44px; max-width: 780px; margin: 0 auto; }
.article-back { display: block; margin-bottom: 16px; font-size: 13px; font-weight: 600; color: var(--accent); }
.article-back:hover { text-decoration: underline; }
.article-title { font-size: clamp(24px, 4vw, 34px); font-weight: 800; line-height: 1.14; margin: 8px 0; letter-spacing: -.01em; }
.article-dek { font-size: 16px; color: var(--text-dim); line-height: 1.5; margin-bottom: 12px; }
.article-meta { font-size: 12px; color: var(--text-dim); padding-bottom: 18px; margin-bottom: 24px; border-bottom: 1px solid var(--stroke); }
.article-content { font-size: 15.5px; line-height: 1.75; }
.article-content h2 { font-size: 21px; font-weight: 700; margin: 30px 0 12px; letter-spacing: -.01em; }
.article-content h3 { font-size: 17px; font-weight: 700; margin: 22px 0 10px; }
.article-content p { margin-bottom: 16px; opacity: .95; }
.article-content ul, .article-content ol { margin: 0 0 16px 22px; }
.article-content li { margin-bottom: 7px; }
.article-content blockquote { margin: 0 0 16px; padding: 10px 16px; border-left: 3px solid var(--accent); background: var(--chip-bg); border-radius: 0 8px 8px 0; color: var(--text-dim); font-style: italic; }
.article-content pre { background: #0d1020; border: 1px solid var(--stroke); border-radius: 10px; padding: 14px 16px; overflow-x: auto; margin: 0 0 18px; }
.article-content code { font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace; font-size: 13px; }
.article-content pre code { color: #d6e2f5; }
.article-content :not(pre) > code { background: var(--chip-bg); padding: 2px 6px; border-radius: 5px; font-size: .88em; color: var(--accent); }
.article-content a { color: var(--accent); text-decoration: underline; }
:root[data-theme="light"] .article-content pre { background: #1c2333; }

/* ============================================================
   RESPONSIVE additions for new components
   ============================================================ */
@media (max-width: 720px) {
  .dock-inner { gap: 4px; padding: 6px 8px 10px; overflow-x: auto; overflow-y: hidden; }
  .dock-indicator { bottom: 2px; }
  .desktop-icons .desktop-icon:nth-child(n+4) { display: none; } /* keep desktop tidy on phones */
  .art-vertical { display: none; }
  .games-body { flex-direction: column; height: auto; }
  .games-nav { width: auto; flex-direction: row; overflow-x: auto; border-right: none; border-bottom: 1px solid var(--stroke-soft); }
  .games-nav-item { flex-shrink: 0; }
  .articles-list { grid-template-columns: 1fr; }
  .article-reader { padding: 20px 18px 40px; }
  .cv-skills, .cv-cols { grid-template-columns: 1fr !important; }
  .cv-header { flex-direction: column; }
  .cv-contact { text-align: left; }
  .cv-sheet { padding: 22px 18px 8px; }
  .cv-actions { padding: 8px 18px 22px; }
}

/* ============================================================
   CV / RÉSUMÉ
   ============================================================ */
.cv-body { padding: 0; }
.cv-sheet { max-width: 820px; margin: 0 auto; padding: 30px 34px 8px; }
.cv-header { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; padding-bottom: 18px; border-bottom: 2px solid var(--accent); margin-bottom: 22px; }
.cv-name { font-size: 30px; font-weight: 800; letter-spacing: -.02em; }
.cv-title { font-size: 16px; color: var(--accent); font-weight: 600; margin-top: 2px; }
.cv-tagline { font-size: 13.5px; color: var(--text-dim); margin-top: 6px; max-width: 44ch; }
.cv-contact { list-style: none; display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--text-dim); text-align: right; }
.cv-section { margin-bottom: 20px; }
.cv-h { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--accent); font-weight: 700; margin-bottom: 11px; padding-bottom: 5px; border-bottom: 1px solid var(--stroke); }
.cv-summary { font-size: 14px; line-height: 1.65; color: var(--text); opacity: .95; }
.cv-skills { display: grid; grid-template-columns: repeat(2, 1fr); gap: 11px 26px; }
.cv-skill h4 { font-size: 12.5px; font-weight: 700; margin-bottom: 2px; }
.cv-skill p { font-size: 12.5px; color: var(--text-dim); line-height: 1.5; }
.cv-exp { margin-bottom: 16px; }
.cv-exp-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: baseline; font-size: 14px; margin-bottom: 6px; }
.cv-when { font-size: 12px; color: var(--text-dim); white-space: nowrap; font-weight: 600; }
.cv-bullets { margin: 0 0 6px 18px; }
.cv-bullets li { font-size: 13px; line-height: 1.55; color: var(--text); opacity: .92; margin-bottom: 4px; }
.cv-tech { font-size: 11.5px; color: var(--accent); font-weight: 600; }
.cv-list { margin-left: 18px; }
.cv-list li { font-size: 13px; line-height: 1.55; color: var(--text); opacity: .92; margin-bottom: 4px; }
.cv-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 30px; }
.cv-actions { padding: 6px 34px 24px; max-width: 820px; margin: 0 auto; display: flex; gap: 10px; }

@media print {
  .cv-header { border-color: #333 !important; }
  .cv-h { border-color: #ccc !important; }
  .cv-sheet { max-width: none; padding: 0; }
}
