/* ─────────────────────────────────────────────────────────────
   eye.css · the floating eye (2026-10-01). Logic: js/phone.js.

   One way back to the doors from anywhere: the red eye of the mark
   in a paper circle, bottom-right, every width. Press it and the
   index (home, the five doors, the reading room, what you saw, what you
   missed, WTF) comes in over
   the page. Phones keep the full-screen sheet from css/phone.css;
   above 640px the same sheet is a panel from the right with the page
   dimmed behind it. Only on the site (html.ph-site); Calling All Gods
   keeps its own Menu. Linked after css/phone.css.
   ───────────────────────────────────────────────────────────── */

/* ── The eye ── */
html.ph-site .ph-fab.ph-eye {
  display: inline-grid; place-items: center;
  position: fixed; z-index: 9000;
  right: max(16px, env(safe-area-inset-right, 0px));
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  width: 56px; height: 56px; padding: 0; margin: 0;
  border: 0; border-radius: 50%;
  background: #FCFCFA; color: #111110; cursor: pointer;
  box-shadow:
    inset 0 0 0 1px rgba(17,17,16,.2),
    0 0 0 3px #fff,
    0 0 0 3.5px rgba(14,14,12,.12),
    0 10px 22px -8px rgba(14,14,12,.5);
  transition: transform .3s cubic-bezier(.34,1.56,.64,1), opacity .3s, background-color .2s ease;
  -webkit-tap-highlight-color: transparent;
}
html.ph-site .ph-eye .ph-eye-mark {
  display: block; width: 30px; height: 19px;           /* eye.svg is 1234 × 765 */
  background: #E03A1F;
  -webkit-mask: url(../images/mark/eye.svg) center / contain no-repeat;
          mask: url(../images/mark/eye.svg) center / contain no-repeat;
  transition: transform .3s cubic-bezier(.34,1.56,.64,1);
}
html.ph-site .ph-eye .ph-fab-label {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
html.ph-site .ph-eye:hover, html.ph-site .ph-eye:focus-visible { background: #111110; outline: none; transform: translateY(-2px); }
html.ph-site .ph-eye:hover .ph-eye-mark, html.ph-site .ph-eye:focus-visible .ph-eye-mark { transform: scale(1.08); }
html.ph-site .ph-eye:focus-visible { outline: 2px solid #E03A1F; outline-offset: 5px; }
html.ph-site .ph-eye:active { transform: scale(.95); }
html.ph-site .ph-eye[aria-expanded="true"] { background: #111110; }
html.ph-site .ph-fab.ph-eye.is-tucked { transform: translateY(96px); opacity: 0; pointer-events: none; }

/* The eye is on every page, at all times (his ruling, 2026-10-04): over a work,
   a book, a toy and the breather too, and it never tucks away on scroll.
   The one exception is onboarding, the first-visit threshold on home. */
html.rk-th .ph-eye, html.rk-th-eye .ph-eye { opacity: 0; pointer-events: none; }
html.ph-site .ph-fab.ph-eye.is-tucked { transform: none; opacity: 1; pointer-events: auto; }
/* Above the breather's frost (9900); pressing it there closes the breather and opens the index. */
html.rk-breather-open .ph-fab.ph-eye { z-index: 9950; }
/* Above a book or toy reader (.modal, 9450), below the sheet (9500). */
html:has(.modal[aria-hidden="false"]) .ph-fab.ph-eye { z-index: 9460; }
/* The reader's thumbnail strip scrolls clear of it. */
html.ph-site .spread-thumbs { padding-right: calc(16px + 56px + 12px) !important; }

/* The tangent stickers clear the eye. */
html.ph-site .rk-sticker.pin-corner,
html.rk-breather-eye .rk-sticker.pin-corner { bottom: calc(16px + 56px + 14px + env(safe-area-inset-bottom, 0px)) !important; }

/* ── WTF, inside the sheet (every width) ── */
.ph-wtf {
  display: flex; align-items: center; gap: 1rem;
  margin-top: 1.6rem; padding-top: 1.1rem;
  border-top: 1px solid var(--rule-soft, rgba(17,17,16,0.16));
}
.ph-wtf[hidden] { display: none; }
.ph-wtf-b {
  flex: none; box-sizing: border-box;
  display: inline-flex; align-items: center; justify-content: center;
  height: 40px; min-width: 56px; padding: 0 1em; margin: 0 0 0 3px;
  border: 0; border-radius: 2px;
  background: #FCFCFA; color: #111110;
  font: 400 11.5px/1 var(--mono, ui-monospace, Menlo, monospace);
  letter-spacing: .22em; text-transform: uppercase; text-indent: .1em;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
  transform: rotate(1.5deg);
  box-shadow: inset 0 0 0 1px rgba(17,17,16,.22), 0 0 0 3px #fff, 0 0 0 3.5px rgba(14,14,12,.14), 0 8px 18px -8px rgba(14,14,12,.5);
  transition: transform .25s cubic-bezier(.34,1.56,.64,1), background-color .2s ease, color .2s ease;
}
.ph-wtf-b:hover, .ph-wtf-b:focus-visible { background: #111110; color: #FCFCFA; transform: rotate(0deg) translateY(-2px); outline: none; }
.ph-wtf-b:focus-visible { outline: 2px solid #E03A1F; outline-offset: 5px; }
.ph-wtf-b .rk-cen { position: relative; display: inline; white-space: nowrap; }
.ph-wtf-b .rk-cen-w { color: transparent !important; background: #111110; border-radius: 1px; padding: 0 .06em; }
.ph-wtf-b:hover .rk-cen-w, .ph-wtf-b:focus-visible .rk-cen-w { background: #FCFCFA; }
.ph-wtf-b .rk-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ph-wtf-tip {
  font-family: var(--serif, Georgia, serif); font-style: italic;
  font-size: 0.98rem; line-height: 1.35; color: var(--ink-2, #2C2B28);
}

/* ── What you saw, and Come back to this (every width) ──
   The way back, moved here from the breather's sticker (2026-10-01).
   One sideways row of the works you stopped at, newest first; under it the
   come-back line. Quiet: a mono kicker, small squares, the doors stay the thing. */
.ph-seen {
  margin-top: 1.6rem; padding-top: 1.1rem;
  border-top: 1px solid var(--rule-soft, rgba(17,17,16,0.16));
  min-width: 0;
}
.ph-seen[hidden], .ph-seen [hidden] { display: none !important; }
.ph-seen-k {
  margin: 0 0 .7rem;
  font: 400 11px/1 var(--mono, ui-monospace, Menlo, monospace);
  letter-spacing: .16em; text-transform: uppercase; color: var(--ink-2, #2C2B28);
}
.ph-seen-row {
  display: flex; gap: 6px; margin: 0 -3px; padding: 3px 3px 8px;
  overflow-x: auto; overflow-y: hidden; scrollbar-width: thin;
  -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; touch-action: pan-x pan-y;
}
.ph-seen-row a {
  flex: none; display: block; width: 56px; height: 56px;
  background: #E9E9E4; box-shadow: 0 0 0 1px rgba(17,17,16,.16);
  transition: transform .2s ease, box-shadow .2s ease;
}
.ph-seen-row a:hover, .ph-seen-row a:focus-visible { box-shadow: 0 0 0 2px var(--red, #E03A1F); transform: translateY(-2px); outline: none; }
.ph-seen-row img { display: block; width: 100%; height: 100%; object-fit: cover; -webkit-user-drag: none; pointer-events: none; }
.ph-seen-back {
  display: inline-flex; align-items: center; min-height: 44px; max-width: 100%;
  font-family: var(--serif, Georgia, serif); font-style: italic; font-size: 1.02rem; line-height: 1.3;
  color: var(--ink, #111110); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .22em;
  overflow-wrap: anywhere;
}
.ph-seen-back:hover, .ph-seen-back:focus-visible { color: var(--red, #E03A1F); outline: none; }
.ph-seen .ph-seen-row + .ph-seen-back { margin-top: .2rem; }

/* ── What you missed (every width) ──
   The last ADHD stickers that popped up and went, each drawn the way it popped
   up (paper, red, black or dot; tape, tag, tilt, words, picture) at half size,
   in one sideways row, so you know it again. A link goes where it pointed; the
   rest go back on the page when pressed. */
.ph-missed {
  margin-top: 1.6rem; padding-top: 1.1rem;
  border-top: 1px solid var(--rule-soft, rgba(17,17,16,0.16));
  min-width: 0;
}
.ph-missed[hidden] { display: none !important; }
.ph-missed-k { display: flex; align-items: center; gap: .7em; }
.ph-missed-tag {
  font-style: normal; font-size: 8.5px; letter-spacing: .14em; line-height: 1;
  padding: 3px 5px 2px; background: #111110; color: #FCFCFA;
}
.ph-missed-row {
  display: flex; align-items: flex-start; gap: 14px; margin: 0 -10px; padding: 16px 10px 16px;
  overflow-x: auto; overflow-y: hidden; scrollbar-width: thin;
  -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; touch-action: pan-x pan-y;
}
/* each one: the sticker as it popped up, drawn again at half size (zoom keeps the layout box honest) */
.ph-mi {
  all: unset; flex: none; box-sizing: border-box; display: block; cursor: pointer;
  padding: 2px; border-radius: 4px; -webkit-tap-highlight-color: transparent;
  transition: transform .22s cubic-bezier(.34,1.56,.64,1);
}
.ph-mi:hover, .ph-mi:focus-visible { transform: translateY(-3px); }
.ph-mi:focus-visible { outline: 2px solid var(--red, #E03A1F); outline-offset: 3px; }
.ph-mini {
  position: relative; display: block; box-sizing: border-box; zoom: .5;
  max-width: 22rem; color: #191815;
  font-family: var(--hand, cursive); font-weight: 400; text-align: left;
  transform: rotate(var(--r, -2deg)); pointer-events: none;
  -webkit-user-select: none; user-select: none;
}
.ph-mini .rk-s-body { font-size: 1.6rem; cursor: inherit; }
.ph-mini.m-big .rk-s-body { font-size: 2.6rem; white-space: nowrap; padding: .8rem 1.35rem 1.15rem; }
/* what sits on the tangents, the kid asides and the rest (the live ones: css/restless.css) */
.ph-mini.m-tangent { width: 250px; }
.ph-mini.m-tangent .rk-s-body { padding: 0.9rem 1rem 1.05rem; font-size: 1rem; line-height: 1.2; white-space: normal; }
.ph-mini.m-track { width: 230px; }
.ph-mini.m-doom { width: 270px; }
.ph-mini.m-kid-aside { width: 280px; }
.ph-mini.m-kid-pair { max-width: 19rem; }
.ph-mini.m-kid-pair .rk-s-body { font-size: 2.1rem; line-height: 1.04; white-space: normal; }
.ph-mini .rk-t { display: block; }
.ph-mini .rk-t::after { content: ""; display: table; clear: both; }
.ph-mini .rk-t-hand { display: block; font-family: var(--hand); font-size: 1.38rem; line-height: 1; color: var(--red, #E03A1F); margin-bottom: 0.3rem; }
.ph-mini.m-doom .rk-t-hand { font-size: 1.5rem; line-height: 1.02; }
.ph-mini .rk-t-title {
  display: block; font-family: var(--hand); font-weight: 600; font-size: 1.6rem; line-height: 1.02; color: inherit;
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.16em;
  text-decoration-color: color-mix(in srgb, currentColor 35%, transparent);
}
.ph-mini .rk-t-pitch { display: block; margin-top: 0.4rem; font-family: var(--serif); font-style: italic; font-size: 0.84rem; line-height: 1.4; color: var(--ink-2, #3a3935); }
.ph-mini .rk-t-lead { display: block; margin-top: 0.7rem; font-family: var(--hand); font-size: 1.12rem; line-height: 1; color: var(--red, #E03A1F); }
.ph-mini .rk-t-say { display: block; font-family: var(--hand); font-size: 1.36rem; line-height: 1.1; color: inherit; }
.ph-mini .rk-t-img {
  float: right; width: 72px; height: 72px; object-fit: cover; margin: -0.2rem -0.2rem 0.4rem 0.7rem;
  background: #FCFCFA; padding: 4px 4px 11px; box-shadow: 0 6px 14px rgba(14,14,12,.18); transform: rotate(4deg);
}
.ph-mini.v-ink .rk-t-pitch { color: rgba(252,252,250,.72); }
.ph-seen:not([hidden]) + .ph-missed { margin-top: 1.1rem; }

/* ── The sheet as a panel, above 640px ── */
@media (min-width: 641px) {
  html.ph-site .ph-scrim {
    display: block; position: fixed; inset: 0; z-index: 9400;
    background: rgba(14,14,12,.32);
    opacity: 0; transition: opacity .24s ease;
  }
  html.ph-site .ph-scrim[hidden] { display: none; }
  html.ph-site .ph-scrim.is-open { opacity: 1; }

  html.ph-site .ph-sheet {
    display: flex; flex-direction: column;
    position: fixed; top: 0; right: 0; bottom: 0; z-index: 9500;
    width: min(27rem, 92vw); box-sizing: border-box;
    overflow-y: auto; overscroll-behavior: contain;
    padding: 0 2rem 1.8rem;
    background: var(--paper, #FCFCFA); color: var(--ink, #111110);
    box-shadow: -24px 0 60px -30px rgba(14,14,12,.55);
    opacity: 0; transform: translateX(28px);
    transition: opacity .24s ease, transform .32s cubic-bezier(.2,.7,.2,1);
  }
  html.ph-site .ph-sheet[hidden] { display: none; }
  html.ph-site .ph-sheet.is-open { opacity: 1; transform: none; }
  html.ph-site.ph-locked, html.ph-site.ph-locked body { overflow: hidden; }

  html.ph-site .ph-head {
    display: flex; align-items: center; justify-content: space-between;
    min-height: 64px; border-bottom: 1px solid var(--rule, #1A1A18);
  }
  html.ph-site .ph-kicker {
    font-family: var(--mono, monospace); font-size: 11px;
    letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-2, #2C2B28);
  }
  html.ph-site .ph-close {
    width: 44px; height: 44px; margin-right: -10px;
    border: 0; background: none; color: inherit; cursor: pointer;
    font: 300 2rem/1 var(--display, Georgia, serif);
  }
  html.ph-site .ph-close:hover { color: var(--red, #E03A1F); }

  html.ph-site .ph-home {
    display: flex; align-items: baseline; justify-content: space-between;
    padding: 1.1rem 0 0.9rem; text-decoration: none; color: inherit;
    border-bottom: 1px solid var(--rule-soft, rgba(17,17,16,0.16));
  }
  html.ph-site .ph-home .ph-title { font-family: var(--display, Georgia, serif); font-style: italic; font-size: 1.45rem; }
  html.ph-site .ph-home-note { font-family: var(--serif, Georgia, serif); font-style: italic; font-size: 0.9rem; color: var(--ink-2, #2C2B28); }

  html.ph-site .ph-doors { display: flex; flex-direction: column; }
  html.ph-site .ph-door {
    display: grid; grid-template-columns: 3.4rem 1fr; align-items: baseline;
    padding: 0.8rem 0; text-decoration: none; color: inherit;
    border-bottom: 1px solid var(--rule-soft, rgba(17,17,16,0.16));
  }
  html.ph-site .ph-num { font-family: var(--mono, monospace); font-size: 11px; letter-spacing: 0.12em; color: var(--ink-2, #2C2B28); }
  html.ph-site .ph-door .ph-title {
    font-family: var(--display, Georgia, serif); font-weight: 400;
    font-size: 1.95rem; line-height: 1.04; letter-spacing: -0.015em;
    transition: color .15s ease;
  }
  html.ph-site .ph-door:hover .ph-title, html.ph-site .ph-home:hover .ph-title { color: var(--red, #E03A1F); font-style: italic; }
  html.ph-site .ph-sheet [aria-current="page"] .ph-title { font-style: italic; color: var(--red, #E03A1F); }

  html.ph-site .ph-room { display: grid; grid-template-columns: 1fr 1fr; column-gap: 1.2rem; margin-top: 1.3rem; }
  html.ph-site .ph-room a {
    display: flex; align-items: center; min-height: 40px;
    font-family: var(--serif, Georgia, serif); font-size: 1.02rem;
    font-variant-caps: all-small-caps; letter-spacing: 0.06em;
    color: var(--ink, #111110); text-decoration: none;
    border-bottom: 1px solid var(--rule-soft, rgba(17,17,16,0.16));
  }
  html.ph-site .ph-room a:hover, html.ph-site .ph-room a[aria-current="page"] { color: var(--red, #E03A1F); }

  html.ph-site .ph-foot {
    margin-top: auto; padding-top: 1.8rem;
    display: flex; flex-direction: column; gap: 0.15rem;
    font-family: var(--serif, Georgia, serif); font-size: 0.98rem;
  }
  html.ph-site .ph-foot a { color: var(--ink, #111110); display: inline-flex; align-items: center; min-height: 34px; }
  html.ph-site .ph-social { display: flex; gap: 1.4rem; }
  html.ph-site .ph-social a { font-size: 0.95rem; color: var(--ink-2, #2C2B28); }
}

/* ── Phones: the eye takes the Index pill's place ── */
@media (max-width: 640px) {
  html.ph-site .ph-fab.ph-eye { right: max(14px, env(safe-area-inset-right, 0px)); bottom: calc(14px + env(safe-area-inset-bottom, 0px)); }
  html.ph-site .ph-wtf { margin-top: 1.4rem; }
}

@media (prefers-reduced-motion: reduce) {
  html.ph-site .ph-fab.ph-eye, html.ph-site .ph-eye .ph-eye-mark, html.ph-site .ph-sheet, html.ph-site .ph-scrim, .ph-wtf-b, .ph-seen-row a, .ph-mi { transition: none; }
}
@media print { .ph-eye, .ph-scrim { display: none !important; } }
