/* ===========================================================================
   LaunchTag. One Macintosh screen, in one ink.
   The grammar is read off art/ref/mac-template.jpg: black bezel, grey menu bar,
   hard 3 px borders, hard offset shadows with no blur, shared-border cell rows,
   window title strips with two boxes and a centred file name, a halftone band,
   and no hue anywhere on the page.
   =========================================================================== */

@font-face { font-family: Chillax; src: url(../fonts/chillax-400.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: Chillax; src: url(../fonts/chillax-500.woff2) format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: Chillax; src: url(../fonts/chillax-600.woff2) format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: Chillax; src: url(../fonts/chillax-700.woff2) format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: Tabular; src: url(../fonts/tabular-400.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: Tabular; src: url(../fonts/tabular-500.woff2) format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: Tabular; src: url(../fonts/tabular-700.woff2) format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --paper: #ffffff;
  --ink: #000000;
  --chrome: #c4c4c4;   /* the menu bar and every push button */
  --strip: #cbcbcb;    /* a window title strip */
  --sunk: #9d9d9d;     /* a pressed button */

  --line: 3px;
  --bezel: 10px;
  --drop: 8px;         /* the hard offset shadow, no blur, exactly as his reference draws it */

  --pad-x: clamp(28px, 4.2vw, 80px);
  --gap: 28px;
  --band: clamp(52px, 6vw, 96px);
  --win-pad: clamp(26px, 2vw, 32px);

  --display: clamp(44px, 6.8vw, 130px);
  --title: clamp(26px, 3.1vw, 52px);
  --lead: clamp(19px, 1.3vw, 24px);
  --body: 18px;
  --label: 16px;

  font-synthesis: none;
  accent-color: #000000;   /* a range track on this page is ink, never the browser's blue */
}

* { box-sizing: border-box; }

html { background: var(--ink); -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Chillax, ui-sans-serif, system-ui, sans-serif;
  font-weight: 500;
  font-size: var(--body);
  line-height: 1.55;
  border: var(--bezel) solid var(--ink);   /* the screen's edge: the page lives inside the Macintosh */
  min-height: 100vh;
  overflow-x: hidden;
}

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

h1, h2, h3, p, ul, ol, figure { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: inherit; }
img { display: block; max-width: 100%; }

.mono { font-family: Tabular, ui-monospace, monospace; font-weight: 500; font-variant-numeric: tabular-nums; }
.num { font-family: Tabular, ui-monospace, monospace; font-weight: 700; font-variant-numeric: tabular-nums; }

:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: var(--line) solid var(--ink);
  outline-offset: 3px;
}

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

.menubar {
  display: flex;
  align-items: stretch;
  gap: 0;
  background: var(--chrome);
  border-bottom: var(--line) solid var(--ink);
  padding: 0 22px 0 0;
  min-height: 62px;
  flex-wrap: wrap;
}

.menubar__mark {
  display: grid;
  place-items: center;
  width: 62px;
  flex: none;
  border-right: var(--line) solid var(--ink);
  background: var(--paper);
}
.menubar__mark img { width: 44px; height: 44px; }

.menubar__nav { display: flex; align-items: center; flex-wrap: wrap; gap: 0; min-width: 0; }

.menubar__item {
  display: inline-flex;
  align-items: center;
  min-height: 56px;
  padding: 0 24px;
  font-size: 19px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.menubar__item:hover { background: var(--ink); color: var(--chrome); }
.menubar__item[aria-current="page"] { background: var(--ink); color: var(--chrome); }

.menubar__clock {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 0 4px 0 24px;
  font-size: 17px;
  font-weight: 600;
  white-space: nowrap;
}
.menubar__clock .num { font-size: 20px; }

/* ------------------------------------------------------------------ bands */

.band { padding: var(--band) var(--pad-x); }
.band--rule { border-top: var(--line) solid var(--ink); }
.band--halftone {
  background: var(--paper) url(../img/halftone.png) repeat;
  background-size: 24px 24px;
  border-top: var(--line) solid var(--ink);
  border-bottom: var(--line) solid var(--ink);
}
.band__head { font-size: var(--title); font-weight: 700; letter-spacing: -0.02em; line-height: 1.05; }
.band__sub { font-size: var(--lead); max-width: 62ch; }
/* The heading always owns its own line; a note sits under it, never beside it on the halftone. */
.band__headrow { display: grid; gap: 16px; margin-bottom: 38px; justify-items: start; }

/* On the dotted ground the heading needs its own plate, or the halftone eats it. */
.band--halftone .band__head {
  display: inline-block;
  max-width: 100%;
  background: var(--paper);
  border: var(--line) solid var(--ink);
  box-shadow: var(--drop) var(--drop) 0 var(--ink);
  padding: 0.62em 1em;
  line-height: 1.16;
}
.band--halftone .band__headrow { margin-bottom: calc(38px + var(--drop)); }

/* ------------------------------------------------------------------- hero */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  grid-template-areas: "text pic" "text about";
  column-gap: clamp(30px, 3.4vw, 64px);
  row-gap: 26px;
  align-items: start;
  padding: clamp(34px, 3.2vw, 54px) var(--pad-x) clamp(34px, 3.2vw, 54px);
}
.hero__text { grid-area: text; align-self: center; }
.hero__pic { grid-area: pic; }
.hero__about { grid-area: about; min-width: 0; }
.hero__display {
  font-size: var(--display);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: -0.03em;
}
.hero__lead { font-size: var(--lead); margin-top: 24px; max-width: 38ch; }
.hero__lead a { text-underline-offset: 4px; }
.hero__actions { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; margin-top: 30px; }
.hero__pic { width: 100%; height: clamp(190px, 21vw, 380px); object-fit: contain; object-position: center; }

/* --------------------------------------------------------------- controls */

.key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 56px;
  padding: 14px 26px;
  background: var(--chrome);
  color: var(--ink);
  border: var(--line) solid var(--ink);
  box-shadow: var(--drop) var(--drop) 0 var(--ink);
  font: inherit;
  font-size: 18px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  text-align: center;
}
.key:hover { background: var(--paper); }
.key:active { transform: translate(var(--drop), var(--drop)); box-shadow: 0 0 0 var(--ink); background: var(--sunk); }
.key[aria-disabled="true"], .key:disabled {
  background: repeating-linear-gradient(135deg, #d8d8d8 0 6px, #ffffff 6px 12px);
  color: #6a6a6a;
  cursor: not-allowed;
  box-shadow: var(--drop) var(--drop) 0 #8a8a8a;
}
.key--wide { width: 100%; }
.key--big { min-height: 66px; font-size: 21px; padding: 17px 34px; }
.key--mark img { width: 22px; height: 22px; flex: none; }

.textlink { font-weight: 600; text-underline-offset: 4px; }

.field {
  display: block;
  width: 100%;
  min-height: 58px;
  padding: 12px 18px;
  border: var(--line) solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: 19px;
}
.field::placeholder { color: #8d8d8d; }
.field:disabled { background: #ededed; color: #777; }
.label {
  display: block;
  font-size: var(--label);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: none;
  margin-bottom: 9px;
}
.help { font-size: var(--label); margin-top: 9px; }
.help--bad { font-weight: 600; }

/* ------------------------------------------------------- shared-edge cells */

.cells {
  display: grid;
  grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr));
  border: var(--line) solid var(--ink);
  border-right-width: 0;
  box-shadow: var(--drop) var(--drop) 0 var(--ink);
  background: var(--chrome);
}
.cell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 96px;
  padding: 18px 30px;
  border-right: var(--line) solid var(--ink);
  text-decoration: none;
  min-width: 0;
}
a.cell:hover { background: var(--paper); }
.cell__label { font-size: var(--label); font-weight: 600; }
.cell__value { font-size: clamp(24px, 1.7vw, 30px); font-weight: 700; line-height: 1.1; }
.cell__stack { display: grid; gap: 2px; min-width: 0; }
.cell__arrow { width: 22px; height: 22px; flex: none; }

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

.win {
  background: var(--paper);
  border: var(--line) solid var(--ink);
  box-shadow: var(--drop) var(--drop) 0 var(--ink);
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.win__bar {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 18px;
  background: var(--strip);
  border-bottom: var(--line) solid var(--ink);
  user-select: none;
}
.win__box {
  width: 20px; height: 20px; flex: none;
  padding: 0; border: 0; background: transparent center / contain no-repeat;
  cursor: pointer;
}
.win__box--close { background-image: url(../img/box-close.png); }
.win__box--zoom { background-image: url(../img/box-zoom.png); }
.win__box:hover { background-color: var(--ink); border-radius: 50%; }
.win__name {
  flex: 1;
  text-align: center;
  font-family: Tabular, ui-monospace, monospace;
  font-weight: 500;
  font-size: var(--label);
  padding: 0 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.win__bar-pad { width: 50px; flex: none; }
.win__body { padding: var(--win-pad); display: grid; gap: 22px; align-content: start; }
.win__body--tight { padding: 22px var(--win-pad); }
.win__pic {
  border-bottom: var(--line) solid var(--ink);
  background: var(--paper);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.win--shaded .win__body, .win--shaded .win__pic, .win--shaded .win__foot { display: none; }
.win__foot { padding: 0 var(--win-pad) var(--win-pad); display: grid; gap: 14px; }

/* ------------------------------------------------------------------- rows */

/* The rules run the full width of the window; the text keeps its inset from the window edge. */
.rows { display: grid; gap: 0; border-top: var(--line) solid var(--ink); margin-inline: calc(var(--win-pad) * -1); }
.row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, auto);
  align-items: center;
  gap: 18px;
  padding: 15px var(--win-pad);
  border-bottom: 1px solid var(--ink);
  min-width: 0;
}
.row:last-child { border-bottom: 0; }
.row__k { font-size: var(--label); font-weight: 600; min-width: 0; }
.row__v { font-size: 20px; font-weight: 700; text-align: right; overflow-wrap: anywhere; }

.addr {
  font-family: Tabular, ui-monospace, monospace;
  font-weight: 500;
  font-size: 19px;
  line-height: 1.45;
  overflow-wrap: anywhere;
  word-break: break-word;
  min-width: 0;
  user-select: all;
}

/* ------------------------------------------------------------------- tags */

.glyph {
  display: grid;
  place-items: center;
  background: var(--paper);
  image-rendering: pixelated;
}
.glyph canvas, .glyph img { display: block; }

.taggrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: calc(var(--gap) + var(--drop));
}

/* the scattered feed: windows that really drag by their title strip */
.desk {
  position: relative;
  min-height: 560px;
  touch-action: pan-y;
}
.desk .win { position: absolute; width: min(430px, 88vw); }
.desk .win__bar { cursor: grab; }
.desk .win.is-drag .win__bar { cursor: grabbing; }
.desk--stack { min-height: 0; display: grid; gap: calc(var(--gap) + var(--drop)); }
.desk--stack .win { position: static; width: auto; }

/* ------------------------------------------------------------------ misc */

.split { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: calc(var(--gap) + var(--drop)); align-items: stretch; }
.split > .win { height: 100%; }
.split .win__body { flex: 1 1 auto; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: calc(var(--gap) + var(--drop)); }
.step__n { font-size: 17px; font-weight: 700; font-family: Tabular, monospace; }
.step__h { font-size: 24px; font-weight: 700; line-height: 1.15; }
.step p { font-size: 17px; }

.note { font-size: var(--label); }
.stack { display: grid; gap: 22px; align-content: start; }
.stack--tight { gap: 12px; }
.inline { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; }

.marquee-none { }
.sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.empty { display: grid; gap: 18px; justify-items: start; }
.empty img { width: min(320px, 70%); }

.bar {
  height: 20px;
  border: var(--line) solid var(--ink);
  background: var(--paper);
  position: relative;
  overflow: hidden;
}
.bar__fill { position: absolute; inset: 0 auto 0 0; background: var(--ink); }

.slider {
  width: 100%;
  min-height: 48px;
  accent-color: var(--ink);
}

.dialog {
  border: var(--line) solid var(--ink);
  box-shadow: var(--drop) var(--drop) 0 var(--ink);
  background: var(--paper);
  color: var(--ink);
  padding: 0;
  max-width: min(560px, 92vw);
}
.dialog::backdrop { background: rgba(0, 0, 0, 0.55); }

/* ------------------------------------------------------------- responsive */

@media (max-width: 1080px) {
  .hero { grid-template-columns: minmax(0, 1fr); grid-template-areas: "pic" "text" "about"; row-gap: 32px; }
  .hero__pic { height: clamp(200px, 34vw, 340px); }
  .cells { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cell { min-height: 92px; }
}

/* On a narrow window a label and its value stop fighting for the same line. */
@media (max-width: 560px) {
  .row { grid-template-columns: minmax(0, 1fr); gap: 4px; padding-top: 13px; padding-bottom: 13px; }
  .row__v { text-align: left; }
}

@media (max-width: 720px) {
  :root { --drop: 6px; --bezel: 7px; --line: 3px; }
  .menubar { padding-right: 0; align-items: center; min-height: 0; }
  .menubar__mark { width: 56px; align-self: stretch; }
  .menubar__mark img { width: 38px; height: 38px; }
  .menubar__clock { padding: 12px 18px 12px 16px; }
  .menubar__nav { width: 100%; order: 3; border-top: var(--line) solid var(--ink); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .menubar__item { justify-content: center; padding: 0 14px; font-size: 17px; min-height: 54px; }
  .menubar__item:nth-child(odd) { border-right: var(--line) solid var(--ink); }
  .menubar__item:nth-child(-n+2) { border-bottom: var(--line) solid var(--ink); }
  .menubar__clock { margin-left: auto; padding-right: 18px; }
  .cells { grid-template-columns: minmax(0, 1fr); border-right-width: var(--line); }
  .cell { border-right: 0; border-bottom: var(--line) solid var(--ink); }
  .cell:last-child { border-bottom: 0; }
  .taggrid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 380px) {
  .menubar__item { font-size: 16px; padding: 0 10px; }
  .key { padding: 14px 20px; }
  .cell { padding-left: 26px; padding-right: 26px; }
}

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