/* =====================================================================
   בינה עסקית · course site
   Slash + Clock system: 45° cuts, diagonal wipes, one house ease.
   ===================================================================== */

:root {
  --ink: #0A1033;
  --deep: #06142A;
  --teal: #00A5A5;
  --teal-l: #2CD1CD;
  --paper: #F2EEE4;
  --danger: #FF5A36;

  --m-A: #14B4C2; --m-B: #4C8DFF; --m-C: #F2C811; --m-D: #B07CFF; --m-E: #FF7A6B;

  --ease: cubic-bezier(.2, .8, .2, 1);
  --dur: .6s;
  --cut: 14px;
  --hh: 68px;
  --tab-h: 62px;

  --f-display: 'Secular One', 'Heebo', system-ui, sans-serif;
  --f-body: 'Heebo', system-ui, sans-serif;
  --f-mono: 'JetBrains Mono', ui-monospace, Consolas, monospace;

  /* dark (default) */
  --bg: #0A1033;
  --bg-2: #06142A;
  --surface: #0F1842;
  --surface-2: #142052;
  --line: rgba(143, 155, 208, .18);
  --text: #F2EEE4;
  --text-2: #C9CCE0;
  --meta: #8F9BD0;
  --accent: #2CD1CD;
  --accent-ink: #06142A;
  --ring-seen: #3A4472;
  --ghost-bg: rgba(143, 155, 208, .06);
  --ghost-line: rgba(143, 155, 208, .22);
  --lg-mk: #2CD1CD;
  --lg-tx: #F2EEE4;
  --header-bg: rgba(10, 16, 51, .94);
  --focus: #2CD1CD;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #F2EEE4;
  --bg-2: #E7E1D2;
  --surface: #FBF9F4;
  --surface-2: #EFEADF;
  --line: rgba(10, 16, 51, .13);
  --text: #0A1033;
  --text-2: #2A2F55;
  --meta: #5A5E82;
  --accent: #007A7A;
  --accent-ink: #F2EEE4;
  --ring-seen: #C5C2CF;
  --ghost-bg: rgba(10, 16, 51, .03);
  --ghost-line: rgba(10, 16, 51, .16);
  --lg-mk: #00A5A5;
  --lg-tx: #0A1033;
  --header-bg: rgba(242, 238, 228, .95);
  --focus: #007A7A;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--hh) + 16px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.6 var(--f-body);
  overflow-x: hidden;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
img, video, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
.ic { width: 22px; height: 22px; flex: none; }

:focus { outline: none; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }

.skip {
  position: fixed; top: 8px; inset-inline-start: 8px; z-index: 300;
  background: var(--accent); color: var(--accent-ink); padding: 8px 14px; font-weight: 700;
  transform: translateY(-160%); transition: transform .3s var(--ease);
}
.skip:focus { transform: none; }

.cut { clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut)); }

/* ---------- background layers ---------- */
.bg-fallback {
  position: fixed; inset: 0; z-index: -3; pointer-events: none;
  background:
    linear-gradient(118deg, transparent 64%, rgba(0, 165, 165, .22) 64%, rgba(0, 165, 165, .22) 64.15%, transparent 64.15%),
    radial-gradient(120% 70% at 85% 110%, rgba(0, 165, 165, .16), transparent 60%),
    var(--bg);
}
:root[data-theme="light"] .bg-fallback {
  background:
    linear-gradient(118deg, transparent 64%, rgba(0, 165, 165, .25) 64%, rgba(0, 165, 165, .25) 64.15%, transparent 64.15%),
    radial-gradient(120% 70% at 85% 110%, rgba(0, 165, 165, .12), transparent 60%),
    var(--bg);
}
#bg3d {
  position: fixed; inset: 0; width: 100%; height: 100%; z-index: -2; pointer-events: none;
  opacity: 0; transition: opacity 1.4s var(--ease);
}
#bg3d.ready { opacity: 1; }
.grain {
  position: fixed; inset: -50%; z-index: 250; pointer-events: none; opacity: .045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 .5 0 0 0 0 .5 0 0 0 1 0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1.2s steps(5) infinite;
}
:root[data-theme="light"] .grain { opacity: .06; mix-blend-mode: multiply; }
@keyframes grain {
  0% { transform: translate(0, 0); } 20% { transform: translate(-3%, 2%); } 40% { transform: translate(2%, -3%); }
  60% { transform: translate(-2%, -1%); } 80% { transform: translate(3%, 3%); } 100% { transform: translate(0, 0); }
}

/* ---------- header ---------- */
.topbar {
  position: sticky; top: 0; z-index: 60;
  height: var(--hh);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 32px;
  background: var(--header-bg);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 16px; text-decoration: none; min-width: 0; }
.logo { height: 34px; width: 97px; flex: none; overflow: visible; }
.brand-slash { width: 3px; height: 40px; background: var(--accent); transform: skewX(-24deg); flex: none; transform-origin: bottom; }
.brand-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.brand-name { font-family: var(--f-display); font-size: 25px; letter-spacing: .005em; }
.brand-sub { font-size: 13px; color: var(--meta); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 62ch; }
.top-actions { display: flex; align-items: center; gap: 6px; }
.tbtn {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; min-width: 40px; padding: 0 9px;
  color: var(--text-2); transition: color .3s var(--ease), background-color .3s var(--ease);
}
.tbtn:hover { color: var(--text); background: var(--surface); }
.drawer-btn { display: none; font-size: 14px; font-weight: 500; }

/* ---------- layout ---------- */
.layout {
  display: grid;
  grid-template-columns: minmax(250px, 300px) minmax(0, 600px) minmax(250px, 300px);
  justify-content: center;
  gap: 44px;
  max-width: 1440px;
  margin: 0 auto;
  padding: 26px 32px 80px;
  align-items: start;
}
.center { min-width: 0; }

/* ---------- panels ---------- */
.panel {
  position: sticky; top: calc(var(--hh) + 26px);
  max-height: calc(100vh - var(--hh) - 44px);
  overflow-y: auto; overscroll-behavior: contain;
  scrollbar-width: thin; scrollbar-color: var(--line) transparent;
  padding-bottom: 12px;
}
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.panel h2 { font-family: var(--f-display); font-weight: 400; font-size: 21px; line-height: 1.2; }
.panel h3 { font-size: 13.5px; font-weight: 500; color: var(--meta); margin: 0 0 10px; }
.panel-sec + .panel-sec { margin-top: 30px; }
.sheet-grip, .sheet-close { display: none; }
.panel-about { display: none; }
.scrim { position: fixed; inset: 0; z-index: 70; background: rgba(3, 8, 24, .55); opacity: 0; transition: opacity .4s var(--ease); }
.scrim.on { opacity: 1; }

.placeholder-note {
  display: flex; gap: 10px; align-items: flex-start;
  font-size: 13px; color: var(--meta); line-height: 1.5;
  padding: 10px 12px; border: 1px dashed var(--ghost-line); margin-bottom: 22px;
}
.placeholder-note::before { content: ''; flex: none; width: 3px; height: 16px; margin-top: 2px; background: var(--meta); transform: skewX(-24deg); }

/* KPI */
.kpi-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); }
.kpi { background: var(--bg); padding: 14px 12px 14px 4px; min-height: 104px; }
.layout .kpi { background: color-mix(in srgb, var(--bg) 88%, transparent); }
.kpi-num { font-family: var(--f-mono); font-weight: 600; font-size: 34px; line-height: 1.1; letter-spacing: -.02em; direction: ltr; text-align: right; }
.kpi-num.empty { color: var(--meta); }
.kpi-label { font-size: 13.5px; font-weight: 500; margin-top: 6px; }
.kpi-note { font-size: 12px; color: var(--meta); }
.chart { width: 100%; height: auto; overflow: visible; }
.chart text { font-family: var(--f-mono); font-size: 10px; fill: var(--meta); }
.chart .lbl { font-family: var(--f-body); font-size: 11px; }
.chart .val { fill: var(--text); font-weight: 600; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--meta); margin-top: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; margin-inline-end: 6px; vertical-align: -1px; clip-path: polygon(3px 0, 100% 0, 100% calc(100% - 3px), calc(100% - 3px) 100%, 0 100%, 0 3px); }
.dom-row { display: grid; grid-template-columns: 88px 1fr 34px; gap: 10px; align-items: center; font-size: 13px; padding: 4px 0; }
.dom-bar { height: 8px; position: relative; }
.dom-bar span { position: absolute; inset-block: 0; inset-inline-start: 0; background: var(--accent); }
.dom-bar.ghost { background: repeating-linear-gradient(-45deg, var(--ghost-line) 0 1.5px, transparent 1.5px 5px); }
.dom-val { font-family: var(--f-mono); font-size: 12px; color: var(--meta); text-align: left; }

/* Materials */
.next {
  position: relative; background: var(--surface); padding: 16px 18px 16px 16px;
  --cut: 16px;
}
.next::before { content: ''; position: absolute; inset-block: 0; inset-inline-start: 0; width: 4px; background: var(--mc, var(--accent)); }
.next-when { font-size: 13px; color: var(--meta); }
.next-title { font-family: var(--f-display); font-size: 18px; line-height: 1.3; margin: 4px 0 12px; }
.countdown { display: flex; gap: 2px; direction: ltr; justify-content: flex-end; }
.cd-cell { display: flex; flex-direction: column; align-items: center; min-width: 52px; }
.cd-cell b { font-family: var(--f-mono); font-weight: 600; font-size: 26px; line-height: 1; font-variant-numeric: tabular-nums; }
.cd-cell span { font-size: 11px; color: var(--meta); margin-top: 4px; }
.cd-sep { font-family: var(--f-mono); font-size: 22px; color: var(--meta); line-height: 1; padding-top: 1px; }

.files { list-style: none; margin: 0; padding: 0; }
.file a, .file-locked {
  display: grid; grid-template-columns: 22px 1fr; gap: 12px; align-items: start;
  padding: 10px 6px; text-decoration: none; border-bottom: 1px solid var(--line);
  transition: background-color .3s var(--ease);
}
.file a:hover { background: var(--surface); }
.file .ic { color: var(--fc, var(--meta)); margin-top: 2px; }
.file.is-locked .file-locked { cursor: not-allowed; opacity: .45; filter: grayscale(1); user-select: none; }
.file.is-locked .ic { color: var(--meta); }
.file-tag { font-size: 12px; color: var(--meta); display: block; }
.file-title { font-weight: 500; font-size: 15px; display: block; line-height: 1.35; }
.file-dates { font-family: var(--f-mono); font-size: 11.5px; color: var(--meta); display: block; margin-top: 2px; }
.group-link {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px;
  padding: 12px 14px; background: var(--accent); color: var(--accent-ink); font-weight: 700; text-decoration: none;
  --cut: 12px;
}
.group-link small { font-weight: 500; font-size: 12px; opacity: .8; }

.schedule { list-style: none; margin: 0; padding: 0; }
.mtg { display: grid; grid-template-columns: 4px 26px 44px 1fr; gap: 10px; align-items: baseline; padding: 7px 0; font-size: 13.5px; line-height: 1.4; }
.mtg-bar { align-self: stretch; background: var(--mc); }
.mtg-n, .mtg-d { font-family: var(--f-mono); font-size: 12px; color: var(--meta); }
.mtg-note { display: block; font-size: 12px; color: var(--accent); }
.mtg.past { opacity: .5; }
.mtg.is-next .mtg-t { font-weight: 700; }
.mtg.is-next .mtg-n { color: var(--text); }
.mod-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--meta); margin-top: 10px; }
.mod-legend i { display: inline-block; width: 4px; height: 12px; margin-inline-end: 5px; vertical-align: -1px; }
.about-list { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 13.5px; margin: 0; }
.about-list dt { color: var(--meta); }
.about-list dd { margin: 0; }
.about-list .mono { font-family: var(--f-mono); font-size: 12.5px; }

/* ---------- stories ---------- */
.stories { margin: 0 -8px 26px; position: relative; }
.stories-track {
  display: flex; gap: 6px; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none;
  padding: 6px 8px 10px;
}
.stories-track::-webkit-scrollbar { display: none; }
.story {
  flex: 0 0 auto; width: 84px; display: flex; flex-direction: column; align-items: center; gap: 7px;
  scroll-snap-align: start; text-align: center;
}
.ring { position: relative; width: 76px; height: 76px; border-radius: 50%; transition: transform .5s var(--ease); }
.ring-arcs { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.ring-arcs path { fill: none; stroke-width: 3; stroke-linecap: butt; transition: stroke .5s var(--ease); }
.ring-ticks line { stroke: var(--meta); stroke-width: 1; opacity: .5; }
.ring-cover {
  position: absolute; inset: 6px; border-radius: 50%; overflow: hidden; background: var(--bg-2);
  display: grid; place-items: center;
}
:root[data-theme="light"] .ring-cover { background: var(--ink); }
.ring-cover img { width: 100%; height: 100%; object-fit: cover; }
.ring-cover .rc-text { font-family: var(--f-display); font-size: 21px; color: var(--paper); line-height: 1; }
.ring-cover::after { /* slash */
  content: ''; position: absolute; width: 2px; height: 140%; inset-inline-start: 22%; top: -20%;
  background: var(--mc); transform: rotate(35deg); opacity: .9;
}
/* typographic cover: always ink, in both themes — the ring reads as a badge, not a photo */
.ring-cover.rc-type {
  container-type: inline-size;
  background:
    radial-gradient(120% 90% at 28% 12%, rgba(242, 238, 228, .07), transparent 58%),
    linear-gradient(124deg, transparent 0 70%, var(--mc) 70% 71.6%, color-mix(in srgb, var(--mc) 26%, transparent) 71.6% 81%, transparent 81%),
    #0A1033;
  box-shadow: inset 0 0 0 1px rgba(143, 155, 208, .14);
}
.ring-cover.rc-type::after { display: none; } /* the slash lives in the background, clear of the keyword */
.rc-kw {
  position: relative; z-index: 1;
  font-family: var(--f-display); color: #F2EEE4; line-height: 1; white-space: nowrap;
  font-size: 18px; font-size: calc(var(--fit, .3) * 100cqw);
  letter-spacing: -.01em; text-shadow: 0 1px 6px rgba(6, 10, 30, .55);
  unicode-bidi: plaintext;
}
.story.seen .rc-kw { color: #B9BEDA; }
.story-label { font-size: 12.5px; line-height: 1.3; max-width: 84px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.story.seen .story-label { color: var(--meta); }
.story.locked .ring-cover { background: transparent; border: 1px solid var(--line); }
.story.locked .rc-text { font-family: var(--f-mono); font-size: 17px; color: var(--meta); }
.story.locked .ring-cover::after { opacity: .35; }
.story.locked .story-label { color: var(--meta); }
.lock-badge {
  position: absolute; bottom: 0; inset-inline-end: 0; width: 22px; height: 22px; display: grid; place-items: center;
  background: var(--bg); color: var(--meta); border-radius: 50%;
}
.lock-badge .ic { width: 12px; height: 12px; }
.story:focus-visible { outline: none; }
.story:focus-visible .ring { outline: 2px solid var(--focus); outline-offset: 3px; }
.story:not(.locked):hover .ring-arcs path { filter: brightness(1.2); }

/* ---------- feed ---------- */
.feed-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 12px; padding-bottom: 14px; margin-bottom: 22px; border-bottom: 1px solid var(--line); }
.feed-head h2 { white-space: nowrap; font-family: var(--f-display); font-weight: 400; font-size: 26px; line-height: 1.2; }
.feed-sub { font-size: 13px; color: var(--meta); }

/* Post frame. clip-path removes box-shadow and clips a normal border at the
   cuts, so: elevation = drop-shadow on the (unclipped) wrapper; hairline = a
   pseudo-element whose polygon traces the outer cut shape and then the inner
   one in reverse (a 1px ring with a hole) so it follows the 45° corners. */
:root {
  --frame: rgba(44, 209, 205, .25);
  --frame-hi: rgba(44, 209, 205, .62);
  --frame-sheen: rgba(242, 238, 228, .07);
  --media-sep: rgba(143, 155, 208, .16);
  --elev: drop-shadow(0 1px 1px rgba(3, 6, 22, .35)) drop-shadow(0 10px 22px rgba(3, 6, 22, .30));
}
:root[data-theme="light"] {
  --frame: rgba(0, 165, 165, .36);
  --frame-hi: rgba(0, 150, 150, .78);
  --frame-sheen: rgba(255, 255, 255, .9);
  --media-sep: rgba(10, 16, 51, .10);
  --elev: drop-shadow(0 1px 1px rgba(10, 16, 51, .06)) drop-shadow(0 10px 20px rgba(10, 16, 51, .07));
}
.post-wrap { perspective: 1400px; margin-bottom: 34px; filter: var(--elev); }
.post {
  position: relative;
  background: var(--surface); --cut: 18px; --hl: 1px; --hd: .414px; /* hd = hl·tan(22.5°): inner offset along a 45° cut */
  transform-style: preserve-3d;
  transition: transform .7s var(--ease);
}
.post::before, .post::after, .pf-tick { content: ''; position: absolute; pointer-events: none; z-index: 6; }
.post::before {
  inset: 0; background: var(--frame);
  clip-path: polygon(
    var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut), var(--cut) 0,
    calc(var(--cut) + var(--hd)) var(--hl), var(--hl) calc(var(--cut) + var(--hd)), var(--hl) calc(100% - var(--hl)),
    calc(100% - var(--cut) - var(--hd)) calc(100% - var(--hl)), calc(100% - var(--hl)) calc(100% - var(--cut) - var(--hd)),
    calc(100% - var(--hl)) var(--hl), calc(var(--cut) + var(--hd)) var(--hl));
  transition: background-color .45s var(--ease);
}
/* faint inner top highlight, fading out before both ends */
.post::after {
  top: 1px; height: 1px; inset-inline: calc(var(--cut) + 6px) 6px;
  background: linear-gradient(90deg, transparent, var(--frame-sheen) 30%, var(--frame-sheen) 70%, transparent);
}
/* accent tick parallel to the top-left cut, drawn on hover */
.pf-tick {
  width: calc(var(--cut) * .9); height: 2px; background: #2CD1CD;
  left: calc(var(--cut) * .5 + 3px); top: calc(var(--cut) * .5 + 3px);
  transform: translate(-50%, -50%) rotate(-45deg) scaleX(0); transform-origin: 50% 50%;
  transition: transform .5s var(--ease);
}
:root[data-theme="light"] .pf-tick { background: #00A5A5; }
@media (hover: hover) and (pointer: fine) {
  .post:hover::before, .post:focus-within::before { background: var(--frame-hi); }
  .post:hover .pf-tick, .post:focus-within .pf-tick { transform: translate(-50%, -50%) rotate(-45deg) scaleX(1); }
}
.post.target { animation: target 1.6s var(--ease); }
@keyframes target { 0%, 40% { background: var(--surface-2); } }
.post-header { display: flex; align-items: center; gap: 12px; padding: 14px 16px; }
.sigil { width: 40px; height: 40px; flex: none; }
.post-who { min-width: 0; flex: 1; line-height: 1.3; }
.post-author { font-weight: 700; font-size: 14.5px; }
.post-meta { font-size: 12.5px; color: var(--meta); }
.type-chip {
  font-size: 12px; font-weight: 500; padding: 3px 9px 3px 8px; white-space: nowrap;
  border: 1px solid var(--line); display: inline-flex; align-items: center; gap: 6px;
}
.type-chip::before { content: ''; width: 3px; height: 12px; background: var(--tc); transform: skewX(-24deg); }
.sample-tag { font-size: 11.5px; color: var(--meta); border: 1px dashed var(--ghost-line); padding: 2px 7px; white-space: nowrap; }

.media { position: relative; background: var(--deep); aspect-ratio: 16 / 9; overflow: hidden; user-select: none; -webkit-user-select: none; }
.media::after { /* thin inner separator above and below the media */
  content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 4;
  box-shadow: inset 0 1px 0 var(--media-sep), inset 0 -1px 0 var(--media-sep);
}
.track {
  display: flex; height: 100%; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scrollbar-width: none;
  touch-action: pan-x pan-y; overscroll-behavior-x: contain;
}
.track::-webkit-scrollbar { display: none; }
.track.dragging { scroll-snap-type: none; cursor: grabbing; }
.slide { position: relative; flex: 0 0 100%; height: 100%; scroll-snap-align: start; scroll-snap-stop: always; overflow: hidden; } /* clips transition transforms so they never grow the scroll range */
/* .frame = what a slide shows; also cloned as the transition ghost. Modes (see feed.js fitOf):
   m-cover fills the box · m-contain whole image on a blurred, ink-tinted copy of itself · m-pan full width, panned top→bottom */
.frame { position: absolute; inset: 0; overflow: hidden; background: var(--deep); }
.frame img, .frame video, .frame .snap { display: block; -webkit-user-drag: none; pointer-events: none; }
.frame img.main, .frame video, .frame .snap { width: 100%; height: 100%; object-fit: cover; }
.frame.m-auto img.main { object-position: 50% 0; }
.frame .bd { display: none; position: absolute; inset: -30px; width: calc(100% + 60px); height: calc(100% + 60px); max-width: none; object-fit: cover; filter: blur(24px) saturate(1.15); }
.frame.m-contain .bd { display: block; }
.frame.m-contain::after { content: ''; position: absolute; inset: 0; background: rgba(10, 16, 51, .5); }
.frame.m-contain video { position: relative; z-index: 1; object-fit: contain; }
.frame.m-contain img.main { position: relative; z-index: 1; object-fit: contain; filter: drop-shadow(0 12px 28px rgba(0, 0, 0, .4)); }
.frame.m-pan img.main, .frame.m-pan video { position: absolute; top: 0; left: 0; height: auto; object-fit: fill; will-change: transform; }
.c-arrow {
  position: absolute; top: 50%; width: 36px; height: 36px; margin-top: -18px; display: grid; place-items: center;
  background: rgba(242, 238, 228, .92); color: var(--ink); --cut: 8px;
  opacity: 0; transition: opacity .35s var(--ease), transform .35s var(--ease); z-index: 3;
}
.c-arrow .ic { width: 18px; height: 18px; }
.c-prev { inset-inline-start: 10px; }
.c-next { inset-inline-end: 10px; }
.media:hover .c-arrow:not([disabled]), .c-arrow:focus-visible { opacity: 1; }
.c-arrow[disabled] { opacity: 0 !important; pointer-events: none; }
.c-count {
  position: absolute; top: 10px; inset-inline-end: 10px; font: 500 12px/1 var(--f-mono);
  background: rgba(6, 20, 42, .78); color: var(--paper); padding: 5px 8px; direction: ltr; z-index: 3;
}
.dots { display: flex; justify-content: center; gap: 7px; padding: 12px 0 0; height: 22px; }
/* autoplay countdown under the dots: a slim parallelogram that fills toward the next slide */
.c-prog {
  width: 56px; height: 2px; margin: 7px auto 0; position: relative; overflow: hidden;
  background: var(--line); clip-path: polygon(2px 0, 100% 0, calc(100% - 2px) 100%, 0 100%);
  opacity: 0; transition: opacity .4s var(--ease);
}
.c-prog.on { opacity: 1; }
.c-prog i { position: absolute; inset: 0; background: var(--accent); transform: scaleX(0); transform-origin: 100% 50%; }
/* transition layer (ghost of the outgoing slide) */
.fx { position: absolute; inset: 0; z-index: 2; pointer-events: none; overflow: hidden; }
.fx-pane { position: absolute; inset: 0; background: var(--deep); will-change: transform, opacity, clip-path; }
.fx-pane.clear { background: none; }
.fx-blade { position: absolute; top: -10%; height: 120%; width: 2px; background: #2CD1CD; box-shadow: 0 0 12px rgba(44, 209, 205, .6); transform-origin: 50% 50%; will-change: transform; }
.fx-hand { position: absolute; left: 50%; top: 50%; width: 2px; height: 75%; margin-left: -1px; background: linear-gradient(#2CD1CD, rgba(44, 209, 205, 0)); transform-origin: 50% 0; will-change: transform; }
.dot { width: 6px; height: 6px; background: var(--meta); opacity: .45; transform: rotate(45deg); transition: all .45s var(--ease); }
.dot.on { opacity: 1; background: var(--accent); transform: rotate(45deg) scale(1.35); }
.v-mute-ind {
  position: absolute; bottom: 12px; inset-inline-end: 12px; width: 34px; height: 34px; display: grid; place-items: center;
  background: rgba(6, 20, 42, .78); color: var(--paper); border-radius: 50%;
}
.v-mute-ind .ic { width: 18px; height: 18px; }
.media.has-video .v-mute-ind { z-index: 3; transition: opacity .3s var(--ease); }
.media.has-video:not(.on-video) .v-mute-ind { opacity: 0; }

.burst { position: absolute; width: 0; height: 0; pointer-events: none; z-index: 5; }
.burst svg { position: absolute; width: 96px; height: 96px; left: -48px; top: -48px; color: var(--paper); --fill: var(--danger); filter: drop-shadow(0 6px 18px rgba(0,0,0,.35)); animation: pop .9s var(--ease) forwards; }
.burst svg use { stroke: var(--danger); }
.burst i { position: absolute; width: 3px; height: 16px; left: -1.5px; top: -8px; background: var(--danger); transform: rotate(var(--a)) translateY(0); animation: shard .7s var(--ease) forwards; }
@keyframes pop { 0% { transform: scale(.2) rotate(-12deg); opacity: 0; } 25% { transform: scale(1.1) rotate(0); opacity: 1; } 70% { transform: scale(1); opacity: 1; } 100% { transform: scale(.9) translateY(-24px); opacity: 0; } }
@keyframes shard { 0% { transform: rotate(var(--a)) translateY(-30px) scaleY(.2); opacity: 0; } 30% { opacity: 1; } 100% { transform: rotate(var(--a)) translateY(-78px) scaleY(1); opacity: 0; } }

.post-body { padding: 4px 16px 18px; }
.actions { display: flex; align-items: center; gap: 4px; margin: 0 -8px; }
.act { width: 42px; height: 42px; display: grid; place-items: center; color: var(--text); transition: transform .4s var(--ease), color .3s var(--ease); }
.act .ic { width: 24px; height: 24px; }
.act:active { transform: scale(.88); }
.act[aria-pressed="true"] { --fill: currentColor; }
.act.like[aria-pressed="true"] { color: var(--danger); }
.act.save { margin-inline-start: auto; }
.act.save[aria-pressed="true"] { color: var(--accent); }
.act.bump { animation: bump .5s var(--ease); }
@keyframes bump { 40% { transform: scale(1.25); } }
.post-title { font-family: var(--f-display); font-weight: 400; font-size: 21px; line-height: 1.3; margin: 6px 0 2px; }
.post-domain { font-size: 13px; color: var(--meta); }
.post-caption { font-size: 15px; color: var(--text-2); margin: 8px 0 12px; max-width: 62ch; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip { font-size: 12.5px; padding: 3px 9px; background: var(--surface-2); color: var(--text-2); }
.grade { font-family: var(--f-mono); font-size: 12.5px; padding: 3px 9px; background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.open-link {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 14px; padding: 9px 14px; --cut: 10px;
  background: var(--text); color: var(--bg); font-weight: 700; font-size: 14px; text-decoration: none;
  transition: background-color .3s var(--ease);
}
.open-link:hover { background: var(--accent); color: var(--accent-ink); }
.open-link .ic { width: 16px; height: 16px; }

.empty-feed { padding: 40px 0; color: var(--meta); }

/* ---------- toast ---------- */
.toast {
  position: fixed; z-index: 400; inset-inline: 0; margin: 0 auto; bottom: 28px; width: max-content; max-width: calc(100vw - 32px);
  background: var(--text); color: var(--bg); padding: 10px 16px; font-weight: 500; font-size: 14px; --cut: 10px;
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
  transform: translateY(140%); opacity: 0; transition: transform .5s var(--ease), opacity .5s var(--ease);
  pointer-events: none;
}
.toast.on { transform: none; opacity: 1; }

/* ---------- tab bar (mobile) ---------- */
.tabbar { display: none; }

/* ---------- story viewer ---------- */
.viewer {
  position: fixed; inset: 0; z-index: 200; background: #030A18;
  display: flex; align-items: center; justify-content: center; gap: 28px;
  touch-action: none;
}
.viewer[hidden] { display: none; }
.v-frame {
  position: relative; height: min(94vh, 980px); aspect-ratio: 9 / 16; max-width: 100vw;
  background: #000; overflow: hidden; color: var(--paper);
  clip-path: polygon(18px 0, 100% 0, 100% calc(100% - 18px), calc(100% - 18px) 100%, 0 100%, 0 18px);
}
.v-stage { position: absolute; inset: 0; }
.v-stage video, .v-stage .soon { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.v-stage.wipe { animation: vwipe .55s var(--ease); }
@keyframes vwipe { from { clip-path: polygon(120% 0, 120% 0, 100% 100%, 100% 100%); } to { clip-path: polygon(-20% 0, 120% 0, 100% 100%, -40% 100%); } }
.v-shade {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to bottom, rgba(3, 10, 24, .7), transparent 18%, transparent 62%, rgba(3, 10, 24, .85));
}
.v-progress { position: absolute; top: calc(10px + env(safe-area-inset-top)); inset-inline: 10px; display: flex; gap: 4px; z-index: 3; }
.seg { flex: 1; height: 3px; background: rgba(242, 238, 228, .3); overflow: hidden; }
.seg i { display: block; height: 100%; background: var(--paper); transform-origin: right center; transform: scaleX(0); }
.seg.done i { transform: scaleX(1); }
.v-head {
  position: absolute; top: calc(22px + env(safe-area-inset-top)); inset-inline: 10px 6px; z-index: 3;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.v-unit { display: flex; align-items: center; gap: 8px; font-family: var(--f-display); font-size: 15px; min-width: 0; }
.v-unit #vUnit { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.v-dot { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--vc, var(--teal-l)); flex: none; }
.v-count { font-family: var(--f-mono); font-size: 12px; opacity: .75; direction: ltr; }
.v-ctrls { display: flex; flex: none; }
.v-btn { width: 40px; height: 40px; display: grid; place-items: center; color: var(--paper); }
.v-btn:hover { background: rgba(242, 238, 228, .12); }
.v-caption { position: absolute; bottom: calc(22px + env(safe-area-inset-bottom)); inset-inline: 18px; z-index: 3; pointer-events: none; }
.v-caption { transition: opacity .6s var(--ease), transform .6s var(--ease); }
.v-caption.dim { opacity: 0; transform: translateY(8px); }
.v-frame.paused .v-caption.dim { opacity: 1; transform: none; }
.v-code { font-family: var(--f-mono); font-size: 13px; color: var(--teal-l); direction: ltr; display: inline-block; }
.v-title { font-family: var(--f-display); font-size: 22px; line-height: 1.25; margin-top: 2px; text-wrap: balance; }
.v-hint {
  position: absolute; z-index: 4; top: 50%; inset-inline: 0; margin: -20px auto 0; width: max-content;
  background: rgba(3, 10, 24, .8); padding: 9px 14px; font-size: 14px; pointer-events: none;
}
.v-side {
  width: 48px; height: 48px; display: grid; place-items: center; color: var(--paper);
  border: 1px solid rgba(242, 238, 228, .25); border-radius: 50%;
  transition: background-color .3s var(--ease);
}
.v-side:hover { background: rgba(242, 238, 228, .1); }
.v-side[disabled] { opacity: .25; pointer-events: none; }
.v-frame.paused .v-progress { opacity: .55; }
::view-transition-group(story-open) { animation-duration: .55s; animation-timing-function: cubic-bezier(.2, .8, .2, 1); }
::view-transition-old(story-open), ::view-transition-new(story-open) { height: 100%; object-fit: cover; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .4s; }

/* "בקרוב" card — Slash + Clock */
.soon {
  background: var(--ink); overflow: hidden; display: block;
  --sd: 5s;
}
.soon-bg {
  position: absolute; inset: 0;
  background: repeating-linear-gradient(-45deg, rgba(143, 155, 208, .06) 0 1px, transparent 1px 22px);
}
.soon-band {
  position: absolute; width: 240%; height: 120px; left: -70%; top: 34%;
  background: var(--sc, var(--teal)); transform: rotate(-45deg) translateX(-120%);
  animation: band 1s var(--ease) .1s forwards;
}
.soon-band.b2 { height: 10px; top: 48%; opacity: .7; animation-delay: .22s; }
@keyframes band { to { transform: rotate(-45deg) translateX(0); } }
.soon-clock { position: absolute; top: 15%; inset-inline-start: 50%; width: 46%; aspect-ratio: 1; transform: translateX(50%); }
.soon-clock circle { fill: var(--ink); stroke: rgba(242, 238, 228, .25); stroke-width: 1.5; }
.soon-clock .tk { stroke: var(--paper); stroke-width: 2; }
.soon-clock .hand { stroke: var(--sc, var(--teal-l)); stroke-width: 3; transform-origin: 50px 50px; animation: hand var(--sd) linear forwards; }
.soon-clock .sweep { fill: none; stroke: var(--sc, var(--teal-l)); stroke-width: 6; opacity: .35; stroke-dasharray: 251.3; stroke-dashoffset: 251.3; transform: rotate(-90deg); transform-origin: 50px 50px; animation: sweep var(--sd) linear forwards; }
@keyframes hand { from { transform: rotate(0); } to { transform: rotate(360deg); } }
@keyframes sweep { to { stroke-dashoffset: 0; } }
.soon-text { position: absolute; inset-inline: 22px; bottom: 25%; }
.soon-code { font-family: var(--f-mono); font-weight: 600; font-size: 64px; line-height: 1; direction: ltr; text-align: right; color: var(--paper); opacity: 0; animation: rise .8s var(--ease) .35s forwards; }
.soon-label {
  display: inline-block; margin-top: 14px; background: var(--paper); color: var(--ink); font-weight: 900; font-size: 15px;
  padding: 5px 12px; clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
  opacity: 0; animation: rise .8s var(--ease) .5s forwards;
}
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
.v-frame.paused .soon *, .v-frame.paused .soon { animation-play-state: paused !important; }

/* =====================================================================
   tutorials — "הדרכת השבוע" (pinned, above the feed), panel list, theater.
   The card is a screening room: ink in both themes, a 2px teal hairline
   (vs. the posts' 1px tinted frame), the thumbnail bleeding edge to edge.
   ===================================================================== */
.tut-feature { margin-bottom: 34px; }
.tut-feature[hidden] { display: none; }
.tut-wrap { filter: var(--elev); }
.tut {
  position: relative; background: #0A1033; color: #F2EEE4;
  --cut: 18px; --hl: 2px; --hd: .828px; /* hd = hl·tan(22.5°) */
  clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut));
}
:root:not([data-theme="light"]) .tut { background: #06142A; }
.tut::before { /* 2px teal ring that follows the 45° cuts */
  content: ''; position: absolute; inset: 0; z-index: 6; pointer-events: none; background: #2CD1CD;
  clip-path: polygon(
    var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut), var(--cut) 0,
    calc(var(--cut) + var(--hd)) var(--hl), var(--hl) calc(var(--cut) + var(--hd)), var(--hl) calc(100% - var(--hl)),
    calc(100% - var(--cut) - var(--hd)) calc(100% - var(--hl)), calc(100% - var(--hl)) calc(100% - var(--cut) - var(--hd)),
    calc(100% - var(--hl)) var(--hl), calc(var(--cut) + var(--hd)) var(--hl));
}
.tut-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; padding: 16px 18px 0; }
.tut-pin {
  display: inline-flex; align-items: center; gap: 8px; padding: 4px 11px 4px 10px;
  background: #2CD1CD; color: #0A1033; font-weight: 700; font-size: 13px; line-height: 1.3;
  clip-path: polygon(7px 0, 100% 0, 100% calc(100% - 7px), calc(100% - 7px) 100%, 0 100%, 0 7px);
}
.tut-pin::before { content: ''; width: 2px; height: 13px; background: #0A1033; transform: skewX(-30deg); }
.tut-mtg { font-size: 13px; color: #B9BEDA; }
.tut-mtg b, .tl-meta b, .th-meta b { font-family: var(--f-mono); font-weight: 600; }
.tut-cc { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: #B9BEDA; }
.tut-cc b { font: 600 10.5px/1 var(--f-mono); padding: 3px 4px; border: 1px solid rgba(242, 238, 228, .4); color: #F2EEE4; }
.tut-dur { margin-inline-start: auto; font: 500 12.5px/1 var(--f-mono); padding: 5px 8px; border: 1px solid rgba(242, 238, 228, .24); color: #F2EEE4; }
.tut-title { font-family: var(--f-display); font-weight: 400; font-size: 26px; line-height: 1.2; padding: 10px 18px 0; }
.tut-sub { font-size: 14.5px; color: #C9CCE0; padding: 4px 18px 14px; max-width: 62ch; }

.tut-media, .th-media { position: relative; aspect-ratio: 16 / 9; background: #000; overflow: hidden; }
.tut-media:fullscreen { aspect-ratio: auto; width: 100%; height: 100%; }
.tut-iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; }
.tut-poster { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: pointer; color: #F2EEE4; }
.tut-poster img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .9s var(--ease); }
.tut-poster:focus-visible { outline: 2px solid #2CD1CD; outline-offset: -4px; }
.tut-shade { position: absolute; inset: 0; background: linear-gradient(to top, rgba(6, 10, 30, .72), rgba(6, 10, 30, .08) 42%, transparent 70%); }
.tut-ovl-title { position: absolute; inset-inline: 18px; bottom: 26px; font-family: var(--f-display); font-size: 28px; line-height: 1.15; text-align: start; text-shadow: 0 2px 12px rgba(0, 0, 0, .5); }
.tut-play {
  position: absolute; top: 50%; left: 46.5%; width: 72px; height: 72px; margin: -36px 0 0 -36px; /* sits in the gap between the thumbnail agenda and its title */
  display: grid; place-items: center; background: #2CD1CD; color: #0A1033;
  clip-path: polygon(16px 0, 100% 0, 100% calc(100% - 16px), calc(100% - 16px) 100%, 0 100%, 0 16px);
  transition: transform .5s var(--ease), background-color .3s var(--ease);
}
.tut-play svg { width: 36px; height: 36px; margin-left: 4px; }
.tut-poster:hover .tut-play, .tut-poster:focus-visible .tut-play { transform: scale(1.07); background: #F2EEE4; }
.tut-poster:hover img { transform: scale(1.015); }
.tut-resume {
  position: absolute; bottom: 16px; inset-inline-start: 16px; padding: 6px 11px; font-size: 13.5px; font-weight: 500;
  background: rgba(6, 10, 30, .86); color: #F2EEE4;
  clip-path: polygon(7px 0, 100% 0, 100% calc(100% - 7px), calc(100% - 7px) 100%, 0 100%, 0 7px);
}
.tut-resume[hidden] { display: none; }
.tut-resume b { font-family: var(--f-mono); font-weight: 600; color: #2CD1CD; }
.tut-pbar { position: absolute; inset-inline: 0; bottom: 0; height: 4px; background: rgba(242, 238, 228, .16); }
.tut-pbar i, .tl-prog i { position: absolute; inset: 0; background: #2CD1CD; transform-origin: 100% 50%; transform: scaleX(0); }

.tut-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px 0; }
.tut-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.tut-btn {
  display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 12px;
  font-size: 13.5px; font-weight: 500; color: #F2EEE4; border: 1px solid rgba(242, 238, 228, .22);
  transition: background-color .3s var(--ease), border-color .3s var(--ease);
}
.tut-btn .ic { width: 17px; height: 17px; }
.tut-btn:hover { background: rgba(242, 238, 228, .08); border-color: #2CD1CD; }
.tut-btn:focus-visible, .tut-ch:focus-visible, .th-close:focus-visible { outline-color: #2CD1CD; }
.tut-chcount { font-size: 12.5px; color: #8F9BD0; white-space: nowrap; }
.tut-chapters { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 18px 20px; }
.tut-ch {
  display: inline-flex; align-items: baseline; gap: 8px; padding: 6px 10px; text-align: start;
  font-size: 13px; line-height: 1.35; color: #DCDDEA; background: rgba(242, 238, 228, .06);
  box-shadow: inset -2px 0 0 transparent;
  transition: background-color .3s var(--ease), color .3s var(--ease), box-shadow .3s var(--ease);
}
.tut-ch-t { font: 500 11.5px/1 var(--f-mono); color: #2CD1CD; }
.tut-ch:hover { background: rgba(242, 238, 228, .12); color: #F2EEE4; }
.tut-ch[aria-current="true"] { background: rgba(44, 209, 205, .16); color: #F2EEE4; box-shadow: inset -2px 0 0 #2CD1CD; }

/* panel list */
.tl-list { list-style: none; margin: 0; padding: 0; }
.tl-in {
  display: grid; grid-template-columns: 112px 1fr; gap: 12px; align-items: center; width: 100%;
  padding: 9px 4px; text-align: start; text-decoration: none; border-bottom: 1px solid var(--line);
  transition: background-color .3s var(--ease);
}
button.tl-in:hover { background: var(--surface); }
.tl-thumb {
  position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; background: var(--ink);
  clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px);
}
.tl-thumb img { width: 100%; height: 100%; object-fit: cover; }
.tl-dur { position: absolute; left: 4px; bottom: 4px; font: 500 10.5px/1 var(--f-mono); padding: 3px 5px; background: rgba(6, 10, 30, .86); color: #F2EEE4; }
.tl-text { display: flex; flex-direction: column; min-width: 0; }
.tl-meta { font-size: 12px; color: var(--meta); }
.tl-title { font-weight: 500; font-size: 14.5px; line-height: 1.3; }
.tl-when { font-family: var(--f-mono); font-size: 11.5px; color: var(--meta); margin-top: 2px; }
.tl-prog { position: relative; display: block; height: 3px; margin-top: 7px; background: var(--line); overflow: hidden; }
.tl-prog i { background: var(--accent); }
.tl.is-locked .tl-in { cursor: not-allowed; user-select: none; }
.tl.is-locked .tl-thumb, .tl.is-locked .tl-title { opacity: .45; filter: grayscale(1); }

/* theater */
.theater {
  position: fixed; inset: 0; z-index: 220; display: grid; place-items: center; padding: 28px;
  background: rgba(3, 8, 24, .94); opacity: 0; transition: opacity .35s var(--ease);
}
.theater.on { opacity: 1; }
.theater[hidden] { display: none; }
.th-trap { position: absolute; width: 1px; height: 1px; overflow: hidden; }
.th-box { width: min(1180px, 100%, calc((100vh - 230px) * 16 / 9)); min-width: min(100%, 520px); color: #F2EEE4; }
.th-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.th-meta { display: flex; gap: 12px; font-size: 13px; color: #8F9BD0; }
.th-meta span { font-family: var(--f-mono); }
.th-title { font-family: var(--f-display); font-weight: 400; font-size: 24px; line-height: 1.2; }
.th-close { width: 44px; height: 44px; display: grid; place-items: center; color: #F2EEE4; border: 1px solid rgba(242, 238, 228, .25); flex: none; }
.th-close:hover { background: rgba(242, 238, 228, .1); }
.th-media { clip-path: polygon(18px 0, 100% 0, 100% calc(100% - 18px), calc(100% - 18px) 100%, 0 100%, 0 18px); }
.th-ch .tut-chapters { padding: 14px 0 0; }

/* =====================================================================
   "מצגת השבוע" — the tutorial card's quieter sibling: paper (surface),
   a 1px teal hairline on the cuts, the slide sitting on a short stack.
   ===================================================================== */
.deck-feature { margin: -18px 0 34px; }
.deck-feature[hidden] { display: none; }
.dk-wrap { filter: var(--elev); }
.dk {
  position: relative; background: var(--surface); color: var(--text);
  display: grid; grid-template-columns: minmax(0, 46%) minmax(0, 1fr); gap: 20px; align-items: center;
  padding: 16px 18px 18px 20px;
  --cut: 14px; --hl: 1px; --hd: .414px;
  clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut));
}
.dk::before { /* 1px teal hairline that follows the cuts */
  content: ''; position: absolute; inset: 0; z-index: 3; pointer-events: none; background: var(--frame-hi);
  clip-path: polygon(
    var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut), var(--cut) 0,
    calc(var(--cut) + var(--hd)) var(--hl), var(--hl) calc(var(--cut) + var(--hd)), var(--hl) calc(100% - var(--hl)),
    calc(100% - var(--cut) - var(--hd)) calc(100% - var(--hl)), calc(100% - var(--hl)) calc(100% - var(--cut) - var(--hd)),
    calc(100% - var(--hl)) var(--hl), calc(var(--cut) + var(--hd)) var(--hl));
}
/* thumbnail on a stack: two offset sheets peek out toward the card's inner corner */
.dk-thumb { position: relative; display: block; width: 100%; padding: 10px 0 0 10px; cursor: pointer; }
.dk-face, .dk-sheet {
  display: block; aspect-ratio: 16 / 9;
  clip-path: polygon(9px 0, 100% 0, 100% calc(100% - 9px), calc(100% - 9px) 100%, 0 100%, 0 9px);
}
.dk-face { position: relative; z-index: 2; background: var(--ink); overflow: hidden; }
.dk-face img { width: 100%; height: 100%; object-fit: cover; }
.dk-sheet { position: absolute; z-index: 1; top: 10px; left: 10px; right: 0; transition: transform .45s var(--ease); }
.dk-sheet-1 { transform: translate(-5px, -5px); background: #2A3A78; }
.dk-sheet-2 { transform: translate(-10px, -10px); background: #00A5A5; opacity: .55; }
:root[data-theme="light"] .dk-sheet-1 { background: #46507E; }
.dk-thumb:hover .dk-sheet-1, .dk-thumb:focus-visible .dk-sheet-1 { transform: translate(-7px, -7px); }
.dk-thumb:hover .dk-sheet-2, .dk-thumb:focus-visible .dk-sheet-2 { transform: translate(-14px, -14px); }
.dk-thumb:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }

.dk-body { min-width: 0; }
.dk-head { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; }
.dk-pin {
  display: inline-flex; align-items: center; gap: 7px; padding: 2px 10px 2px 9px;
  font-weight: 700; font-size: 12.5px; line-height: 1.4; color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--frame-hi);
  clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px);
}
.dk-pin::before { content: ''; width: 2px; height: 12px; background: var(--accent); transform: skewX(-30deg); }
.dk-chip { font-size: 12.5px; color: var(--meta); padding: 2px 7px; border: 1px solid var(--line); line-height: 1.4; }
.dk-chip b { font-family: var(--f-mono); font-weight: 600; color: var(--text-2); }
.dk-title { font-family: var(--f-display); font-weight: 400; font-size: 20px; line-height: 1.25; margin: 10px 0 14px; text-wrap: balance; }
.dk-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.dk-btn {
  display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 12px;
  font-size: 13.5px; font-weight: 500; color: var(--text); border: 1px solid var(--ghost-line);
  transition: background-color .3s var(--ease), border-color .3s var(--ease), color .3s var(--ease);
}
.dk-btn .ic { width: 17px; height: 17px; }
.dk-btn:hover { border-color: var(--accent); background: var(--ghost-bg); }
.dk-primary {
  background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 700;
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
}
.dk-primary:hover { background: var(--text); border-color: var(--text); color: var(--bg); }

/* panel: decks in the documents list */
.file-btn {
  display: grid; grid-template-columns: 22px 1fr; gap: 12px; align-items: start; width: 100%; text-align: start;
  padding: 10px 6px; border-bottom: 1px solid var(--line); transition: background-color .3s var(--ease);
}
.file-btn:hover { background: var(--surface); }
.file-deck .ic { color: var(--accent); }
.deck-tag {
  display: inline-block; margin-inline-end: 6px; padding: 0 6px; font-size: 11px; font-weight: 700; line-height: 1.55;
  color: var(--accent-ink); background: var(--accent); vertical-align: 1px;
  clip-path: polygon(4px 0, 100% 0, 100% calc(100% - 4px), calc(100% - 4px) 100%, 0 100%, 0 4px);
}
.file-deck.is-locked .deck-tag { background: var(--meta); }

/* deck overlay: the deck fills the viewport under a slim bar */
.deckov {
  position: fixed; inset: 0; z-index: 230; display: flex; flex-direction: column;
  background: #030818; color: #F2EEE4; opacity: 0; transition: opacity .3s var(--ease);
}
.deckov.on { opacity: 1; }
.deckov[hidden] { display: none; }
.dkov-bar {
  display: flex; align-items: center; gap: 10px; flex: none; min-height: 52px;
  padding: env(safe-area-inset-top) 10px 0 8px; border-bottom: 1px solid rgba(44, 209, 205, .28);
}
.dkov-slash { width: 3px; height: 18px; background: #2CD1CD; transform: skewX(-30deg); flex: none; margin-inline: 8px 2px; }
.dkov-title { font-family: var(--f-display); font-weight: 400; font-size: 17px; line-height: 1.2; min-width: 0; flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.dkov-hint { font-size: 12.5px; color: #8F9BD0; white-space: nowrap; }
.dkov-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; min-width: 38px; padding: 0 10px;
  font-size: 13px; font-weight: 500; color: #F2EEE4; text-decoration: none; border: 1px solid rgba(242, 238, 228, .22); flex: none;
}
.dkov-btn .ic { width: 17px; height: 17px; }
.dkov-btn:hover { background: rgba(242, 238, 228, .08); border-color: #2CD1CD; }
.dkov-btn:focus-visible { outline: 2px solid #2CD1CD; outline-offset: 2px; }
.dkov-stage { position: relative; flex: 1; min-height: 0; }
.dkov-frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; background: #06142A; }
.deckov.is-fs .dkov-bar { display: none; }

/* =====================================================================
   tablet: feed + KPI, materials in a drawer
   ===================================================================== */
@media (max-width: 1099px) {
  .layout { grid-template-columns: minmax(230px, 270px) minmax(0, 600px); gap: 32px; padding-inline: 24px; }
  .drawer-btn { display: inline-flex; }
  .panel-mat {
    position: fixed; top: 0; bottom: 0; inset-inline-end: 0; left: 0; right: auto; z-index: 80;
    width: min(380px, 88vw); max-height: none; background: var(--bg); padding: 20px 22px 40px;
    border-inline-start: 1px solid var(--line);
    transform: translateX(-104%); visibility: hidden;
    transition: transform .5s var(--ease), visibility 0s linear .5s;
  }
  .panel-mat.open { transform: none; visibility: visible; transition: transform .5s var(--ease); }
  .panel-mat .sheet-close { display: inline-flex; }
}

/* =====================================================================
   mobile: single column, sticky stories, tab bar, bottom sheets
   ===================================================================== */
@media (max-width: 759px) {
  :root { --hh: 54px; }
  .topbar { padding: 0 16px; }
  .logo { height: 24px; width: 68px; }
  .brand { gap: 10px; }
  .brand-slash { height: 26px; }
  .brand-name { font-size: 20px; }
  .brand-sub, .drawer-btn { display: none; }

  .layout { display: block; padding: 0 16px calc(var(--tab-h) + 40px + env(safe-area-inset-bottom)); }
  .stories {
    position: sticky; top: var(--hh); z-index: 50; margin: 0 -16px 20px;
    background: var(--header-bg); border-bottom: 1px solid var(--line);
  }
  .stories-track { padding: 10px 12px 8px; gap: 2px; }
  .story { width: 76px; }
  .ring { width: 66px; height: 66px; }
  .ring-cover { inset: 5px; }
  .ring-cover .rc-text { font-size: 18px; }
  .story-label { font-size: 11.5px; -webkit-line-clamp: 1; max-width: 72px; }
  .feed-head h2 { font-size: 22px; }
  .post-wrap { margin: 0 -16px 26px; perspective: none; }
  .post { --cut: 0px; }
  .post-wrap { filter: none; }
  .post::before { clip-path: none; background: none; box-shadow: inset 0 1px 0 var(--frame), inset 0 -1px 0 var(--frame); }
  .post::after, .pf-tick { display: none; }
  .media { aspect-ratio: 16 / 9; }
  .c-arrow { display: none; }

  .panel, .panel-mat, .panel-about {
    display: block;
    position: fixed; inset: auto 0 calc(var(--tab-h) + env(safe-area-inset-bottom)) 0; top: auto; z-index: 80; width: 100%;
    max-height: calc(100vh - var(--tab-h) - 64px); max-height: calc(100dvh - var(--tab-h) - env(safe-area-inset-bottom) - 64px);
    background: var(--bg); padding: 0 18px 28px;
    border-top: 1px solid var(--line);
    clip-path: polygon(22px 0, 100% 0, 100% 100%, 0 100%, 0 22px);
    transform: translateY(104%); visibility: hidden;
    transition: transform .5s var(--ease), visibility 0s linear .5s;
  }
  .panel.open { transform: none; visibility: visible; transition: transform .5s var(--ease); }
  .panel.dragging { transition: none; }
  .sheet-grip { display: flex; justify-content: center; padding: 10px 0 6px; position: sticky; top: 0; background: var(--bg); z-index: 1; touch-action: none; }
  .sheet-grip span { width: 40px; height: 4px; background: var(--meta); opacity: .6; }
  .sheet-close { display: inline-flex; }
  .panel-head { position: sticky; top: 20px; background: var(--bg); z-index: 1; padding: 4px 0 10px; margin-bottom: 8px; }

  .tabbar {
    display: grid; grid-template-columns: repeat(4, 1fr);
    position: fixed; inset: auto 0 0 0; z-index: 90;
    height: calc(var(--tab-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: var(--header-bg); border-top: 1px solid var(--line);
  }
  .tabbar button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11.5px; color: var(--meta); position: relative; }
  .tabbar button[aria-current="page"] { color: var(--text); }
  .tabbar button[aria-current="page"]::before { content: ''; position: absolute; top: 0; width: 22px; height: 3px; background: var(--accent); transform: skewX(-30deg); }
  .toast { bottom: calc(var(--tab-h) + 18px + env(safe-area-inset-bottom)); }

  .tut-feature { margin: 0 -16px 26px; }
  .tut-wrap { filter: none; }
  .tut { --cut: 0px; clip-path: none; }
  .tut::before { clip-path: none; background: none; box-shadow: inset 0 2px 0 #2CD1CD, inset 0 -2px 0 #2CD1CD; }
  .tut-head { padding: 14px 16px 0; }
  .tut-title { font-size: 22px; padding-inline: 16px; }
  .tut-sub { padding-inline: 16px; font-size: 14px; }
  .tut-play { width: 54px; height: 54px; margin: -27px 0 0 -27px; }
  .tut-play svg { width: 24px; height: 24px; }
  .tut-bar { padding: 12px 16px 0; }
  .tut-chcount { display: none; }
  .tut-chapters { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity; padding: 12px 16px 18px; }
  .tut-chapters::-webkit-scrollbar { display: none; }
  .tut-ch { flex: 0 0 auto; white-space: nowrap; scroll-snap-align: start; }
  .theater { padding: 0; align-items: center; background: #030A18; }
  .tut-cc-l { display: none; }
  .th-box { width: 100%; min-width: 0; }
  .th-head { padding: 0 16px; }
  .th-media { clip-path: none; }
  .th-ch .tut-chapters { padding: 14px 16px 0; }

  .deck-feature { margin: -12px -16px 26px; }
  .dk-wrap { filter: none; }
  .dk { grid-template-columns: 1fr; gap: 14px; padding: 16px 16px 18px; --cut: 0px; clip-path: none; }
  .dk::before { clip-path: none; background: none; box-shadow: inset 0 1px 0 var(--frame-hi), inset 0 -1px 0 var(--frame-hi); }
  .dk-title { font-size: 19px; margin: 8px 0 12px; }
  .dk-actions .dk-btn { flex: 1; justify-content: center; }
  .dkov-hint { display: none; }
  .dkov-new span { display: none; }

  .viewer { gap: 0; background: #000; }
  .v-side { display: none; }
  .v-frame { width: 100vw; height: 100vh; height: 100dvh; aspect-ratio: auto; clip-path: none; }
  .soon-clock { width: 52%; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .grain { animation: none; }
  .soon-clock .hand, .soon-clock .sweep { animation-duration: var(--sd) !important; }
}

@media (max-width: 759px) { .about-desktop { display: none; } }
