/* BALTSAR, what every page shares.
   The three skins, the menu bar, a window, the footer, the contact box and
   the skin picker. Three voices: the logo's own face for what is said loudly,
   Departure Mono for what the machine says, Helvetica for the rest. */

:root {
  --ink: #000;
  --paper: #fff;
  --chrome: #e4e4e4;
  /* How far along a work is. Green, because it reads as progress at a glance. */
  --meter: #0fb84a;

  --machine: "Departure Mono", "Courier New", monospace;
  --plain: "Helvetica Neue", Helvetica, Arial, sans-serif;

  --edge: 2px solid var(--ink);
  --gutter: clamp(1rem, 4vw, 3rem);
}

/* Bunker is licensed from basement.studio. The licence lets the site serve
   the file; it does not let the file be shared, so the repository that holds
   it has to stay private. No local() here: every visitor gets the same cut. */
@font-face {
  font-family: "Bunker";
  src: url("fonts/Bunker-Regular.woff2") format("woff2");
  font-display: block;
}

@font-face {
  font-family: "Departure Mono";
  src: local("Departure Mono"), url("fonts/DepartureMono-Regular.otf") format("opentype");
  font-display: swap;
}

/* Three skins to choose between. Each names the ground the forest dissolves
   into, the colour of the dots, one accent, and the dark end of the page.
   --flip tells the shader the ground is dark, so the dots are the light part. */
html,
html[data-look="papper"] {
  --ground: #ececec;
  --on-ground: #000;
  --dots: #000;
  --flip: 0;
  --accent: #ff5a2b;
  --deep: #000;
  --on-deep: #fff;
  --deep-loud: #fff;
  --deep-accent: #ff5a2b;
  --deep-btn-ink: #000;
  --loud: "Bunker", "Arial Black", sans-serif;
  --loud-weight: 400;
  --loud-track: 0em;
  --loud-scale: 0.9;
}

html[data-look="skog"] {
  --ground: #0e2117;
  --on-ground: #eef2e6;
  --dots: #a9cf5c;
  --flip: 1;
  --accent: #c9f24a;
  --deep: #000;
  --on-deep: #eef2e6;
  --deep-loud: #c9f24a;
  --deep-accent: #c9f24a;
  --deep-btn-ink: #000;
  --loud: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --loud-weight: 700;
  --loud-track: -0.055em;
  --loud-scale: 1.08;
}

html[data-look="95"] {
  --ground: #008080;
  --on-ground: #fff;
  --dots: #004a4a;
  --flip: 0;
  --accent: #ffff00;
  --deep: #c0c0c0;
  --on-deep: #000;
  --deep-loud: #000080;
  --deep-accent: #000080;
  --deep-btn-ink: #fff;
  --loud: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --loud-weight: 700;
  --loud-track: -0.055em;
  --loud-scale: 1.08;
}

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

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  background: var(--ground);
  color: var(--ink);
  font-family: var(--plain);
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body.is-lightbox-open {
  overflow: hidden;
}

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

a {
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 3000;
  padding: 0.4rem 0.8rem;
  border: var(--edge);
  background: var(--accent);
  font-family: var(--machine);
  font-size: 1.03125rem;
  transform: translateY(-300%);
}

.skip-link:focus {
  transform: none;
}

/* menu bar: two blocks pinned to the corners, the way a desktop keeps them */
.menubar {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  right: 0.75rem;
  z-index: 100;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  pointer-events: none;
}

.menubar-logo,
.menubar-nav {
  pointer-events: auto;
  border: var(--edge);
  background: var(--paper);
  box-shadow: 3px 3px 0 var(--ink);
}

.menubar-logo {
  display: grid;
  place-items: center;
  height: 2.5rem;
  padding: 0 0.8rem;
}

.menubar-logo img {
  width: 104px;
  height: auto;
  image-rendering: pixelated;
}

.menubar-nav {
  display: flex;
  height: 2.5rem;
}

.menubar-nav a,
.menubar-nav button {
  display: grid;
  place-items: center;
  padding: 0 0.85rem;
  border: 0;
  border-left: var(--edge);
  background: none;
  color: var(--ink);
  font-family: var(--machine);
  font-size: 1.03125rem;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
}

.menubar-nav > :first-child {
  border-left: 0;
}

.menubar-nav a:hover,
.menubar-nav button:hover {
  background: var(--accent);
}

/* a window, as the desktop draws it */
.win {
  position: relative;
  display: flex;
  flex-direction: column;
  border: var(--edge);
  background: var(--paper);
  box-shadow: 6px 6px 0 var(--ink);
  color: var(--ink);
  text-decoration: none;
  transition: transform 0.12s ease-out, box-shadow 0.12s ease-out;
}

.win:hover {
  transform: translate(-2px, -2px);
  box-shadow: 8px 8px 0 var(--ink);
}

.win:active {
  transform: translate(3px, 3px);
  box-shadow: 3px 3px 0 var(--ink);
}

.win.is-held {
  transition: none;
  box-shadow: 14px 14px 0 rgba(0, 0, 0, 0.55);
}

.win-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  height: 2rem;
  padding: 0 0.45rem;
  border-bottom: var(--edge);
  background: repeating-linear-gradient(var(--ink) 0 2px, var(--paper) 2px 5px) content-box;
  padding-block: 0.4rem;
}

.win:hover .win-bar,
.win.is-held .win-bar {
  background-color: var(--accent);
  background-image: repeating-linear-gradient(var(--ink) 0 2px, var(--accent) 2px 5px);
}

.win-box {
  flex: none;
  width: 0.95rem;
  height: 0.95rem;
  border: var(--edge);
  background: var(--paper);
  box-shadow: 0 0 0 3px var(--paper);
}

.win-name {
  margin-inline: auto;
  padding: 0 0.6rem;
  background: var(--paper);
  font-family: var(--machine);
  font-size: 1.2rem;
  line-height: 1.2rem;
  letter-spacing: 0.02em;
}

.win:hover .win-box,
.win.is-held .win-box {
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent);
}

.win:hover .win-name,
.win.is-held .win-name {
  background: var(--accent);
}

.win picture {
  display: block;
}

.win img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-bottom: var(--edge);
}

.win-body {
  display: grid;
  gap: 0.5rem;
  padding: 1rem 1rem 1.15rem;
}

.win-line {
  font-size: 1.2rem;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.win-where {
  font-family: var(--machine);
  font-size: 0.95rem;
  line-height: 1.1;
  color: #454545;
}

.win-status {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: auto;
  padding: 0.6rem 0.6rem;
  border-top: var(--edge);
  background: var(--chrome);
}

.meter {
  flex: 1;
  height: 1.5rem;
  padding: 3px;
  border: var(--edge);
  background: var(--paper);
}

.meter i {
  display: block;
  width: calc(var(--p) * 1%);
  min-width: 10px;
  height: 100%;
  background: repeating-linear-gradient(90deg, var(--meter) 0 10px, transparent 10px 13px);
}

.win-pct {
  min-width: 3.4rem;
  font-family: var(--machine);
  font-size: 1.375rem;
  line-height: 1;
  text-align: right;
}

.foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  /* Room at the bottom for the skin picker, which sits over this corner. */
  padding: 1.25rem var(--gutter) 4.5rem;
  border-top: 1px solid color-mix(in srgb, var(--on-deep) 28%, transparent);
  background: var(--deep);
  color: var(--on-deep);
  font-family: var(--machine);
  font-size: 1.03125rem;
  line-height: 1.1;
}

.foot a {
  color: var(--deep-accent);
}

/* contact: a dialog box, as the system would have drawn it */
.sheet {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  padding: 1.25rem;
}

.sheet[hidden] {
  display: none;
}

.sheet-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background:
    radial-gradient(var(--dots) 1px, transparent 1.3px) 0 0 / 6px 6px,
    color-mix(in srgb, var(--ground) 88%, transparent);
  cursor: pointer;
}

.sheet-inner {
  position: relative;
  z-index: 1;
  width: min(26rem, 100%);
  max-height: 88vh;
  overflow-y: auto;
  padding: 1.5rem 1.25rem 0.5rem;
  border: var(--edge);
  background: var(--paper);
  box-shadow: 8px 8px 0 var(--ink);
}

.sheet-heading {
  font-family: var(--loud);
  font-weight: var(--loud-weight);
  font-size: 1.6rem;
  line-height: 1;
  letter-spacing: var(--loud-track);
}

.sheet-text {
  margin-top: 0.6rem;
  font-size: 1rem;
}

.sheet-close {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  width: 2.25rem;
  height: 2.25rem;
  border: var(--edge);
  background: var(--paper);
  cursor: pointer;
}

.sheet-close:hover {
  background: var(--accent);
}

.sheet-close span,
.sheet-close span::before {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 1.1rem;
  height: 2px;
  background: var(--ink);
}

.sheet-close span {
  transform: translate(-50%, -50%) rotate(45deg);
}

.sheet-close span::before {
  content: "";
  top: 0;
  left: 0;
  transform: rotate(90deg);
}

.channels {
  list-style: none;
  margin-top: 1.25rem;
}

.channel {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-height: 3.75rem;
  padding: 0.6rem 0.5rem;
  margin-inline: -0.5rem;
  border-top: var(--edge);
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
}

.channel:hover,
.channel:focus-visible {
  background: var(--accent);
}

.channel-icon {
  flex: none;
  width: 1.4rem;
  height: 1.4rem;
}

.channel-icon svg {
  width: 100%;
  height: 100%;
}

.channel-copy {
  display: grid;
}

.channel-name {
  font-family: var(--machine);
  font-size: 1.03125rem;
  line-height: 1.1;
}

.channel-note {
  font-size: 0.9rem;
  color: #454545;
}

/* look 95: grey bevels and a navy title bar, the other desktop of that decade */
html[data-look="95"] .win {
  border-color: #fff #000 #000 #fff;
  background: #c0c0c0;
  box-shadow: 2px 2px 0 #000;
  padding: 3px;
}

html[data-look="95"] .win-bar,
html[data-look="95"] .win:hover .win-bar,
html[data-look="95"] .win.is-held .win-bar {
  border: 0;
  background: #000080;
}

html[data-look="95"] .win-name,
html[data-look="95"] .win:hover .win-name,
html[data-look="95"] .win.is-held .win-name {
  margin-inline: 0 auto;
  order: -1;
  background: none;
  color: #fff;
}

html[data-look="95"] .win-box,
html[data-look="95"] .win:hover .win-box,
html[data-look="95"] .win.is-held .win-box {
  border: 2px solid;
  border-color: #fff #000 #000 #fff;
  background: #c0c0c0;
  box-shadow: none;
}

html[data-look="95"] .win img {
  border: 2px solid;
  border-color: #000 #fff #fff #000;
}

html[data-look="95"] .win-body {
  background: #fff;
  border: 2px solid;
  border-color: #000 #fff #fff #000;
  border-top: 0;
}

html[data-look="95"] .win-status {
  border-top: 0;
  background: none;
}

html[data-look="95"] .meter {
  border-color: #000 #fff #fff #000;
}

html[data-look="95"] .menubar-logo,
html[data-look="95"] .menubar-nav,
html[data-look="95"] .hero-hint,
html[data-look="95"] .looks {
  background: #c0c0c0;
  border-color: #fff #000 #000 #fff;
  box-shadow: 1px 1px 0 #000;
}

/* The skin picker. It stays with you down the page, the way a desktop
   accessory would, and the choice is remembered. */
.looks {
  position: fixed;
  left: 0.75rem;
  bottom: max(0.75rem, env(safe-area-inset-bottom));
  z-index: 150;
  display: flex;
  align-items: stretch;
  border: var(--edge);
  background: var(--paper);
  /* The thin paper ring keeps the picked skin readable over the dark footer. */
  box-shadow: 0 0 0 1px var(--paper), 3px 3px 0 var(--ink);
  font-family: var(--machine);
  font-size: 0.95rem;
  line-height: 1;
}

.looks[hidden] {
  display: none;
}

.looks-name {
  display: flex;
  align-items: center;
  padding: 0 0.7rem;
  color: var(--ink);
}

.looks button {
  padding: 0.5rem 0.7rem;
  border: 0;
  border-left: var(--edge);
  background: none;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}

.looks button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.looks button[aria-pressed="true"] {
  background: var(--ink);
  color: var(--paper);
}

html[data-look="95"] .looks button[aria-pressed="true"] {
  background: #000080;
  color: #fff;
}

/* The picker gets tighter on a narrow screen. */
@media (max-width: 59.99rem) {
  .looks {
    font-size: 0.85rem;
  }

  .looks-name,
  .looks button {
    padding-inline: 0.55rem;
  }
}
