/* Manic Store. Tokens and type from manicedge.com (v5, Google type set).
   Concept: one short line and a shelf of drifting app icons. Each icon opens a quiet room. */

@font-face { font-family: "League Gothic"; font-style: normal; font-weight: 400; font-display: swap; src: url("/fonts/LeagueGothic-Regular.woff2") format("woff2"); }
@font-face { font-family: "Figtree"; font-style: normal; font-weight: 300 900; font-display: swap; src: url("/fonts/Figtree-Variable.woff2") format("woff2"); }
@font-face { font-family: "DM Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("/fonts/DMMono-Regular.woff2") format("woff2"); }

:root {
  color-scheme: light dark;
  --paper: #F6F4EF;
  --ink: #16140F;
  --ink-soft: #5F5A50;
  --line: rgba(22, 20, 15, 0.16);
  --accent: #E8490F;
  --night: #16140F;            /* the ReadMe room is dark in both modes */
  --night-ink: #F6F4EF;
  --night-soft: rgba(246, 244, 239, 0.62);
  --display: "League Gothic", "Arial Narrow", sans-serif;
  --sans: "Figtree", -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: "DM Mono", ui-monospace, SFMono-Regular, monospace;
  --gutter: clamp(1.25rem, 5vw, 6rem);
  --slow: 1.4s;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #16140F;
    --ink: #F6F4EF;
    --ink-soft: #A9A395;
    --line: rgba(246, 244, 239, 0.16);
    --night: #0E0D0A;
  }
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { background: var(--paper); color: var(--ink); font: 400 1.0625rem/1.55 var(--sans); -webkit-font-smoothing: antialiased; }
::selection { background: var(--accent); color: #F6F4EF; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 4px; }

.meta { font-family: var(--mono); font-size: 0.8rem; letter-spacing: 0.04em; color: var(--ink-soft); }
.name { font-family: var(--display); font-weight: 400; line-height: 0.82; letter-spacing: 0.005em; }
.say { font-size: clamp(1.1rem, 1.5vw, 1.35rem); line-height: 1.5; max-width: 30ch; }
.go {
  display: inline-flex; gap: 0.6em; align-items: center; font-weight: 600; text-decoration: none;
  border-bottom: 1px solid currentColor; padding-bottom: 0.2rem;
}
.go span { transition: transform var(--slow) var(--ease); }
.go:hover span { transform: translateX(6px); }
.go:hover { color: var(--accent); }

/* ---------- the only navigation: a wordmark ---------- */
.mark { position: absolute; top: 1.75rem; left: var(--gutter); z-index: 3; display: inline-flex; align-items: center; gap: 0.6rem; text-decoration: none; }
.mark img { width: 22px; height: 22px; }
.mark span { font-family: var(--display); font-size: 1.6rem; line-height: 1; padding-top: 0.15rem; }

/* ---------- the line ---------- */
.hero { position: relative; min-height: 100dvh; display: grid; align-items: center; padding: 6rem var(--gutter) 5rem; overflow: hidden; }
.sentence {
  position: relative; z-index: 2; max-width: 8ch;
  font-family: var(--display); font-weight: 400; letter-spacing: 0.005em;
  font-size: clamp(4.5rem, 13vw, 13.5rem); line-height: 0.88;
}

/* the shelf: app icons drifting; each one is a link to its room */
.floats { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.float { position: absolute; width: clamp(6rem, 11.5vw, 11.5rem); pointer-events: auto; text-decoration: none; color: var(--ink); }
.float img { width: 100%; aspect-ratio: 1; border-radius: 22.5%; box-shadow: 0 30px 50px -26px rgba(22, 20, 15, 0.55); transform: rotate(var(--r)); transition: transform var(--slow) var(--ease), opacity var(--slow) var(--ease), filter var(--slow) var(--ease); }
.float .tag {
  position: absolute; left: 50%; top: 100%; translate: -50% 1.6rem; white-space: nowrap;
  font-family: var(--mono); font-size: 0.85rem; letter-spacing: 0.04em;
  opacity: 0; transition: opacity var(--slow) var(--ease), translate var(--slow) var(--ease);
}
.float.f-pretzel { top: 13%; right: 13%; --r: 7deg; }
.float.f-readme  { top: 42%; right: 36%; --r: -6deg; width: clamp(5.5rem, 10vw, 10rem); }
.float.f-mfy     { bottom: 12%; right: 10%; --r: 4deg; width: clamp(5rem, 9vw, 9rem); }

.floats:has(.float:hover, .float:focus-visible) .float img { opacity: 0.2; filter: grayscale(1); }
.floats:has(.float:hover, .float:focus-visible) .float:is(:hover, :focus-visible) img { opacity: 1; filter: none; transform: rotate(0deg) scale(1.3); }
.float:hover .tag, .float:focus-visible .tag { opacity: 1; translate: -50% 2.6rem; }
.float:focus-visible { outline: none; }

/* ---------- rooms ---------- */
.room { position: relative; }

/* Pretzel: text left, a navy field bleeding off the right edge */
.pretzel { display: grid; grid-template-columns: 1fr 1.15fr; min-height: 100dvh; }
.pretzel .text { align-self: end; padding: 6rem var(--gutter) clamp(4rem, 9vh, 7rem); }
.pretzel .name, .mfy .name { font-size: clamp(6rem, 15vw, 14rem); margin-bottom: 2rem; }
.pretzel .say { margin-bottom: 1.5rem; }
.pretzel .meta { margin-bottom: 2.5rem; }
.field { background: #1B1F4B; display: grid; place-items: center; padding: 8vh 10%; overflow: hidden; }
.field img { width: min(23rem, 100%); border-radius: 24px; box-shadow: 0 50px 80px -36px rgba(0, 0, 0, 0.75); transform: rotate(-3deg); }

/* ReadMe: a dark room; its panel pins under the top edge, where the real one sits */
.readme { background: var(--night); color: var(--night-ink); min-height: 170vh; overflow: clip; }
.prompter {
  position: sticky; top: 0; z-index: 2; margin: 0 auto; width: min(54rem, 92vw);
  background: #262626; color: #fff; border-radius: 0 0 28px 28px;
  padding: clamp(1.25rem, 3vw, 2rem) clamp(1.25rem, 3.5vw, 2.5rem) clamp(1.5rem, 3vw, 2.25rem);
  font: 600 clamp(1.25rem, 2.7vw, 2.2rem)/1.32 -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", sans-serif;
  letter-spacing: -0.01em; box-shadow: 0 40px 70px -40px rgba(0, 0, 0, 0.9);
}
.prompter .t { transition: color 0.5s ease; }
.prompter .t.now { color: #FBD960; }
.readme .text { position: absolute; left: 0; right: 0; bottom: 0; padding: 0 var(--gutter) clamp(4rem, 10vh, 7rem); display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 2rem 4rem; }
.readme .name { font-size: clamp(6rem, 17vw, 16rem); }
.readme .say, .readme .meta { color: var(--night-soft); }
.readme .say { margin-bottom: 1rem; }

/* Manifestiny: centred statement, the sprout grows in */
.mfy { min-height: 100dvh; display: grid; place-items: center; text-align: center; padding: 8rem var(--gutter); }
.mfy .sprout { width: clamp(5rem, 9vw, 8rem); border-radius: 22.5%; margin: 0 auto 3rem; }
.mfy .name { font-size: clamp(3.4rem, 8vw, 7.5rem); max-width: 16ch; margin: 0 auto 2rem; line-height: 0.92; }
.mfy .say { margin: 0 auto 1.25rem; }
.mfy .meta { margin-bottom: 2.5rem; }

/* ---------- footer ---------- */
.foot { background: var(--accent); color: #16140F; padding: clamp(3rem, 7vw, 5.5rem) var(--gutter) 2rem; overflow: hidden; }
.foot .big { font-family: var(--display); font-size: clamp(2.6rem, 6vw, 5.5rem); line-height: 0.95; max-width: 18ch; margin-bottom: 3rem; }
.foot .big a { text-decoration-thickness: 2px; text-underline-offset: 0.12em; }
.foot .small { display: flex; flex-wrap: wrap; gap: 0.75rem 2rem; justify-content: space-between; font-weight: 500; font-size: 0.95rem; }
.foot .small a { text-underline-offset: 0.25em; }

/* ---------- slow motion (all of it gated) ---------- */
@media (prefers-reduced-motion: no-preference) {
  /* the line reads itself in, word by word */
  .js .sentence .w { opacity: 0; animation: in 1.8s var(--ease) forwards; animation-delay: calc(300ms + var(--i) * 140ms); }
  /* objects drift on long, uneven loops */
  .float { animation: arrive 2.4s var(--ease) both, drift 22s ease-in-out infinite alternate; animation-delay: calc(900ms + var(--n) * 400ms), 0s; }
  .float.f-readme { animation-duration: 2.4s, 27s; }
  .float.f-mfy { animation-duration: 2.4s, 31s; }
  /* rooms fade up as they arrive */
  .js .reveal { opacity: 0; transform: translateY(36px); transition: opacity 1.8s var(--ease), transform 1.8s var(--ease); transition-delay: calc(var(--d, 0) * 160ms); }
  .js .reveal.in { opacity: 1; transform: none; }
  .js .mfy .sprout.reveal { transform: scale(0.55) rotate(-8deg); transition-duration: 2.6s; }
  .js .mfy .sprout.reveal.in { transform: none; }
  /* the demo card turns with the scroll */
  @supports (animation-timeline: view()) {
    .field img { animation: turn linear both; animation-timeline: view(); animation-range: entry 0% exit 100%; }
  }
}
@keyframes in { from { opacity: 0; transform: translateY(0.25em); } to { opacity: 1; transform: none; } }
@keyframes arrive { from { opacity: 0; translate: 0 40px; } }
@keyframes drift { 0% { transform: translate(0, 0); } 50% { transform: translate(-14px, 18px); } 100% { transform: translate(10px, -16px); } }
@keyframes turn { from { transform: rotate(-9deg) translateY(12vh); } to { transform: rotate(4deg) translateY(-10vh); } }
.sentence .w { display: inline-block; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition-duration: 0.01ms !important; }
}

/* ---------- narrow screens: one column, the shelf sits under the line ---------- */
@media (max-width: 760px) {
  .hero { align-items: start; padding-top: 7rem; min-height: auto; }
  .sentence { font-size: clamp(4rem, 24vw, 7rem); }
  .floats { position: relative; inset: auto; display: flex; gap: 1.5rem; margin-top: 3rem; }
  .floats { align-items: flex-start; }
  .float.f-pretzel, .float.f-readme, .float.f-mfy { position: relative; inset: auto; width: auto; }
  .float img { width: 5.5rem; height: 5.5rem; }
  .floats { flex-wrap: wrap; row-gap: 3.5rem; margin: 3rem 0 2rem 0.75rem; }
  .float .tag { opacity: 0.7; translate: -50% 0.9rem; font-size: 0.75rem; }
  .pretzel { grid-template-columns: 1fr; }
  .pretzel .text { padding-top: 5rem; }
  .field { min-height: 80vh; }
  .readme { min-height: 140vh; }
  .readme .text { grid-template-columns: 1fr; }
}
