/* am-i.pet /1/  Terry, by Nikolai.  One picture that stays, the words
   pass under it, and the day comes with the last paragraph. */
:root {
  --bg: #06082e; --text: #ece6d8; --dim: #8f93ad; --line: #f2c14e;
  --display: "Caprasimo", "Cooper Black", Georgia, serif;
  --sans: "Libre Franklin", "Franklin Gothic Medium", "Helvetica Neue", Arial, sans-serif;
  --stage: 46svh;
  --slow: 3.2s cubic-bezier(.45, 0, .2, 1);
}
html.dawn { --bg: #f8ead6; --text: #2b1b12; --dim: #8a6d58; --line: #d2542f; }
* { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--bg); transition: background-color var(--slow); -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg); color: var(--text); transition: background-color var(--slow), color var(--slow);
  font-family: var(--sans); text-wrap: pretty; overflow-x: hidden; -webkit-font-smoothing: antialiased;
}
::selection { background: var(--line); color: #1b1208; }

.stage { position: sticky; top: 0; z-index: 2; height: var(--stage); overflow: hidden; background: var(--bg); transition: background-color var(--slow); }
.stage img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 62%; display: block; -webkit-user-select: none; user-select: none; }
.stage .d { opacity: 0; transition: opacity var(--slow); }
html.dawn .stage .d { opacity: 1; }
.stage::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 22%; background: linear-gradient(to bottom, transparent, var(--bg)); background: linear-gradient(to bottom, color-mix(in srgb, var(--bg) 0%, transparent), var(--bg)); pointer-events: none; }
.stars { position: absolute; inset: 0 0 45% 0; transition: opacity 1.6s; pointer-events: none; }
html.dawn .stars { opacity: 0; }
.stars i { position: absolute; width: 3px; height: 3px; background: #fff; opacity: 0; animation: tw 4s step-end infinite; }
@keyframes tw { 0%, 100% { opacity: 0; } 40% { opacity: .9; } 55% { opacity: .35; } 70% { opacity: .9; } 85% { opacity: 0; } }

main { position: relative; z-index: 1; max-width: 34rem; margin: 0 auto; padding: 0 22px; }
.s { min-height: calc(100svh - var(--stage)); display: flex; flex-direction: column; justify-content: center; padding: 26px 0; }
p.s { display: block; align-content: center; font-size: clamp(21px, 5.7vw, 27px); line-height: 1.42; font-weight: 450; letter-spacing: -.005em; }
p.s a { color: inherit; text-decoration-color: var(--line); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.head { text-align: center; }
h1 { font-family: var(--display); font-weight: 400; font-size: clamp(84px, 27vw, 168px); line-height: .9; letter-spacing: -.01em; }
.by { margin-top: 18px; font-size: 15px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--dim); transition: color var(--slow); }
p.last { font-family: var(--display); font-weight: 400; font-size: clamp(31px, 8.6vw, 46px); line-height: 1.12; letter-spacing: 0; text-wrap: balance; }

.js .s { opacity: 0; transform: translateY(14px); transition: opacity 1.1s ease, transform 1.1s ease; }
.js .s.in, .js .head { opacity: 1; transform: none; }

.quiet { height: calc(100svh - var(--stage)); }
footer { position: relative; z-index: 1; text-align: center; padding: 0 22px 44px; font-size: 13.5px; font-weight: 600; color: var(--dim); transition: color var(--slow); }
footer nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; margin-bottom: 12px; }
footer a { color: inherit; text-decoration: none; }
footer a:hover { color: var(--text); }

@media (min-width: 900px) {
  :root { --stage: 100vh; }
  .stage { position: fixed; left: 0; top: 0; width: 50vw; height: 100vh; }
  .stage img { object-position: 50% 58%; }
  .stage::after { display: none; }
  main, footer, .quiet { margin-left: 50vw; max-width: none; }
  main { padding: 0 7vw; }
  .s { min-height: 100vh; max-width: 31rem; margin: 0 auto; }
  p.s { font-size: clamp(25px, 2.1vw, 32px); }
  h1 { font-size: clamp(120px, 13vw, 210px); }
  p.last { font-size: clamp(40px, 3.6vw, 60px); }
  .quiet { height: 50vh; }
}
@media (prefers-reduced-motion: reduce) {
  :root { --slow: 0s; }
  .js .s { opacity: 1; transform: none; transition: none; }
  .stars i { animation: none; }
}
