/* ═══════════════════════════════════════════════════════════════════
   zendrx.dev — design system · "mint sky" edition
   light sky desktop · dark terminal windows · flat colors only
   ═══════════════════════════════════════════════════════════════════ */

:root {
  /* desktop wallpaper */
  --sky: #A6D5F7;
  --sky-deep: #8FC4EE;
  --cloud: #FFFFFF;
  --sun: #FFD876;

  /* panels & chrome */
  --panel: #10304F;
  --panel-hi: #1B4A77;
  --titlebar: #E9F2FC;
  --titlebar-ink: #143A5F;
  --win-border: #5C86AC;

  /* terminal / window interior */
  --bg: #0D1420;
  --bg-raise: #111A2A;
  --panel-2: #131D2E;
  --border: #1F3350;
  --border-hi: #33517A;
  --fg: #C9D6E8;
  --fg-hi: #EAF1FA;
  --dim: #64789A;
  --faint: #40536F;

  /* accents — sky blue replaces the old green */
  --accent: #5EB3F6;
  --accent-bright: #8FCBFF;
  --red: #F7768E;
  --yellow: #E0AF68;
  --magenta: #BB9AF7;
  --orange: #FF9E64;

  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas,
    'Liberation Mono', monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  background: var(--sky);
  color: var(--fg);
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #2A415F; border: 2px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }

a { color: var(--accent-bright); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

:focus-visible { outline: 1px solid var(--accent); outline-offset: 2px; }

/* ═══════════════════════ desktop scene ═══════════════════════ */

.desktop {
  min-height: 100dvh;
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.wallpaper {
  position: fixed;
  inset: 0;
  background: var(--sky);
  z-index: -1;
  overflow: hidden;
}

.wallpaper .sun {
  position: absolute;
  top: 7%;
  right: 9%;
  width: 74px;
  height: 74px;
  border-radius: 50%;
  background: var(--sun);
  box-shadow: 0 0 0 14px rgba(255, 216, 118, 0.25);
}

.wallpaper .cloud {
  position: absolute;
  background: var(--cloud);
  border-radius: 100px;
  opacity: 0.9;
}

.wallpaper .cloud::before,
.wallpaper .cloud::after {
  content: '';
  position: absolute;
  background: inherit;
  border-radius: 50%;
}

.wallpaper .c1 { width: 130px; height: 38px; top: 14%; left: 8%; }
.wallpaper .c1::before { width: 52px; height: 52px; top: -24px; left: 22px; }
.wallpaper .c1::after  { width: 38px; height: 38px; top: -16px; left: 64px; }

.wallpaper .c2 { width: 100px; height: 30px; top: 30%; right: 16%; opacity: 0.75; }
.wallpaper .c2::before { width: 40px; height: 40px; top: -19px; left: 16px; }
.wallpaper .c2::after  { width: 30px; height: 30px; top: -12px; left: 50px; }

.wallpaper .c3 { width: 170px; height: 44px; bottom: 24%; left: -30px; opacity: 0.6; }
.wallpaper .c3::before { width: 60px; height: 60px; top: -28px; left: 34px; }
.wallpaper .c3::after  { width: 44px; height: 44px; top: -18px; left: 84px; }

.wallpaper .c4 { width: 90px; height: 26px; bottom: 12%; right: 30%; opacity: 0.5; }
.wallpaper .c4::before { width: 34px; height: 34px; top: -16px; left: 14px; }
.wallpaper .c4::after  { width: 26px; height: 26px; top: -10px; left: 44px; }

/* ═══════════════════════ desktop icons ═══════════════════════ */

.dicons {
  position: absolute;
  top: 22px;
  left: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  z-index: 5;
}

.dicon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  width: 84px;
  background: transparent;
  border: 1px solid transparent;
  color: #14406B;
  font: inherit;
  font-size: 11px;
  line-height: 1.3;
  text-align: center;
  padding: 8px 4px;
  cursor: pointer;
  border-radius: 4px;
}

.dicon:hover { background: rgba(255, 255, 255, 0.35); border-color: rgba(20, 64, 107, 0.25); }
.dicon:active { background: rgba(20, 64, 107, 0.18); }
.dicon span:last-child { text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6); word-break: break-all; }

.glyph { display: block; position: relative; flex: none; }

.glyph.folder {
  width: 38px;
  height: 27px;
  background: #5FA8E8;
  border: 1px solid #3E7FBF;
  border-radius: 0 4px 4px 4px;
}
.glyph.folder::before {
  content: '';
  position: absolute;
  top: -5px;
  left: -1px;
  width: 16px;
  height: 6px;
  background: #5FA8E8;
  border: 1px solid #3E7FBF;
  border-bottom: none;
  border-radius: 3px 4px 0 0;
}
.glyph.folder::after {
  content: '';
  position: absolute;
  inset: 4px 3px 3px 3px;
  background: #8FC9F5;
  border-radius: 2px;
}

.glyph.file {
  width: 27px;
  height: 35px;
  background: #F4FAFF;
  border: 1px solid #7FA8CC;
  border-radius: 2px;
}
.glyph.file::before {
  content: '';
  position: absolute;
  top: 5px;
  left: 5px;
  right: 5px;
  height: 3px;
  background: #A8C8E4;
  box-shadow: 0 7px 0 #A8C8E4, 0 14px 0 #A8C8E4, 0 21px 0 #D4E6F6;
}
.glyph.file::after {
  content: 'PDF';
  position: absolute;
  bottom: -14px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 8px;
  letter-spacing: 1px;
  color: #14406B;
  display: none;
}

.glyph.trash {
  width: 28px;
  height: 34px;
  background: #D7E9F8;
  border: 1px solid #7FA8CC;
  border-radius: 3px 3px 6px 6px;
}
.glyph.trash::before {
  content: '';
  position: absolute;
  top: -6px;
  left: -3px;
  right: -3px;
  height: 5px;
  background: #B9D6EE;
  border: 1px solid #7FA8CC;
  border-radius: 3px;
}
.glyph.trash::after {
  content: '';
  position: absolute;
  top: 4px;
  left: 6px;
  right: 6px;
  height: 2px;
  background: #9DBEDC;
  box-shadow: 0 8px 0 #9DBEDC, 0 16px 0 #9DBEDC;
}

/* ═══════════════════════ window chrome ═══════════════════════ */

.window {
  position: relative;
  background: var(--bg);
  border: 1px solid var(--win-border);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(9, 42, 79, 0.4), 0 4px 14px rgba(9, 42, 79, 0.25);
  display: flex;
  flex-direction: column;
}

.window.blurred .titlebar { color: #6C8199; }
.window.blurred .win-btn { opacity: 0.5; }

.titlebar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--titlebar);
  color: var(--titlebar-ink);
  padding: 7px 10px 7px 14px;
  font-size: 12.5px;
  user-select: none;
  flex: none;
}

.tb-app { display: flex; align-items: center; gap: 8px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.tb-glyph {
  display: inline-block;
  background: var(--panel);
  color: var(--accent-bright);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
}

.win-btns { margin-left: auto; display: flex; gap: 8px; }

.win-btn {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid rgba(20, 58, 95, 0.35);
  background: #CFE3F6;
  cursor: pointer;
  position: relative;
  transition: background 0.15s, transform 0.15s;
}

.win-btn:hover { transform: scale(1.08); }
.win-btn.min:hover { background: var(--accent); }
.win-btn.max:hover { background: var(--yellow); }
.win-btn.close:hover { background: var(--red); }

.win-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  margin: auto;
  width: 10px;
  height: 2px;
  background: #2A517A;
  border-radius: 1px;
  opacity: 0;
}
.win-btn.min::before { opacity: 1; }

.win-btn.max::before {
  width: 9px;
  height: 9px;
  background: transparent;
  border: 2px solid #2A517A;
  border-radius: 2px;
  opacity: 0;
}
.win-btn.max.on::before { opacity: 1; }

.win-btn.close::before,
.win-btn.close::after {
  width: 11px;
  height: 2px;
  background: #8C2F44;
  opacity: 0;
  top: 50%;
  left: 50%;
}
.win-btn.close::before { transform: translate(-50%, -50%) rotate(45deg); }
.win-btn.close::after  { transform: translate(-50%, -50%) rotate(-45deg); }
.win-btn.close:hover::before,
.win-btn.close:hover::after { opacity: 1; }

/* window states (index terminal) */
.term-window {
  width: min(940px, 94vw);
  height: min(640px, calc(100dvh - 130px));
  margin: 24px auto 20px;
  z-index: 10;
}

.term-window.maximized {
  width: calc(100vw - 24px);
  height: calc(100dvh - 110px);
  margin: 12px auto 16px;
}

.term-window.minimized { display: none; }

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-9px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(4px); }
}
.window.shake { animation: shake 0.4s ease-in-out; }

/* ═══════════════════════ bottom panel ═══════════════════════ */

.panel {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--panel);
  color: #D8E8FA;
  padding: 6px 12px;
  font-size: 12.5px;
  z-index: 20;
  box-shadow: 0 -6px 18px rgba(9, 42, 79, 0.25);
}

.menu-btn {
  font: inherit;
  color: inherit;
  background: var(--panel-hi);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 4px;
  padding: 5px 14px;
  cursor: pointer;
  transition: background 0.15s;
}
.menu-btn:hover { background: #22639E; }

.task-item {
  font: inherit;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #B9D4EE;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  padding: 5px 12px;
  cursor: pointer;
  max-width: 320px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.task-item:hover { background: rgba(255, 255, 255, 0.08); }
.task-item.active { background: var(--panel-hi); border-color: rgba(255, 255, 255, 0.16); color: #EAF4FF; }

.task-glyph {
  background: var(--accent);
  color: #0D1420;
  font-weight: 700;
  font-size: 10px;
  border-radius: 3px;
  padding: 1px 5px;
}

.task-spacer { flex: 1; }

.clock { color: #B9D4EE; letter-spacing: 0.5px; padding-right: 4px; }

/* ═══════════════════════ terminal ═══════════════════════ */

.term {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  cursor: text;
}

.term-output {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px 8px;
  min-height: 0;
}

.term-line { white-space: pre-wrap; word-break: break-word; min-height: 1.25em; }

.t-dim    { color: var(--dim); }
.t-faint  { color: var(--faint); }
.t-accent { color: var(--accent); }
.t-red    { color: var(--red); }
.t-yellow { color: var(--yellow); }
.t-hi     { color: var(--fg-hi); }

.ok-tag { color: var(--accent); font-weight: 700; }

.banner {
  color: var(--accent);
  font-size: clamp(6px, 1.45vw, 12.5px);
  line-height: 1.2;
  font-weight: 500;
}

.term-input-line { display: flex; }

.prompt { color: var(--accent); margin-right: 10px; white-space: nowrap; }
.prompt .p-host { color: var(--accent-bright); }
.prompt .p-dim { color: var(--dim); }

.cursor {
  display: inline-block;
  width: 8px;
  height: 1.15em;
  background: var(--accent);
  vertical-align: text-bottom;
  transform: translateY(2px);
  animation: blink 1.1s steps(2, start) infinite;
}
@keyframes blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }
.window.blurred .cursor { animation: none; opacity: 0.4; }

.sr-input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
  top: -100px;
  left: -100px;
}

.chips {
  display: none;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 14px 14px;
  border-top: 1px solid var(--border);
}

@media (hover: none) and (pointer: coarse) {
  .chips { display: flex; }
}

.chip {
  font: inherit;
  font-size: 12px;
  color: var(--fg);
  background: var(--bg-raise);
  border: 1px solid var(--border-hi);
  border-radius: 4px;
  padding: 8px 13px;
  cursor: pointer;
}
.chip:active { background: var(--border); color: var(--accent-bright); }

/* ═══════════════════════ inner pages (windowed) ═══════════════════════ */

.page-window {
  width: min(1100px, calc(100vw - 28px));
  margin: 26px auto 22px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.page {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 22px 24px 26px;
  min-height: 0;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 14px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--border);
  color: var(--dim);
  font-size: 12.5px;
  gap: 12px;
}

.topbar .path b { color: var(--accent); font-weight: 500; }
.topbar a.back { color: var(--dim); }
.topbar a.back::before { content: '$ '; color: var(--faint); }
.topbar a.back:hover { color: var(--accent-bright); }

main { flex: 1; }

footer.status {
  border-top: 1px solid var(--border);
  padding-top: 12px;
  margin-top: 26px;
  color: var(--faint);
  font-size: 11.5px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

/* ── section headings ($ ./fetch-projects etc.) ── */
.cmdline { color: var(--dim); font-size: 13px; margin-bottom: 4px; }
.cmdline::before { content: '$ '; color: var(--accent); }
.cmdline b { color: var(--fg); font-weight: 500; }
.cmdline + .cmdline { margin-top: 0; }

.statline { color: var(--faint); font-size: 12px; margin: 6px 0 20px; }
.statline b { color: var(--dim); font-weight: 500; }

/* ── loading / error ── */
.loadline { color: var(--dim); display: flex; align-items: center; gap: 10px; padding: 8px 0; font-size: 13px; }
.spinner { display: inline-block; width: 1em; text-align: center; color: var(--accent); }

.note {
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--dim);
  padding: 12px 16px;
  font-size: 12.5px;
  margin-top: 14px;
}

.errbox {
  border: 1px solid var(--red);
  padding: 16px 18px;
  margin-top: 10px;
  color: var(--fg);
  font-size: 13px;
  line-height: 1.7;
}
.fail-tag { color: var(--red); font-weight: 700; }
.err-hint { color: var(--dim); font-size: 12px; margin: 6px 0 12px; }

.btn {
  display: inline-block;
  font: inherit;
  font-size: 12.5px;
  color: var(--fg);
  background: var(--bg-raise);
  border: 1px solid var(--border-hi);
  border-radius: 4px;
  padding: 8px 16px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.btn:hover { border-color: var(--accent); color: var(--accent-bright); text-decoration: none; }

.btn-solid {
  background: var(--accent);
  color: #0D1420;
  border-color: var(--accent);
  font-weight: 700;
}
.btn-solid:hover { background: var(--accent-bright); color: #0D1420; }

/* ═══════════════════════ portfolio ═══════════════════════ */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
}

.pcard {
  display: flex;
  flex-direction: column;
  gap: 10px;
  border: 1px solid var(--border);
  background: var(--bg-raise);
  padding: 16px 18px;
  color: var(--fg);
  transition: border-color 0.15s, transform 0.15s, background 0.15s;
}

.pcard:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  text-decoration: none;
  background: var(--panel-2);
}

.prow { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }

.pname { color: var(--fg-hi); font-weight: 600; font-size: 14.5px; }
.pname::before { content: '▸ '; color: var(--accent); }

.pstars { color: var(--yellow); font-size: 12px; white-space: nowrap; }

.pdesc {
  color: var(--dim);
  font-size: 12.8px;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: calc(2 * 1.55em);
}

.pmeta { display: flex; align-items: center; gap: 10px; color: var(--faint); font-size: 11.5px; flex-wrap: wrap; }

.lang-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; margin-right: 5px; background: var(--faint); }

.tag {
  border: 1px solid var(--border);
  color: var(--magenta);
  font-size: 10.5px;
  padding: 1px 7px;
  border-radius: 3px;
}

/* ═══════════════════════ blog ═══════════════════════ */

.plist { display: flex; flex-direction: column; border: 1px solid var(--border); }

.prow-item {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 4px 14px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--border);
  color: var(--fg);
  background: transparent;
  transition: background 0.12s;
}
.prow-item:last-child { border-bottom: none; }
.prow-item:hover { background: var(--bg-raise); text-decoration: none; }

.prow-item .idx { color: var(--faint); }
.prow-item .title { color: var(--fg-hi); font-weight: 600; }
.prow-item:hover .title { color: var(--accent-bright); }
.prow-item .date { color: var(--faint); font-size: 11.5px; text-align: right; }
.prow-item .ex { grid-column: 2 / 4; color: var(--dim); font-size: 12.5px; }

/* ═══════════════════════ article (read.html) ═══════════════════════ */

.article { max-width: 780px; margin: 0 auto; width: 100%; }

.a-title {
  font-size: clamp(22px, 4vw, 30px);
  color: var(--fg-hi);
  line-height: 1.3;
  margin: 2px 0 0;
}

.a-meta {
  color: var(--faint);
  font-size: 12px;
  margin: 10px 0 26px;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}
.a-meta .sep { color: var(--border-hi); }

.md h2, .md h3 { color: var(--fg-hi); margin: 30px 0 12px; font-size: 19px; }
.md h2::before, .md h3::before { color: var(--accent); font-weight: 500; }
.md h2::before { content: '## '; }
.md h3::before { content: '### '; }

.md p { margin: 12px 0; }
.md ul, .md ol { margin: 12px 0 12px 22px; }
.md li { margin: 5px 0; }

.md code {
  background: var(--panel-2);
  border: 1px solid var(--border);
  padding: 1px 6px;
  font-size: 12.5px;
  color: var(--yellow);
  border-radius: 3px;
}

.md pre {
  background: var(--panel-2);
  border: 1px solid var(--border);
  padding: 14px 16px;
  overflow-x: auto;
  margin: 16px 0;
  position: relative;
}

.md pre code { background: none; border: none; padding: 0; color: var(--fg); font-size: 12.8px; line-height: 1.6; }

.md blockquote { border-left: 2px solid var(--accent); padding: 2px 0 2px 14px; color: var(--dim); margin: 14px 0; }
.md hr { border: none; border-top: 1px solid var(--border); margin: 24px 0; }
.md img { max-width: 100%; }
.md a { border-bottom: 1px solid var(--border-hi); }

.copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  font: inherit;
  font-size: 10.5px;
  color: var(--faint);
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 2px 8px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.12s;
  border-radius: 3px;
}
.md pre:hover .copy-btn { opacity: 1; }
.copy-btn:hover { color: var(--accent); border-color: var(--accent); }

/* ═══════════════════════ about ═══════════════════════ */

.about-name { font-size: clamp(30px, 6vw, 44px); color: var(--fg-hi); line-height: 1.15; }
.about-name .prefix { color: var(--accent); }
.slugline {
  display: inline-block;
  color: var(--yellow);
  background: var(--panel-2);
  border: 1px solid var(--border);
  padding: 2px 10px;
  font-size: 12px;
  margin-bottom: 10px;
}
.about-sub { color: var(--dim); margin-top: 8px; }

.sect { margin-top: 34px; }
.sect-title { color: var(--dim); font-size: 13px; margin-bottom: 14px; }
.sect-title::before { content: '$ '; color: var(--accent); }

.story p { margin: 10px 0; max-width: 72ch; }
.story .hl { color: var(--accent-bright); }

.stack { display: flex; flex-wrap: wrap; gap: 8px; }

.stack span {
  border: 1px solid var(--border);
  background: var(--bg-raise);
  color: var(--fg);
  font-size: 12.5px;
  padding: 6px 13px;
  border-radius: 4px;
  transition: border-color 0.15s, color 0.15s;
}
.stack span:hover { border-color: var(--accent); color: var(--accent-bright); }

.links { display: flex; flex-wrap: wrap; gap: 12px; }
.links .btn .btn-icon { color: var(--faint); margin-right: 8px; }
.links .btn:hover .btn-icon { color: var(--accent); }

.contact-line { color: var(--dim); font-size: 13px; margin-top: 18px; }
.contact-line a { color: var(--accent-bright); }
.contact-line .copied { color: var(--accent); margin-left: 10px; font-size: 12px; }

/* ═══════════════════════ responsive & a11y ═══════════════════════ */

@media (max-width: 720px) {
  .dicons { flex-direction: row; flex-wrap: wrap; gap: 6px; right: 16px; width: auto; }
  .dicon { width: 74px; }
  .term-window { margin: 96px auto 16px; }
  .term-window.maximized { margin-top: 90px; }
  .page { padding: 16px; }
  .grid { grid-template-columns: 1fr; }
  .prow-item { grid-template-columns: 34px 1fr auto; padding: 13px 14px; }
  footer.status { flex-direction: column; gap: 4px; }
  .task-item { max-width: 180px; }
  .clock { font-size: 11px; }
}

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