@import url("./lib/scroll-director.css") layer(scroll-director);

body[data-page="index"] {
  --story-ink: #151613;
  --story-light: #f3f1e7;
  --story-accent: #d9f36c;
  --story-gutter: clamp(24px, 5.5vw, 112px);
  --story-header: 66px;
  --story-display: Georgia, "Times New Roman", serif;
  background: var(--story-ink);
}

[data-page="index"] .site-header {
  position: fixed;
  inset: 0 0 auto;
  height: var(--story-header);
  background: var(--story-ink);
  border-bottom-color: #ffffff24;
}

[data-page="index"] .header-inner {
  width: calc(100% - 2 * var(--story-gutter));
}

[data-page="index"] .brand,
[data-page="index"] .site-nav a {
  color: var(--story-light);
}

[data-page="index"] .brand svg rect { fill: var(--story-accent); }
[data-page="index"] .brand svg path { fill: var(--story-ink); }
[data-page="index"] .site-nav a:hover { color: var(--story-accent); }
[data-page="index"] .menu-toggle {
  background: transparent;
  border-color: #ffffff40;
  color: var(--story-light);
}

.scroll-story { --sd-background: var(--story-ink); }
.story-stage { background: var(--story-ink); }
.story-scene {
  color: var(--story-light);
  overflow: clip;
  scroll-margin-top: var(--story-header);
}
.story-scene:not(.sd-scene) { position: relative; }
.story-scene [data-sd-world] { position: absolute; inset: 0; }
.scroll-story:not([data-sd-reduced="false"]) .story-scene {
  min-height: max(630px, 85svh);
}
.story-scene h1,
.story-scene h2,
.home-setup h2 {
  font-family: var(--story-display);
  font-weight: 400;
  line-height: 0.93;
  letter-spacing: -0.067em;
  color: inherit;
}
.story-scene p { max-width: 32ch; }
.story-scene a { color: inherit; }
.story-scene a:hover { text-decoration-thickness: 2px; }

.story-opening { background: #282c25; }
.story-photo,
.story-shade {
  position: absolute;
  inset: 0;
}
.story-photo { inset: -8% -5% -14%; }
.story-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 62% 53%;
}
.story-shade {
  background: linear-gradient(0deg, #10120e 0%, #10120eb0 21%, transparent 61%),
    linear-gradient(90deg, #1417107a 0%, transparent 76%);
}
.story-opening-title,
.story-opening-copy {
  position: absolute;
  inset: auto auto clamp(110px, 17svh, 200px) var(--story-gutter);
}
.story-opening-title h1 { font-size: clamp(5.2rem, 10.45vw, 12rem); }
.story-opening-title h1 span { color: var(--story-accent); }
.story-opening-copy {
  left: auto;
  right: var(--story-gutter);
  width: clamp(220px, 23vw, 350px);
  bottom: clamp(104px, 17svh, 200px);
}
.story-opening-copy p {
  color: #dfdfd4;
  font-size: clamp(1rem, 1.4vw, 1.25rem);
}
.story-opening-copy a,
.story-layers-copy a,
.story-code-copy a {
  display: inline-block;
  margin-top: 22px;
  font-size: 0.9375rem;
  font-weight: 600;
  text-underline-offset: 5px;
}
.story-opening-copy a { color: var(--story-accent); }
.story-scene a span { margin-left: 5px; }

.story-layers { background: #1c1e19; }
.story-plates {
  position: absolute;
  inset: 24% 46% 19% var(--story-gutter);
  perspective: 1100px;
}
.story-plate-layer {
  position: absolute;
  inset: auto;
  width: 54%;
}
.plate-layer-far { left: 1%; top: 0; }
.plate-layer-mid { right: 1%; top: 23%; width: 58%; }
.plate-layer-near { left: 12%; top: 54%; }
.story-plates .story-plate-layer { transform-origin: center; }
.story-plate {
  margin: 0;
  padding: 6px 6px 0;
  background: #2a2d24;
  border: 1px solid #848578;
  box-shadow: 0 10px 18px #0a0b0940;
}
.story-plate img {
  height: clamp(105px, 20svh, 224px);
  width: 100%;
  object-fit: cover;
}
.story-plate figcaption {
  padding: 8px 4px 9px;
  font: 0.75rem/1.4 ui-monospace, SFMono-Regular, Consolas, monospace;
}
.plate-far { transform: rotate(-9deg); }
.plate-far img { object-position: 50% 0%; filter: brightness(1.24) contrast(.77); }
.plate-mid { transform: rotate(7deg); }
.plate-mid img { object-position: 62% 48%; }
.plate-mid figcaption { text-align: right; }
.plate-near { transform: rotate(-4deg); }
.plate-near img { object-position: 55% 95%; filter: contrast(1.12) brightness(.83); }
.story-layers-copy {
  position: absolute;
  inset: 29% var(--story-gutter) auto 57%;
}
.story-layers-copy h2,
.story-code-copy h2 { font-size: clamp(3.5rem, 6.5vw, 7.5rem); }
.story-layers-copy p,
.story-code-copy p {
  font-size: clamp(1rem, 1.4vw, 1.25rem);
  margin-top: 24px;
}
.story-layers-copy p { color: #c9cebd; }
.story-layers-copy a { color: var(--story-accent); }

.story-code {
  color: #181b11;
  background: var(--story-accent);
}
.story-code-copy {
  position: absolute;
  inset: 31% auto auto var(--story-gutter);
  width: 52%;
}
.story-code-copy p code { color: inherit; background: #18210013; }
.story-typed-layer {
  position: absolute;
  inset: 31% var(--story-gutter) auto auto;
  width: 34%;
}
.story-typed {
  border: 1px solid #242811;
  padding: clamp(14px, 2.3vw, 35px);
}
.story-typed p {
  font: 0.8125rem/1.5 ui-monospace, SFMono-Regular, Consolas, monospace;
  margin: 0 0 12px;
}
.story-typed pre {
  padding: 0;
  color: inherit;
  font-size: clamp(0.85rem, 1.55vw, 1.6rem);
  line-height: 1.65;
}
.story-typed pre span { font-weight: 700; }

.story-transport {
  position: absolute;
  inset: auto 0 0;
  z-index: 2;
  background: var(--story-ink);
  color: var(--story-light);
}
.scroll-story:not([data-sd-reduced="false"]) .story-transport { display: none; }
.story-progress {
  display: block;
  width: 100%;
  height: 2px;
  border: 0;
  appearance: none;
  background: #626653;
  color: var(--story-accent);
}
.story-progress::-webkit-progress-bar { background: #626653; }
.story-progress::-webkit-progress-value { background: var(--story-accent); }
.story-progress::-moz-progress-bar { background: var(--story-accent); }
.story-transport-inner {
  min-height: 54px;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  align-items: center;
  padding-inline: var(--story-gutter);
  font-size: 0.875rem;
}
.story-transport nav { display: flex; gap: clamp(12px, 2.3vw, 40px); }
.story-transport a { color: #c4c6b9; text-decoration: none; }
.story-transport a:hover { text-decoration: underline; }
.story-transport a[aria-current="step"] { color: var(--story-accent); }
.story-scroll-hint { color: #e0e3d2; white-space: nowrap; }
.story-scroll-hint [aria-hidden] { color: var(--story-accent); margin-left: 8px; }

.home-setup {
  background: var(--story-light);
  color: var(--story-ink);
  padding: clamp(55px, 9vw, 126px) 0;
  scroll-margin-top: var(--story-header);
}
.home-setup-inner {
  width: calc(100% - 2 * var(--story-gutter));
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.2fr);
  gap: clamp(32px, 6vw, 120px);
  align-items: start;
}
.home-setup h2 { font-size: clamp(3rem, 5.75vw, 6.5rem); margin-bottom: 26px; }
.home-setup-copy p { max-width: 33ch; margin-bottom: 14px; }
.home-install {
  display: flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  max-width: 100%;
  margin: 26px 0 16px;
  padding: 8px 10px;
  border: 1px solid #c4c2b5;
}
.home-install code { min-width: 0; overflow: auto; white-space: nowrap; font-size: 0.8125rem; }
.home-setup-links { display: flex; gap: 10px 24px; flex-wrap: wrap; font-size: .9375rem; }
.home-setup-links a { color: #354316; }
.home-setup .code-panel,
.home-setup .code-toolbar,
.home-setup .code-note {
  border-color: #ccc9bb;
  background: #eae7db;
}
.home-setup .code-toolbar { background: #e2dfd3; }
.home-setup .code-panel { border-radius: 2px; }
.home-setup pre,
.home-setup .code-note,
.home-setup .tabs button { color: #35382d; }
.home-setup .tabs button[aria-selected="true"] { color: #252d16; background: #f8f7ee; }
[data-page="index"] .site-footer { background: #e8e5d9; border-top-color: #ccc9bb; }
[data-page="index"] .footer-inner { width: calc(100% - 2 * var(--story-gutter)); }

@media (max-width: 880px) {
  .story-opening-title h1 { font-size: clamp(4.5rem, 11vw, 7rem); }
  .story-opening-title { bottom: 265px; }
  .story-opening-copy { left: var(--story-gutter); right: auto; bottom: 105px; width: min(100% - 2 * var(--story-gutter), 360px); }
  .story-plates { inset: 24% 46% 20% var(--story-gutter); }
  .story-layers-copy { left: 58%; }
  .story-plate figcaption { font-size: 0.625rem; }
  .story-layers-copy h2, .story-code-copy h2 { font-size: clamp(2.9rem, 7vw, 5rem); }
}

@media (max-width: 650px) {
  body[data-page="index"] { --story-header: 60px; }
  [data-page="index"] .site-nav[data-open="true"] {
    top: calc(var(--story-header) - 1px);
    background: var(--story-ink);
    border-color: #ffffff36;
  }
  .story-opening-title h1 { font-size: clamp(3.55rem, 12.3vw, 5.4rem); }
  .story-opening-title { bottom: 39%; }
  .story-opening-copy { bottom: 15%; }
  .story-opening-copy a, .story-layers-copy a, .story-code-copy a { margin-top: 13px; }
  .story-opening-copy p, .story-layers-copy p, .story-code-copy p { line-height: 1.5; }
  .story-photo img { object-position: 66% center; }
  .story-shade {
    background: linear-gradient(0deg, #10120e 0%, #10120ea3 42%, transparent 84%);
  }
  .story-plates { inset: 19% var(--story-gutter) 46%; }
  .story-plate { padding: 4px 4px 0; }
  .story-plate img { height: clamp(63px, 12svh, 112px); }
  .story-plate figcaption { padding: 4px; }
  .story-layers-copy { inset: auto var(--story-gutter) 12% var(--story-gutter); }
  .story-layers-copy p, .story-code-copy p { margin-top: 13px; }
  .story-layers-copy h2, .story-code-copy h2 { font-size: clamp(2.75rem, 10vw, 4.5rem); }
  .story-code-copy { inset: 18% var(--story-gutter) auto; width: auto; }
  .story-typed-layer { inset: auto var(--story-gutter) 13%; width: auto; }
  .story-typed { padding: 12px 15px; }
  .story-typed p { margin-bottom: 6px; }
  .story-typed pre { line-height: 1.45; }
  .story-transport-inner { min-height: 46px; font-size: .75rem; }
  .story-scroll-hint [aria-hidden] { margin-left: 1px; }
  .home-setup-inner { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 360px) {
  .story-scroll-hint { display: none; }
  .story-transport nav { width: 100%; justify-content: space-between; }
}

@media (max-height: 640px) and (max-width: 650px) {
  .story-opening-title { bottom: 43%; }
  .story-opening-title h1 { font-size: min(12vw, 4.5rem); }
  .story-plates { inset-block: 16% 54%; }
  .story-layers-copy h2, .story-code-copy h2 { font-size: 2.6rem; }
  .story-layers-copy { bottom: 11%; }
  .story-typed-layer { bottom: 11%; }
}

@media (max-height: 490px) and (min-width: 651px) {
  .story-opening-title, .story-opening-copy { bottom: 80px; }
  .story-opening-title h1 { font-size: clamp(4rem, 9vw, 5.3rem); }
  .story-opening-copy { left: auto; right: var(--story-gutter); width: 34%; }
  .story-layers-copy h2, .story-code-copy h2 { font-size: clamp(2.5rem, 6vw, 3.25rem); }
  .story-plates { inset-block: 29% 20%; }
  .story-plate img { height: 82px; }
  .story-typed pre { font-size: 0.875rem; }
  .story-layers-copy p, .story-code-copy p { margin-top: 12px; }
}
