:root {
  --ink: #0d0e10;
  --paper: #ece6dc;
  --muted: #8b867d;
  --accent: #ff5a1f;
  --accent-ink: #b5360a;

  --serif: "Instrument Serif", "Iowan Old Style", "Times New Roman", serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --pad: clamp(16px, 3.2vw, 44px);
  --ease: cubic-bezier(.7, 0, .2, 1);

  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  background: var(--ink);
  color: var(--paper);
  font-family: var(--mono);
  font-size: 13px;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

/* film grain over everything except the dialog */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: .07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

a {
  color: inherit;
  text-decoration: none;
}

p,
h1,
h2,
h3,
ol {
  margin: 0;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.label {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: .08em;
  text-transform: uppercase;
}

/* ---------- canvas & whisper ---------- */

.graph {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.whisper {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 3;
  max-width: min(260px, 70vw);
  padding: 8px 12px;
  border-left: 2px solid var(--accent);
  background: rgba(13, 14, 16, .82);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: var(--paper);
  font-size: 12px;
  line-height: 1.5;
  pointer-events: none;
  opacity: 0;
  transition: opacity .25s;
}

.whisper.is-on {
  opacity: 1;
}

.whisper::after {
  content: "▍";
  margin-left: 1px;
  color: var(--accent);
  animation: blink 1s steps(1) infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

/* ---------- frame ---------- */

.frame {
  position: relative;
  z-index: 1;
  height: 100vh;
  height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 16px;
  padding: max(var(--pad), env(safe-area-inset-top)) max(var(--pad), env(safe-area-inset-right)) max(var(--pad), env(safe-area-inset-bottom)) max(var(--pad), env(safe-area-inset-left));
  pointer-events: none;
}

.frame a,
.frame button {
  pointer-events: auto;
}

.top {
  display: flex;
  justify-content: space-between;
  align-items: last baseline;
  gap: 16px;
  color: var(--muted);
  font-size: 12px;
}

.mark {
  display: inline-flex;
  align-items: last baseline;
  gap: 10px;
  color: var(--paper);
  font-weight: 500;
  letter-spacing: .02em;
}

.mark .tld {
  color: var(--muted);
}

.logo {
  height: 20px;
  width: auto;
  overflow: visible;
}

.logo-body {
  fill: var(--paper);
}

.logo-head {
  fill: var(--accent);
  transform-box: fill-box;
  transform-origin: 100% 60%;
  transition: transform .5s var(--ease);
}

/* trunk up */
.mark:hover .logo-head {
  transform: rotate(-12deg);
}

.clock {
  display: flex;
  align-items: baseline;
  gap: .6em;
  font-variant-numeric: tabular-nums;
}

.clock time {
  color: var(--paper);
}

.pulse {
  align-self: center;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(255, 90, 31, .6);
  animation: pulse 2.4s infinite;
}

.pulse.is-asleep {
  background: var(--muted);
  animation: none;
}

@keyframes pulse {
  70% {
    box-shadow: 0 0 0 8px rgba(255, 90, 31, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(255, 90, 31, 0);
  }
}

/* ---------- hero ---------- */

.hero {
  align-self: end;
  display: grid;
  gap: clamp(10px, 2vh, 22px);
  padding-bottom: clamp(0px, 2vh, 24px);
}

.role {
  color: var(--accent);
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.name {
  font-size: 0;
}

/* drawn on the elephant's grid, see /brand: 1028 × 168; J and F 5u, lowercase 3u */
.wordmark {
  display: block;
  width: min(40vw, 64vh, 640px);
  height: auto;
  overflow: visible;
}

.wordmark-ink {
  fill: var(--paper);
}

.wordmark-ember {
  fill: var(--accent);
}

.tagline {
  max-width: 30ch;
  font-family: var(--serif);
  font-size: clamp(20px, min(2.2vw, 3.4vh), 32px);
  line-height: 1.18;
  color: rgba(236, 230, 220, .7);
}

.tagline em {
  color: var(--paper);
}

/* ---------- bottom ---------- */

.bottom {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 28px;
  font-size: 13px;
}

.links a,
.sheet a:not(.cta) {
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  padding-bottom: 2px;
  transition: background-size .35s var(--ease);
}

.links a:hover,
.sheet a:not(.cta):hover {
  background-size: 100% 1px;
}

.open {
  position: relative;
  flex: none;
  width: clamp(92px, 9vw, 124px);
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--paper);
  cursor: pointer;
}

.open::before {
  content: "";
  position: absolute;
  inset: 22%;
  border-radius: 50%;
  background: var(--accent);
  transform: scale(.32);
  transition: transform .5s var(--ease);
}

.ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  fill: currentColor;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  animation: spin 18s linear infinite;
}

.plus {
  position: absolute;
  inset: 0;
  transition: transform .5s var(--ease);
}

.plus::before,
.plus::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 22%;
  height: 1.5px;
  background: var(--ink);
  transform: translate(-50%, -50%);
}

.plus::after {
  transform: translate(-50%, -50%) rotate(90deg);
}

.sticker {
  position: absolute;
  left: 50%;
  top: 50%;
  height: 30%;
  width: auto;
  transform: translate(-50%, -50%) scale(0) rotate(-20deg);
  transition: transform .5s var(--ease);
}

.sticker-body {
  fill: var(--ink);
}

.sticker-head {
  fill: var(--paper);
}

.open:hover::before,
.open:focus-visible::before {
  transform: scale(1);
}

.open:hover .plus,
.open:focus-visible .plus {
  transform: rotate(90deg) scale(0);
}

.open:hover .sticker,
.open:focus-visible .sticker {
  transform: translate(-50%, -50%) scale(1) rotate(0);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------- sheet (overlay) ---------- */

.sheet {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  overflow: hidden;
  background: var(--paper);
  color: var(--ink);
  clip-path: circle(0 at var(--x, 90%) var(--y, 90%));
  transition: clip-path .9s var(--ease);
}

.sheet.is-open {
  clip-path: circle(var(--r, 150vmax) at var(--x, 90%) var(--y, 90%));
}

.sheet::backdrop {
  background: transparent;
}

.sheet-inner {
  height: 100%;
  display: grid;
  grid-template-rows: auto 1fr auto auto auto;
  gap: clamp(16px, 4vh, 48px);
  padding: max(var(--pad), env(safe-area-inset-top)) max(var(--pad), env(safe-area-inset-right)) max(var(--pad), env(safe-area-inset-bottom)) max(var(--pad), env(safe-area-inset-left));
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .5s, transform .7s var(--ease);
}

.sheet.is-open .reveal {
  opacity: 1;
  transform: none;
  transition-delay: calc(.3s + var(--d) * 70ms);
}

.sheet-top {
  display: flex;
  justify-content: space-between;
  align-items: last baseline;
  gap: 16px;
}

.sheet-label {
  display: flex;
  align-items: last baseline;
  gap: 10px;
}

.sheet .logo {
  height: 16px;
}

.sheet .logo-body {
  fill: var(--ink);
}

/* ---------- the herd (↑↑↓↓←→←→BA) ---------- */

.herd {
  position: fixed;
  left: 100%;
  bottom: calc(var(--pad) + 64px);
  z-index: 1;
  display: flex;
  align-items: flex-end;
  gap: 14px;
  pointer-events: none;
  animation: herd 11s linear forwards;
}

.herd svg {
  height: 34px;
  width: auto;
  animation: walk 1s ease-in-out infinite;
  animation-delay: calc(var(--i) * -.14s);
}

.herd-body {
  fill: var(--paper);
}

.herd-head {
  fill: var(--accent);
}

.herd .follower {
  opacity: .55;
}

.herd .follower path {
  fill: var(--muted);
}

@keyframes herd {
  to {
    transform: translateX(calc(-100vw - 100%));
  }
}

@keyframes walk {
  50% {
    transform: translateY(-3px);
  }
}

.close {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0 8px 12px;
  border: 0;
  background: none;
  color: var(--ink);
  font: 500 11px/1 var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  cursor: pointer;
}

.close kbd {
  padding: 4px 6px;
  border: 1px solid currentColor;
  border-radius: 3px;
  font: inherit;
  font-size: 10px;
}

.close:hover kbd {
  background: var(--ink);
  color: var(--paper);
}

/* shares the hats' columns, so the lede sits over 03 */
.sheet-head,
.hats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px clamp(20px, 3.4vw, 56px);
}

.sheet-head {
  align-self: end;
  align-items: end;
}

.sheet-title {
  grid-column: span 2;
}

.sheet-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(44px, min(9vw, 13vh), 160px);
  line-height: .88;
  letter-spacing: -.02em;
}

.sheet-title em {
  color: var(--accent);
}

.lede {
  max-width: 22ch;
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(20px, min(2.2vw, 3.4vh), 34px);
  line-height: 1.15;
  text-wrap: balance;
}

.hat {
  display: grid;
  gap: 12px;
  align-content: start;
  padding-top: 12px;
  border-top: 1px solid var(--ink);
}

.hat .label {
  color: var(--accent-ink);
}

.hat p {
  max-width: 36ch;
  font-family: var(--serif);
  font-size: clamp(16px, min(1.5vw, 2.6vh), 23px);
  line-height: 1.28;
}

.flow {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 0;
  padding: 0;
  list-style: none;
  font-size: 11px;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.flow li {
  display: flex;
  align-items: center;
}

.flow li:not(:last-child)::after {
  content: "";
  width: clamp(8px, 2vw, 32px);
  height: 1px;
  margin: 0 4px;
  background: var(--ink);
  opacity: .35;
}

/* each step lights up in turn: 8 steps × 1s */
.flow span {
  padding: 6px 10px;
  border: 1px solid rgba(13, 14, 16, .35);
  border-radius: 999px;
  white-space: nowrap;
  animation: step 8s infinite;
  animation-delay: calc(var(--i) * 1s);
}

@keyframes step {

  0%,
  10% {
    background: var(--ink);
    border-color: var(--ink);
    color: var(--paper);
  }

  13%,
  100% {
    background: transparent;
    border-color: rgba(13, 14, 16, .35);
    color: var(--ink);
  }
}

.sheet-bottom {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  padding-top: 12px;
  border-top: 1px solid rgba(13, 14, 16, .2);
}

.sheet-bottom .label {
  line-height: 1.9;
  color: rgba(13, 14, 16, .7);
}

.cta {
  display: inline-flex;
  align-items: baseline;
  gap: .15em;
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(34px, min(5vw, 8vh), 80px);
  line-height: 1;
  transition: color .3s;
}

.cta span {
  font-style: normal;
  font-size: .6em;
  transition: transform .4s var(--ease);
}

.cta:hover {
  color: var(--accent-ink);
}

.cta:hover span {
  transform: translate(4px, -4px);
}

/* ---------- small screens ---------- */

@media (max-width: 640px) {
  .status {
    display: none;
  }

  .wordmark {
    width: min(100%, 64vh, 440px);
  }

  .sheet-inner {
    gap: 14px;
  }

  .sheet-title {
    font-size: clamp(40px, 6.4vh, 56px);
  }

  .lede {
    font-size: 18px;
    max-width: none;
  }

  .sheet-head,
  .hats {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .sheet-title {
    grid-column: auto;
  }

  .hat {
    gap: 6px;
    padding-top: 8px;
  }

  .hat p {
    max-width: none;
    font-size: clamp(14px, 2.3vh, 18px);
    line-height: 1.24;
  }

  .long {
    display: none;
  }

  .flow {
    font-size: 10px;
    gap: 6px 0;
  }

  .flow span {
    padding: 5px 8px;
  }

  .sheet-bottom .label {
    line-height: 1.7;
  }

  .cta {
    font-size: 36px;
    white-space: nowrap;
  }
}

@media (max-height: 520px) {
  .wordmark {
    width: min(40vw, 70vh);
  }

  .tagline {
    max-width: 44ch;
    font-size: 18px;
  }

  .hero {
    gap: 8px;
    padding-bottom: 0;
  }

  .open {
    width: 84px;
  }
}

@media (max-height: 520px) and (min-width: 641px) {
  .sheet-inner {
    gap: 12px;
  }

  .hat p {
    font-size: 15px;
  }
}

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    transition-delay: 0s !important;
  }
}
