@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600&display=swap');

/*
  Default: Windows retro.
  Toggle: html[data-theme="mac"] for the macOS skin.
*/

:root {
  color-scheme: light;

  --page-max: 960px;

  /* Windows 9x-ish palette */
  --desktop: #008080;
  --face: #c0c0c0;
  --face-2: #dfdfdf;
  --hilite: #ffffff;
  --shadow: #808080;
  --shadow-2: #404040;
  --text: #000000;
  --muted: #333333;
  --link: #0000ee;
  --visited: #551a8b;
  --title-1: #000080;
  --title-2: #1084d0;
  --title-text: #ffffff;
  --content: #ffffff;
  --panel: #f4f4f4;
  --focus: #000000;

  /* Legacy variables used by some mini-app pages. */
  --win-bg: #c0c0c0;
  --win-white: #ffffff;
  --win-black: #000000;
  --win-dark: #808080;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--desktop);
  color: var(--text);
  position: relative;
  z-index: 0;
  font-family: Tahoma, Verdana, Arial, sans-serif;
  line-height: 1.35;
}

a {
  color: var(--link);
}

a:visited {
  color: var(--visited);
}

img {
  max-width: 100%;
  height: auto;
}

hr {
  border: 0;
  border-top: 1px solid #c7c7c7;
  margin: 14px 0;
}

.page {
  max-width: var(--page-max);
  margin: 22px auto;
  padding: 0 14px 32px;
}

.window {
  background: var(--face);
  border-top: 2px solid var(--hilite);
  border-left: 2px solid var(--hilite);
  border-right: 2px solid var(--shadow-2);
  border-bottom: 2px solid var(--shadow-2);
  box-shadow: inset -1px -1px 0 var(--shadow), inset 1px 1px 0 var(--hilite);
}

.titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 3px 6px;
  background: linear-gradient(90deg, var(--title-1), var(--title-2));
  color: var(--title-text);
  font-size: 12px;
  font-weight: 700;
}

.titlebar .controls {
  display: flex;
  gap: 4px;
}

.titlebar .control {
  width: 18px;
  height: 18px;
  background: var(--face);
  border-top: 1px solid var(--hilite);
  border-left: 1px solid var(--hilite);
  border-right: 1px solid var(--shadow);
  border-bottom: 1px solid var(--shadow);
  box-shadow: inset -1px -1px 0 var(--shadow-2), inset 1px 1px 0 var(--hilite);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  line-height: 1;
  color: var(--text);
  user-select: none;
}

.menubar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 4px 6px;
  background: var(--face);
  border-top: 1px solid var(--hilite);
  border-bottom: 1px solid var(--shadow);
  font-size: 12px;
}

.menubar-left {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.menubar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
}

.menubar a {
  color: var(--text);
  text-decoration: none;
  padding: 2px 6px;
}

.menubar a:hover {
  background: var(--title-1);
  color: var(--title-text);
}

.menubar a:focus-visible,
.btn:focus-visible,
.theme-toggle:focus-visible {
  outline: 1px dotted var(--focus);
  outline-offset: 2px;
}

.theme-toggle {
  height: 22px;
  margin-left: auto;
  padding: 0 6px;
  background: var(--face);
  border-top: 2px solid var(--hilite);
  border-left: 2px solid var(--hilite);
  border-right: 2px solid var(--shadow);
  border-bottom: 2px solid var(--shadow);
  box-shadow: inset -1px -1px 0 var(--shadow-2), inset 1px 1px 0 var(--hilite);
  cursor: pointer;
  font: inherit;
  line-height: 1;
}

.theme-toggle:active {
  border-top: 2px solid var(--shadow);
  border-left: 2px solid var(--shadow);
  border-right: 2px solid var(--hilite);
  border-bottom: 2px solid var(--hilite);
  box-shadow: none;
  transform: translateY(1px);
}

.theme-icon {
  width: 18px;
  height: 18px;
  position: relative;
  display: inline-block;
  font-size: 0;
  line-height: 0;
}

:root:not([data-theme]),
:root[data-theme="windows"] {
  color-scheme: light;
}

:root:not([data-theme]) .theme-icon::before,
:root[data-theme="windows"] .theme-icon::before {
  content: "";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: system-ui, -apple-system, "Apple Symbols", "Segoe UI Symbol", Tahoma, sans-serif;
  font-size: 14px;
  line-height: 1;
}

:root[data-theme="mac"] .theme-icon::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 4px;
  width: 5px;
  height: 5px;
  background: currentColor;
  box-shadow: 7px 0 0 currentColor, 0 7px 0 currentColor, 7px 7px 0 currentColor;
}

.content {
  background: var(--content);
  border-top: 2px solid var(--hilite);
  border-left: 2px solid var(--hilite);
  border-right: 2px solid var(--shadow);
  border-bottom: 2px solid var(--shadow);
  box-shadow: inset -1px -1px 0 var(--shadow-2), inset 1px 1px 0 var(--hilite);
  margin: 8px;
  padding: 12px 14px;
}

.layout {
  width: 100%;
  border-collapse: collapse;
}

.layout td {
  vertical-align: top;
}

.sidebar {
  width: 240px;
  padding-right: 12px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--shadow);
  padding: 10px;
  margin-bottom: 12px;
  font-size: 12px;
}

.panel h3 {
  margin: 0 0 8px;
  font-size: 12px;
  letter-spacing: 0.2px;
  text-transform: uppercase;
}

.btn {
  display: inline-block;
  background: var(--face);
  color: var(--text);
  border-top: 2px solid var(--hilite);
  border-left: 2px solid var(--hilite);
  border-right: 2px solid var(--shadow);
  border-bottom: 2px solid var(--shadow);
  box-shadow: inset -1px -1px 0 var(--shadow-2), inset 1px 1px 0 var(--hilite);
  padding: 4px 10px;
  text-decoration: none;
  font-size: 12px;
  cursor: pointer;
}

.btn:active {
  border-top: 2px solid var(--shadow);
  border-left: 2px solid var(--shadow);
  border-right: 2px solid var(--hilite);
  border-bottom: 2px solid var(--hilite);
  box-shadow: none;
  transform: translateY(1px);
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.badge-row img {
  image-rendering: auto;
}

.marquee {
  background: #ffffe1;
  border: 1px solid var(--shadow);
  padding: 6px 8px;
  margin-bottom: 12px;
  font-size: 12px;
}

.headline {
  margin: 0 0 10px;
  font-family: "Times New Roman", Times, serif;
  font-size: 32px;
  letter-spacing: 0.2px;
}

.subhead {
  margin: 0 0 12px;
  color: var(--muted);
}

.section-title {
  margin: 0 0 10px;
  font-size: 14px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.featured {
  background: var(--panel);
  border: 1px solid var(--shadow);
  padding: 10px;
}

.featured-list {
  margin: 0;
  padding-left: 18px;
  font-size: 12px;
}

.featured-list li {
  margin-bottom: 6px;
}

.featured-list li:last-child {
  margin-bottom: 0;
}

.projects-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.projects-header .section-title {
  margin-bottom: 0;
}

.projects-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.projects-actions .hint {
  font-size: 11px;
}

.projects-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.projects-table th {
  background: var(--face-2);
  color: var(--text);
  text-align: left;
  padding: 7px 8px;
  font-weight: 700;
  border: 1px solid var(--shadow);
}

.projects-table td {
  border: 1px solid var(--shadow);
  padding: 8px 8px;
}

.projects-table tr:nth-child(even) td {
  background: #fafafa;
}

.projects-table .icon {
  width: 28px;
  text-align: center;
  font-size: 16px;
}

.muted {
  color: #555555;
}

.footer {
  margin-top: 14px;
  font-size: 11px;
  color: #333333;
}

.footer .fineprint {
  color: #555555;
}

@media (max-width: 860px) {
  .page {
    margin: 10px auto;
  }

  .sidebar {
    width: 100%;
    padding-right: 0;
  }

  .layout,
  .layout tbody,
  .layout tr,
  .layout td {
    display: block;
    width: 100%;
  }

  .projects-header {
    align-items: flex-start;
  }

  .projects-actions {
    width: 100%;
  }

  .projects-table thead {
    display: none;
  }

  .projects-table,
  .projects-table tbody,
  .projects-table tr,
  .projects-table td {
    display: block;
    width: 100%;
  }

  .projects-table tr {
    border: 1px solid #c7c7c7;
    margin-bottom: 10px;
    background: #ffffff;
  }

  .projects-table td {
    border: 0;
    padding: 6px 8px;
    background: transparent;
  }

  .projects-table td[data-label]::before {
    content: attr(data-label) ": ";
    font-weight: 700;
    display: inline-block;
    width: 100px;
  }

  .projects-table td.icon {
    text-align: left;
    font-size: 18px;
  }
}

/* ------------------------- */
/* macOS skin (theme toggle) */
/* ------------------------- */

:root[data-theme="mac"] {
  --desktop: #e6eaf2;
  --face: rgba(248, 249, 252, 0.72);
  --text: #1c1c1e;
  --muted: #5b6470;
  --link: #0a84ff;
  --visited: #5e5ce6;
  --panel: rgba(255, 255, 255, 0.86);

  --win-bg: #f4f5f7;
  --win-white: #ffffff;
  --win-black: #1c1c1e;
  --win-dark: #cbd0d8;
}

:root[data-theme="mac"] body {
  background: var(--desktop);
  font-family: "SF Pro Text", "SF Pro Display", "Space Grotesk", "Helvetica Neue", Arial, sans-serif;
  line-height: 1.45;
}

:root[data-theme="mac"] body::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background:
    radial-gradient(1200px 820px at 18% 8%, rgba(160, 175, 199, 0.34), transparent 65%),
    radial-gradient(980px 760px at 82% 14%, rgba(255, 255, 255, 0.55), transparent 66%),
    radial-gradient(1100px 780px at 26% 52%, rgba(160, 175, 199, 0.22), transparent 70%),
    radial-gradient(980px 740px at 76% 78%, rgba(255, 255, 255, 0.38), transparent 70%),
    radial-gradient(900px 680px at 35% 92%, rgba(160, 175, 199, 0.18), transparent 72%),
    linear-gradient(180deg, #cfd6e1 0%, #eff2f7 38%, #e6eaf2 72%, #d9dee8 100%);
  background-repeat: no-repeat;
}

:root[data-theme="mac"] hr {
  border-top: 1px solid rgba(60, 60, 67, 0.2);
}

:root[data-theme="mac"] .window {
  background: var(--face);
  border: 1px solid rgba(60, 60, 67, 0.2);
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

:root[data-theme="mac"] .titlebar {
  justify-content: center;
  padding: 10px 12px;
  background: rgba(250, 251, 253, 0.85);
  color: #1f2933;
  font-family: "SF Pro Text", "Space Grotesk", sans-serif;
  font-size: 13px;
  font-weight: 600;
  border-bottom: 1px solid rgba(60, 60, 67, 0.15);
  position: relative;
  border-top-left-radius: 18px;
  border-top-right-radius: 18px;
}

:root[data-theme="mac"] .titlebar .controls {
  gap: 8px;
  position: absolute;
  left: 12px;
}

:root[data-theme="mac"] .titlebar .control {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #d1d5db;
  border: 0;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12), 0 1px 1px rgba(0, 0, 0, 0.18);
  font-size: 0;
  line-height: 0;
}

:root[data-theme="mac"] .titlebar .control:nth-child(1) {
  background: #ff5f57;
}

:root[data-theme="mac"] .titlebar .control:nth-child(2) {
  background: #febc2e;
}

:root[data-theme="mac"] .titlebar .control:nth-child(3) {
  background: #28c840;
}

:root[data-theme="mac"] .menubar {
  background: rgba(248, 249, 252, 0.8);
  border-bottom: 1px solid rgba(60, 60, 67, 0.15);
  border-top: 0;
  padding: 8px 12px;
  font-family: "SF Pro Text", "Space Grotesk", sans-serif;
  font-size: 12px;
}

:root[data-theme="mac"] .menubar a {
  color: #1f2933;
  padding: 4px 8px;
  border-radius: 8px;
}

:root[data-theme="mac"] .menubar a:hover {
  background: rgba(10, 132, 255, 0.12);
  color: #0a84ff;
}

:root[data-theme="mac"] .theme-toggle {
  height: auto;
  padding: 2px 8px;
  background: none;
  border: 0;
  box-shadow: none;
  border-radius: 8px;
}

:root[data-theme="mac"] .theme-toggle:active {
  transform: none;
}

:root[data-theme="mac"] .theme-toggle:hover {
  background: rgba(10, 132, 255, 0.12);
  color: #0a84ff;
}

:root[data-theme="mac"] .menubar a:focus-visible,
:root[data-theme="mac"] .btn:focus-visible,
:root[data-theme="mac"] .theme-toggle:focus-visible {
  outline: 2px solid rgba(10, 132, 255, 0.5);
  outline-offset: 2px;
}

:root[data-theme="mac"] .content {
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(60, 60, 67, 0.15);
  border-radius: 14px;
  margin: 12px;
  padding: 16px 18px 20px;
  box-shadow: none;
}

:root[data-theme="mac"] .panel,
:root[data-theme="mac"] .featured {
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(60, 60, 67, 0.15);
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

:root[data-theme="mac"] .btn {
  background: linear-gradient(180deg, #ffffff, #e6ebf2);
  border: 1px solid rgba(60, 60, 67, 0.25);
  border-radius: 10px;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.12);
  padding: 6px 12px;
}

:root[data-theme="mac"] .btn:active {
  transform: translateY(1px);
  box-shadow: 0 3px 8px rgba(15, 23, 42, 0.12);
}

:root[data-theme="mac"] .marquee {
  background: rgba(10, 132, 255, 0.08);
  border: 1px solid rgba(10, 132, 255, 0.25);
  border-radius: 10px;
  padding: 8px 10px;
}

:root[data-theme="mac"] .headline {
  font-family: "SF Pro Display", "SF Pro Text", "Space Grotesk", sans-serif;
  font-size: 28px;
}

:root[data-theme="mac"] .subhead {
  color: #475569;
}

:root[data-theme="mac"] .section-title {
  font-family: "SF Pro Text", "Space Grotesk", sans-serif;
  font-size: 16px;
  letter-spacing: 0.4px;
}

:root[data-theme="mac"] .projects-table th {
  background: rgba(15, 23, 42, 0.08);
  border: 0;
  border-bottom: 1px solid rgba(60, 60, 67, 0.2);
}

:root[data-theme="mac"] .projects-table td {
  border: 0;
  border-bottom: 1px solid rgba(60, 60, 67, 0.15);
}

:root[data-theme="mac"] .projects-table tr:nth-child(even) td {
  background: rgba(15, 23, 42, 0.03);
}

:root[data-theme="mac"] .muted {
  color: #5b6470;
}

@media (prefers-reduced-transparency: reduce) {
  :root[data-theme="mac"] .window {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: #ffffff;
  }
}
