/* CACSR — شؤون آسيوية. Holographic night-sky HUD, no WebGL.
   Layout: fixed 2D canvas (stars + sector ring) behind scrolling glass panels.
   Single dark theme on purpose: the logo's night sky. */
:root { color-scheme: dark; }
html, body { margin: 0; padding: 0; background: #0C1A30; }
.cx {
  --sky: #0C1A30; --sky-2: #16294A;
  --green: #2E74B5; --green-hi: #71B8F2;
  --red: #46629E; --red-hi: #A0BAFF;
  --text: #ECF2F8; --dim: #A6B9CE; --hud: #C5E2F7; --gold: #D8B46A; --gold-hi: #F1D592;
  --line: rgba(197,226,247,.2); --line-hi: rgba(197,226,247,.5);
  --glass: rgba(14,30,52,.66); --glass-hi: rgba(20,38,64,.78);
  --f-display: "Cairo","IBM Plex Sans Arabic","Segoe UI",Tahoma,sans-serif;
  --f-body: "IBM Plex Sans Arabic","IBM Plex Sans","Segoe UI",Tahoma,system-ui,sans-serif;
  --f-mono: "IBM Plex Mono",ui-monospace,Menlo,Consolas,monospace;
  --top-h: 64px; --tab-h: 0px;
  color-scheme: dark; position: relative; isolation: isolate;
  background: var(--sky); color: var(--text);
  font-family: var(--f-body); font-size: 16px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
.cx[lang="en"] { --f-body: "IBM Plex Sans","IBM Plex Sans Arabic","Segoe UI",system-ui,sans-serif; }
.cx *, .cx *::before, .cx *::after { box-sizing: border-box; }
.cx a { color: inherit; text-decoration: none; }
.cx button { font: inherit; color: inherit; cursor: pointer; }
.cx h1,.cx h2,.cx h3,.cx p,.cx dl,.cx dd,.cx ol { margin: 0; padding: 0; }
.cx ol { list-style: none; }
.cx img { max-width: 100%; }
.cx :focus-visible { outline: 2px solid var(--green-hi); outline-offset: 3px; }
[hidden] { display: none !important; }
.cx-mono { font-family: var(--f-mono); font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--dim); direction: ltr; unicode-bidi: isolate; }
.cx-select { user-select: all; color: var(--text); }

/* fixed layers */
.cx-canvas { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100lvh; display: block; z-index: 0;
  background: radial-gradient(ellipse at 28% 38%, rgba(46,116,181,.18), transparent 55%), radial-gradient(ellipse at 72% 62%, rgba(70,98,158,.12), transparent 55%), var(--sky); }
.cx-frame { position: fixed; inset: 10px; z-index: 1; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(197,226,247,.022) 0 1px, transparent 1px 3px); }
.cx-frame i { position: absolute; width: 22px; height: 22px; border: 1px solid var(--line-hi); }
.cx-frame i:nth-child(1) { top: 0; left: 0; border-right: 0; border-bottom: 0; }
.cx-frame i:nth-child(2) { top: 0; right: 0; border-left: 0; border-bottom: 0; }
.cx-frame i:nth-child(3) { bottom: 0; left: 0; border-right: 0; border-top: 0; }
.cx-frame i:nth-child(4) { bottom: 0; right: 0; border-left: 0; border-top: 0; }

/* sector labels riding the canvas ring */
.cx-ring-nodes { position: fixed; inset: 0; z-index: 2; pointer-events: none; }
.cx-ring-node { position: absolute; left: 0; top: 0; width: var(--nw, 150px); margin: -10px 0 0 calc(var(--nw, 150px) / -2); text-align: center;
  font-family: var(--f-mono); font-size: 10px; letter-spacing: .12em; color: var(--green-hi); opacity: .85;
  text-transform: uppercase; direction: ltr; transition: opacity .3s; text-shadow: 0 0 8px rgba(12,26,48,.9); }
.cx-ring-node small { display: block; font-family: var(--f-display); font-size: 12px; letter-spacing: 0; text-transform: none; color: var(--dim); }
.cx-ring-node.r { color: var(--red-hi); }

/* top bar */
.cx-top { position: fixed; z-index: 5; top: 0; left: 0; right: 0; height: calc(var(--top-h) + env(safe-area-inset-top,0px));
  padding: env(safe-area-inset-top,0px) max(28px, env(safe-area-inset-right,0px)) 0 max(28px, env(safe-area-inset-left,0px));
  display: flex; align-items: center; gap: 22px;
  background: linear-gradient(to bottom, rgba(12,26,48,.92), rgba(12,26,48,.55) 70%, transparent); }
.cx-brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.cx-brand img { width: 34px; height: auto; flex: none; }
.cx-brand span { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.cx-brand b { font-family: var(--f-display); font-weight: 600; font-size: 15px; white-space: nowrap; }
.cx-brand small { font-size: 9.5px; letter-spacing: .08em; color: var(--green-hi); white-space: nowrap; direction: ltr; unicode-bidi: isolate; }
.cx-nav { display: flex; gap: 6px; margin-inline-start: auto; }
.cx-nav a { padding: 8px 14px; font-size: 14px; color: var(--dim); border: 1px solid transparent; transition: color .2s, border-color .2s; }
.cx-nav a:hover { color: var(--text); }
.cx-nav a.on { color: var(--text); border-color: var(--line); background: rgba(113,184,242,.08); }
.cx-clocks { display: flex; gap: 14px; }
.cx-clocks b { color: var(--gold-hi); font-weight: 500; font-variant-numeric: tabular-nums; }
.cx-lang { flex: none; padding: 7px 14px; border: 1px solid var(--line-hi); background: rgba(14,30,52,.6); font-size: 14px; }
.cx-lang:hover { border-color: var(--green-hi); color: var(--green-hi); }

/* sections */
.cx-main { position: relative; z-index: 3; padding-inline: max(28px, env(safe-area-inset-left,0px)) max(28px, env(safe-area-inset-right,0px)); }
.cx-sec { position: relative; max-width: 1280px; margin: 0 auto; padding-block: 110px; }
.cx-sec-head { display: flex; flex-direction: column; gap: 10px; max-width: 680px; margin-bottom: 44px; }
.cx-sec-head h2 { font-family: var(--f-display); font-weight: 700; font-size: clamp(32px, 4vw, 54px); line-height: 1.12; text-wrap: balance; }
.cx-sec-head p { color: var(--dim); font-size: 17px; max-width: 54ch; }
.cx-sec-head .cx-mono { color: var(--green-hi); }

/* hero */
.cx-hero { min-height: 92vh; min-height: 92svh; display: flex; flex-direction: column; justify-content: center; gap: 36px; padding-top: calc(var(--top-h) + 30px); }
.cx-hero-copy { display: flex; flex-direction: column; gap: 20px; max-width: 580px; }
.cx-eyebrow { color: var(--green-hi); display: flex; align-items: center; direction: inherit; unicode-bidi: normal; letter-spacing: .06em; }
.cx[lang="ar"] .cx-hero h1 { word-spacing: .08em; }
.cx-hero-copy > *, .cx-stats, .cx-scrollcue { animation: cx-rise .9s cubic-bezier(.2,.7,.2,1) both; }
.cx-hero-copy > :nth-child(2) { animation-delay: .12s; }
.cx-hero-copy > :nth-child(3) { animation-delay: .24s; }
.cx-hero-copy > :nth-child(4) { animation-delay: .36s; }
.cx-stats { animation-delay: .5s; }
@keyframes cx-rise { from { opacity: 0; transform: translateY(14px); } }
.cx-hero h1 { font-family: var(--f-display); font-weight: 700; font-size: clamp(40px, 5.4vw, 80px); line-height: 1.08; text-wrap: balance;
  background: linear-gradient(100deg, var(--text) 40%, var(--hud) 60%, var(--text) 75%); background-size: 250% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent; animation: cx-shine 7s ease-in-out infinite; }
@keyframes cx-shine { 0%,100% { background-position: 100% 0; } 50% { background-position: 0 0; } }
.cx-lead { font-size: 19px; color: var(--dim); max-width: 48ch; }
.cx-stats { display: grid; grid-template-columns: repeat(4, auto); justify-content: start; border-block: 1px solid var(--line); width: fit-content; max-width: 100%; }
.cx-stats div { padding: 14px 26px; border-inline-end: 1px solid var(--line); display: flex; flex-direction: column; }
.cx-stats div:first-child { padding-inline-start: 0; }
.cx-stats div:last-child { border-inline-end: 0; }
.cx-stats dd { font-family: var(--f-mono); font-size: 28px; font-weight: 500; color: var(--gold-hi); text-shadow: 0 0 18px rgba(216,180,106,.35); font-variant-numeric: tabular-nums; line-height: 1.15; direction: ltr; }
.cx-stats dt { font-size: 13px; color: var(--dim); }
.cx-scrollcue { display: flex; align-items: center; gap: 12px; animation-delay: .7s; }
.cx-scrollcue em { font-style: normal; }
.cx-scrollcue span { width: 1px; height: 36px; background: linear-gradient(var(--green-hi), transparent); animation: cx-cue 2s ease-in-out infinite; transform-origin: top; }
@keyframes cx-cue { 0% { transform: scaleY(0); } 50% { transform: scaleY(1); } 100% { transform: scaleY(1); opacity: 0; } }
.cx-live { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--red-hi); margin-inline-end: 9px; animation: cx-blink 1.3s steps(2,start) infinite; }
.cx-live.ok { background: var(--green-hi); animation: none; box-shadow: 0 0 10px var(--green-hi); }
@keyframes cx-blink { to { visibility: hidden; } }

/* buttons, chips */
.cx-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.cx-btn { display: inline-flex; align-items: center; gap: 10px; padding: 12px 20px; font-size: 15px; font-weight: 500;
  background: var(--green); border: 1px solid var(--green-hi); color: #fff;
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
  transition: background .2s, box-shadow .2s; }
.cx-btn:hover { background: #3C88CC; box-shadow: 0 0 24px rgba(113,184,242,.4); }
.cx-btn.ghost { background: rgba(14,30,52,.55); border-color: var(--line-hi); color: var(--text); }
.cx-btn.ghost:hover { border-color: var(--green-hi); }
.cx-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; flex: none; }
.cx[dir="rtl"] .cx-btn svg:last-child:not(:first-child), .cx[dir="rtl"] .cx-wall-nav svg { transform: scaleX(-1); }
.cx-chip { display: inline-block; font-family: var(--f-mono); font-size: 11px; letter-spacing: .1em; padding: 3px 8px; border: 1px solid var(--green-hi); color: var(--green-hi); white-space: nowrap; }
.cx-chip.r { border-color: var(--red-hi); color: var(--red-hi); }
.cx-chip.g { border-color: var(--gold); color: var(--gold-hi); }

/* glass panel with HUD corners */
.cx-panel { position: relative; background: var(--glass); border: 1px solid var(--line);
  -webkit-backdrop-filter: blur(10px) saturate(1.2); backdrop-filter: blur(10px) saturate(1.2); }
.cx-panel::before, .cx-panel::after { content: ""; position: absolute; width: 16px; height: 16px; border: 2px solid var(--green-hi); pointer-events: none; z-index: 2; }
.cx-panel::before { top: -1px; inset-inline-start: -1px; border-inline-end: 0; border-bottom: 0; }
.cx-panel::after { bottom: -1px; inset-inline-end: -1px; border-inline-start: 0; border-top: 0; }

/* archive filters + cards */
.cx-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; max-width: none; }
.cx-filters button { padding: 6px 12px; font-size: 13.5px; background: rgba(14,30,52,.55); border: 1px solid var(--line); color: var(--dim); transition: all .2s; }
.cx-filters button:hover { color: var(--text); border-color: var(--line-hi); }
.cx-filters button[aria-pressed="true"] { color: #fff; background: var(--green); border-color: var(--green-hi); }
.cx-filters button b { font-family: var(--f-mono); font-weight: 400; font-size: 10.5px; color: var(--gold-hi); margin-inline-start: 6px; }
.cx-study-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(440px, 100%), 1fr)); gap: 26px; }
.cx-study { display: flex; flex-direction: column; gap: 14px; padding: 22px 24px 24px; opacity: 0; transform: translateY(18px); transition: opacity .6s, transform .6s; }
.cx-study.seen { opacity: 1; transform: none; }
.cx-study:hover { box-shadow: 0 24px 70px -30px rgba(46,116,181,.5), 0 0 0 1px rgba(113,184,242,.25); }
.cx-panel-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.cx-panel-bar .cx-mono { font-size: 10.5px; }
.cx-panel-bar .cx-new { margin-inline-start: auto; }
.cx-cover { position: relative; margin: 0 -24px; aspect-ratio: 21/9; overflow: hidden; background: var(--sky-2); border-block: 1px solid var(--line); }
.cx-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  filter: grayscale(.85) contrast(1.15) brightness(.9); transform: scale(1.03); transition: filter .7s, transform 1s; }
.cx-cover::before { content: ""; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(115deg, var(--green) 0%, #12396A 48%, var(--red) 100%); mix-blend-mode: color; opacity: .7; transition: opacity .7s; }
.cx-cover::after { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(12,26,48,.25) 0 1px, transparent 1px 3px), radial-gradient(ellipse at 50% 50%, transparent 45%, rgba(12,26,48,.7) 100%); }
.cx-study:hover .cx-cover img, .cx-reader-cover img { filter: grayscale(.1) contrast(1.05) brightness(1); transform: scale(1); }
.cx-study:hover .cx-cover::before, .cx-reader-cover::before { opacity: .3; }
.cx-study-title { font-family: var(--f-display); font-weight: 700; font-size: clamp(21px, 2vw, 26px); line-height: 1.3; text-wrap: balance; }
.cx-study-title a:hover { color: var(--hud); }
.cx-rule { height: 1px; background: linear-gradient(to var(--rule-dir, left), var(--green-hi), transparent 70%); }
.cx[dir="ltr"] .cx-rule { --rule-dir: right; }
.cx-study-ex { color: #C6D4E2; font-size: 15.5px; line-height: 1.75; }
.cx-study .cx-actions { margin-top: auto; padding-top: 6px; }
.cx-study .cx-btn { padding: 9px 16px; font-size: 14px; }
.cx-empty { color: var(--dim); padding: 40px 0; }
.cx-new { font-family: var(--f-mono); font-size: 10px; letter-spacing: .12em; color: var(--gold-hi); border: 1px dashed var(--gold); padding: 2px 7px; }
.cx-more { margin-top: 34px; }

/* videos wall */
.cx-videos { max-width: none; }
.cx-videos .cx-sec-head { max-width: 1280px; margin-inline: auto; }
.cx-wall-wrap { position: relative; margin-inline: calc(-1 * max(28px, env(safe-area-inset-left,0px))) calc(-1 * max(28px, env(safe-area-inset-right,0px))); }
.cx-wall { display: flex; gap: 24px; overflow-x: auto; scroll-snap-type: x proximity; padding: 26px max(28px, calc(50% - 150px)); scrollbar-width: none; }
.cx-wall::-webkit-scrollbar { display: none; }
.cx-tile { flex: none; width: min(300px, 74vw); scroll-snap-align: center; padding: 0; border: 0; background: none; position: relative; text-align: start; }
.cx-tile-media { display: block; aspect-ratio: 9/16; position: relative; overflow: hidden; border: 1px solid var(--line); background: var(--sky-2); }
.cx-tile-media img, .cx-tile-media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cx-tile-media video { opacity: 0; transition: opacity .3s; }
.cx-tile.playing video { opacity: 1; }
.cx-tile-media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 55%, rgba(12,26,48,.92)); }
.cx-tile-hud i { position: absolute; width: 18px; height: 18px; border: 2px solid var(--green-hi); z-index: 1; }
.cx-tile-hud i:nth-child(1) { top: -4px; left: -4px; border-right: 0; border-bottom: 0; }
.cx-tile-hud i:nth-child(2) { top: -4px; right: -4px; border-left: 0; border-bottom: 0; }
.cx-tile-hud i:nth-child(3) { bottom: -4px; left: -4px; border-right: 0; border-top: 0; }
.cx-tile-hud i:nth-child(4) { bottom: -4px; right: -4px; border-left: 0; border-top: 0; }
.cx-tile:hover .cx-tile-hud i { border-color: var(--red-hi); }
.cx-tile-play { position: absolute; z-index: 2; top: 42%; left: 50%; width: 60px; height: 60px; margin: -30px 0 0 -30px; border-radius: 50%; display: grid; place-content: center;
  background: rgba(12,26,48,.6); border: 1px solid var(--green-hi); color: var(--text); box-shadow: 0 0 30px rgba(113,184,242,.35); pointer-events: none; }
.cx-tile-play svg { width: 24px; height: 24px; fill: currentColor; margin-inline-start: 3px; }
.cx-tile-info { position: absolute; z-index: 1; inset: auto 16px 16px; display: flex; flex-direction: column; gap: 5px; align-items: flex-start; }
.cx-tile-info strong { font-family: var(--f-display); font-size: 21px; font-weight: 700; line-height: 1.2; }
.cx-tile-info .cx-mono { font-size: 10px; }
.cx-wall-nav { position: absolute; top: 50%; z-index: 2; width: 48px; height: 48px; margin-top: -24px; display: grid; place-content: center; background: var(--glass-hi); border: 1px solid var(--line-hi); }
.cx-wall-nav svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.cx-wall-nav.prev { inset-inline-start: max(16px, calc(50% - 300px)); }
.cx-wall-nav.next { inset-inline-end: max(16px, calc(50% - 300px)); }
.cx-wall-nav:hover { border-color: var(--green-hi); color: var(--green-hi); }

/* news */
.cx-news .cx-sec-head { max-width: 760px; }
.cx-feedlist { max-width: 760px; border-top: 1px solid var(--line); }
.cx-feedlist li { border-bottom: 1px solid var(--line); }
.cx-feedlist a { display: grid; grid-template-columns: auto 1fr auto; gap: 4px 16px; align-items: baseline; padding: 15px 12px; background: rgba(12,26,48,.55); transition: background .2s; }
.cx-feedlist a:hover { background: rgba(46,116,181,.18); }
.cx-feed-title { font-size: 16px; line-height: 1.6; min-width: 0; grid-column: 2; }
.cx-ts { font-variant-numeric: tabular-nums; color: var(--gold); font-size: 11px; }
.cx-feed-src { grid-column: 2; font-size: 10.5px; }

/* method */
.cx-stages { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); position: relative; }
.cx-stages::before { content: ""; position: absolute; top: 34px; left: 0; right: 0; height: 1px; background: linear-gradient(90deg, var(--green-hi), var(--red-hi)); }
.cx-stages li { padding: 52px 18px 0 0; display: flex; flex-direction: column; gap: 8px; position: relative; }
.cx[dir="rtl"] .cx-stages li { padding: 52px 0 0 18px; }
.cx-stages li::before { content: ""; position: absolute; top: 28px; inset-inline-start: 0; width: 12px; height: 12px; transform: rotate(45deg); background: var(--sky); border: 1px solid var(--green-hi); }
.cx-stages li:nth-child(even)::before { border-color: var(--red-hi); }
.cx-stages b { font-family: var(--f-display); font-size: 21px; font-weight: 600; }
.cx-stages p { color: var(--dim); font-size: 14.5px; }
.cx-stages .cx-mono { position: absolute; top: 0; }

/* end */
.cx-end { min-height: 78vh; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; text-align: center; gap: 12px; padding-bottom: 110px; }
.cx-end img { width: 72px; height: auto; }
.cx-word-ar { font-family: var(--f-display); font-weight: 700; font-size: clamp(26px, 3.2vw, 42px); }
.cx-word-en { letter-spacing: .14em; font-size: 13px; color: var(--green-hi); direction: ltr; unicode-bidi: isolate; }
.cx-tagline { font-family: var(--f-display); font-size: 20px; margin-top: 10px; }
.cx-end p { color: var(--dim); max-width: 56ch; }
.cx-end a { color: var(--green-hi); }

/* ticker */
.cx-ticker { position: fixed; z-index: 5; left: 0; right: 0; bottom: 0; height: calc(34px + env(safe-area-inset-bottom,0px)); padding-bottom: env(safe-area-inset-bottom,0px);
  display: flex; align-items: center; background: rgba(12,26,48,.88); border-top: 1px solid var(--line); overflow: hidden; }
.cx-ticker > b { flex: none; padding: 0 16px; color: var(--red-hi); height: 100%; display: flex; align-items: center; border-inline-end: 1px solid var(--line); background: var(--sky); position: relative; z-index: 1; }
.cx-ticker-track { overflow: hidden; flex: 1; }
.cx-ticker-track > div { display: flex; width: max-content; animation: cx-tick 80s linear infinite; }
.cx[dir="rtl"] .cx-ticker-track > div { animation-name: cx-tick-rtl; }
.cx-ticker span { padding: 0 28px; font-size: 13.5px; color: var(--dim); white-space: nowrap; display: inline-flex; align-items: center; gap: 10px; }
.cx-ticker span i { width: 6px; height: 6px; background: var(--green-hi); transform: rotate(45deg); flex: none; }
.cx-ticker span i.r { background: var(--red-hi); }
.cx-ticker a:hover { color: var(--text); }
@keyframes cx-tick { to { transform: translateX(-50%); } }
@keyframes cx-tick-rtl { to { transform: translateX(50%); } }
.cx-main { padding-bottom: 40px; }

/* ask the archive */
.cx-ask { display: inline-flex; align-items: center; gap: 10px; padding: 7px 12px; background: rgba(14,30,52,.6); border: 1px solid var(--line); color: var(--dim); font-size: 13.5px; min-width: 180px; transition: border-color .2s, color .2s; }
.cx-ask:hover { border-color: var(--gold); color: var(--text); }
.cx-ask svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; flex: none; }
.cx-ask kbd { margin-inline-start: auto; font-family: var(--f-mono); font-size: 11px; color: var(--gold); border: 1px solid rgba(216,180,106,.4); padding: 0 6px; }
.cx-search { position: fixed; inset: 0; z-index: 12; background: rgba(2,3,5,.72); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  display: flex; justify-content: center; align-items: flex-start; padding: calc(var(--top-h) + 24px) max(16px, env(safe-area-inset-right,0px)) 24px max(16px, env(safe-area-inset-left,0px)); }
.cx-search-box { width: min(720px, 100%); max-height: calc(100svh - var(--top-h) - 60px); display: flex; flex-direction: column; animation: cx-pop .25s cubic-bezier(.2,.8,.2,1); }
@keyframes cx-pop { from { opacity: 0; transform: translateY(-10px) scale(.98); } }
.cx-search-field { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.cx-search-field > svg { width: 22px; height: 22px; fill: none; stroke: var(--gold); stroke-width: 1.8; flex: none; }
.cx-search-field input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; color: var(--text); font: 500 20px/1.4 var(--f-body); }
.cx-search-field input::placeholder { color: rgba(159,176,170,.6); }
.cx-search-field input::-webkit-search-cancel-button { display: none; }
.cx-x { width: 38px; height: 38px; display: grid; place-content: center; background: none; border: 1px solid var(--line); flex: none; }
.cx-x svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.cx-x:hover { border-color: var(--red-hi); color: var(--red-hi); }
.cx-search-meta { padding: 10px 18px; color: var(--gold); }
.cx-results { overflow-y: auto; padding: 0 8px 10px; }
.cx-results li { display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: 14px; align-items: center; padding: 12px 10px; cursor: pointer; border-inline-start: 2px solid transparent; }
.cx-results li.on, .cx-results li:hover { background: rgba(46,116,181,.16); border-inline-start-color: var(--green-hi); }
.cx-res-t { font-size: 15.5px; line-height: 1.45; }
.cx-res-k { font-size: 10px; white-space: nowrap; }
.cx-none { color: var(--dim); cursor: default !important; }

/* reader */
:root:has(.cx-reader:not([hidden])), :root:has(.cx-search:not([hidden])) { overflow: hidden; }
.cx-reader { position: fixed; inset: 0; z-index: 11; display: flex; flex-direction: column; background: rgba(8,16,30,.86);
  -webkit-backdrop-filter: blur(6px) saturate(1.2); backdrop-filter: blur(6px) saturate(1.2); animation: cx-open .45s cubic-bezier(.2,.8,.2,1); }
@keyframes cx-open { from { opacity: 0; clip-path: inset(48% 0 48% 0); } to { opacity: 1; clip-path: inset(0 0 0 0); } }
.cx-reader-progress { position: absolute; top: 0; left: 0; right: 0; height: 3px; z-index: 2; background: rgba(197,226,247,.08); }
.cx-reader-progress i { display: block; height: 100%; transform-origin: left; transform: scaleX(0); background: linear-gradient(90deg, var(--green-hi), var(--gold), var(--red-hi)); }
.cx[dir="rtl"] .cx-reader-progress i { transform-origin: right; }
.cx-reader-bar { display: flex; align-items: center; gap: 14px; padding: calc(10px + env(safe-area-inset-top,0px)) max(20px, env(safe-area-inset-right,0px)) 10px max(20px, env(safe-area-inset-left,0px)); border-bottom: 1px solid var(--line); background: rgba(12,26,48,.7); }
.cx-reader-bar .cx-mono { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cx-reader-tools { margin-inline-start: auto; display: flex; gap: 10px; align-items: center; flex: none; }
.cx-reader-tools .cx-btn { padding: 8px 14px; font-size: 14px; white-space: nowrap; }
.cx-reader-scroll { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 0 max(16px, env(safe-area-inset-right,0px)) 0 max(16px, env(safe-area-inset-left,0px)); }
.cx-reader-doc { max-width: 760px; margin: 0 auto; padding: 48px 0 120px; display: flex; flex-direction: column; gap: 22px; }
.cx-reader-doc h1 { font-family: var(--f-display); font-weight: 700; font-size: clamp(30px, 4vw, 50px); line-height: 1.18; text-wrap: balance; }
.cx-reader-meta { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; }
.cx-reader-cover { margin: 0; aspect-ratio: 16/7; position: relative; overflow: hidden; border: 1px solid var(--line); background: var(--sky-2); }
.cx-reader-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cx-reader-cover::before { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(115deg, var(--green), transparent 60%); mix-blend-mode: color; opacity: .3; }
.cx-reader-body { font-size: 18.5px; line-height: 1.95; color: #CFDCEA; overflow-wrap: break-word; }
.cx[lang="en"] .cx-reader-body { font-size: 18px; line-height: 1.75; }
.cx-reader-body > * + * { margin-top: 1.1em; }
.cx-reader-body p { margin: 0; }
.cx-reader-body h2, .cx-reader-body h3, .cx-reader-body h4 { font-family: var(--f-display); color: var(--text); line-height: 1.3; margin-top: 1.6em; }
.cx-reader-body a { color: var(--green-hi); text-decoration: underline; text-underline-offset: 3px; }
.cx-reader-body img { max-width: 100%; height: auto; border: 1px solid var(--line); }
.cx-reader-body figure { margin: 1.4em 0; }
.cx-reader-body blockquote { margin: 1.4em 0; padding: 4px 20px; border-inline-start: 2px solid var(--green-hi); color: var(--text); }
.cx-reader-body table { display: block; overflow-x: auto; border-collapse: collapse; }
.cx-reader-body td, .cx-reader-body th { border: 1px solid var(--line); padding: 6px 10px; }
.cx-loading { animation: cx-blink 1s steps(2,start) infinite; }
.cx-reader-foot { display: flex; flex-direction: column; gap: 14px; padding-top: 30px; border-top: 1px solid var(--line); margin-top: 20px; }
.cx-reading .cx-ticker, .cx-reading .cx-tabs { display: none; }

/* video modal */
.cx-modal { position: fixed; inset: 0; z-index: 10; background: rgba(2,3,5,.86); display: grid; place-items: center; padding: 24px; }
.cx-modal-box { display: grid; grid-template-columns: auto minmax(0,320px); gap: 28px; padding: 22px; align-items: end; max-height: 100%; }
.cx-modal video { height: min(78vh, 760px); aspect-ratio: 9/16; max-width: 100%; background: #000; display: block; }
.cx-modal-info { display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.cx-modal-info h3 { font-family: var(--f-display); font-size: 28px; line-height: 1.2; margin: 0; }
.cx-modal-info p { color: var(--dim); font-size: 14px; }
.cx-modal-close { position: absolute; top: 10px; inset-inline-end: 12px; width: 40px; height: 40px; background: none; border: 1px solid var(--line); font-size: 24px; line-height: 1; z-index: 3; }

/* mobile tabs + layout */
.cx-tabs { position: fixed; z-index: 6; left: 0; right: 0; bottom: 0; height: calc(var(--tab-h) + env(safe-area-inset-bottom,0px));
  padding: 0 max(8px, env(safe-area-inset-right,0px)) env(safe-area-inset-bottom,0px) max(8px, env(safe-area-inset-left,0px));
  display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); background: rgba(12,26,48,.92); border-top: 1px solid var(--line);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.cx-tabs a, .cx-tabs button { display: flex; background: none; border: 0; padding: 0; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; color: var(--dim); position: relative; }
.cx-tabs svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.cx-tabs a.on { color: var(--text); }
.cx-tabs a.on svg { stroke: var(--green-hi); }
.cx-tabs a.on::before { content: ""; position: absolute; top: 0; left: 30%; right: 30%; height: 2px; background: var(--green-hi); box-shadow: 0 0 10px var(--green-hi); }

@media (max-width: 1240px) {
  .cx-clocks { display: none; }
  .cx-ask { min-width: 0; }
  .cx-ask span, .cx-ask kbd { display: none; }
}
@media (max-width: 860px) {
  .cx { --top-h: 56px; --tab-h: 62px; font-size: 15px; }
  .cx-frame, .cx-nav, .cx-ask, .cx-scrollcue, .cx-ring-node small { display: none; }
  .cx-ring-node { --nw: 96px; font-size: 9px; }
  .cx-tabs[hidden] { display: grid !important; }
  .cx-top { padding-inline: max(16px, env(safe-area-inset-left,0px)) max(16px, env(safe-area-inset-right,0px)); gap: 12px; }
  .cx-brand { margin-inline-end: auto; }
  .cx-brand img { width: 28px; }
  .cx-brand b { font-size: 13px; }
  .cx-brand small { font-size: 8.5px; }
  .cx-lang { padding: 6px 10px; font-size: 13px; }
  .cx-main { padding-inline: max(16px, env(safe-area-inset-left,0px)) max(16px, env(safe-area-inset-right,0px)); padding-bottom: calc(var(--tab-h) + 50px); }
  .cx-sec { padding-block: 64px; }
  .cx-hero { min-height: 94svh; justify-content: flex-end; gap: 22px; padding-top: 44vh; padding-bottom: 20px; }
  .cx-hero h1 { font-size: 36px; }
  .cx-lead { font-size: 16px; }
  .cx-stats { grid-template-columns: repeat(4, minmax(0,1fr)); width: 100%; }
  .cx-stats div { padding: 10px 8px; }
  .cx-stats dd { font-size: 19px; }
  .cx-stats dt { font-size: 11px; line-height: 1.3; }
  .cx-sec-head { margin-bottom: 26px; padding: 18px; background: var(--glass); border: 1px solid var(--line); }
  .cx-sec-head p { font-size: 15px; }
  .cx-filters { flex-wrap: nowrap; overflow-x: auto; margin-inline: -18px; padding-inline: 18px; scrollbar-width: none; }
  .cx-filters button { flex: none; }
  .cx-study { padding: 18px 18px 20px; }
  .cx-cover { margin-inline: -18px; aspect-ratio: 16/9; }
  .cx-cover img { filter: grayscale(.2) contrast(1.08); }
  .cx-cover::before { opacity: .4; }
  .cx-study .cx-actions .cx-btn { flex: 1 1 auto; justify-content: center; }
  .cx-wall-nav { display: none; }
  .cx-wall { scroll-snap-type: x mandatory; padding-inline: 16px; }
  .cx-feedlist a { grid-template-columns: auto 1fr; padding: 14px 4px; }
  .cx-feed-title { grid-column: 1 / -1; }
  .cx-feed-src { grid-column: 1 / -1; }
  .cx-stages { grid-template-columns: minmax(0,1fr); gap: 18px; }
  .cx-stages::before { top: 0; bottom: 0; width: 1px; height: auto; left: auto; right: auto; inset-inline-start: 5px; background: linear-gradient(var(--green-hi), var(--red-hi)); }
  .cx-stages li, .cx[dir="rtl"] .cx-stages li { padding: 0 0 0 0; padding-inline-start: 32px; }
  .cx-stages li::before { top: 6px; }
  .cx-stages .cx-mono { position: static; }
  .cx-end { min-height: 70svh; padding-bottom: calc(var(--tab-h) + 40px); }
  .cx-ticker { bottom: calc(var(--tab-h) + env(safe-area-inset-bottom,0px)); height: 32px; padding-bottom: 0; }
  .cx-modal { padding: 10px; }
  .cx-modal-box { grid-template-columns: minmax(0,1fr); padding: 14px; gap: 14px; }
  .cx-modal video { height: auto; width: 100%; max-height: 62svh; }
  .cx-reader-doc { padding-top: 24px; }
  .cx-reader-doc h1 { font-size: 28px; }
  .cx-reader-body { font-size: 17.5px; }
  .cx-reader-tools .cx-btn span { font-size: 12.5px; }
  .cx-search { padding-top: calc(env(safe-area-inset-top,0px) + 12px); }
  .cx-results li { grid-template-columns: auto minmax(0,1fr); }
  .cx-res-k { grid-column: 2; }
}

@media (prefers-reduced-motion: reduce) {
  .cx *, .cx *::before, .cx *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .cx-ticker-track > div { animation: none !important; }
}

/* ===================== WordPress theme additions ===================== */
body { margin: 0; background: #0C1A30; }
.cx-slot { display: contents; }
.cx-slot[hidden] { display: none; }

/* footer strip */
.cx-footbar { position: relative; z-index: 3; display: flex; flex-wrap: wrap; gap: 10px 24px; align-items: center; justify-content: space-between;
  max-width: 1280px; margin: 0 auto; padding: 18px max(28px, env(safe-area-inset-right,0px)) 60px; color: var(--dim); font-size: 13px; border-top: 1px solid var(--line); }
.cx-footnav { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.cx-footnav a { color: var(--dim); }
.cx-footnav a:hover { color: var(--green-hi); }

/* article pages (single/page) */
.cx-article { position: relative; z-index: 3; }
.cx-article-doc { padding-top: calc(var(--top-h) + 36px); padding-bottom: 140px; }
.cx-page-progress { position: fixed; z-index: 7; }
.cx-reader-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.cx-next { text-align: start; background: var(--glass); border: 1px solid var(--line); padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; transition: border-color .2s; }
.cx-next:hover { border-color: var(--gold); }
.cx-next b { font-family: var(--f-display); font-size: 17px; font-weight: 600; line-height: 1.35; }
.cx-taglist { display: flex; flex-wrap: wrap; gap: 8px; }
.cx-reader-body .wp-caption, .cx-reader-body figure { max-width: 100%; }
.cx-reader-body .wp-caption-text, .cx-reader-body figcaption { font-size: 13px; color: var(--dim); padding-top: 6px; }
.cx-reader-body .aligncenter { margin-inline: auto; display: block; }
.cx-reader-body iframe, .cx-reader-body video { max-width: 100%; border: 1px solid var(--line); }
.cx-reader-body iframe { aspect-ratio: 16/9; width: 100%; height: auto; }

/* archive pages */
.cx-archive-page { padding-top: calc(var(--top-h) + 60px); }
.cx-pagination { margin-top: 40px; position: relative; z-index: 3; }
.cx-pagination .nav-links { display: flex; flex-wrap: wrap; gap: 8px; }
.cx-pagination .page-numbers { padding: 8px 14px; border: 1px solid var(--line); color: var(--dim); background: rgba(14,30,52,.55); font-variant-numeric: tabular-nums; }
.cx-pagination .page-numbers.current { color: #fff; background: var(--green); border-color: var(--green-hi); }
.cx-pagination a.page-numbers:hover { color: var(--text); border-color: var(--green-hi); }

/* comments */
.cx-comments { margin-top: 48px; border-top: 1px solid var(--line); padding-top: 28px; display: flex; flex-direction: column; gap: 18px; }
.cx-comments-title, .comment-reply-title { font-family: var(--f-display); font-size: 22px; margin: 0; }
.cx-comment-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 14px; }
.cx-comment-list .comment-body { background: var(--glass); border: 1px solid var(--line); padding: 14px 16px; font-size: 15px; }
.cx-comment-list .comment-meta { font-size: 12.5px; color: var(--dim); margin-bottom: 8px; }
.cx-comment-list .children { list-style: none; padding-inline-start: 24px; margin-top: 12px; display: flex; flex-direction: column; gap: 12px; }
.cx-comment-list .avatar { border-radius: 50%; vertical-align: middle; margin-inline-end: 8px; }
.comment-form { display: flex; flex-direction: column; gap: 12px; }
.comment-form label { font-size: 13px; color: var(--dim); display: block; margin-bottom: 4px; }
.comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"], .comment-form textarea,
.cx-reader-body input[type="text"], .cx-reader-body input[type="email"], .cx-reader-body input[type="password"], .cx-reader-body textarea {
  width: 100%; background: rgba(14,30,52,.6); border: 1px solid var(--line); color: var(--text); padding: 10px 12px; font: inherit; }
.comment-form input:focus, .comment-form textarea:focus { outline: none; border-color: var(--green-hi); }
.comment-form .submit, .cx-reader-body input[type="submit"], .cx-reader-body button[type="submit"] {
  display: inline-flex; padding: 12px 20px; font-size: 15px; font-weight: 500; background: var(--green); border: 1px solid var(--green-hi); color: #fff; cursor: pointer; }

/* inner pages: calmer canvas */
.cx.is-inner .cx-hero { min-height: 0; }
.cx.is-inner .cx-frame { opacity: .5; }

/* admin bar handled inline in functions.php */
@media (max-width: 860px) {
  .cx-footbar { padding-bottom: calc(var(--tab-h) + 60px); }
  .cx-reader-nav { grid-template-columns: 1fr; }
  .cx-archive-page { padding-top: calc(var(--top-h) + 30px); }
}
