/* =================================================================
   kagerou.glass — style.css (home)
   Layers over yamero.css. The 3 AM dispensary.
   ================================================================= */

#bg-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

#content { position: relative; z-index: 10; }

/* =================================================================
   Hero — buzzing sign in the void
   ================================================================= */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 2rem 1rem;
  text-align: center;
}

.hero-sign { position: relative; margin-bottom: 0.4rem; }

/* The sign is an animated AVIF (the flowing heat-haze, pre-rendered).
   The <h1> keeps semantics; the live text is the alt/aria-label. */
.hero-kanji {
  margin: 0;
  font-size: 0;
  line-height: 0;
  user-select: none;
}
.hero-kanji picture { display: block; }
.hero-kanji img {
  display: block;
  width: clamp(260px, 58vw, 620px);
  height: auto;
  filter:
    drop-shadow(0 0 0.32em rgba(255,134,191,0.55))
    drop-shadow(0 0 1em rgba(255,95,166,0.40));
}

/* Vertical pharmacy signage on the wide-screen edges (subtle) */
.hero-rail {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  writing-mode: vertical-rl;
  font-family: var(--f-digital);
  font-size: 0.72rem;
  letter-spacing: 0.34em;
  color: var(--ink-faint);
  opacity: 0.45;
  pointer-events: none;
  user-select: none;
  display: none;
  white-space: nowrap;
}
.hero-rail--l { left: 3.4vw; color: var(--cyan); opacity: 0.3; }
.hero-rail--r { right: 3.4vw; color: var(--pink); opacity: 0.3; }
@media (min-width: 1180px) { .hero-rail { display: block; } }

.hero-open {
  display: block;
  margin-top: 0.6rem;
  font-family: var(--f-digital);
  font-size: clamp(0.6rem, 1.6vw, 0.82rem);
  letter-spacing: 0.42em;
  text-indent: 0.42em;
  color: var(--cyan);
  text-shadow: 0 0 8px rgba(118,230,224,0.6);
  animation: buzz 3.4s steps(1) infinite;
}
@keyframes buzz { 0%,92% { opacity: 1; } 93% { opacity: 0.4; } 94%,96% { opacity: 1; } 97% { opacity: 0.5; } 98%,100% { opacity: 1; } }

.hero-sub {
  margin-top: 1.5rem;
  font-family: var(--f-head);
  font-weight: 500;
  font-size: clamp(0.95rem, 2vw, 1.25rem);
  letter-spacing: 0.12em;
  color: var(--ink-soft);
}
.hero-sub b { color: var(--pink-soft); font-weight: 600; }
.hero-sub-text { transition: none; }

.hero-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1.2rem;
  max-width: 660px;
}
.chip {
  font-family: var(--f-digital);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  text-decoration: none;
  padding: 0.32rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: linear-gradient(120deg, rgba(118,230,224,0.10), rgba(255,134,191,0.12));
  transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}
.chip:hover { color: var(--base); background: linear-gradient(120deg, var(--cyan), var(--pink)); border-color: transparent; transform: translateY(-1px); }

.enter-cta {
  display: inline-block;
  margin-top: 1.8rem;
  font-family: var(--f-digital);
  font-size: 0.76rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--cyan);
  padding: 0.55rem 1.5rem;
  border: 1px dashed var(--line-cyan);
  border-radius: 999px;
  transition: color 0.2s ease, background 0.2s ease, border-style 0.2s ease;
  animation: ctaPulse 2.6s ease-in-out infinite;
}
.enter-cta:hover { color: var(--base); background: var(--cyan); border-style: solid; }
@keyframes ctaPulse { 0%,100% { box-shadow: 0 0 0 0 rgba(118,230,224,0); } 50% { box-shadow: 0 0 18px -4px rgba(118,230,224,0.5); } }

.otc-dialog { position: relative; overflow: visible; }

.hero-links {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-top: 1.8rem;
  flex-wrap: wrap;
  justify-content: center;
}
.hero-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--ink-dim);
  text-decoration: none;
  font-family: var(--f-digital);
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  transition: color 0.25s ease, text-shadow 0.25s ease;
}
.hero-links a:hover { color: var(--cyan); text-shadow: 0 0 8px rgba(118,230,224,0.5); }
.hero-links svg { opacity: 0.85; }
.hero-links-sep { color: var(--pink); font-size: 0.7rem; }

.scroll-indicator {
  position: absolute;
  bottom: 2.2rem;
  left: 50%;
  transform: translateX(-50%);
  color: var(--pink);
  animation: scroll-bounce 2.4s ease-in-out infinite;
  transition: opacity 0.6s ease;
}
.scroll-indicator.is-hidden { opacity: 0; pointer-events: none; }
@keyframes scroll-bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); opacity: 0.45; }
  50% { transform: translateX(-50%) translateY(10px); opacity: 1; }
}

/* =================================================================
   Ticker — a fixed bar at the very top of the viewport. Hidden at first;
   once you scroll past the sign (threshold in main.js → .is-pinned) it
   slides down and rides along, a faint blurred band of whispers.
   (Fixed, not sticky: body's overflow-x:hidden makes body a scroll
   container, which breaks position:sticky.)
   ================================================================= */
.ticker {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  margin: 0;
  background: color-mix(in srgb, var(--base) 80%, transparent);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line-hair);
  transform: translateY(-100%);
  opacity: 0;
  transition: transform 0.45s ease, opacity 0.45s ease;
  will-change: transform;
}
.ticker.is-pinned { transform: translateY(0); opacity: 1; }

/* Seamless marquee: main.js fills the track with two identical .ticker__seq
   copies and animates a clean -50% loop (no mid-scroll cut), with a
   width-proportional duration so the speed is constant whatever the content. */
.ticker__track { display: inline-flex; }
.ticker__seq { flex: none; display: inline-block; white-space: nowrap; }
@keyframes ticker-seamless { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* =================================================================
   Dispensary shelf (carousel of windows)
   ================================================================= */
.apps-section { position: relative; z-index: 10; padding: 0.8rem 0 2rem; scroll-margin-top: 3rem; }

/* Shelf heading — the dispensary, front & centre (CTA lands here) */
.shelf-head { text-align: center; max-width: 640px; margin: 0 auto; padding: 0 1.5rem; }
.shelf-title {
  display: inline-flex; align-items: baseline; justify-content: center;
  gap: 0.6rem; flex-wrap: wrap;
}
.shelf-title .sh-jp { font-family: var(--f-display); font-size: clamp(1.4rem, 3.6vw, 2.1rem); color: var(--ink); letter-spacing: 0.02em; }
.shelf-title .sh-en { font-family: var(--f-frag); font-weight: 400; font-size: clamp(0.9rem, 1.7vw, 1.15rem); color: var(--pink-soft); letter-spacing: 0.08em; text-transform: lowercase; }
.shelf-sub {
  margin: 0.55rem auto 0; max-width: 46ch;
  font-family: var(--f-frag); font-weight: 300;
  font-size: clamp(0.8rem, 1.35vw, 0.98rem); line-height: 1.7; letter-spacing: 0.02em;
  color: var(--ink-dim);
}

.apps-scroll {
  display: flex;
  align-items: stretch;
  gap: 2rem;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 1.2rem max(1.5rem, calc(50vw - min(85vw, 900px) / 2));
  cursor: grab;
}
.apps-scroll::-webkit-scrollbar { display: none; }
.apps-scroll.is-dragging { cursor: grabbing; scroll-behavior: auto; user-select: none; }

.app-card {
  flex-shrink: 0;
  width: min(85vw, 900px);
  display: flex;
  flex-direction: column;
  /* visible by default — entrance fade caused empty cards on anchor-jump */
  opacity: 1;
}

/* .card-inner has .win from yamero (border, bar, shadow). Layout the body. */
.card-inner { display: flex; flex-direction: column; height: 100%; }
.card-body {
  display: flex;
  align-items: stretch;
  gap: 2rem;
  flex: 1;
  padding: clamp(1.6rem, 3.5vw, 2.6rem);
}
.card-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.card-screenshot { flex: 0 0 42%; max-width: 42%; display: flex; align-items: center; justify-content: center; }

.card-screenshot-frame {
  position: relative;
  overflow: hidden;
  background: var(--void);
  border: 1px solid var(--line);
  box-shadow: 0 8px 34px rgba(255,95,166,0.12), inset 0 1px 0 rgba(255,255,255,0.06);
  transform: perspective(800px) rotateY(-2deg);
  transition: transform 0.5s cubic-bezier(0.23,1,0.32,1), box-shadow 0.5s ease;
}
.card-screenshot-frame:hover { transform: perspective(800px) rotateY(0) scale(1.02); box-shadow: 0 12px 44px rgba(118,230,224,0.18); }
.card-screenshot-frame img { display: block; width: 100%; height: auto; }
.card-screenshot-frame.is-portrait { max-height: 320px; width: auto; }
.card-screenshot-frame.is-portrait img { width: auto; height: 100%; max-height: 320px; object-fit: contain; }

/* Per-app accent on the window */
[data-accent="refrax"]     .win-bar { background: linear-gradient(90deg, var(--cyan), var(--pink)); }
[data-accent="phosphene"]  .win-bar { background: linear-gradient(90deg, var(--green), var(--lilac)); }
[data-accent="dantrolene"] .win-bar { background: linear-gradient(90deg, var(--pink-hot), var(--lilac)); }
[data-accent="rilmazafone"].win-bar { background: linear-gradient(90deg, var(--lilac), var(--cyan)); }
[data-accent="harmaline"]  .win-bar { background: linear-gradient(90deg, var(--green), var(--cyan)); }

[data-accent="phosphene"]  .win { border-color: var(--green); }
[data-accent="dantrolene"] .win { border-color: var(--pink-hot); }
[data-accent="rilmazafone"].win { border-color: var(--lilac); }
[data-accent="harmaline"]  .win { border-color: var(--green); }
[data-accent="refrax"]     .win { border-color: var(--cyan); }

/* Drug typography */
.card-header { display: flex; align-items: center; gap: 0.7rem; }
.card-icon { width: 34px; height: 34px; border-radius: 8px; flex-shrink: 0; box-shadow: 0 1px 6px rgba(0,0,0,0.4); }
.drug-name {
  font-family: var(--f-display);
  font-size: clamp(1.4rem, 3vw, 2rem);
  letter-spacing: 0.04em;
  margin-bottom: 0;
  background: linear-gradient(100deg, var(--pink), var(--cyan));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
[data-accent="phosphene"]  .drug-name { background: linear-gradient(100deg, var(--green), var(--lilac)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
[data-accent="dantrolene"] .drug-name { background: linear-gradient(100deg, var(--pink-hot), var(--lilac)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
[data-accent="rilmazafone"].drug-name { background: linear-gradient(100deg, var(--lilac), var(--cyan)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
[data-accent="harmaline"]  .drug-name { background: linear-gradient(100deg, var(--green), var(--cyan)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }

.drug-pronunciation { font-family: var(--f-mono); font-size: 0.82rem; color: var(--ink-dim); margin: 0.35rem 0 1.1rem; }
.drug-pronunciation .ipa { color: var(--ink-faint); }
.drug-definition {
  font-family: var(--f-head);
  font-style: italic;
  font-size: clamp(1rem, 1.7vw, 1.12rem);
  line-height: 1.55;
  color: var(--lilac-soft);
  border-left: 2px solid var(--line);
  padding-left: 0.9rem;
  margin-bottom: 1.3rem;
}
.drug-indication { font-size: 0.95rem; margin-bottom: 1.1rem; line-height: 1.6; color: var(--ink-soft); }
.drug-indication .label { font-family: var(--f-digital); font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--pink); margin-right: 0.3rem; }
.drug-features { list-style: none; margin-bottom: 1.8rem; }
.drug-features li { position: relative; padding-left: 1.5rem; margin-bottom: 0.45rem; font-size: 0.9rem; color: var(--ink-soft); }
.drug-features li::before { content: ''; position: absolute; left: 0; top: 0.38em; width: 0.78em; height: 0.66em; background: var(--px-heart-cyan); background-size: contain; background-repeat: no-repeat; image-rendering: pixelated; }

.card-actions { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; margin-top: auto; }

/* =================================================================
   Nav arrows + dots
   ================================================================= */
.apps-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 11;
  display: flex; align-items: center; justify-content: center;
  width: 42px; height: 42px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--pink);
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 3px 3px 0 rgba(255,95,166,0.2);
}
.apps-nav:hover { color: var(--cyan); border-color: var(--line-cyan); box-shadow: 3px 3px 0 rgba(118,230,224,0.25); }
.apps-nav:active { transform: translateY(-50%) translate(2px,2px); box-shadow: 1px 1px 0 rgba(255,95,166,0.2); }
.apps-nav--prev { left: max(0.75rem, calc(50vw - min(85vw, 900px) / 2 - 54px)); }
.apps-nav--next { right: max(0.75rem, calc(50vw - min(85vw, 900px) / 2 - 54px)); }
.apps-nav.is-hidden { opacity: 0; pointer-events: none; }

.apps-dots { display: flex; justify-content: center; gap: 0.6rem; padding: 1.5rem 0 0; }
.apps-dots .dot {
  width: 11px; height: 10px;
  background: var(--px-heart-pink) center/contain no-repeat;
  image-rendering: pixelated;
  opacity: 0.4;
  transition: opacity 0.3s ease, transform 0.3s ease;
  cursor: pointer;
}
.apps-dots .dot:hover { opacity: 0.7; }
.apps-dots .dot.active { opacity: 1; transform: scale(1.25); }

/* =================================================================
   Fragments — the self, dispensed in pieces
   Literary serif floating in the void; scattered off-axis, surfacing
   at random as you scroll. Calm content, never lined up too neatly.
   ================================================================= */
.otc-dialog { transform: rotate(-1.2deg); }

.fragments {
  position: relative;
  z-index: 10;
  max-width: 820px;
  margin: 0 auto;
  padding: clamp(3rem, 8vw, 6rem) 1.5rem;
  display: flex;
  flex-direction: column;
  gap: clamp(2.2rem, 4.5vw, 3.6rem);
}
.fragments--intro {
  padding-top: clamp(1.2rem, 4vw, 2.4rem);
  padding-bottom: clamp(1.2rem, 4vw, 2.4rem);
  gap: clamp(1.3rem, 3vw, 2.1rem);
}

/* dialog + title sit off-axis, left of centre — a scrawled patient-chart label */
.fragments .otc-dialog { align-self: flex-start; margin: 0 0 0 4%; }
.fragments-title {
  align-self: flex-start;
  margin: 0 0 0 6%;
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
  transform: rotate(-2.6deg);
  transform-origin: left center;
}
.fragments-title .ft-jp {
  font-family: var(--f-display);
  font-size: clamp(2rem, 5vw, 3.4rem);
  color: var(--ink);
  letter-spacing: 0.02em;
  line-height: 1;
}
.fragments-title .ft-en {
  font-family: var(--f-frag);
  font-weight: 400;
  font-size: clamp(0.9rem, 1.7vw, 1.15rem);
  color: var(--pink-soft);
  letter-spacing: 0.06em;
  text-transform: lowercase;
  transform: translateY(-0.1em) rotate(1.6deg);
}

.fragment {
  position: relative;
  font-family: var(--f-frag);
  font-weight: 300;
  font-size: clamp(1.02rem, 1.75vw, 1.34rem);
  line-height: 1.85;
  letter-spacing: 0.015em;
  color: var(--ink-soft);
  max-width: 42ch;
  text-wrap: pretty;
  transform: translate(var(--dx, 0px), 0) rotate(var(--rot, 0deg));
}
/* Intro fragments — a faint murmur before the dispensary, not a banner */
.fragments--intro .fragment {
  font-size: clamp(0.84rem, 1.3vw, 1.02rem);
  line-height: 1.8;
  color: var(--ink-dim);
  opacity: 0.82;
  max-width: 34ch;
}
.fragments--intro .fragment--ja { font-size: clamp(0.9rem, 1.4vw, 1.06rem); }
/* loose left/right tendency — jittered further by JS, not a strict grid */
.fragment:nth-of-type(odd)  { align-self: flex-start; text-align: left; }
.fragment:nth-of-type(even) { align-self: flex-end;   text-align: right; }
.fragment b { font-weight: 500; color: var(--pink-soft); }
.fragment::before {
  position: absolute;
  top: -1.4em;
  font-family: var(--f-digital);
  font-size: 0.7rem;
  font-style: normal;
  opacity: 0.5;
}
.fragment:nth-of-type(odd)::before  { content: '♡'; left: 0;  color: var(--pink); }
.fragment:nth-of-type(even)::before { content: '✚'; right: 0; color: var(--cyan); }

.fragment--ja {
  font-family: var(--f-frag-ja);
  font-style: normal;
  font-weight: 400;
  color: var(--lilac-soft);
  font-size: clamp(1.02rem, 1.9vw, 1.34rem);
  line-height: 1.95;
  letter-spacing: 0.03em;
}
.fragment--dim  { color: var(--ink-dim); font-size: clamp(1rem, 1.7vw, 1.22rem); }
.fragment--center { align-self: center; text-align: center; max-width: 48ch; }
.fragment--center::before { left: 50%; right: auto; transform: translateX(-50%); }

/* Random scattered reveal — only when JS enables it and motion is allowed.
   Without .frag-anim (no-JS or reduced-motion) fragments are simply visible. */
/* Reveal touches only opacity + blur (never transform) so per-slot
   rotation/placement in the scattered field survives the entrance. */
.frag-anim .fragment {
  opacity: 0;
  filter: blur(7px);
  transition: opacity 1.05s ease, filter 1.1s ease;
  will-change: opacity, filter;
}
.frag-anim .fragment.is-revealed {
  opacity: 1;
  filter: blur(0);
}

/* =================================================================
   Notes toward a self — scattered case-notes, NOT a list.
   An asymmetric broken grid (ma / negative space) with deliberate
   scale jumps, depth by colour-recession, wandering placement and
   rotation, and the Japanese fragment set as a vertical tategaki
   spine down the right. (denpa text-bleed × NSO collage × net-art grid)
   ================================================================= */
.fragments--deep { max-width: 1080px; }

.frag-field {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  align-items: start;
  column-gap: clamp(0.5rem, 1.6vw, 1.4rem);
  row-gap: clamp(2.2rem, 4.5vw, 3.8rem);
  margin-top: clamp(1.8rem, 4.5vw, 3.2rem);
}
.frag-field .fragment { max-width: none; margin: 0; }

/* six deliberate slots — uneven, wandering, with empty cells between */
.frag-field .fragment:nth-child(1) {
  grid-column: 1 / 6; grid-row: 1;
  justify-self: start; text-align: left;
  font-size: clamp(1.1rem, 2vw, 1.5rem);
  transform: rotate(-2deg);
}
.frag-field .fragment:nth-child(2) {
  grid-column: 6 / 10; grid-row: 1;
  justify-self: end; text-align: right;
  font-size: clamp(0.82rem, 1.25vw, 1rem);
  color: var(--ink-faint);                       /* recedes */
  transform: rotate(3deg) translateY(2.6rem);
}
.frag-field .fragment:nth-child(3) {
  grid-column: 3 / 10; grid-row: 2;
  justify-self: start; text-align: left;
  font-size: clamp(1.2rem, 2.4vw, 1.78rem);      /* the loud one */
  transform: rotate(-1deg) translateY(-0.4rem);
}
.frag-field .fragment:nth-child(4) {             /* Japanese — vertical spine */
  grid-column: 10 / 13; grid-row: 1 / 5;
  justify-self: end; align-self: start;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  max-height: 70vh;                              /* long lines wrap into a 2nd column */
  font-size: clamp(0.98rem, 1.7vw, 1.3rem);
  line-height: 2;
  transform: none;
}
.frag-field .fragment:nth-child(5) {
  grid-column: 4 / 10; grid-row: 3;
  justify-self: center; text-align: left;
  font-size: clamp(0.9rem, 1.5vw, 1.1rem);
  color: var(--ink-dim);
  transform: rotate(4deg) translateY(0.6rem);
}
.frag-field .fragment:nth-child(6) {             /* closing echo — big & faint */
  grid-column: 1 / 8; grid-row: 4;
  justify-self: start; text-align: left;
  font-size: clamp(1.16rem, 2.1vw, 1.62rem);
  color: var(--ink-dim);
  transform: rotate(-1.5deg);
}
/* the closing line loses its centred marker in the field */
.frag-field .fragment--center::before { left: 0; right: auto; transform: none; content: '♡'; color: var(--pink); }

/* mobile: the scatter folds back into a quiet single column */
@media (max-width: 760px) {
  .frag-field { display: flex; flex-direction: column; gap: clamp(2rem, 7vw, 2.8rem); margin-top: 2rem; }
  .frag-field .fragment {
    grid-column: auto !important;
    transform: none !important;
    writing-mode: horizontal-tb !important;
    max-height: none !important;
    justify-self: stretch !important;
    text-align: left !important;
    font-size: clamp(0.96rem, 4vw, 1.16rem) !important;
  }
}

/* =================================================================
   Overheard — a dialogue snippet pinned off to one side
   ================================================================= */
.overheard {
  position: relative;
  z-index: 10;
  max-width: 360px;
  margin: 0.5rem 7% 3rem auto;            /* off to the right, scattered */
  padding: 0.9rem 1.15rem 1rem;
  background: color-mix(in srgb, var(--panel) 88%, transparent);
  border: 1px solid var(--line);
  border-left: 2px solid var(--cyan);
  transform: rotate(1.5deg);
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
  box-shadow: 4px 5px 0 rgba(0, 0, 0, 0.32);
  font-family: var(--f-frag);
  font-weight: 300;
  font-size: 0.92rem;
  line-height: 1.7;
  letter-spacing: 0.01em;
}
.overheard-tag {
  font-family: var(--f-digital);
  font-style: normal;
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  color: var(--cyan);
  opacity: 0.8;
  margin-bottom: 0.35rem;
}
.oh-line::before { content: '— '; opacity: 0.55; }
.oh-line.oh-a { color: var(--ink-soft); }
.oh-line.oh-b { color: var(--pink-soft); margin-left: 1rem; }

/* =================================================================
   Whispers — idle + typed-word easter eggs
   ================================================================= */
.idle-whisper {
  position: fixed;
  left: 50%;
  bottom: 8%;
  transform: translateX(-50%) translateY(10px);
  z-index: 9990;
  font-family: var(--f-frag);
  font-weight: 300;
  font-size: clamp(1rem, 2vw, 1.28rem);
  letter-spacing: 0.02em;
  color: var(--ink-soft);
  text-shadow: 0 0 20px rgba(0, 0, 0, 0.75), 0 0 30px rgba(0, 0, 0, 0.6);
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
  transition: opacity 1.1s ease, transform 1.1s ease;
}
.idle-whisper--top { bottom: auto; top: 16%; }
.idle-whisper.show { opacity: 0.92; transform: translateX(-50%) translateY(0); }

@media (max-width: 768px) {
  .overheard { margin: 0.5rem auto 2.5rem; transform: none; }
  .idle-whisper { font-size: 1rem; white-space: normal; max-width: 80vw; text-align: center; }
}

/* The hidden door to the back room — nearly invisible until found */
.ward-door {
  font-family: var(--f-digital);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: var(--ink);
  text-decoration: none;
  opacity: 0.05;
  transition: opacity 0.5s ease, color 0.5s ease, text-shadow 0.5s ease;
}
.ward-door:hover,
.ward-door:focus {
  opacity: 0.9;
  color: var(--crimson);
  text-shadow: 0 0 10px rgba(232, 68, 126, 0.6);
}

/* =================================================================
   "are you here?" — a neon sign drifts in; click flips the colours.
   The flip is a photographic negative of the whole dispensary. (js/presence.js)
   ================================================================= */
/* The flip is a viewport-exact photographic negative: a fixed overlay painted
   in `difference` blend mode inverts everything beneath it. (A root-element
   `filter` mis-paints with overflow-x:hidden + the carousel — this doesn't.)
   The sign and scanlines sit above it (higher z) so they stay legible. */
.color-flip {
  position: fixed;
  inset: 0;
  z-index: 9994;
  background: #fff;
  mix-blend-mode: difference;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s ease;
}
.color-flip.on { opacity: 1; }

.presence-sign {
  position: fixed;
  z-index: 9995;
  font-family: var(--f-digital);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--cyan);
  background: var(--raise);
  border: 1px solid var(--line-cyan);
  padding: 0.42rem 0.72rem;
  cursor: pointer;
  text-shadow: 0 0 6px rgba(118, 230, 224, 0.55);
  box-shadow: 0 0 18px -6px rgba(118, 230, 224, 0.5), 4px 4px 0 rgba(0, 0, 0, 0.3);
  opacity: 0;
  transition: opacity 1.2s ease, color 0.3s ease, background 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  animation: sway 6s ease-in-out infinite;
}
.presence-sign.show { opacity: 0.92; }
.presence-sign:hover,
.presence-sign:focus-visible { color: var(--base); background: var(--cyan); border-color: var(--cyan); box-shadow: 0 0 22px -4px var(--cyan), 4px 4px 0 rgba(0, 0, 0, 0.3); outline: none; }
.presence-sign.is-on { color: var(--pink-soft); border-color: var(--line); text-shadow: 0 0 6px rgba(255, 95, 166, 0.55); box-shadow: 0 0 18px -6px var(--pink-hot), 4px 4px 0 rgba(0, 0, 0, 0.3); }

/* =================================================================
   Hours note — a line keyed to the visitor's local time (js/hours.js)
   ================================================================= */
.hours-note {
  margin: 1.5rem auto 0.2rem;
  max-width: 52ch;
  text-align: center;
  font-family: var(--f-frag);
  font-weight: 300;
  font-size: clamp(0.8rem, 1.35vw, 0.98rem);
  line-height: 1.7;
  letter-spacing: 0.02em;
  color: var(--ink-dim);
  opacity: 0;
  transition: opacity 1.8s ease;
}
.hours-note.show { opacity: 0.85; }
/* daylight visitors are an anomaly — the line reads faintly wrong */
[data-hours="day"] .hours-note { color: var(--crimson); opacity: 0; }
[data-hours="day"] .hours-note.show { opacity: 0.82; }

/* =================================================================
   Void field — fragments adrift in the margins (js/void.js)
   ================================================================= */
.void-field {
  position: absolute;
  inset: 0;
  z-index: 2;                 /* behind content (z 10), above bg canvas (z 1) */
  pointer-events: none;
  overflow: hidden;
}
.void-frag {
  position: absolute;
  max-width: 16ch;
  font-family: var(--f-frag);
  font-weight: 300;
  font-size: clamp(0.7rem, 1vw, 0.86rem);
  line-height: 1.5;
  color: var(--ink-faint);
  text-shadow: 0 0 12px rgba(0, 0, 0, 0.6);
  opacity: 0;
  transition: opacity 2.2s ease;
  transform: rotate(var(--vrot, 0deg));
  will-change: transform;
}
.void-field.show .void-frag { opacity: 0.2; }

/* =================================================================
   Latest from the Ledger — two most recent entries, after the shelf
   ================================================================= */
.latest { position: relative; z-index: 10; max-width: 900px; margin: 0 auto; padding: clamp(2rem, 5vw, 3.4rem) 1.5rem clamp(1rem, 3vw, 1.8rem); }
.latest-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.3rem; }
.latest-title { display: inline-flex; align-items: baseline; gap: 0.6rem; flex-wrap: wrap; }
.latest-title .lt-jp { font-family: var(--f-display); font-size: clamp(1.1rem, 2.6vw, 1.5rem); color: var(--ink); letter-spacing: 0.02em; }
.latest-title .lt-en { font-family: var(--f-frag); font-weight: 400; font-size: clamp(0.85rem, 1.6vw, 1.05rem); color: var(--pink-soft); letter-spacing: 0.06em; text-transform: lowercase; }
.latest-all { font-family: var(--f-digital); font-size: 0.72rem; letter-spacing: 0.06em; color: var(--ink-dim); text-decoration: none; white-space: nowrap; transition: color 0.2s ease; }
.latest-all:hover { color: var(--cyan); }

.latest-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }

.post-card {
  display: flex; flex-direction: column; gap: 0.55rem;
  padding: 1.2rem 1.3rem 1.1rem;
  background: color-mix(in srgb, var(--panel) 90%, transparent);
  border: 1px solid var(--line);
  border-left: 2px solid var(--cyan);
  text-decoration: none;
  box-shadow: 3px 4px 0 rgba(0, 0, 0, 0.28);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.post-card:hover { transform: translateY(-3px); border-left-color: var(--pink-hot); box-shadow: 4px 6px 0 rgba(255, 95, 166, 0.22); }
.post-meta { display: flex; align-items: center; gap: 0.7rem; flex-wrap: wrap; font-family: var(--f-digital); font-size: 0.62rem; letter-spacing: 0.06em; color: var(--ink-faint); }
.post-fol { color: var(--cyan); }
.post-recipe { color: var(--pink); }
.post-date { margin-left: auto; color: var(--ink-faint); }
.post-title { font-family: var(--f-head); font-weight: 500; font-size: clamp(1.02rem, 1.8vw, 1.22rem); line-height: 1.4; letter-spacing: 0.01em; color: var(--ink); }
.post-card:hover .post-title { color: var(--cyan); }
.post-blurb { font-family: var(--f-frag); font-weight: 300; font-size: clamp(0.82rem, 1.3vw, 0.95rem); line-height: 1.65; color: var(--ink-dim); }
.post-seal { margin-top: auto; font-family: var(--f-digital); font-size: 0.66rem; letter-spacing: 0.08em; color: var(--pink-soft); }

@media (max-width: 680px) { .latest-grid { grid-template-columns: 1fr; } }

/* =================================================================
   The transmission — the one line left before the window closes.
   The quiet last beat: revealed only if you reach the bottom. Plain,
   because a hand-off under pressure is allowed to be plain.
   ================================================================= */
.transmission {
  position: relative;
  z-index: 10;
  max-width: 600px;
  margin: clamp(2.5rem, 7vw, 5.5rem) auto clamp(1rem, 3vw, 2rem);
  padding: 0 1.5rem;
  text-align: center;
}
.transmission::before {
  content: '';
  display: block;
  width: 38px; height: 1px;
  margin: 0 auto clamp(2rem, 5vw, 3.4rem);
  background: var(--line);
}
.transmission-mark {
  display: block;
  font-family: var(--f-digital);
  font-size: 0.68rem;
  letter-spacing: 0.32em;
  text-indent: 0.32em;
  color: var(--cyan);
  opacity: 0.55;
  margin-bottom: 1.1rem;
}
.transmission-body {
  font-family: var(--f-frag);
  font-weight: 300;
  font-size: clamp(0.96rem, 1.7vw, 1.2rem);
  line-height: 1.95;
  letter-spacing: 0.02em;
  color: var(--ink-dim);
}
.transmission-body b { color: var(--ink-soft); font-weight: 400; }

/* the reader's answer — a quiet vow, not a loud call to action */
.forget-btn {
  display: inline-block;
  margin-top: clamp(1.8rem, 4vw, 2.8rem);
  font-family: var(--f-digital);
  font-size: 0.74rem;
  letter-spacing: 0.16em;
  text-transform: lowercase;
  text-decoration: none;
  color: var(--ink-dim);
  padding: 0.6rem 1.6rem;
  border: 1px solid var(--line-hair);
  border-radius: 999px;
  transition: color 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease, background 0.4s ease;
}
.forget-btn:hover, .forget-btn:focus {
  color: var(--base);
  background: linear-gradient(120deg, var(--cyan), var(--pink));
  border-color: transparent;
  box-shadow: 0 0 24px -6px var(--pink-hot);
  outline: none;
}

/* =================================================================
   Footer
   ================================================================= */
.site-footer { position: relative; z-index: 10; max-width: 760px; margin: 0 auto; padding: 4rem 1.5rem 3.5rem; text-align: center; }
.footer-inner { display: flex; align-items: center; justify-content: center; gap: 0.7rem; flex-wrap: wrap; margin-bottom: 0.6rem; font-family: var(--f-digital); font-size: 0.74rem; }
.footer-logo { font-family: var(--f-display); font-size: 1.05rem; color: var(--ink); }
.footer-sep { color: var(--pink); font-size: 0.66rem; }
.site-footer a { color: var(--ink-dim); text-decoration: none; transition: color 0.2s; }
.site-footer a:hover { color: var(--cyan); }
.footer-craft { margin-top: 1.1rem; font-size: 0.78rem; color: var(--ink-faint); font-style: italic; }
.footer-craft a { color: var(--ink-dim); text-decoration: none; }
.footer-craft a:hover { color: var(--pink); }

/* Mobile: thin out the web-1.0 furniture so the footer breathes.
   Drop the boxy 88×31 badges and the webring (pure decoration); keep the
   counter, the blinky sign, the hidden ward door, the nav and the craft. */
@media (max-width: 768px) {
  .site-footer { padding: 2.8rem 1.25rem 2.6rem; }
  .site-footer .web-furniture .badge88,
  .site-footer .web-furniture .webring { display: none; }
  .site-footer .web-furniture { gap: 0.7rem 1rem; margin-top: 1.1rem; }
  .footer-inner { gap: 0.45rem 0.7rem; }
}

/* =================================================================
   Mobile
   ================================================================= */
@media (max-width: 768px) {
  .apps-scroll { gap: 1.25rem; padding: 1.5rem max(1rem, calc(50vw - min(90vw, 900px) / 2)); }
  .app-card { width: min(90vw, 900px); }
  .card-body { flex-direction: column; padding: 1.4rem; }
  .card-screenshot { flex: none; width: 100%; max-width: none; }
  .card-screenshot-frame { transform: none; }
  .card-screenshot-frame.is-portrait { max-height: 240px; }
  .card-screenshot-frame.is-portrait img { max-height: 240px; }
  .apps-nav { display: none; }
  .card-actions { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  .app-card { opacity: 1; transform: none; transition: none; }
  .scroll-indicator, .hero-open, .enter-cta, .hero-kanji { animation: none; }
  .apps-scroll { scroll-behavior: auto; }
  .card-screenshot-frame { transform: none; transition: none; }
  .presence-sign { animation: none; }
  .color-flip { transition: none; }
  .ticker { transition: opacity 0.3s ease; }
}
