/* =====================================================
   Retro Mac-OS desktop — polished pass
   ===================================================== */

* { cursor: url('cursor.svg') 0 0, default; }

:root {
  --desktop-bg: #6f7acc;
  --desktop-hi: #a9b2f0;
  --menubar-bg: #f6efd6;
  --window-bg: #efe5c2;
  --window-paper: #fbf4d8;
  --window-grid: rgba(34, 81, 255, 0.055);
  --fg: #051C2C;
  --blue: #051C2C;
  --blue-2: #1a3a5c;
  --blue-soft: rgba(5, 28, 44, 0.1);
  --dashed: #2a3a5c;
  --dashed-soft: rgba(5, 28, 44, 0.22);
  --muted: #4a5a6e;
  --placeholder: #7a8a9e;
  --bubble-bg: #f8f4ff;
  --shadow: 4px 4px 0 rgba(5, 28, 44, 0.5);
  --shadow-sm: 2px 2px 0 rgba(5, 28, 44, 0.3);
  --serif: "DIN Alternate", "DIN Next LT Pro", "DIN Next",
           "D-DIN", "Barlow", "Oswald", "Arial Narrow", sans-serif;
  --din-cond: "DIN Condensed", "DIN Alternate", "Barlow Condensed",
              "Oswald", "Arial Narrow", sans-serif;
  --mono: ui-monospace, "Monaco", "Menlo", "JetBrains Mono", "SF Mono",
          "Cascadia Mono", Consolas, monospace;
}

* , *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.6;
  color: var(--fg);
  min-height: 100vh;
  background-color: var(--desktop-bg);
  /* Perfect 2-pixel checker dither — authentic classic-Mac desktop look */
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='2' height='2' shape-rendering='crispEdges'><rect width='1' height='1' fill='%23a9b2f0'/><rect x='1' y='1' width='1' height='1' fill='%23a9b2f0'/></svg>");
  background-attachment: fixed;
  image-rendering: pixelated;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
img, svg { display: block; max-width: 100%; }

/* ---------- Menu bar ---------- */
.menubar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 7px 48px;
  background: var(--menubar-bg);
  border-bottom: 2px solid #000;
  font-family: var(--serif);
  font-size: 15px;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.1);
}
.menu-brand { display: flex; align-items: center; gap: 9px; }
.menu-brand img { width: 20px; height: 22px; image-rendering: pixelated; display: inline; vertical-align: middle; position: relative; top: -1px; }
.menu-name {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--fg);
  white-space: nowrap;
  position: relative;
  top: -1px;
}
.menu-item {
  color: var(--fg);
  padding: 2px 6px;
  cursor: default;
  line-height: 1.3;
  border-radius: 1px;
}
.menu-item:hover { background: var(--fg); color: var(--menubar-bg); text-decoration: none; }
.menu-item[aria-current="page"] { background: var(--fg); color: var(--menubar-bg); }
.menu-item .caret { font-size: 10px; margin-left: 2px; position: relative; top: -1px; }
.menu-clock {
  margin-left: auto;
  font-family: var(--serif);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
  font-size: 15px;
}

/* ---------- Desktop ---------- */
.desktop {
  display: flex;
  justify-content: center;
  padding: 48px 210px 96px 28px; /* reserve right gutter for icon rail */
  max-width: 1680px;
  margin: 0 auto;
  min-height: calc(100vh - 36px); /* fill viewport below menubar */
}

/* ---------- Window ---------- */
.window {
  background: var(--window-bg);
  border: 2px solid #051C2C;
  box-shadow: var(--shadow);
  max-width: 980px;
  width: 100%;
  justify-self: center;
  transform-origin: center center;
  display: flex;
  flex-direction: column;
}
.window-body {
  flex: 1;
}
@keyframes winClose {
  0%   { transform: scale(1);    opacity: 1; }
  60%  { transform: scale(0.35); opacity: 0.8; }
  100% { transform: scale(0.04); opacity: 0; }
}
@keyframes winOpen {
  0%   { transform: scale(0.04); opacity: 0; }
  60%  { transform: scale(1.04); opacity: 1; }
  100% { transform: scale(1);    opacity: 1; }
}
.window.is-closing { animation: winClose 260ms ease-in forwards; pointer-events: none; }
.window.is-opening { animation: winOpen  260ms ease-out both; }
.window.is-closed  { display: none; }
.title-close { cursor: pointer; }
.title-close:active { background: #051C2C; color: var(--window-bg); transform: translate(1px, 1px); }
.titlebar {
  position: relative;
  height: 24px;
  padding: 0 8px;
  border-bottom: 2px solid #051C2C;
  display: flex;
  align-items: center;
  background-image: repeating-linear-gradient(
    to bottom,
    #051C2C 0 1px,
    transparent 1px 3px
  );
  cursor: default;
  user-select: none;
}
.title-close {
  position: relative;
  z-index: 1;
  width: 18px;
  height: 16px;
  padding: 0;
  margin-left: 2px;
  font: 700 10px/14px var(--mono);
  text-align: center;
  color: #051C2C;
  background: var(--window-bg);
  border: 1px solid #051C2C;
  box-shadow: 1px 1px 0 rgba(5,28,44,0.15);
  cursor: default;
}
.title-close:hover { background: #051C2C; color: var(--window-bg); }
.title-label {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  padding: 0 12px;
  background: var(--window-bg);
  font-family: var(--serif);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.window-body {
  padding: 40px 56px 52px;
  background-color: var(--window-paper);
  background-image:
    linear-gradient(0deg, var(--window-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--window-grid) 1px, transparent 1px);
  background-size: 18px 18px;
}

/* ---------- Writing page header ---------- */
.writing-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 14px;
}
.writing-header .title-serif { margin: 0; }
.writing-index {
  font-family: var(--mono);
  font-size: 14px;
  white-space: nowrap;
}
.writing-index strong {
  font-family: var(--serif);
  color: var(--blue);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 13px;
  margin-right: 6px;
}

/* ---------- Name row with social links ---------- */
.name-row {
  position: relative;
  margin-bottom: 14px;
}
.name-row .title-serif {
  margin: 0;
}
.social-links {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 14px;
}
.social-link {
  color: var(--fg);
  opacity: 0.45;
  display: flex;
  align-items: center;
  text-decoration: none;
  transition: opacity 0.15s;
}
.social-link:hover { opacity: 1; text-decoration: none; }
.social-link svg { display: block; }

/* ---------- About header ---------- */
.about-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin: 0 0 14px;
}
.about-avatar {
  width: 72px;
  flex-shrink: 0;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
}
.about-header .title-serif {
  flex: 1;
  text-align: right;
  margin: 0;
}

/* ---------- Titles & meta ---------- */
.title-serif {
  font-family: var(--din-cond);
  font-weight: 700;
  color: var(--blue);
  font-size: clamp(38px, 2rem + 2.2vw, 54px);
  text-align: center;
  line-height: 1.02;
  margin: 0 0 14px;
  letter-spacing: 0.02em;
}
.meta-line {
  display: flex;
  justify-content: center;
  gap: 32px;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 14px;
  margin: 0 0 20px;
}
.meta-line strong {
  font-family: var(--serif);
  color: var(--blue);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 13px;
  margin-right: 6px;
}
.rule-thick {
  border: 0;
  border-top: 4px solid var(--blue);
  margin: 14px 0 22px;
}
.rule-dashed {
  border: 0;
  border-top: 1px dashed var(--dashed);
  margin: 20px 0;
}

/* ---------- Data rows with dashed separators (receipt style) ---------- */
.data { margin: 8px 0 16px; }
.data p {
  margin: 0;
  padding: 9px 0;
  border-bottom: 1px dashed var(--dashed-soft);
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.5;
}
.data p:last-child { border-bottom: 0; }
.data strong, .data b {
  font-family: var(--serif);
  color: var(--blue);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 13px;
  margin-right: 10px;
  display: inline-block;
  min-width: 92px;
}
.placeholder { color: var(--placeholder); font-style: italic; }

/* ---------- Bubble + avatar ---------- */
.bubble-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0;
  align-items: end;
  margin-top: 24px;
}
.bubble {
  position: relative;
  padding: 20px 26px;
  border: 2px solid #051C2C;
  border-left: 4px solid var(--blue);
  background: var(--bubble-bg);
  font-family: "Roboto", var(--serif);
  font-weight: 300;
  font-size: 14px;
  line-height: 1.75;
  box-shadow: var(--shadow-sm);
  margin-top: 24px;
}
.bubble p { margin: 0 0 12px; }
.bubble p:last-child { margin-bottom: 0; }
.bubble-contact { color: #6b8fc2; margin-top: 18px !important; }
.bubble-contact a { color: #6b8fc2; text-decoration: none; }
.bubble-contact a:hover { text-decoration: underline; }
.bubble-name {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.01em;
}
.bubble-head {
  font-family: var(--serif);
  font-weight: 700;
  color: var(--blue);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 12px;
  margin-top: 20px !important;
}
.avatar {
  width: 120px;
  height: 180px;
  margin-left: 28px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.avatar svg {
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  filter: drop-shadow(2px 2px 0 rgba(0,0,0,0.18));
}

/* ---------- Icon rail (desktop folders) ---------- */
.icon-rail {
  position: fixed;
  top: 56px;
  right: 60px;
  display: flex;
  flex-direction: column;
  gap: 26px;
  align-items: center;
  z-index: 5;
}
.dtop-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: #000;
  text-decoration: none;
  padding: 2px;
  border-radius: 1px;
}
.dtop-icon:hover { text-decoration: none; background: rgba(255,255,255,0.1); }
.dtop-icon:hover .label { background: var(--blue); color: #fff; border-color: var(--blue); }
.folder {
  width: 52px;
  height: 44px;
  background: url("folder.svg") no-repeat center / contain;
  image-rendering: pixelated;
}
.dtop-icon .label {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 13px;
  padding: 1px 8px;
  background: #fff;
  border: 1px solid #000;
  color: #000;
  line-height: 1.5;
  box-shadow: 1px 1px 0 rgba(0,0,0,0.2);
}
.dtop-icon[aria-current="page"] .label,
.dtop-icon.active .label {
  background: #000;
  color: #fff;
  border-color: #000;
}

/* ---------- Section sub-heads ---------- */
.section-head {
  font-family: var(--din-cond);
  font-weight: 700;
  color: var(--blue);
  font-size: 30px;
  margin: 32px 0 14px;
  text-align: center;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ---------- Blog list ---------- */
.post-list {
  list-style: none;
  padding: 0;
  margin: 18px 0 0;
  border-top: 1px dashed var(--dashed-soft);
}
.post-list li { border-bottom: 1px dashed var(--dashed-soft); }
.post-list a {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  gap: 16px;
  padding: 12px 4px;
  align-items: baseline;
  font-family: var(--mono);
}
.post-list a:hover { background: var(--blue-soft); text-decoration: none; }
.post-list .idx {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.04em;
}
.post-list .title {
  font-family: var(--serif);
  color: var(--blue);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 15px;
}
.post-list .date {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  letter-spacing: 0.04em;
}

/* ---------- Post ---------- */
.post-head { text-align: left; margin-bottom: 14px; }
.post .title-serif { text-align: left; font-size: 32px; }
.post .date {
  font-family: var(--mono);
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.04em;
}
.post .prose { font-size: 14px; line-height: 1.8; max-width: 66ch; }
.post .prose p { margin: 0 0 14px; }
.post .prose h2 {
  font-family: var(--serif);
  color: var(--blue);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 18px;
  margin: 24px 0 10px;
}
.post .prose code {
  font-family: var(--mono);
  background: var(--window-bg);
  border: 1px solid rgba(0,0,0,0.18);
  padding: 1px 5px;
  font-size: 12.5px;
}
.post-nav {
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px dashed var(--dashed-soft);
  font-family: var(--serif);
  color: var(--blue);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 13px;
}

/* ---------- Legacy (hidden) ---------- */
.hero, .site-header, .site-footer, .eyebrow, .section-title { display: none !important; }
.reveal { opacity: 1 !important; transform: none !important; }

/* ---------- Responsive ---------- */
@media (max-width: 940px) {
  .desktop { padding: 24px 18px 120px 18px; }
  .icon-rail {
    position: fixed;
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 18px;
    padding: 12px;
    background: rgba(111, 122, 204, 0.8);
    backdrop-filter: blur(2px);
  }
  .window-body { padding: 28px 24px 36px; }
  .bubble-row { grid-template-columns: 1fr; }
  .bubble { margin-right: 0; }
  .bubble::before, .bubble::after { display: none; }
  .avatar { width: 96px; height: 144px; margin: 18px auto 0; }
  .meta-line { gap: 20px; font-size: 13px; }
}
@media (max-width: 520px) {
  .menubar { gap: 10px; font-size: 13px; padding: 5px 20px; }
  .menu-clock { font-size: 13px; }
  .title-serif { font-size: 28px; }
  .section-head { font-size: 22px; }
}
