/* ============================================================
   eSora Frequency — the eSora mark IS the experience.
   Editorial Paper system using ONLY the approved eSora tokens:
   Paper #F6F5F1, Ink #100F0D, rust-on-paper #B6481B (accents),
   rust-on-ink #D2602C (on-dark highlights), paper-on-rust
   #FFF7F0; secondary text uses the site's approved neutrals
   (#4A4A4F ink2 / #8A8A92 muted). No invented brown/orange shades.
   Fraunces for the daily thought, Geist for interface text,
   JetBrains Mono for technical labels and time.
   No navy, no glass, no orbs, no orbit graphics, no black circle.
   ============================================================ */

/* ---------- brand fonts (self-hosted subsets, assets/fonts/) ---------- */
@font-face{
  font-family:'Fraunces';font-style:normal;font-weight:400;font-display:swap;
  src:url('../fonts/fraunces-400.woff2') format('woff2');
}
@font-face{
  font-family:'Fraunces';font-style:italic;font-weight:400;font-display:swap;
  src:url('../fonts/fraunces-400-italic.woff2') format('woff2');
}
@font-face{
  font-family:'Geist';font-style:normal;font-weight:400 500;font-display:swap;
  src:url('../fonts/geist-400-500.woff2') format('woff2');
}

.ef{
  /* approved eSora brand tokens (binding spec) */
  --esora-paper:#F6F5F1;
  --esora-ink:#100F0D;
  --esora-rust-on-paper:#B6481B;
  --esora-rust-on-ink:#D2602C;
  --esora-paper-on-rust:#FFF7F0;
  --ef-paper:var(--esora-paper);
  --ef-ink:var(--esora-ink);
  --ef-rust:var(--esora-rust-on-paper);
  --ef-line:rgba(16,15,13,.13);      /* 1px border, derived from Ink */
  --ef-mut:#4A4A4F;                  /* approved site neutral (ink2), AA on Paper */
  --ef-shadow:0 24px 60px -28px rgba(16,15,13,.28),0 4px 14px -8px rgba(16,15,13,.14);
  --ef-glyph-shadow:0 12px 28px -14px rgba(16,15,13,.38);
  --ef-ease:cubic-bezier(.22,1,.36,1);
  --ef-edge:calc(20px + env(safe-area-inset-right,0px));
  --ef-bottom:calc(20px + env(safe-area-inset-bottom,0px));
}
.ef *,.ef *::before,.ef *::after{box-sizing:border-box}
.ef[hidden],.ef [hidden]{display:none !important}
.ef{
  position:fixed;z-index:960;
  font-family:'Geist',var(--body,Inter,system-ui,sans-serif);
  color:var(--ef-ink);
}

/* ---------- the mark (official window.__markPaths geometry) ---------- */
.ef-mark{display:block}
.ef-m-ink{fill:var(--ef-ink)}
.ef-m-e{fill:var(--ef-rust)}
.ef-m-light{transition:opacity .5s ease}
.ef-m-ember{opacity:.72;transition:opacity .3s ease}
.ef-m-ember-core{opacity:.85;transition:opacity .3s ease}
/* track progress: a thin rust stroke along the glyph's existing outer
   contour (the official ink ring path; dasharray/offset driven from JS) */
.ef-m-ring{fill:none;stroke:var(--ef-rust);stroke-width:26;stroke-linecap:round}

/* ---------------- collapsed: the bare glyph ---------------- */
.ef-glyph{
  right:var(--ef-edge);bottom:calc(var(--ef-bottom) + var(--ef-consent-h,0px));
  width:66px;height:66px;padding:5px;border-radius:50%;cursor:pointer;
  /* nearly-invisible Paper backing so the Ink ring survives dark chapters */
  background:rgba(246,245,241,.78);
  -webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px);
  border:1px solid rgba(16,15,13,.07);
  box-shadow:var(--ef-glyph-shadow);
  opacity:0;transform:translateY(6px);pointer-events:none;
  transition:opacity .45s var(--ef-ease),transform .45s var(--ef-ease),box-shadow .4s ease;
}
.ef-glyph.on{opacity:1;transform:none;pointer-events:auto}
.ef-glyph.ef-dock-left{right:auto;left:calc(20px + env(safe-area-inset-left,0px))}
.ef-glyph-art{display:block;width:56px;height:56px}
.ef-glyph-art .ef-mark{width:56px;height:56px}
.ef-glyph:hover,.ef-glyph:focus-visible{box-shadow:0 14px 32px -14px rgba(16,15,13,.45)}
.ef-glyph:hover .ef-m-ember,.ef-glyph:focus-visible .ef-m-ember{opacity:1}
.ef-glyph.ef-playing .ef-m-ember{opacity:1}

/* hover/focus: a rust hairline extends, then "Listen · Today's thought" */
.ef-glyph-reveal{
  position:absolute;right:calc(100% - 2px);top:50%;transform:translateY(-50%);
  display:flex;align-items:center;pointer-events:none;
}
.ef-glyph-line{width:0;height:1px;background:var(--ef-rust);flex:none;order:2;
  transition:width .32s var(--ef-ease)}
.ef-glyph-hint{
  order:1;white-space:nowrap;margin-right:0;
  font-family:var(--mono,'JetBrains Mono',monospace);font-size:10.5px;
  letter-spacing:.06em;text-transform:uppercase;color:var(--ef-ink);
  background:var(--ef-paper);border:1px solid var(--ef-line);border-radius:999px;
  padding:9px 14px;box-shadow:0 10px 24px -14px rgba(16,15,13,.3);
  opacity:0;transform:translateX(8px);
  transition:opacity .3s var(--ef-ease) .14s,transform .3s var(--ef-ease) .14s;
}
.ef-glyph:hover .ef-glyph-line,.ef-glyph:focus-visible .ef-glyph-line{width:18px}
.ef-glyph:hover .ef-glyph-hint,.ef-glyph:focus-visible .ef-glyph-hint{opacity:1;transform:none}
.ef-glyph.ef-dock-left .ef-glyph-reveal{right:auto;left:calc(100% - 2px)}
.ef-glyph.ef-dock-left .ef-glyph-line{order:1}
.ef-glyph.ef-dock-left .ef-glyph-hint{order:2}

/* ---------------- invitation (grows from the glyph) ---------------- */
.ef-invite{
  right:var(--ef-edge);bottom:calc(var(--ef-bottom) + 76px + var(--ef-consent-h,0px));
  width:min(360px,calc(100vw - 32px));
  background:var(--ef-paper);border:1px solid var(--ef-line);border-radius:20px;
  box-shadow:var(--ef-shadow);padding:24px 26px;
  transform-origin:100% 100%;
  opacity:0;transform:translateY(10px) scale(.96);pointer-events:none;
  transition:opacity .4s var(--ef-ease),transform .4s var(--ef-ease);
}
.ef-invite.on{opacity:1;transform:none;pointer-events:auto}
.ef-invite.ef-dock-left{right:auto;left:calc(20px + env(safe-area-inset-left,0px));transform-origin:0 100%}
.ef-invite-q{
  margin:0 0 18px;font-family:'Fraunces',Georgia,serif;font-weight:400;font-style:italic;
  font-size:19px;line-height:1.32;color:var(--ef-ink);
}
.ef-invite-row{display:flex;gap:10px;flex-wrap:wrap}
.ef-btn{
  display:inline-flex;align-items:center;justify-content:center;min-height:44px;
  font:inherit;font-size:14px;font-weight:500;border-radius:999px;padding:11px 20px;
  cursor:pointer;border:1px solid transparent;
  transition:background .3s ease,color .3s ease,border-color .3s ease;
}
.ef-btn--sound{background:var(--ef-rust);color:var(--esora-paper-on-rust)}
.ef-btn--sound:hover{background:var(--ef-ink)}
.ef-btn--quiet{background:transparent;color:var(--ef-ink);border-color:var(--ef-line)}
.ef-btn--quiet:hover{border-color:var(--ef-ink)}

/* ---------------- expanded: the editorial Paper surface ---------------- */
.ef-panel{
  right:var(--ef-edge);bottom:calc(var(--ef-bottom) + var(--ef-consent-h,0px));
  width:min(410px,calc(100vw - 32px));
  max-height:min(520px,calc(100dvh - 40px));
  overflow-y:auto;overscroll-behavior:contain;
  background:var(--ef-paper);
  border:1px solid var(--ef-line);border-radius:22px;box-shadow:var(--ef-shadow);
  padding:28px 32px 24px;
  transform-origin:100% 100%;
  opacity:0;pointer-events:none;
}
.ef-panel:not([hidden]){pointer-events:auto}
.ef-panel.on{opacity:1;transition:opacity .25s ease}
.ef-panel.ef-dock-left{right:auto;left:calc(20px + env(safe-area-inset-left,0px));transform-origin:0 100%}
.ef-handle{display:none}
.ef-edge{
  position:absolute;top:-1px;left:26px;right:26px;height:1px;
  background:var(--ef-rust);transform:scaleX(0);transform-origin:100% 50%;
  pointer-events:none;
}

/* -- header: THE glyph (the only mark in the panel — and the play/pause
      control) + mono label + one close control -- */
.ef-head{display:flex;align-items:flex-start;gap:12px}
.ef-head-mark{
  position:relative;flex:none;width:44px;height:44px;margin:-7px 0 0 -7px;
  padding:4px;background:none;border:0;border-radius:50%;cursor:pointer;
}
.ef-head-mark .ef-mark{width:36px;height:36px}
/* hover/focus overlay: a small play/pause symbol over the glyph — no
   background, no circle, just the symbol */
.ef-head-overlay{
  position:absolute;inset:0;display:grid;place-items:center;pointer-events:none;
  opacity:0;transition:opacity .2s ease;
}
.ef-head-overlay svg{width:11px;height:11px;fill:var(--ef-paper)}
.ef-head-mark:hover .ef-head-overlay,.ef-head-mark:focus-visible .ef-head-overlay{opacity:1}
.ef-head-label{
  margin:2px 0 0;font-family:var(--mono,'JetBrains Mono',monospace);font-size:10.5px;
  letter-spacing:.06em;text-transform:uppercase;line-height:1.75;color:var(--ef-ink);
}
.ef-head-label span{display:block;color:var(--ef-mut);letter-spacing:.06em}
.ef-close{
  margin:-6px -10px 0 auto;width:44px;height:44px;flex:none;border-radius:50%;
  background:none;border:1px solid transparent;cursor:pointer;
  display:grid;place-items:center;color:var(--ef-mut);
  transition:color .3s,border-color .3s;
}
.ef-close:hover{color:var(--ef-ink);border-color:var(--ef-line)}
.ef-close svg{width:15px;height:15px;stroke:currentColor;stroke-width:1.7;fill:none;stroke-linecap:round}

/* -- daily thought: the emotional centre -- */
.ef-thought{margin-top:26px}
.ef-eyebrow{
  margin:0 0 14px;font-family:var(--mono,'JetBrains Mono',monospace);
  font-size:10px;letter-spacing:.06em;text-transform:uppercase;color:var(--ef-rust);
}
.ef-quote{
  margin:0;font-family:'Fraunces',Georgia,serif;font-weight:400;
  font-size:34px;line-height:1.12;letter-spacing:0;text-align:left;
  max-width:34rem;color:var(--ef-ink);
}
.ef-trow{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:14px}
.ef-another{
  background:none;border:0;padding:10px 0;min-height:44px;cursor:pointer;
  font:inherit;font-size:13.5px;font-weight:500;color:var(--ef-rust);
  display:inline-flex;align-items:center;gap:7px;
}
.ef-another svg{width:13px;height:13px;stroke:currentColor;stroke-width:1.8;fill:none;stroke-linecap:round;stroke-linejoin:round;
  transition:transform .3s var(--ef-ease)}
.ef-another:hover svg{transform:translateX(3px)}
.ef-ticons{display:flex;gap:2px}
.ef-ticon{
  width:44px;height:44px;border-radius:50%;border:1px solid transparent;
  background:none;cursor:pointer;display:grid;place-items:center;color:var(--ef-mut);
  transition:color .3s,border-color .3s;
}
.ef-ticon:hover{color:var(--ef-ink);border-color:var(--ef-line)}
.ef-ticon svg{width:15px;height:15px;stroke:currentColor;stroke-width:1.6;fill:none;stroke-linecap:round;stroke-linejoin:round}

/* -- music row: one quiet row (title + description, dot + times, hair) -- */
.ef-music{
  margin-top:22px;border-top:1px solid var(--ef-line);padding-top:20px;
  display:flex;align-items:flex-start;gap:14px;
}
.ef-music-meta{flex:1;min-width:0}
.ef-title{margin:0;font-weight:500;font-size:16px;letter-spacing:-.005em;color:var(--ef-ink)}
.ef-desc{margin:3px 0 0;font-size:12.5px;line-height:1.45;color:var(--ef-mut)}
.ef-music-times{display:flex;align-items:center;gap:10px;margin-top:10px}
/* a very small rust dot communicates playing status — nothing louder */
.ef-dot{
  width:6px;height:6px;flex:none;border-radius:50%;background:var(--ef-rust);
  opacity:0;transform:scale(.5);transition:opacity .25s ease,transform .25s ease;
}
.ef-dot.on{opacity:1;transform:none}
/* quiet state text: tiny muted Geist, no capitals, no heavy tracking */
.ef-state{font-size:11px;color:var(--ef-mut);flex:none;min-width:56px}
.ef-time{
  font-family:var(--mono,'JetBrains Mono',monospace);font-size:10.5px;
  color:var(--ef-mut);flex:none;min-width:30px;
}
.ef-time:last-child{text-align:right}
/* one 1px rust progress hairline; the range twin lies transparently on top
   so click/drag and keyboard both seek natively; a small refined handle
   appears only during hover or keyboard focus */
.ef-progress{position:relative;flex:1;height:20px;display:flex;align-items:center;border-radius:4px}
.ef-hair{position:relative;width:100%;height:1px;background:rgba(16,15,13,.14)}
.ef-hair-fill{
  position:absolute;inset:0;background:var(--ef-rust);
  transform-origin:0 50%;transform:scaleX(0);
}
.ef-hair-handle{
  position:absolute;top:50%;left:0;width:10px;height:10px;border-radius:50%;
  background:var(--ef-paper);border:1.5px solid var(--ef-rust);
  box-shadow:0 1px 3px rgba(16,15,13,.25);
  transform:translate(-50%,-50%);opacity:0;transition:opacity .2s ease;
  pointer-events:none;
}
.ef-progress:hover .ef-hair-handle,.ef-progress:focus-within .ef-hair-handle{opacity:1}
.ef-seek{
  position:absolute;left:0;right:0;top:50%;transform:translateY(-50%);
  width:100%;height:32px;margin:0;opacity:0;cursor:pointer;
}
.ef-progress:focus-within{outline:2px solid var(--ef-rust);outline-offset:3px}

/* volume: small icon; the rust slider reveals on hover/activation */
.ef-volwrap{display:flex;align-items:center;flex:none;margin-top:-2px}
.ef-volbtn{
  width:44px;height:44px;border-radius:50%;border:1px solid transparent;
  background:none;cursor:pointer;display:grid;place-items:center;color:var(--ef-mut);
  transition:color .3s,border-color .3s;
}
.ef-volbtn:hover{color:var(--ef-ink);border-color:var(--ef-line)}
.ef-volbtn svg{width:16px;height:16px;fill:currentColor;stroke:none}
.ef-volbtn svg path+path{fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round}
.ef-vol{
  width:0;opacity:0;margin:0;cursor:pointer;accent-color:var(--ef-rust);
  transition:width .35s var(--ef-ease),opacity .3s ease;
}
.ef-volwrap:hover .ef-vol,.ef-volwrap:focus-within .ef-vol{width:76px;opacity:1}

/* credit + licensing: quiet 11px text under the music row */
.ef-credit{margin:16px 0 0;font-size:11px;line-height:1.6;color:var(--ef-mut)}

/* -- share card (compact, same Paper system) -- */
.ef-share{margin-top:16px}
.ef-card{
  border:1px solid var(--ef-line);border-radius:16px;background:var(--esora-paper-on-rust);
  padding:18px 18px 14px;
}
.ef-card-quote{
  margin:0 0 12px;font-family:'Fraunces',Georgia,serif;font-weight:400;
  font-size:17px;line-height:1.35;color:var(--ef-ink);
}
.ef-card-rule{display:block;width:34px;height:1px;background:var(--ef-rust);margin:0 0 10px}
.ef-card-brand{
  margin:0;font-family:var(--mono,'JetBrains Mono',monospace);font-size:9.5px;
  letter-spacing:.06em;text-transform:uppercase;color:var(--ef-mut);
}
.ef-card-url{margin:4px 0 0;font-size:11px;color:var(--ef-mut);word-break:break-all}
.ef-share-actions{display:flex;gap:16px;margin-top:6px}
.ef-saction{
  background:none;border:0;padding:8px 0;min-height:44px;cursor:pointer;
  font:inherit;font-size:12.5px;font-weight:500;color:var(--ef-rust);
}
.ef-saction:hover{text-decoration:underline;text-underline-offset:3px}
.ef-saction--quiet{color:var(--ef-mut)}

/* -- focus + screen-reader helpers -- */
.ef :focus-visible{outline:2px solid var(--ef-rust);outline-offset:3px;border-radius:8px}
.ef-glyph:focus-visible,.ef-close:focus-visible,.ef-ticon:focus-visible,
.ef-volbtn:focus-visible,.ef-head-mark:focus-visible{border-radius:50%}
.ef-sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap}

/* ---------------- mobile: the glyph + a Paper bottom sheet ---------------- */
@media (max-width:720px){
  .ef-glyph{
    width:58px;height:58px;padding:5px;
    right:calc(14px + env(safe-area-inset-right,0px));
    bottom:calc(14px + env(safe-area-inset-bottom,0px) + var(--ef-consent-h,0px));
  }
  .ef-glyph.ef-dock-left{right:auto;left:calc(14px + env(safe-area-inset-left,0px))}
  .ef-glyph-art,.ef-glyph-art .ef-mark{width:48px;height:48px}
  .ef-glyph-hint{display:none} /* touch has no hover; the glyph speaks for itself */
  .ef-invite{
    left:12px;right:12px;bottom:calc(84px + env(safe-area-inset-bottom,0px) + var(--ef-consent-h,0px));
    width:auto;transform-origin:50% 100%;
  }
  .ef-invite.ef-dock-left{left:12px;right:12px}
  .ef-panel{
    left:0;right:0;bottom:var(--ef-consent-h,0px);width:auto;
    max-height:86dvh;border-radius:24px 24px 0 0;border-bottom:0;
    padding:4px 22px calc(20px + env(safe-area-inset-bottom,0px));
    transform-origin:50% 100%;
  }
  .ef-panel.ef-dock-left{left:0}
  .ef-handle{display:grid;place-items:center;height:30px;cursor:grab;touch-action:none}
  .ef-handle i{width:44px;height:4px;border-radius:2px;background:rgba(16,15,13,.18)}
  .ef-quote{font-size:28px;line-height:1.12}
  .ef-thought{margin-top:20px}
  .ef-desc{display:none} /* nonessential on small screens */
  .ef-vol{display:none}    /* mute stays; slider reveals on focus-within only */
  .ef-volwrap:focus-within .ef-vol{display:block;width:76px;opacity:1}
}

/* ---------------- reduced motion: short fades only ---------------- */
@media (prefers-reduced-motion: reduce){
  .ef-invite,.ef-glyph,.ef-panel,.ef-btn,.ef-ticon,.ef-volbtn,.ef-close,.ef-another svg{
    transition:opacity .2s ease,color .2s ease,background-color .2s ease,border-color .2s ease !important;
    transform:none !important;animation:none !important;
  }
  .ef-glyph-hint{transition:opacity .2s ease !important;transform:none !important}
  .ef-glyph-line{transition:none !important}
  .ef-m-light{transition:opacity .3s ease}
  .ef-edge{display:none}
}

/* quiet 11px note (Web Audio unavailable) — approved neutral */
.ef-credit-note{font-size:11px;color:var(--ef-mut);margin-top:10px}
