/* Hegetic Components: the frame every component page shares (cx-*). The component itself lives in .cx-stage and styles
   itself only through the --c-* variables below, so the theme switch (Hegetic + the four sector worlds) repaints it.
   Requires ../../brand/tokens.css first. */
:root, [data-theme="hegetic"] {
  --c-bg: var(--plaster); --c-fg: var(--ink); --c-muted: var(--stone-text); --c-line: var(--line); --c-raise: var(--paper);
  --c-deep: var(--ink); --c-mid: var(--aegean); --c-soft: #DCE3E8; --c-accent: var(--ember); --c-on-deep: var(--plaster);
  --c-r-media: 14px; --c-r-card: 16px; --c-r-btn: 999px;
  --c-display: var(--sans); --c-display-weight: 750;
}
[data-theme="stays"]  { --c-bg: var(--stays-ground);  --c-deep: var(--stays-deep);  --c-mid: var(--stays-mid);  --c-soft: var(--stays-light);  --c-line: rgba(15, 76, 92, .16); --c-raise: #F7F1E6; --c-r-media: 999px 999px 18px 18px; --c-r-card: 22px; --c-r-btn: 999px; }
[data-theme="keys"]   { --c-bg: var(--keys-ground);   --c-deep: var(--keys-deep);   --c-mid: var(--keys-mid);   --c-soft: var(--keys-light);   --c-line: rgba(36, 69, 58, .16); --c-raise: #F2F5F1; --c-r-media: 3px; --c-r-card: 3px; --c-r-btn: 3px; }
[data-theme="ledger"] { --c-bg: var(--ledger-ground); --c-deep: var(--ledger-deep); --c-mid: var(--ledger-mid); --c-soft: var(--ledger-light); --c-line: rgba(31, 56, 100, .16); --c-raise: #FAF7EE; --c-r-media: 0; --c-r-card: 0; --c-r-btn: 0; }
[data-theme="care"]   { --c-bg: var(--care-ground);   --c-deep: var(--care-deep);   --c-mid: var(--care-mid);   --c-soft: var(--care-light);   --c-line: rgba(70, 60, 122, .16); --c-raise: #F5F4FA; --c-r-media: 32px; --c-r-card: 32px; --c-r-btn: 999px; }

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--c-bg); color: var(--c-fg); font: 17px/1.55 var(--sans); -webkit-font-smoothing: antialiased; transition: background-color .5s var(--ease); }
html[lang="el"] [lang="en"]:not(html, .cx-seg > *), html[lang="en"] [lang="el"]:not(html, .cx-seg > *) { display: none !important; }   /* the language buttons always show */
a { color: inherit; }
.cx-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* the bar: the library, this component, prev / next, the theme and the language */
.cx-top { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 14px; height: 60px; padding: 0 var(--gutter); background: color-mix(in srgb, var(--c-bg) 86%, transparent); backdrop-filter: blur(14px) saturate(1.3); -webkit-backdrop-filter: blur(14px) saturate(1.3); border-bottom: 1px solid var(--c-line); font-size: 14px; }
.cx-top__logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--c-fg); font-weight: 650; white-space: nowrap; }
.cx-top__logo svg { height: 18px; width: auto; }
.cx-top__crumb { display: flex; align-items: center; gap: 8px; min-width: 0; font: 500 12.5px/1 var(--mono); color: var(--c-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cx-top__crumb a { text-decoration: none; } .cx-top__crumb a:hover { color: var(--c-fg); }
.cx-top__crumb b { color: var(--c-fg); font-weight: 500; }
.cx-top__sp { flex: 1; }
.cx-seg { display: flex; padding: 3px; border-radius: 999px; border: 1px solid var(--c-line); background: color-mix(in srgb, var(--c-raise) 70%, transparent); }
.cx-seg button { height: 30px; padding: 0 11px; border: 0; border-radius: 999px; background: transparent; color: var(--c-fg); font: 600 12.5px/1 var(--sans); cursor: pointer; opacity: .62; white-space: nowrap; }
.cx-seg button:hover { opacity: 1; }
.cx-seg button[aria-pressed="true"] { background: var(--c-deep); color: var(--c-on-deep); opacity: 1; }
.cx-seg button i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 0; }
.cx-nav { display: flex; gap: 6px; }
.cx-nav a { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--c-line); text-decoration: none; font-size: 15px; }
.cx-nav a:hover { border-color: var(--c-fg); }

/* the head: id, name, one line */
.cx-head { max-width: var(--wrap); margin: 0 auto; padding: 56px var(--gutter) 34px; display: grid; grid-template-columns: 1fr minmax(0, 420px); gap: 24px 48px; align-items: end; }
.cx-id { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; font: 500 12px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--c-mid); margin: 0; }
.cx-id::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--c-accent); }
.cx-head h1 { margin: 0; font: var(--c-display-weight) clamp(44px, 7vw, 104px)/.92 var(--c-display); letter-spacing: -.045em; }
.cx-head p.cx-lede { margin: 0; color: var(--c-muted); font-size: 19px; line-height: 1.45; }
.cx-hint { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; margin: 6px 0 0; font: 500 12.5px/1.4 var(--mono); color: var(--c-mid); }
.cx-hint::before { content: ""; width: 24px; height: 1px; background: currentColor; }

/* the stage: the live component. Full width; a component that needs scroll room makes itself tall. */
.cx-stage { position: relative; isolation: isolate; }
.cx-stage--framed { max-width: calc(var(--wrap) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }
.cx-stage--framed > .cx-box { position: relative; border-radius: var(--c-r-card); overflow: hidden; border: 1px solid var(--c-line); background: var(--c-raise); }

/* the notes: what it does, good for, under the hood */
.cx-notes { max-width: var(--wrap); margin: 0 auto; padding: 72px var(--gutter) 40px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; border-top: 1px solid var(--c-line); margin-top: 72px; }
.cx-notes h2 { margin: 0 0 10px; font: 500 12px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--c-mid); }
.cx-notes p, .cx-notes li { margin: 0; color: var(--c-muted); font-size: 15.5px; }
.cx-notes ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.cx-notes li::before { content: "· "; color: var(--c-accent); font-weight: 700; }
.cx-foot { max-width: var(--wrap); margin: 0 auto; padding: 28px var(--gutter) 48px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font: 500 13px/1.4 var(--mono); color: var(--c-muted); }
.cx-foot a { text-decoration: none; } .cx-foot a:hover { color: var(--c-fg); }
.cx-foot b { color: var(--c-fg); font-weight: 500; }

@media (max-width: 900px) {
  .cx-top { gap: 8px; } .cx-top__crumb .cx-top__cat { display: none; }
  .cx-seg--theme button span { display: none; } .cx-seg--theme button { padding: 0 9px; } .cx-seg--theme button i { margin: 0; }
  .cx-head { grid-template-columns: 1fr; padding-top: 36px; } .cx-notes { grid-template-columns: 1fr; gap: 24px; padding-top: 48px; margin-top: 48px; }
}
@media (max-width: 560px) { .cx-nav { display: none; } .cx-top__logo span { display: none; } }
