/* ═══════════════════════════════════════════════════════════════════════
   CIRCLE THRICE · CANON DELTA R5-14  —  ELEVATION (CT-ELV) + MOTION (CT-MOT)
   LOCKED (Ivy, 2026-07-29). The R5-14 integrated portal is the definition of
   good for the current design; the elements altered there are canon for those
   elements from here on.

   This file is ADDITIVE. Earlier artifacts do not import it and are unchanged
   by design ("do not go back and change anything in previous designs").
   Import order on a new page:
       ct-canon.css → ct-canon-r5.css → ct-canon-r514.css → page styles
   and put class `r514` on the screen root to take the elevation + motion rules.
   Tokens are global (:root) so any design can cite them by name.

   Reference implementation: R5-14 Integrated Portal Prototype.html (D-042)
   Specimen sheet / spec: R5-15 Style Guide - Portal Canon.html (D-043)
   ═══════════════════════════════════════════════════════════════════════ */
:root{
  /* ── CT-ELV01 · the sheet elevation scale ───────────────────────────
     Four steps only. Every shadow in the system is one of these; no bespoke
     shadows. Each is layered (a contact shadow + a soft cast) so paper reads
     as paper, and each stays UNDER the hairline in weight — dimension never
     competes with data. */
  --lift-1:0 1px 2px rgba(43,50,64,.05);                                                   /* at rest on white */
  --lift-2:0 1px 2px rgba(43,50,64,.06),0 4px 11px -6px rgba(43,50,64,.13);                 /* a sheet on a ground */
  --lift-3:0 2px 5px rgba(30,40,60,.07),0 15px 35px -11px rgba(30,40,60,.25),
           0 42px 82px -35px rgba(30,40,60,.3);                                             /* floating over content */
  --lift-frame:0 1px 2px rgba(30,40,60,.05),0 11px 26px -9px rgba(30,40,60,.15),
           0 36px 72px -32px rgba(30,40,60,.23);                                            /* the app frame on the desk */

  /* ── CT-ELV02 · the overlapping-sheet chrome casts ──────────────────
     The chrome is a stack of sheets: rail over header over timespan bar over
     tab row over body, the tray on top. Each casts only onto the sheet beneath. */
  --cast-rail:5px 0 14px -10px rgba(30,40,60,.28);
  --cast-strip:0 4px 10px -7px rgba(30,40,60,.28);
  --cast-tsrow:0 5px 12px -8px rgba(30,40,60,.28);
  --cast-tabs:0 6px 14px -9px rgba(30,40,60,.3);
  --cast-tray:-5px 0 15px -13px rgba(30,40,60,.22);
  --cast-slide-in:-22px 0 40px -18px rgba(30,40,60,.5);   /* a sheet mid-travel */
  --cast-slide-rest:-2px 0 18px -14px rgba(30,40,60,.3),0 -6px 22px -13px rgba(30,40,60,.28);

  /* ── CT-ELV03 · hairlines ───────────────────────────────────────────
     Two weights. The soft one is for an edge that meets a tinted ground, where
     the full rule reads heavy. Scroll-edge masks are hairlines, never fades. */
  --hair:1px solid var(--vpale);
  --hair-soft:1px solid rgba(221,228,236,.55);
  --hair-edge:var(--vpale);            /* the 1px scroll-edge line of a scrolling band */

  /* ── CT-ELV04 · grounds (the "rooms") ───────────────────────────────
     A ground says which room you are in. Chrome is always white or the nav tone,
     so the always-today line stays continuous across every room. */
  --nav-tone:var(--paper);   /* header nav strip — the tone of the CT logo square */
  --tab-tone:var(--white);   /* the Overview/Orrery row */
  --tray-bg:#fcfdff;         /* the relevance tray: a v-pale blue-grey, LIGHTER than nav */
  --room-lib:#e8eef6;        /* the Library card grid: medium-light blue-grey */
  --room-read:var(--white);  /* a detail page is ALL WHITE, end to end */

  /* ── CT-MOT01 · the motion scale ────────────────────────────────────
     Three durations, two easings, nothing over 800ms. Motion never moves data:
     it moves SHEETS. */
  --mot-fast:.34s;   /* a field, a chip, a fade */
  --mot-base:.46s;   /* a sheet arriving */
  --mot-slow:.78s;   /* a page travelling across another */
  --mot-breath:2.6s; /* an attention breath */
  --mot-ease:cubic-bezier(.22,.72,.24,1);        /* soft ease-out, the default */
  --mot-ease-long:cubic-bezier(.16,.68,.16,1);   /* longer glide, for --mot-slow */
}

/* ═══ CT-ELV · applied ═════════════════════════════════════════════════ */
.r514{border-radius:3px;box-shadow:var(--lift-frame);}
.r514 .rail{position:relative;z-index:5;box-shadow:var(--cast-rail);}
.r514 .strip{position:relative;z-index:4;background:var(--nav-tone);box-shadow:var(--cast-strip);}
.r514 .tsrow{position:relative;z-index:3;box-shadow:var(--cast-tsrow);}
.r514 .chrome-tabs{position:relative;z-index:2;background:var(--tab-tone);box-shadow:var(--cast-tabs);}
.r514 .rl{position:relative;z-index:6;background:var(--tray-bg);border-left:var(--hair-soft);box-shadow:var(--cast-tray);}
.r514 .rl>*{position:relative;z-index:1;}
/* CT-ELV05 · grain. A ground gets its texture from fine fractal noise, never a
   repeating hairline weave — a 1px weave moirés at fractional zoom. */
.r514 .rl::before{content:"";position:absolute;inset:0;pointer-events:none;opacity:.35;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.3'/%3E%3C/svg%3E"),radial-gradient(130% 90% at 50% -10%,rgba(63,109,150,.05),transparent 62%);background-size:140px 140px,100% 100%;mix-blend-mode:multiply;}
.r514 .rl .tstat,.r514 .rl .stl{box-shadow:var(--lift-2);}
/* CT-NAV01 ink · canon of the portal: the rail carries the tray's label ink,
   never the lightest --icon (it read faint at 7px on the nav tone). */
.r514 .rail .ni{color:var(--muted);}
.r514 .rail .ni-lbl{color:var(--muted);font-weight:600;}
.r514 .rail .ni:hover,.r514 .rail .ni:hover .ni-lbl,.r514 .rail .ni.on{color:var(--blue);}
/* rooms */
.r514[data-area="library"] .ctp-body{background:var(--room-lib);}
.r514 .lib-scroll{background:transparent;}
.r514 .lib-page,.r514 .lib-page-top,.r514 .lib-toolbar{background:var(--room-read);}
/* CT-ELV06 · a scrolling band's edges are a hairline + a slight cast, never a fade */
.r514 .bv-wrap::before,.r514 .bv-wrap::after{width:1px;background:var(--hair-edge);}
.r514 .bv-wrap::before{box-shadow:3px 0 7px -3px rgba(30,40,60,.22);}
.r514 .bv-wrap::after{box-shadow:-3px 0 7px -3px rgba(30,40,60,.22);}
/* the one glassy sheet in the system: a popover floating over the reading column */
.g13pop{background:rgba(255,255,255,.9);backdrop-filter:blur(14px) saturate(1.4);-webkit-backdrop-filter:blur(14px) saturate(1.4);box-shadow:var(--lift-3);}

/* ═══ CT-MOT · applied ═════════════════════════════════════════════════ */
/* CT-MOT02 · load-in "Sheets settle" — first paint only, resting design untouched.
   Full choreography in r5-portal-enter.css (.ent-a). */
/* CT-MOT03 · a detail page SLIDES OVER: in from the right, no bounce, its leading
   edge shedding a cast shadow as it lands. Paper over paper. */
@keyframes ctSlideOver{
  from{transform:translateX(7%);box-shadow:var(--cast-slide-in);}
  to{transform:none;box-shadow:var(--cast-slide-rest);}
}
.r514 .lib-page.open{animation:ctSlideOver var(--mot-slow) var(--mot-ease-long) both;}
/* CT-MOT04 · the attention BREATH — a closed affordance swells and settles three
   times, then stops for good. No glow, no colour of its own. */
@keyframes ctBreath{0%,100%{transform:translateX(0) scale(1);}50%{transform:translateX(-2.5px) scale(1.03);}}
@keyframes ctBreathBg{0%,100%{background:transparent;}50%{background:var(--paper);}}
.r514 .rl-strip.rl-cue{animation:ctBreathBg var(--mot-breath) ease-in-out 3;}
.r514 .rl-strip.rl-cue>*{animation:ctBreath var(--mot-breath) ease-in-out 3;transform-origin:center;}
/* CT-MOT05 · reduced motion turns the whole layer off. Non-negotiable. */
@media (prefers-reduced-motion:reduce){
  .r514,.r514 *{animation:none!important;transition:none!important;}
}
