/* vistormu.dev, the placeholder sheet.
   the figma file is the contract: `website`, page `placeholder`. every value
   below is read off those frames, and when the two disagree the frames win. */

/* self hosted, latin subset, OFL. no third party origin. */
@font-face {
  font-family: "IBM Plex Mono"; src: url("/fonts/ibmplexmono-400.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono"; src: url("/fonts/ibmplexmono-500.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
}

/* two prints of the same sheet, the figma `color` collection's two modes.
   blueprint is the default and paper follows the system setting, unless the
   reader picked one with the print switch, which sets data-theme. */
:root {
  --ground: #0f2a4a;
  --line: rgba(214, 230, 250, 0.05);
  --line-major: rgba(214, 230, 250, 0.10);
  --frame: rgba(214, 230, 250, 0.45);
  --text: #e8f0fa;
  --muted: #9fb4cc;
  --live: #f2c46b;
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="blueprint"]) {
    --ground: #f4f1ea;
    --line: rgba(29, 53, 87, 0.06);
    --line-major: rgba(29, 53, 87, 0.12);
    --frame: rgba(29, 53, 87, 0.55);
    --text: #1d3557;
    --muted: #4f6480;
    --live: #c2410c;
    color-scheme: light;
  }
}

:root[data-theme="paper"] {
  --ground: #f4f1ea;
  --line: rgba(29, 53, 87, 0.06);
  --line-major: rgba(29, 53, 87, 0.12);
  --frame: rgba(29, 53, 87, 0.55);
  --text: #1d3557;
  --muted: #4f6480;
  --live: #c2410c;
  color-scheme: light;
}

:root {
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --minor: 24px;
  --margin: 24px;
  --pad: 96px;
  --h1: 64px;
}

@media (max-width: 560px) {
  :root { --margin: 12px; --pad: 32px; --h1: 32px; }
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  padding: var(--margin);
  display: flex;
  background-color: var(--ground);
  /* the drafting grid. a major line every fifth, starting on the margin so
     the outline sits on a line */
  background-image:
    linear-gradient(var(--line-major) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-major) 1px, transparent 1px),
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size:
    calc(var(--minor) * 5) calc(var(--minor) * 5),
    calc(var(--minor) * 5) calc(var(--minor) * 5),
    var(--minor) var(--minor),
    var(--minor) var(--minor);
  background-position: calc(var(--margin) - 1px) calc(var(--margin) - 1px);
  color: var(--muted);
  font: 15px/24px var(--mono);
}

h1, p, dl, dd { margin: 0; }
a { color: var(--text); text-underline-offset: 3px; }
a:hover, a:focus-visible { color: var(--live); }
:focus-visible { outline: 1px solid var(--live); outline-offset: 2px; }

/* the drawing border: a 1px rule with a second one 6px outside it */
.sheet {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  margin: 6px;
  border: 1px solid var(--frame);
  outline: 1px solid var(--frame);
  outline-offset: 6px;
}

.drawing {
  padding: var(--pad);
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: calc(628px + 2 * var(--pad));
}

.note {
  font-size: 13px;
  line-height: 20.8px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  font: 500 var(--h1)/1.1 var(--mono);
  letter-spacing: -0.02em;
  color: var(--text);
}

/* the title block, bottom right as on paper. the rules between cells are the
   1px gap showing the frame colour through, so no cell decides its borders. */
.titleblock {
  align-self: flex-end;
  width: min(100%, 520px);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--frame);
  border-top: 1px solid var(--frame);
  border-left: 1px solid var(--frame);
}

.titleblock > div {
  padding: 10px 14px;
  background: var(--ground);
  min-width: 0;
}
.titleblock .wide { grid-column: 1 / -1; }

.titleblock dt {
  font-size: 11px;
  line-height: 17.6px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.titleblock dd { color: var(--text); }
.titleblock .live { color: var(--live); }

/* the print switch. the current print is plain text, the other one is a link
   shaped button, underlined like every other link on the sheet. */
.print { color: var(--muted); }
.print button {
  font: inherit;
  color: var(--text);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}
.print button[aria-pressed="false"] {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.print button[aria-pressed="false"]:hover,
.print button[aria-pressed="false"]:focus-visible { color: var(--live); }
.print button[aria-pressed="true"] { cursor: default; }

@media (max-width: 560px) {
  .titleblock { width: 100%; border-left: 0; }
  /* half a phone fits neither an email address nor the switch */
  .titleblock > div { grid-column: 1 / -1; }
}
