/* Mike Houston, carved in stone. One wall of ashlar; every block drawn live in WebGL2 by stone.js. */
:root {
  --mortar: #6f675c;
  --mortar-d: #4e4840;
  --joint: 6px;
  --gut: clamp(10px, 2.2vw, 30px);
  --ink: #2b2620;
  --ink-2: #5d544a;
  --paper: #d9cfbd;
  --cut: #8b7f6f;
  --gold: #b48a3c;
  --serif: "EB Garamond", "Iowan Old Style", Georgia, serif;
  --caps: "Cinzel", "Trajan Pro", "Times New Roman", serif;
}
* { box-sizing: border-box; }
html { background: #2a2723; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100%; color: var(--ink); font-family: var(--serif);
  background: #2a2723 radial-gradient(120% 60% at 50% 0%, #3a352f 0%, #2a2723 60%, #1e1c19 100%);
  -webkit-tap-highlight-color: transparent;
}
body.sheet-open { overflow: hidden; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }

/* ------------------------------------------------------------ the wall */
#wall {
  position: relative; margin: 0 auto; padding: var(--gut) var(--gut) calc(var(--gut) * 1.4);
  max-width: 1760px;
}
.masonry {
  position: relative; display: flex; flex-direction: column; gap: var(--joint);
  padding: var(--joint); border-radius: 2px;
  background-color: var(--mortar);
  background-image:
    radial-gradient(circle at 20% 30%, rgba(255,255,255,.05) 0 1px, transparent 1.5px),
    radial-gradient(circle at 70% 60%, rgba(0,0,0,.12) 0 1px, transparent 1.6px),
    radial-gradient(circle at 40% 80%, rgba(255,255,255,.04) 0 .8px, transparent 1.2px);
  background-size: 7px 7px, 11px 11px, 5px 5px;
  box-shadow: 0 30px 60px -30px rgba(0,0,0,.7), inset 0 0 0 1px rgba(0,0,0,.25);
}
.course { display: flex; gap: var(--joint); }
.block {
  position: relative; display: block; flex: 0 0 auto; color: inherit; text-decoration: none;
  background: #b8ad9b; outline: none; cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.18), 0 1px 0 rgba(255,255,255,.08);
}
.block canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.block .lbl, .block .pic { display: none; }
.nogl .block .lbl, .nogl .block .pic { display: block; }
.block .lbl { position: absolute; left: 0; right: 0; bottom: 6%; text-align: center; pointer-events: none; }
.block:focus-visible::after { content: ""; position: absolute; inset: 3px; border: 2px solid rgba(214,174,92,.9); pointer-events: none; }
.block.filler, .block.lintel, .block.plinth { cursor: default; }
.block.erased { cursor: default; }
.block.fish { cursor: pointer; }

/* stone buttons: small blocks of their own, letters cut in them */
.btn {
  position: relative; flex: 0 0 auto; padding: 0; border: 0; margin: 0; cursor: pointer;
  background: #6d6a66; color: transparent; font: 600 14px/1 var(--caps); letter-spacing: .12em;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.3), 0 2px 0 rgba(0,0,0,.35);
  transition: transform .12s ease, box-shadow .12s ease;
}
.btn canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.btn:active, .btn.down { transform: translateY(1px); box-shadow: inset 0 0 0 1px rgba(0,0,0,.35), 0 1px 0 rgba(0,0,0,.35); }
.btn:focus-visible { outline: 2px solid rgba(214,174,92,.9); outline-offset: 2px; }
.btn .t { position: absolute; inset: 0; display: grid; place-items: center; color: transparent; }
.nogl .btn .t { color: #efe7d9; }
.lintel-row { display: flex; gap: var(--joint); }
.controls { display: flex; flex-direction: column; gap: var(--joint); flex: 0 0 auto; }
.controls .btn { flex: 1 1 0; }

/* the sky over the wall: snow and rain fall here, nothing else */
#sky { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 5; display: none; }
#sky.on { display: block; }

/* ------------------------------------------------------------ sheets: a project, the index, about */
.sheet {
  position: fixed; inset: 0; z-index: 10; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain; background: #2a2723; opacity: 0; transition: opacity .35s ease;
}
.sheet.in { opacity: 1; }
.sheet[hidden] { display: none; }
.sheet:focus { outline: none; }
.slab {
  position: relative; margin: 0 auto; max-width: 1240px; min-height: 100%;
  padding: clamp(14px, 3vw, 40px) clamp(14px, 4vw, 56px) 64px;
  background-color: #cdc3b1; background-size: 640px 640px;
  box-shadow: 0 0 0 1px rgba(0,0,0,.35), 0 40px 80px rgba(0,0,0,.5);
}
.slab.slate { background-color: #4a4f53; color: #e9e4da; }
.slab-top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; margin-bottom: clamp(12px, 2vw, 22px); }
.slab-top .nav { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.slab-top .btn { width: 108px; height: 44px; }
.hero { position: relative; width: 100%; margin: 0 0 clamp(18px, 3vw, 34px); background: #b8ad9b; }
.hero canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.lede { max-width: 46em; margin: 0 auto 8px; font-size: clamp(19px, 1.6vw, 23px); line-height: 1.5; color: var(--ink); text-wrap: pretty; }
.sec { margin: clamp(28px, 4vw, 52px) 0 0; }
.sec h3 {
  margin: 0 auto 12px; max-width: 46em; font: 600 clamp(14px, 1.15vw, 16px)/1.3 var(--caps); letter-spacing: .14em;
  color: #4a4238; text-shadow: 0 1px 0 rgba(255,255,255,.35), 0 -1px 0 rgba(0,0,0,.25);
}
.sec p { max-width: 46em; margin: 0 auto 16px; font-size: clamp(17px, 1.3vw, 19px); line-height: 1.5; color: var(--ink-2); }
.sunk {
  position: relative; background: #1b1916; padding: 0; margin: 0;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.6), 0 0 0 clamp(4px, .6vw, 7px) #b5aa98, 0 0 0 calc(clamp(4px, .6vw, 7px) + 1px) rgba(0,0,0,.35),
              inset 0 2px 0 rgba(255,255,255,.06), 0 1px 0 calc(clamp(4px, .6vw, 7px) + 1px) rgba(255,255,255,.25);
}
.films { display: grid; gap: clamp(18px, 2.4vw, 30px); grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); max-width: 1100px; margin: 0 auto; padding: 8px; }
.films.one { grid-template-columns: 1fr; }
.films.tall { grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); max-width: 980px; }
.film { position: relative; aspect-ratio: 16 / 9; overflow: hidden; }
.films.tall .film { aspect-ratio: 9 / 16; }
.film img { width: 100%; height: 100%; object-fit: cover; display: block; }
.film iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.film button.play {
  position: absolute; inset: 0; width: 100%; height: 100%; border: 0; padding: 0; background: transparent; cursor: pointer;
}
.film button.play i {
  position: absolute; left: 50%; top: 50%; width: 74px; height: 74px; margin: -37px 0 0 -37px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #d8cfbf, #a89c88 60%, #7d7262);
  box-shadow: 0 6px 16px rgba(0,0,0,.45), inset 0 -3px 6px rgba(0,0,0,.25), inset 0 2px 2px rgba(255,255,255,.5);
}
.film button.play i::after {
  content: ""; position: absolute; left: 30px; top: 23px; border-style: solid; border-width: 14px 0 14px 22px;
  border-color: transparent transparent transparent #4a4238; filter: drop-shadow(0 1px 0 rgba(255,255,255,.5));
}
.film .cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 10px 12px; font: 500 15px/1.2 var(--serif); color: #f3ede2; background: linear-gradient(transparent, rgba(0,0,0,.65)); pointer-events: none; }
.film.live .cap, .film.live button.play { display: none; }
.pics { display: grid; gap: clamp(14px, 2vw, 24px); max-width: 1100px; margin: 18px auto 0; padding: 8px; }
.pics.row-2 { grid-template-columns: repeat(2, 1fr); }
.pics.row-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 640px) { .pics.row-3, .pics.row-2 { grid-template-columns: 1fr 1fr; } }
.pics img { width: 100%; height: auto; display: block; background: #1b1916; }
.radio { list-style: none; max-width: 46em; margin: 14px auto 0; padding: 0; display: grid; gap: 10px; }
.radio button {
  display: flex; align-items: center; gap: 14px; width: 100%; padding: 10px 14px 10px 10px; border: 0; text-align: left; cursor: pointer;
  font: 500 18px/1.25 var(--serif); color: var(--ink); background: #c3b8a5;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.18), inset 0 2px 3px rgba(0,0,0,.18), 0 1px 0 rgba(255,255,255,.4);
}
.radio button i { flex: 0 0 34px; height: 34px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #d8cfbf, #8f8471); box-shadow: 0 2px 4px rgba(0,0,0,.35); position: relative; }
.radio button i::after { content: ""; position: absolute; left: 13px; top: 10px; border-style: solid; border-width: 7px 0 7px 11px; border-color: transparent transparent transparent #4a4238; }
.radio button.on i::after { left: 11px; top: 11px; width: 12px; height: 12px; border: 0; background: linear-gradient(90deg, #4a4238 0 4px, transparent 4px 8px, #4a4238 8px 12px); }
.radio button .bar { flex: 1 1 auto; height: 3px; background: rgba(0,0,0,.12); position: relative; min-width: 40px; }
.radio button .bar b { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--gold); }
.credits { max-width: 46em; margin: clamp(34px, 5vw, 60px) auto 0; padding-top: 18px; border-top: 1px solid rgba(0,0,0,.2); box-shadow: 0 1px 0 rgba(255,255,255,.3) inset; }
.credits dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0; font-size: 17px; line-height: 1.4; }
.credits dt { font: 600 13px/1.7 var(--caps); letter-spacing: .12em; color: #5d544a; }
.credits dd { margin: 0; color: var(--ink); }
.next { display: flex; justify-content: center; gap: 12px; margin: 44px auto 0; flex-wrap: wrap; }
.next .btn { width: min(100%, 340px); height: 64px; }

/* index: the names cut in a slate tablet */
.tablet { position: relative; width: 100%; margin: 0 auto; background: #4a4f53; }
.tablet canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.tablet a { position: absolute; display: block; color: transparent; text-decoration: none; outline: none; }
.tablet a:focus-visible { box-shadow: inset 0 0 0 2px rgba(214,174,92,.9); }
.nogl .tablet a { color: #ece6da; font: 600 clamp(14px, 1.8vw, 20px)/1 var(--caps); letter-spacing: .08em; display: flex; align-items: center; justify-content: center; }

/* about */
.about-body { max-width: 40em; margin: 0 auto; font-size: clamp(18px, 1.4vw, 21px); line-height: 1.55; }
.about-body .role { font: 600 clamp(15px, 1.2vw, 17px)/1.4 var(--caps); letter-spacing: .14em; color: #4a4238; margin: 0 0 14px; }
.about-body ol { list-style: none; padding: 0; margin: 26px 0 0; display: grid; gap: 16px; }
.about-body li b { display: block; font: 600 14px/1.5 var(--caps); letter-spacing: .12em; color: #4a4238; }
.about-body li span { color: var(--ink-2); }
.about-body a { color: #3d3328; text-decoration-thickness: 1px; text-underline-offset: 3px; }

/* no WebGL: the reliefs as lit photographs of the carving, the words as type */
.nogl .block { background-size: cover; background-position: center; }
.nogl .block .lbl { color: #2b2620; font: 600 clamp(11px, 1.3vw, 18px)/1.2 var(--caps); letter-spacing: .1em; text-shadow: 0 1px 0 rgba(255,255,255,.5); }
.nogl .block .lbl small { display: block; font-size: .7em; opacity: .8; margin-top: 2px; }
.nogl .block .pic { position: absolute; left: 4.5%; right: 4.5%; top: 5%; bottom: 24%; background-size: cover; background-position: center; box-shadow: inset 0 0 0 1px rgba(0,0,0,.3), inset 0 3px 8px rgba(0,0,0,.4); }
.nogl .block.lintel .lbl { top: 0; bottom: 0; display: grid; place-items: center; font-size: clamp(30px, 7vw, 110px); letter-spacing: .12em; }

body.booting #wall { visibility: hidden; }
@media (max-width: 640px) { :root { --joint: 4px; } .slab-top .btn { width: 88px; height: 40px; } }
@media (prefers-reduced-motion: reduce) { .sheet { transition: none; } }
