@font-face {
  font-family: "Jersey 15";
  src: url("assets/fonts/jersey-15.woff2") format("woff2");
  font-display: swap;
}

:root {
  --desk: #1d5a66;
  --desk-deep: #174a54;
  --ink: #141413;
  --ink-soft: #4a504f;
  --paper: #ffffff;
  --chrome: #e9eeee;
  --line: #d5dddd;
  --clawd: #d97757;
  --clawd-deep: #a8502f;
  --term: #10292e;

  --menubar-h: 2rem;
  /* The animation canvas; his body is about 41% of it, so Medium is a 230px Clawd. */
  --clawd-base: 560px;
  --clawd-scale: 1;
  --clawd-w: min(calc(var(--clawd-base) * var(--clawd-scale)), 96vw, 62vh);
  --clawd-h: calc(var(--clawd-w) * 1850 / 2750);

  --sans: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

:root[data-size="small"] { --clawd-base: 380px; }
:root[data-size="large"] { --clawd-base: 760px; }

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--menubar-h) + 1.5rem);
  scrollbar-color: #7fb3bd var(--desk-deep);
}

body {
  min-height: 100vh;
  background-color: var(--desk);
  /* The desktop pattern: tiny Clawds, cut from his own pixel grid. */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='96' shape-rendering='crispEdges'%3E%3Cg fill='%23ffffff' fill-opacity='.055'%3E%3Cpath d='M16 12h16v4h4v4h-4v4h-2v4h-2v-4h-2v4h-2v-4h-2v4h-2v-4h-2v4h-2v-8h-4v-4h4z'/%3E%3Cpath d='M76 60h16v4h4v4h-4v4h-2v4h-2v-4h-2v4h-2v-4h-2v4h-2v-4h-2v4h-2v-8h-4v-4h4z'/%3E%3C/g%3E%3C/svg%3E");
  color: var(--ink);
  font: 1.0625rem/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: var(--clawd); color: var(--ink); }

a { color: inherit; text-underline-offset: 0.2em; text-decoration-thickness: 1px; }

/* A white ring inside an ink ring, so focus shows on white, on the desk, and on dark controls alike. */
:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 0;
  box-shadow: 0 0 0 5px var(--ink);
  border-radius: 6px;
}

.visually-hidden,
.skip:not(:focus) {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}
.skip:focus {
  position: fixed; top: 2.5rem; left: 1rem; z-index: 60;
  background: var(--paper); padding: 0.5rem 0.875rem; border-radius: 8px;
}

/* Menubar */

.menubar {
  position: fixed; inset: 0 0 auto 0; z-index: 40;
  height: var(--menubar-h);
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0 0.875rem;
  background: rgba(238, 244, 244, 0.82);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  backdrop-filter: blur(18px) saturate(1.4);
  font-size: 0.875rem;
  line-height: 1;
}
.menubar-left, .menubar-right { display: flex; align-items: center; gap: 0.25rem; min-width: 0; }
.menubar a, .menu-button {
  display: inline-flex; align-items: center; height: 1.5rem; padding: 0 0.5rem;
  border-radius: 5px; text-decoration: none; color: var(--ink);
}
.menubar a:hover, .menu-button:hover, .menu-button[aria-expanded="true"] { background: rgba(20, 20, 19, 0.1); }
.app-name { font-weight: 700; }
.unofficial {
  padding: 0.1875rem 0.5rem; border-radius: 5px;
  background: var(--ink); color: var(--paper); font-weight: 600; white-space: nowrap;
}
.status { color: var(--ink-soft); white-space: nowrap; padding: 0 0.25rem; font-variant-numeric: tabular-nums; }
.clock { padding: 0 0.25rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.menu { position: relative; }
.menu-button { border: 0; background: none; font: inherit; cursor: pointer; }
.menu-button svg { display: block; }

.menu-panel {
  position: absolute; top: calc(100% + 0.375rem); right: 0; z-index: 50;
  min-width: 13rem; padding: 0.3125rem;
  background: rgba(246, 249, 249, 0.96);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  border-radius: 9px;
  box-shadow: 0 14px 36px -8px rgba(6, 28, 34, 0.5);
  font-size: 0.875rem; line-height: 1.2;
}
.menu-panel[hidden] { display: none; }
.menu-panel button, .menu-panel a {
  display: flex; align-items: center; width: 100%; height: auto;
  padding: 0.375rem 0.625rem; border: 0; border-radius: 5px;
  background: none; color: var(--ink); font: inherit; text-align: left; cursor: pointer; text-decoration: none;
}
.menu-panel button:hover, .menu-panel a:hover { background: var(--ink); color: var(--paper); }
.menu-group { margin: 0.3125rem 0; padding: 0.3125rem 0; border-block: 1px solid var(--line); }
.menu-label { display: block; padding: 0.25rem 0.625rem; color: var(--ink-soft); font-size: 0.75rem; }
.menu-group button { padding-left: 1.75rem; position: relative; }
.menu-group button[aria-pressed="true"]::before {
  content: ""; position: absolute; left: 0.6875rem; top: 50%;
  width: 0.3125rem; height: 0.5625rem; margin-top: -0.4375rem;
  border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg);
}

/* Windows */

main {
  display: grid; gap: clamp(2rem, 5vw, 3.5rem);
  justify-items: center;
  padding: var(--menubar-h) clamp(0.875rem, 4vw, 2.5rem) calc(var(--clawd-h) * 0.5 + 7.5rem);
}

/* The first screen is the hero window alone, with open desk below it for the Dock and Clawd. */
.desk-row {
  width: 100%;
  min-height: calc(100svh - var(--menubar-h));
  display: grid; justify-items: center; align-content: center;
  padding: clamp(1rem, 3vh, 3rem) 0 calc(var(--clawd-h) * 0.45 + 2.5rem);
}

.window {
  width: min(100%, 58rem);
  background: var(--paper);
  border-radius: 14px;
  box-shadow: 0 28px 70px -18px rgba(6, 28, 34, 0.6);
  overflow: hidden;
}
.titlebar {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  height: 2.375rem; padding: 0 0.875rem;
  background: var(--chrome);
  font-size: 0.8125rem; font-weight: 600; color: var(--ink-soft);
}
.lights { display: flex; gap: 0.5rem; }
.lights i { width: 0.75rem; height: 0.75rem; border-radius: 50%; background: #ff5f57; }
.lights i:nth-child(2) { background: #febc2e; }
.lights i:nth-child(3) { background: #28c840; }
.titlebar .count { justify-self: end; font-weight: 400; font-variant-numeric: tabular-nums; }
.window-body { padding: clamp(1.25rem, min(4.5vw, 5vh), 3.25rem); }

/* Hero window */

h1 {
  font: 400 clamp(3rem, min(9.4vw, 12vh), 6rem)/0.88 "Jersey 15", var(--sans);
  letter-spacing: 0;
  text-wrap: balance;
}
.lede {
  margin-top: 1.25rem; max-width: 42rem;
  font-size: clamp(1.125rem, 2.2vw, 1.375rem); line-height: 1.45;
  text-wrap: pretty;
}
.install { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: clamp(1.25rem, 3vh, 2rem); align-items: stretch; }
.download {
  display: inline-flex; flex-direction: column; justify-content: center; gap: 0.125rem;
  padding: 0.75rem 1.5rem; border: 0; border-radius: 12px;
  background: var(--ink); color: var(--paper);
  font: 600 1.1875rem/1.2 var(--sans); text-align: left; text-decoration: none; cursor: pointer;
  transition: transform 0.2s var(--ease), background-color 0.2s var(--ease);
}
.download small { font-size: 0.8125rem; font-weight: 500; opacity: 0.85; }
a.download:hover, button.download:not(:disabled):hover { background: var(--clawd-deep); transform: translateY(-1px); }
.download:disabled {
  cursor: not-allowed;
  background: #5a6160;
}
.brew {
  display: flex; align-items: center; gap: 0.5rem; min-width: 0; max-width: 100%;
  padding: 0.375rem 0.375rem 0.375rem 1rem; border-radius: 12px;
  background: var(--term); color: #e6f2f3;
}
.brew code {
  font: 0.9375rem/1.4 var(--mono); white-space: nowrap; overflow-x: auto; min-width: 0;
  padding: 0.375rem 0; scrollbar-width: none;
}
.brew code::before { content: "$ "; color: #7fb3bd; }
.copy {
  flex: none; padding: 0.5rem 0.875rem; border: 0; border-radius: 8px;
  background: #24505a; color: #e6f2f3; font: 600 0.875rem/1 var(--sans); cursor: pointer;
  transition: background-color 0.2s var(--ease);
}
.copy:hover { background: #2f6772; }
.copy[data-copied] { background: var(--clawd); color: var(--ink); }
.requirements { margin-top: 1rem; font-size: 0.9375rem; color: var(--ink-soft); max-width: 42rem; }
.disclaimer {
  margin-top: clamp(1rem, 2.5vh, 1.75rem); padding-top: clamp(0.875rem, 2vh, 1.25rem); border-top: 1px solid var(--line);
  font-weight: 600;
}

/* Acts window */

.window-acts .window-body { padding: clamp(1rem, 3vw, 1.75rem); }
.hint { font-size: 0.9375rem; color: var(--ink-soft); margin: 0 0.375rem 0.75rem; }
.acts {
  list-style: none;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(7.25rem, 1fr)); gap: 0.25rem;
}
.act {
  display: grid; justify-items: center; gap: 0.25rem; width: 100%;
  padding: 0.5rem 0.25rem 0.625rem; border: 0; border-radius: 10px;
  background: none; color: var(--ink); font: 0.8125rem/1.2 var(--sans); cursor: pointer;
  transition: background-color 0.15s var(--ease);
}
.act img { width: 100%; max-width: 8.25rem; height: auto; image-rendering: pixelated; }
.act span { padding: 0.125rem 0.4375rem; border-radius: 5px; }
.act:hover { background: #eef3f3; }
.act[aria-pressed="true"] { background: #e3ecec; }
.act[aria-pressed="true"] span { background: var(--ink); color: var(--paper); }
:root[data-clawd="static"] .act { cursor: default; }

/* Read Me window */

.window-readme { width: min(100%, 40rem); }
/* Windows sit where someone left them, not in a column. */
@media (min-width: 64rem) {
  .window-acts { justify-self: start; margin-left: max(0px, calc(50% - 33rem)); }
  .window-readme { justify-self: end; margin-right: max(0px, calc(50% - 31rem)); margin-top: -1.5rem; }
  /* Beside the Read Me window with clear desk between them, not touching its text. */
  .window-about { justify-self: start; margin-left: max(0px, calc(50% - 33rem)); margin-top: -9rem; }
}
.window-readme .window-body { font-size: 1.0625rem; }
.window-readme p { max-width: 34rem; text-wrap: pretty; }
.facts { list-style: none; margin: 1.5rem 0; display: grid; gap: 0.625rem; }
.facts li { position: relative; padding-left: 1.75rem; max-width: 34rem; }
.facts li::before {
  /* A single Clawd pixel as the bullet. */
  content: ""; position: absolute; left: 0.25rem; top: 0.5em;
  width: 0.5625rem; height: 0.5625rem; background: var(--clawd);
}

/* About window: the app's real About window */

.window-about { width: min(100%, 21.25rem); }
.window-about .window-body { padding: 1.25rem; background: #f3f5f5; }
.about-card {
  display: grid; justify-items: center; padding: 1.375rem 1rem 1.25rem;
  background: var(--paper); border-radius: 12px; text-align: center;
}
.about-card img { margin-bottom: 0.75rem; }
.about-card h2 { font: 600 1.0625rem/1.2 var(--sans); }
.about-card p { margin-top: 0.5rem; font-size: 0.8125rem; color: var(--ink-soft); }
.about-links { list-style: none; margin-top: 1.375rem; background: var(--paper); border-radius: 12px; overflow: hidden; }
.about-links li + li { border-top: 1px solid var(--line); }
.about-links a {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.6875rem 1rem; font-size: 0.875rem; text-decoration: none;
}
.about-links a::after {
  /* Opens elsewhere: an arrow leaving up and to the right. */
  content: ""; flex: none; width: 0.75rem; height: 0.75rem;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='%234a504f' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 9l6-6M4.5 3H9v4.5'/%3E%3C/svg%3E") center / contain no-repeat;
}
.about-links a:hover { background: #eef3f3; }
/* The list clips its corners, so the ring is drawn inside the row. */
.about-links a:focus-visible { outline: 0; border-radius: 0; box-shadow: inset 0 0 0 3px var(--ink); }
.about-foot { margin-top: 1.25rem; text-align: center; font-size: 0.8125rem; color: var(--ink-soft); }

/* Dock */

.dock {
  position: fixed; left: 50%; bottom: 0.625rem; z-index: 20;
  transform: translateX(-50%);
  display: flex; gap: 0.5rem; padding: 0.5rem;
  /* Dark glass, so the plate holds over white windows as well as the desk. */
  background: rgba(13, 38, 44, 0.62);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  backdrop-filter: blur(18px) saturate(1.4);
  border-radius: 20px;
}
.dock a { display: block; position: relative; border-radius: 12px; transition: transform 0.25s var(--ease); }
/* Clawd is running. */
.dock a:first-child::after {
  content: ""; position: absolute; left: 50%; bottom: -0.375rem;
  width: 0.25rem; height: 0.25rem; margin-left: -0.125rem; border-radius: 50%; background: #e6f2f3;
}
.dock a:hover, .dock a:focus-visible { transform: translateY(-6px) scale(1.08); }
.dock img, .dock svg { display: block; width: 3.25rem; height: 3.25rem; }

/* Clawd: in front of everything, and clicks pass straight through him. */

#clawd {
  position: fixed; left: 0; bottom: 0; z-index: 30;
  width: var(--clawd-w); height: var(--clawd-h);
  pointer-events: none;
  will-change: transform;
  transform: translate3d(8vw, 0, 0);
}
.clawd-body {
  position: absolute; inset: 0;
  transition: opacity 0.15s linear, scale 0.15s var(--ease);
}
.clawd-body[data-facing="left"] { transform: scaleX(-1); }
.clawd-body[data-popped] { opacity: 0; scale: 0.6; }
.clawd-body .anim { position: absolute; inset: 0; visibility: hidden; }
.clawd-body .anim.on { visibility: visible; }
/* Shown until the animations take over, and kept if they never load. */
/* Sized to match his body inside the animation canvas. */
.clawd-fallback { position: absolute; left: 29.5%; right: 29.5%; bottom: 0; }
.clawd-fallback svg { display: block; width: 100%; height: auto; }
:root[data-clawd="live"] .clawd-fallback { display: none; }
:root[data-hidden] #clawd { display: none; }

@media (max-width: 47.9375rem) {
  :root { --clawd-scale: 0.55; }
  .menubar-left a:not(.app-name), .clock, .status { display: none; }
  .dock { display: none; }
  main { padding-bottom: calc(var(--clawd-h) * 0.5 + 3rem); }
  .desk-row { min-height: 0; padding-bottom: 0; }
  .install { flex-direction: column; }
  .brew code { white-space: normal; overflow-wrap: anywhere; }
  .download { align-items: flex-start; }
  .acts { grid-template-columns: repeat(auto-fill, minmax(5.75rem, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}
