/*
 * Shared macOS shell for the project demos.
 *
 * Same design language as the README: graphite desktop, translucent window
 * chrome, traffic lights, SF-substitute type. Every demo page is a scene
 * running inside one or two of these windows.
 */

:root {
  --desk-top: #1a1a1d;
  --desk-bot: #0b0b0d;
  --win: #1c1c1e;
  --win-2: #202024;
  --bar-top: #3a3a3c;
  --bar-bot: #2c2c2e;
  --sidebar: #232326;
  --field: #141416;
  --hairline: #38383a;

  --text: #f2f2f7;
  --text-2: #aeaeb2;
  --text-3: #7c7c82;
  --text-4: #5a5a60;

  --blue: #0a84ff;
  --pink: #ff5c7e;
  --purple: #bf5af2;
  --green: #32d74b;
  --orange: #ff9f0a;
  --yellow: #ffd60a;
  --teal: #64d2ff;
  --red: #ff453a;

  --ui: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --radius: 11px;
  --shadow: 0 10px 34px rgba(0, 0, 0, 0.55), 0 1px 3px rgba(0, 0, 0, 0.5);
}

* {
  box-sizing: border-box;
}

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

body {
  background: linear-gradient(168deg, var(--desk-top) 0%, #141417 42%, var(--desk-bot) 100%) fixed;
  color: var(--text);
  font-family: var(--ui);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  padding: 0 0 72px;
}

/* Faint neutral blooms, matching the README wallpaper. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(680px circle at 8% 4%, rgba(58, 58, 66, 0.42), transparent 70%),
    radial-gradient(620px circle at 94% 30%, rgba(66, 66, 76, 0.26), transparent 70%),
    radial-gradient(760px circle at 40% 96%, rgba(46, 49, 56, 0.3), transparent 70%);
}

/* ------------------------------------------------------------- menu bar */

.menubar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 22px;
  height: 30px;
  padding: 0 16px;
  font-size: 12px;
  background: rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.menubar a {
  color: var(--text);
  text-decoration: none;
  opacity: 0.86;
}

.menubar a:hover {
  opacity: 1;
  text-decoration: underline;
}

.menubar .apple {
  font-size: 14px;
  opacity: 0.9;
}

.menubar .name {
  font-weight: 700;
}

.menubar .spacer {
  margin-left: auto;
}

.menubar .clock {
  color: var(--text-2);
}

/* --------------------------------------------------------------- layout */

.wrap {
  position: relative;
  z-index: 1;
  max-width: 1060px;
  margin: 0 auto;
  padding: 34px 22px 0;
}

.page-head {
  display: flex;
  align-items: flex-end;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.page-head .icon {
  width: 62px;
  height: 62px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  font-size: 30px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25), var(--shadow);
}

/*
 * App marks. The tinted squircles carry the same glyph set the README draws
 * (scripts/chrome.mjs), so the site and the profile speak one visual language
 * — and no icon depends on which emoji font the reader happens to have.
 */
.mark {
  display: block;
  width: 55%;
  height: 55%;
  fill: #fff;
}

.mark.line {
  fill: none;
  stroke: #fff;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.page-head h1 {
  margin: 0;
  font-size: 27px;
  letter-spacing: -0.7px;
}

.page-head p {
  margin: 5px 0 0;
  color: var(--text-2);
  font-size: 14px;
  max-width: 62ch;
}

.page-head .links {
  margin-left: auto;
  display: flex;
  gap: 9px;
}

/* --------------------------------------------------------------- window */

.win {
  background: var(--win);
  border-radius: var(--radius);
  box-shadow: var(--shadow), inset 0 0 0 1px rgba(255, 255, 255, 0.12);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.titlebar {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 14px;
  background: linear-gradient(var(--bar-top), var(--bar-bot));
  border-bottom: 1px solid rgba(0, 0, 0, 0.55);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
  flex: none;
}

.lights {
  display: flex;
  gap: 8px;
}

.lights i {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: block;
}

.lights i:nth-child(1) {
  background: #ff5f57;
  box-shadow: inset 0 0 0 0.5px #e0443e;
}

.lights i:nth-child(2) {
  background: #febc2e;
  box-shadow: inset 0 0 0 0.5px #dea123;
}

.lights i:nth-child(3) {
  background: #28c840;
  box-shadow: inset 0 0 0 0.5px #1aab29;
}

.titlebar .title {
  flex: 1;
  text-align: center;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  padding-right: 52px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.titlebar .title small {
  display: block;
  font-size: 10px;
  font-weight: 400;
  color: var(--text-3);
}

.body {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* --------------------------------------------------------------- pieces */

.split {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr 1fr;
  align-items: stretch;
}

@media (max-width: 860px) {
  .split {
    grid-template-columns: 1fr;
  }
}

.btn {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  font: 600 12px var(--ui);
  padding: 7px 14px;
  border-radius: 7px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

.btn:hover {
  background: rgba(255, 255, 255, 0.13);
}

.btn.primary {
  background: var(--blue);
  border-color: transparent;
}

.btn.primary:hover {
  background: #2b95ff;
}

.term {
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.72;
  padding: 16px 18px;
  height: 100%;
  overflow: hidden;
  white-space: pre-wrap;
  word-break: break-word;
}

.term .p {
  color: var(--green);
}

.term .path {
  color: var(--teal);
}

.term .dim {
  color: var(--text-3);
}

.term .ok {
  color: var(--green);
}

.term .warn {
  color: var(--orange);
}

.term .acc {
  color: var(--pink);
}

.caret {
  display: inline-block;
  width: 7px;
  height: 1em;
  vertical-align: -2px;
  background: var(--text);
  animation: blink 1.05s steps(1) infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-2);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.controls {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0 0;
  flex-wrap: wrap;
}

.controls .note {
  color: var(--text-4);
  font-size: 12px;
}

.footer {
  max-width: 1060px;
  margin: 40px auto 0;
  padding: 0 22px;
  color: var(--text-4);
  font-size: 12px;
  position: relative;
  z-index: 1;
}

.footer a {
  color: var(--text-3);
}

/* Anything mid-animation fades in rather than popping. */
.fade {
  animation: fade 0.34s ease both;
}

@keyframes fade {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .fade,
  .caret {
    animation: none;
  }
}
