/* The landing page: five acts, each a screen tall, over a scene that is drawn behind the whole page and follows the
   scroll. The words keep to the left, where the cut is; the tree stands to the right. */
html { scroll-behavior: smooth; }
/* --edge: where the edge of the slanted band meets the top of the window. From there it runs down and to the left
   along the cut, so it passes to the right of the wordmark, and the words, which start just short of --edge, are
   never crossed by it. */
body { height: auto; min-height: 100%; overflow-x: hidden; --edge: max(174px, 4vw + 50vh * tan(var(--cut))); background: radial-gradient(1200px 640px at 78% 108%, #0e1613 0%, var(--bg) 62%) fixed; }

#scene { position: fixed; inset: 0; z-index: 0; width: 100%; height: 100%; pointer-events: none; }

.top { position: fixed; z-index: 3; inset: 0 0 auto; display: flex; align-items: center; justify-content: space-between; height: 64px; padding: 0 34px; }
.top .wm { font-size: 23px; }
.enter { padding: 6px 18px; border: 1px solid var(--line); border-radius: 99px; font-size: 13.5px; letter-spacing: .08em; color: var(--ink-dim); transition: color .25s var(--ease), border-color .25s var(--ease); }
.enter:hover { color: var(--ink); border-color: var(--jade-deep); }

/* what comes from elsewhere comes down the cut: the band slides in and stops on the seam, is brighter while the
   scions fly, and is gone at the end, where the tree stands in the middle */
.band {
  position: fixed; z-index: 1; top: 0; height: 160vh; left: calc(var(--edge) - 100vw); width: 100vw; pointer-events: none; transform-origin: 100% 0;
  background: linear-gradient(100deg, rgba(229,138,107,0) 45%, rgba(229,138,107,.11)); border-right: 1px solid rgba(227,189,114,.6);
  box-shadow: 0 0 80px rgba(227,189,114,.16); transform: skewX(calc(var(--cut) * -1)); animation: dock 1.6s var(--ease) backwards;
  transition: box-shadow 1s var(--ease), border-color 1s var(--ease), opacity 1s var(--ease);
}
body[data-act="2"] .band { border-right-color: var(--seam); box-shadow: 0 0 130px rgba(227,189,114,.36); }
body[data-act="5"] .band { opacity: 0; }
/* the side the words stand on is a little darker than the scene behind them, so a tree in the mist never reads as
   part of a line; gone in the last act, where the words are in the middle */
body::after {
  content: ""; position: fixed; z-index: 0; inset: 0; pointer-events: none; transition: opacity 1.1s var(--ease);
  background: linear-gradient(90deg, rgba(6,10,9,.66) 0%, rgba(6,10,9,.46) 30%, rgba(6,10,9,0) 56%);
}
body[data-act="5"]::after { opacity: 0; }
/* a clause that is not broken in the middle where the line is short */
.act p .hold { display: inline-block; }
@keyframes dock {
  from { opacity: 0; transform: translate(37px, -114px) skewX(calc(var(--cut) * -1)); }
  to { opacity: 1; transform: skewX(calc(var(--cut) * -1)); }
}

/* ---------- the acts ---------- */
main { position: relative; z-index: 1; }
.act { position: relative; display: grid; align-content: center; justify-items: start; min-height: 100vh; padding: 96px 34px 80px calc(var(--edge) - 8px); }
/* what an act says comes up into place when the act is reached, one line after another */
.act > * { max-width: min(540px, 40vw); opacity: 0; transform: translateY(20px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.act.in > * { opacity: 1; transform: none; }
.act.in > :nth-child(2) { transition-delay: .09s; }
.act.in > :nth-child(3) { transition-delay: .18s; }
.act.in > :nth-child(4) { transition-delay: .27s; }
.act.in > :nth-child(5) { transition-delay: .36s; }

.no { font-size: 13px; letter-spacing: .32em; color: var(--seam); }
.no::before {
  content: ""; display: inline-block; width: 1px; height: 22px; margin-right: 16px; vertical-align: -6px;
  background: var(--seam); transform: rotate(var(--cut)); box-shadow: 0 0 10px rgba(227,189,114,.55);
}
.act h1 { max-width: none; margin: 0; font: 400 clamp(38px, 5.2vw, 82px)/1.26 var(--serif); letter-spacing: .08em; white-space: nowrap; }
.act h1 span { display: block; }
.act h1 span:first-child { padding-left: .42em; }   /* the two lines stand along the cut */
.act em { font-style: normal; }
.from { color: var(--scion); }
.mine { color: var(--jade); }
.act h2 { margin: 16px 0 0; font: 400 clamp(52px, 6.6vw, 104px)/1.12 var(--serif); letter-spacing: .2em; white-space: nowrap; }
.act p { margin: 24px 0 0; font-size: clamp(15px, 1.2vw, 17.5px); line-height: 1.95; letter-spacing: .05em; color: var(--ink-dim); }
.hero p { margin-top: 30px; }
.cta { margin-top: 40px; }
.go { height: 50px; padding: 0 32px 0 38px; font-size: 16px; letter-spacing: .34em; }
.go::after { content: "\2192"; letter-spacing: 0; transition: transform .3s var(--ease); }
.go:hover::after { transform: translateX(4px); }

/* there is more below */
.down { position: absolute; left: calc(var(--edge) - 8px); bottom: 30px; width: 1px; height: 56px; background: var(--line); overflow: hidden; }
.down::after { content: ""; position: absolute; left: 0; top: -45%; width: 1px; height: 45%; background: var(--seam); animation: fall 2.4s var(--ease) infinite; }
@keyframes fall { to { top: 100%; } }

.names { display: flex; flex-wrap: wrap; gap: 8px; margin: 28px 0 0; padding: 0; list-style: none; }
.names li { padding: 3px 13px; border: 1px solid var(--line); border-radius: 99px; font-size: 13px; letter-spacing: .14em; color: var(--ink-dim); background: rgba(6,8,7,.55); }
.venues li { border-color: rgba(229,138,107,.3); color: #dfae9e; letter-spacing: .06em; }

.act .figures { display: flex; align-items: baseline; gap: 10px; margin-top: 30px; font-size: 14px; letter-spacing: .24em; color: var(--ink-faint); }
.figures b { font: 400 clamp(46px, 5vw, 76px)/1 var(--serif); letter-spacing: .01em; color: var(--ink); font-variant-numeric: tabular-nums; }
.figures i { align-self: center; width: 1px; height: 46px; margin: 0 16px 0 8px; background: var(--seam); transform: rotate(var(--cut)); box-shadow: 0 0 10px rgba(227,189,114,.55); }

/* one idea, as the app shows it: where it was cut from, in the colour of what comes from elsewhere, ending on the
   slanted cut with the seam in gold; then what it is, and how it was marked */
.act .specimen {
  position: relative; display: grid; grid-template-columns: minmax(0, 36%) minmax(0, 1fr) 58px; width: min(600px, 44vw); max-width: none; margin-top: 34px;
  background: rgba(12,15,14,.86); border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
}
.sp-from { position: relative; z-index: 0; display: flex; flex-direction: column; justify-content: center; gap: 7px; min-width: 0; padding: 18px 32px 18px 20px; }
.sp-from::before {
  content: ""; position: absolute; z-index: -1; top: -1px; bottom: -1px; left: -70px; right: 0;
  background: linear-gradient(100deg, rgba(229,138,107,.2), rgba(229,138,107,.07)); border-right: 1px solid var(--seam);
  box-shadow: 8px 0 26px -10px rgba(227,189,114,.6); transform: skewX(calc(var(--cut) * -1));
}
.sp-venue { font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--scion); }
.sp-paper { font-size: 12.5px; line-height: 1.55; color: var(--ink-dim); }
.sp-idea { display: flex; flex-direction: column; justify-content: center; gap: 8px; min-width: 0; padding: 18px 16px 18px 46px; }
.sp-area { font-size: 12px; letter-spacing: .1em; color: var(--ink-faint); }
.sp-idea h3 { margin: 0; font-size: 15.5px; font-weight: 500; line-height: 1.6; letter-spacing: .01em; }
.sp-bars { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 6px 0 0; }
.sp-bars div { display: grid; gap: 5px; }
.sp-bars dt { font-size: 11px; letter-spacing: .16em; color: var(--ink-faint); }
.sp-bars dd { position: relative; height: 2px; margin: 0; background: var(--line); }
.sp-bars dd::after { content: ""; position: absolute; inset: 0 auto 0 0; width: calc(var(--v) * 20%); background: var(--jade); transition: width 1.2s var(--ease) .6s; }
.act:not(.in) .sp-bars dd::after { width: 0; }
.sp-tier { display: grid; place-items: center; border-left: 1px solid var(--line-soft); font: 400 32px/1 var(--serif); color: var(--a); }

/* the works that come nearest, as the check reports them: how near, and where they stop short */
.closest { display: grid; gap: 10px; margin: 30px 0 0; padding: 0; list-style: none; width: min(560px, 42vw); max-width: none; }
.closest li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px; align-items: baseline; padding: 11px 16px; border: 1px solid var(--line); border-left: 2px solid var(--jade-deep); border-radius: 10px; background: rgba(12,15,14,.72); }
.closest b { font-size: 11.5px; font-weight: 400; letter-spacing: .16em; white-space: nowrap; }
.cl-part { color: var(--jade); }
.cl-rel { color: var(--ink-faint); }
.act .cl-note { margin-top: 12px; font-size: 12px; letter-spacing: .1em; color: var(--ink-faint); }
.closest span { font-size: 13.5px; line-height: 1.75; color: var(--ink-dim); }

/* the last act: the tree in the middle, the words under it */
.act.end { align-content: end; justify-items: center; padding: 96px 34px 12vh; text-align: center; }
.act.end > * { max-width: none; }
.act.end h2 { margin: 0; font-size: clamp(34px, 4.2vw, 64px); letter-spacing: .2em; text-indent: .2em; }
.act.end .cta { margin-top: 34px; }

/* where the page is in the telling: five marks at the side, each at the slant of the cut */
.rail { position: fixed; z-index: 3; right: 24px; top: 50%; display: grid; gap: 12px; transform: translateY(-50%); }
.rail button { width: 26px; height: 16px; padding: 0; border: 0; background: none; cursor: pointer; }
.rail button::before {
  content: ""; display: block; width: 1px; height: 14px; margin: 0 auto; background: var(--ink-faint); transform: rotate(var(--cut));
  transition: background .4s var(--ease), box-shadow .4s var(--ease), transform .4s var(--ease);
}
.rail button:hover::before { background: var(--ink); }
.rail button.on::before { background: var(--seam); box-shadow: 0 0 10px rgba(227,189,114,.7); transform: rotate(var(--cut)) scaleY(1.7); }

/* A narrow window, or one that stands upright: the tree above, the words under it. The scene asks the same question
   in the same words (story.js). */
@media (max-width: 1000px), (orientation: portrait) {
  .band, .down { display: none; }
  body::after { display: none; }
  /* the scene is gone before the words begin, whatever it is showing */
  #scene { -webkit-mask-image: linear-gradient(#000 42%, transparent 56%); mask-image: linear-gradient(#000 42%, transparent 56%); }
  .act { align-content: end; justify-items: center; min-height: 100vh; padding: 54vh 22px 8vh; text-align: center; }
  .act > * { max-width: 560px; }
  .act h1 { font-size: clamp(30px, 8.6vw, 60px); white-space: normal; }
  .act h1 span:first-child { padding-left: 0; }
  .act h2 { margin-top: 10px; font-size: clamp(40px, 11vw, 72px); text-indent: .2em; }
  .act p { margin-top: 16px; }
  .names, .act .figures, .act .specimen, .closest { margin-top: 22px; }
  .closest { width: min(560px, 100%); text-align: left; }
  .act h1, .act h2, .act p { text-shadow: 0 0 22px var(--bg), 0 0 8px var(--bg); }
  .no::before { display: none; }
  .names, .act .figures { justify-content: center; }
  .act .specimen { grid-template-columns: minmax(0, 1fr) 52px; width: min(560px, 100%); text-align: left; }
  .sp-from { grid-column: 1 / -1; padding: 14px 18px; border-bottom: 1px solid var(--seam); background: linear-gradient(100deg, rgba(229,138,107,.2), rgba(229,138,107,.07)); }
  .sp-from::before { display: none; }
  .sp-idea { padding: 16px 14px 16px 18px; }
  .act.end { padding: 54vh 22px 10vh; }
  /* the last line is too long for an upright window in one piece: its two halves stand one over the other,
     as the two lines of the first screen do */
  .act.end h2 { line-height: 1.4; text-indent: 0; white-space: normal; }
  .act.end h2 span { display: block; padding-left: .2em; }


  .top { padding: 0 16px; }
  .rail { right: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
