/* Concept A, "Four strings". The home page is the instrument. */
:root {
  --night: #091610;
  --deep: #10251a;
  --moss: #b5c5a8;
  --light: #f1f0e5;
  --sun: #dfaf6e;
  --line: rgba(241, 240, 229, .16);

  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  --gutter: clamp(1rem, 4vw, 3.5rem);
  /* where the strings start: the nut */
  --nut: calc(var(--gutter) + 2rem);

  /* string heights inside the first screen (fractions of its height) */
  --y-g: 50%;
  --y-c: 62%;
  --y-e: 74%;
  --y-a: 86%;

  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--night);
  color: var(--light);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.55;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .2em; }
a:hover { color: var(--sun); }
:focus-visible { outline: 2px solid var(--sun); outline-offset: 3px; border-radius: 2px; }
button { font: inherit; color: inherit; }
h1, h2 { font-weight: inherit; margin: 0; }

.skip {
  position: absolute; left: var(--gutter); top: -4rem; z-index: 50;
  background: var(--light); color: var(--night); padding: .75rem 1rem;
}
.skip:focus { top: 1rem; }

/* ---------- the first screen ---------- */
.stage {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  height: 40rem;            /* floor so the strings keep their spacing on short screens */
  height: max(100svh, 38rem);
  overflow: hidden;
  isolation: isolate;
}
.stage canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  z-index: 0;
  touch-action: pan-y;
  cursor: crosshair;
}
.nut { position: absolute; left: var(--nut); top: 0; width: 0; height: 0; }

.topbar {
  position: absolute; z-index: 3;
  top: .5rem; right: var(--gutter);
  display: flex; gap: .25rem; align-items: center;
  font-size: .9375rem;
}
.topbar a, .topbar button {
  min-height: 2.75rem; padding: 0 .75rem;
  display: inline-flex; align-items: center;
  color: var(--moss);
}
.topbar button {
  background: none; border: 1px solid var(--line); border-radius: 999px; cursor: pointer;
}
.topbar button[aria-pressed="true"] { color: var(--sun); border-color: rgba(223, 175, 110, .5); }
.topbar a:hover, .topbar button:hover { color: var(--light); }

.masthead {
  position: absolute; z-index: 1;
  left: var(--gutter); right: var(--gutter);
  top: clamp(4rem, 12vh, 8rem);
  pointer-events: none;      /* a strum can pass over the name */
}
.masthead h1 {
  font-family: var(--serif);
  font-weight: 300;
  font-variation-settings: "opsz" 72;
  font-size: clamp(3.25rem, 1.2rem + 8.5vw, 11rem);
  line-height: .88;
  letter-spacing: -0.025em;
  color: var(--light);
}
.masthead p {
  margin: clamp(.75rem, 2vh, 1.5rem) 0 0;
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(1.2rem, 1rem + 1vw, 1.85rem);
  line-height: 1.25;
  color: var(--moss);
  max-width: 30ch;
  text-wrap: balance;
}

/* the four doors sit on their strings */
.doors { list-style: none; margin: 0; padding: 0; }
.door-btn {
  position: absolute; z-index: 2;
  left: var(--gutter);
  top: var(--y);
  transform: translateY(-50%);
  display: flex; align-items: center;
  min-height: 2.75rem;
  padding: 0;
  background: none; border: 0;
  cursor: pointer;
  text-align: left;
}
.door-btn .note {
  width: calc(var(--nut) - var(--gutter));
  font-size: 1rem; font-weight: 500;
  color: var(--moss);
}
.door-btn .word {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.375rem, 1.1rem + 1vw, 2.125rem);
  line-height: 1.1;
  padding: .1em .45em .18em;
  margin-left: .5rem;
  background: var(--night);   /* the string passes behind the word */
  color: var(--light);
  transition: color .2s;
}
.door-btn:hover .word,
.door-btn[aria-expanded="true"] .word { color: var(--sun); }
.door-btn[aria-expanded="true"] .note { color: var(--sun); }
.door-btn:focus-visible { outline: none; }
.door-btn:focus-visible .word { outline: 2px solid var(--sun); outline-offset: 2px; }

/* a door's panel: one still, one sentence, one link */
.panel {
  position: absolute; z-index: 4;
  right: var(--gutter);
  top: clamp(4rem, 12vh, 8rem);
  width: min(25rem, 38vw);
  background: var(--deep);
  border: 1px solid var(--line);
  box-shadow: 0 1.5rem 3rem rgba(0, 0, 0, .45);
}
.panel[hidden] { display: none; }
.panel img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.panel-text { padding: 1.25rem 1.5rem 1.5rem; }
.panel h2 {
  font-family: var(--serif);
  font-size: 1.75rem; line-height: 1.1;
  color: var(--sun);
}
.panel p { margin: .5rem 0 1rem; max-width: 34ch; }
.panel-link {
  display: inline-flex; align-items: center;
  min-height: 2.75rem; padding: 0 1.1rem;
  background: var(--light); color: var(--night);
  text-decoration: none; font-weight: 500;
  border-radius: 999px;
}
.panel-link:hover { background: var(--sun); color: var(--night); }
.panel .panel-alt { margin: 1rem 0 0; font-size: .9375rem; color: var(--moss); }
.panel .panel-alt a { display: inline-block; padding: .7rem 0; }
.close {
  position: absolute; top: .5rem; right: .5rem;
  min-height: 2.75rem; padding: 0 .9rem;
  background: rgba(9, 22, 16, .82); border: 0; border-radius: 999px;
  color: var(--light); font-size: .875rem; cursor: pointer;
}
.close:hover { color: var(--sun); }

@media (prefers-reduced-motion: no-preference) {
  .panel:not([hidden]) { animation: open .32s cubic-bezier(.2, .7, .2, 1); }
  @keyframes open { from { opacity: 0; transform: translateY(.5rem); } }
}

.status, .keys {
  position: absolute; z-index: 1;
  bottom: .75rem; margin: 0;
  font-size: .875rem; color: var(--moss);
  pointer-events: none;
}
.status { left: var(--gutter); }
.keys { right: var(--gutter); }
@media (hover: none) { .keys { display: none; } }

/* ---------- below the first screen: quiet ---------- */
.works {
  padding: clamp(4rem, 10vw, 7rem) var(--gutter) clamp(3rem, 8vw, 5rem);
  max-width: 72rem;
}
.works:focus { outline: none; }
.works > h2, .rooms h2 {
  font-family: var(--serif);
  font-size: clamp(1.75rem, 1.3rem + 1.5vw, 2.5rem);
  line-height: 1.1;
  margin-bottom: 1.5rem;
}
.index { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.index li { border-bottom: 1px solid var(--line); }
.index a {
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 15rem) minmax(0, 1fr);
  grid-template-areas: "img title line" "img kind line";
  column-gap: clamp(1rem, 3vw, 2.5rem);
  align-items: start;
  padding: 1.25rem 0;
  text-decoration: none;
}
.index img, .thumb-empty {
  grid-area: img;
  width: 7.5rem; aspect-ratio: 3 / 2; object-fit: cover;
}
.thumb-empty { height: 1px; }   /* no picture yet for this one; the column stays empty on purpose */
.index .title {
  grid-area: title;
  font-family: var(--serif); font-size: 1.5rem; line-height: 1.15;
}
.index .kind { grid-area: kind; font-size: .9375rem; color: var(--moss); margin-top: .25rem; }
.index .line {
  grid-area: line;
  font-family: var(--serif); font-style: italic; font-size: 1.125rem; line-height: 1.45;
  color: var(--light); max-width: 40ch;
}
.index a:hover .title { color: var(--sun); }

.rooms { margin-top: clamp(3rem, 7vw, 4.5rem); }
.rooms ul { list-style: none; margin: 0; padding: 0; }
.rooms li {
  display: grid; grid-template-columns: 7.5rem 1fr; column-gap: clamp(1rem, 3vw, 2.5rem);
  align-items: baseline; color: var(--moss);
}
.rooms a {
  font-family: var(--serif); font-size: 1.375rem; color: var(--light);
  min-height: 2.75rem; display: inline-flex; align-items: center;
}
.rooms a:hover { color: var(--sun); }

.foot {
  padding: clamp(3rem, 8vw, 5rem) var(--gutter) 2.5rem;
  border-top: 1px solid var(--line);
}
.foot .ask {
  font-family: var(--serif); font-weight: 300;
  font-size: clamp(1.75rem, 1.2rem + 2.2vw, 3rem); line-height: 1.15;
  max-width: 22ch; margin: 0 0 1.25rem;
}
.foot ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; column-gap: 1.75rem; }
.foot li a { display: inline-flex; align-items: center; min-height: 2.75rem; }
.foot .small { margin: 2.5rem 0 0; font-size: .875rem; color: var(--moss); }
.foot .small a { display: inline-block; padding: .7rem 0; margin-left: .5rem; }

/* ---------- small screens ---------- */
@media (max-width: 47.99rem) {
  :root {
    --y-g: 45%;
    --y-c: 57%;
    --y-e: 69%;
    --y-a: 81%;
  }
  .masthead { top: 3.75rem; }
  .masthead h1 { font-size: clamp(4.5rem, 1rem + 18vw, 7rem); }
  .status { bottom: .5rem; font-size: .8125rem; }
  .keys { display: none; }   /* no room beside the status line on a narrow window */
  .panel {
    position: fixed;
    left: 0; right: 0; bottom: 0; top: auto;
    width: auto;
    max-height: 78svh; overflow-y: auto;
    border-left: 0; border-right: 0; border-bottom: 0;
  }
  .panel img { aspect-ratio: 16 / 7; }
  .panel-text { padding: 1rem var(--gutter) 1.5rem; }
  .index a {
    grid-template-columns: 5.5rem minmax(0, 1fr);
    grid-template-areas: "img title" "img kind" "img line";
  }
  .index img, .thumb-empty { width: 5.5rem; }
  .index .line { margin-top: .5rem; font-size: 1rem; }
  .rooms li { grid-template-columns: 5.5rem 1fr; }
}
@media (max-width: 47.99rem) and (prefers-reduced-motion: no-preference) {
  .panel:not([hidden]) { animation-name: rise; }
  @keyframes rise { from { transform: translateY(1.5rem); opacity: 0; } }
}
