/* ScriptKitty site. Light paper, one accent taken from the pixel cat's ears (#8A2A78), dark terminal.
   Fonts are in fonts.css (inline woff2, OFL). No outside requests. */
:root {
  --paper: #FBF7F2; --paper2: #F4EDE6; --ink: #1B1530; --muted: #5D5470; --rule: #E5DAD8;
  --accent: #8A2A78; --term: #150B26; --term2: #1F1136; --tt: #EDE4F7; --tdim: #8C7FA8; --tpink: #FF4FD8; --tok: #3FD6C8;
  --sans: "Lato", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Plex Mono", ui-monospace, "DejaVu Sans Mono", Menlo, Consolas, monospace;
  --pixel: "Silkscreen", var(--mono);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 18px/1.65 var(--sans); }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
img.px, .px { image-rendering: pixelated; image-rendering: crisp-edges; }
.wrap { max-width: 72rem; margin: 0 auto; padding: 0 24px; }

/* header */
header.top { border-bottom: 1px solid var(--rule); }
header.top .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 28px; padding-top: 16px; padding-bottom: 16px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 900; font-size: 20px; letter-spacing: -.01em; margin-right: auto; }
.brand img { width: 32px; height: 32px; }
nav.pages { display: flex; flex-wrap: wrap; gap: 4px 22px; font-size: 15.5px; }
nav.pages a { color: var(--muted); text-decoration: none; }
nav.pages a:hover { color: var(--ink); }
nav.pages a[aria-current="page"] { color: var(--ink); font-weight: 700; }

/* type */
h1, h2, h3 { font-weight: 900; letter-spacing: -.015em; color: var(--ink); }
h1 { font-size: clamp(2.3rem, 5vw, 3.9rem); line-height: 1.06; margin: 0 0 20px; }
h2 { font-size: 1.55rem; line-height: 1.2; margin: 0 0 12px; }
h3 { font-size: 1.1rem; margin: 1.6em 0 .3em; font-weight: 700; }
p, ul, ol { margin: 0 0 1em; }
li { margin: .3em 0; }
.lead { font-size: 1.25rem; line-height: 1.55; color: var(--muted); max-width: 40rem; }
.kicker { font-family: var(--pixel); font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); margin: 0 0 14px; display: block; }
code { font-family: var(--mono); font-size: .86em; background: var(--paper2); border: 1px solid var(--rule); padding: 0 5px; border-radius: 4px; }
pre { font-family: var(--mono); font-size: 14.5px; line-height: 1.6; background: var(--term); color: var(--tt); padding: 18px 20px; border-radius: 10px; overflow-x: auto; margin: 0 0 1.4em; }
pre code { background: none; border: 0; padding: 0; font-size: inherit; color: inherit; }
small { color: var(--muted); }

/* page head (inner pages) */
.pagehead { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 32px; align-items: end; padding: 64px 0 40px; border-bottom: 1px solid var(--rule); }
.pagehead h1 { font-size: clamp(2.1rem, 4.4vw, 3.3rem); }
.pagehead .lead { margin: 0; }
.pagehead img { width: 140px; height: auto; }

/* sections: heading in the left column, text in the right */
section.row { display: grid; grid-template-columns: 17rem minmax(0, 44rem); gap: 0 56px; padding: 44px 0; border-bottom: 1px solid var(--rule); }
section.row:last-of-type { border-bottom: 0; }
section.row > .rh h2 { position: sticky; top: 24px; }
section.row > .rh h2::before { content: ""; display: block; width: 50px; height: 30px; margin-bottom: 14px; background: url(img/mark.png) no-repeat left top / 50px 30px; image-rendering: pixelated; }
section.row > .rb > :last-child { margin-bottom: 0; }

/* tables */
.scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; margin: 0 0 1.2em; font-size: 16px; }
th, td { text-align: left; vertical-align: top; padding: 10px 12px 10px 0; border-bottom: 1px solid var(--rule); }
th { font-family: var(--pixel); font-weight: 400; font-size: 12px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }

/* status words: plain, with a pixel square */
.tag { font-family: var(--pixel); font-size: 12px; letter-spacing: .05em; text-transform: uppercase; white-space: nowrap; color: var(--ink); }
.tag::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 7px; vertical-align: 1px; background: var(--muted); }
.t-ok::before { background: #1E7A78; } .t-test::before { background: #C7683C; } .t-no::before { background: var(--accent); }

.note { border-left: 3px solid var(--accent); background: var(--paper2); padding: 14px 18px; margin: 0 0 1.4em; border-radius: 0 8px 8px 0; }
.note > :last-child { margin-bottom: 0; }
.next { font-size: 16px; color: var(--muted); }
figure { margin: 0; }
svg { max-width: 100%; height: auto; }

/* ---------------- front page ---------------- */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 56px; align-items: center; padding-top: 72px; padding-bottom: 80px; }
.hero .lead { margin-bottom: 28px; }
.cta { display: flex; flex-wrap: wrap; gap: 12px 22px; align-items: center; font-size: 16.5px; }
.cta code { font-size: 15px; background: var(--term); color: var(--tt); border: 0; padding: 9px 14px; border-radius: 8px; }
.cta a { font-weight: 700; text-decoration: none; }
.cta a:hover { text-decoration: underline; }

.term { position: relative; margin-top: 70px; }
.term .cat { position: absolute; right: 26px; bottom: 100%; width: 170px; height: 135px; }
.term .cat img { position: absolute; right: 0; bottom: -2px; }
.term .cat .asleep { width: 170px; height: 80px; }
.term .cat .up { width: 140px; height: 135px; opacity: 0; }
.screen { background: var(--term); color: var(--tt); border-radius: 12px; font: 14.5px/1.75 var(--mono); padding: 0 0 18px; box-shadow: 0 1px 0 rgba(27,21,48,.04), 0 24px 48px -24px rgba(27,21,48,.45); overflow: hidden; }
.screen .bar { font-family: var(--pixel); font-size: 11px; letter-spacing: .06em; color: var(--tdim); padding: 10px 18px; background: var(--term2); margin-bottom: 14px; }
.screen .ln { padding: 0 18px; white-space: pre; overflow: hidden; }
.screen .who { color: var(--tdim); }
.screen .agent { color: var(--tpink); }
.screen .you { color: var(--tok); }
.screen .ok { color: var(--tok); font-weight: 700; }
.screen .dim { color: var(--tdim); }
.screen .gone { color: var(--tdim); text-decoration: line-through; }

/* the scene plays once: lines appear in turn, the cat wakes at the rm and settles after the go-back */
@media (prefers-reduced-motion: no-preference) {
  .screen .ln { opacity: 0; animation: show .01s linear forwards; animation-delay: var(--t); }
  .screen .type { display: inline-block; vertical-align: bottom; overflow: hidden; width: 0; animation: type .9s steps(var(--n)) forwards; animation-delay: var(--t); }
  .term .cat .asleep { animation: wake 9.4s steps(1) 0s forwards; }
  .term .cat .up { animation: wake-up 9.4s steps(1) 0s forwards; }
}
@media (prefers-reduced-motion: reduce) { .screen .type { width: auto; } }
@keyframes show { to { opacity: 1; } }
@keyframes type { to { width: calc(var(--n) * 1ch); } }
@keyframes wake { 0% { opacity: 1; } 33% { opacity: 0; } 100% { opacity: 1; } }
@keyframes wake-up { 0% { opacity: 0; } 33% { opacity: 1; } 100% { opacity: 0; } }

.story { background: var(--term); color: var(--tt); }
.story .wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px 72px; padding-top: 80px; padding-bottom: 80px; }
.story .kicker { color: var(--tpink); }
.story h2 { color: var(--tt); font-size: clamp(1.8rem, 3.4vw, 2.6rem); line-height: 1.12; margin-bottom: 18px; }
.story p { color: #C9BEDD; }
.story .big { font-weight: 900; color: var(--tt); }
.story a { color: var(--tpink); }
.story .wide { grid-column: 1 / -1; border-top: 1px solid #2B1A4A; padding-top: 28px; font-size: 16px; color: var(--tdim); max-width: 52rem; }

.trio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 48px; padding: 80px 0 64px; }
.trio h2 { font-size: 1.3rem; }
.trio h2::before { content: ""; display: block; width: 50px; height: 30px; margin-bottom: 16px; background: url(img/mark.png) no-repeat left top / 50px 30px; image-rendering: pixelated; }
.trio p { color: var(--muted); font-size: 17px; }

.split { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 56px; align-items: center; padding: 64px 0; border-top: 1px solid var(--rule); }
.split.flip { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); }
.split img.room { width: 100%; height: auto; display: block; border-radius: 10px; }
.split figcaption { font-size: 14.5px; color: var(--muted); margin-top: 10px; }

/* footer: the room at night */
footer.bottom { background: var(--term); color: #C9BEDD; margin-top: 40px; }
footer.bottom .band { height: 200px; background: url(img/room-night.png) center 38% / 960px auto no-repeat var(--term); image-rendering: pixelated; border-bottom: 1px solid #2B1A4A; }
footer.bottom .wrap { padding-top: 26px; padding-bottom: 32px; display: flex; flex-wrap: wrap; gap: 8px 32px; justify-content: space-between; font-size: 15.5px; }
footer.bottom p { margin: 0; }
footer.bottom .price { color: var(--tt); font-weight: 700; }

@media (max-width: 900px) {
  .hero, .story .wrap, .split, .split.flip { grid-template-columns: minmax(0, 1fr); }
  .hero { padding-top: 40px; padding-bottom: 56px; gap: 24px; }
  .trio { grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 56px 0 32px; }
  section.row { grid-template-columns: minmax(0, 1fr); padding: 32px 0; }
  section.row > .rh h2 { position: static; }
  .split .media { order: -1; }
}
@media (max-width: 560px) {
  body { font-size: 17px; }
  .wrap { padding-left: 16px; padding-right: 16px; }
  .pagehead { grid-template-columns: minmax(0, 1fr); padding: 36px 0 28px; }
  .pagehead img { width: 96px; order: -1; }
  .screen { font-size: 12px; }
  .screen .ln, .screen .bar { padding-left: 12px; padding-right: 12px; }
  .term .cat { right: 12px; transform: scale(.7); transform-origin: right bottom; }
  .story .wrap { padding-top: 56px; padding-bottom: 56px; }
  footer.bottom .band { height: 140px; background-size: 720px auto; }
  th, td { padding-right: 8px; }
}

/* the scene's timing, line by line (seconds from load; n = characters typed) */
.d1 { --t: .3s; --n: 2; } .d2 { --t: 1.2s; } .d3 { --t: 1.8s; --n: 21; } .d4 { --t: 3.3s; --n: 2; } .d5 { --t: 3.9s; }
.d6 { --t: 4.9s; --n: 11; } .d7 { --t: 6.2s; } .d8 { --t: 6.9s; --n: 2; } .d9 { --t: 7.6s; }
.story code { background: var(--term2); border-color: #2B1A4A; color: var(--tt); }
.split pre { font-size: 13.5px; white-space: pre-wrap; word-break: break-word; }
