/**
 * Fern — a white-label skin. The client's identity on SazAI's elements. (data-skin="fern")
 *
 * THE NAME. A fern is four hundred million years old, prospers in the shade, and repeats the
 * same frond at every scale. That is this identity: almost no colour, one structure restated
 * from the 100px head down to the 14px label, and a discipline that does not ask to be noticed.
 *
 * THE RULE (Rames, 2026-09-11): elements and tokens.css are the guardrails; inside them the
 * skin may change whatever it wants, but it must keep every element. This file re-lays the
 * page: the rail becomes a light bar on paper, the hero becomes an enormous display head whose
 * line-height is locked to 1, sections are labelled by small monospaced pills, and the footer
 * becomes a black plane. Nothing is removed.
 *
 * WHERE THE VALUES COME FROM. The client publishes an open brand book with hex values and a
 * font list; it was cross-read against computed styles on the home and one interior page
 * (2026-09-11). Where the two disagree the book wins: the site paints a lighter purple than the
 * book specifies, and the book value is what ships here. 91.5% of elements compute zero radius;
 * where radius exists it is 4 to 5 pixels and never a pill, so that exact exception is kept.
 *
 * THE SIGNATURE, AND IT IS TYPOGRAPHIC. A display face near 100px with line-height locked to 1
 * against 14px body on a 26px line: a ratio near seven to one, held deliberately. A third
 * voice, monospaced and semibold, carries every tag and every button label. All three faces the
 * book names are freely licensed, so the stack can name them honestly. Nothing is downloaded,
 * and the chain continues into Arabic, Hebrew and CJK for the five locales a Latin-only stack
 * would leave as tofu.
 *
 * COLOUR IS A LABEL, NOT A SURFACE. The four secondaries appear only inside small monospaced
 * eyebrow pills naming a section. None of them is ever a page ground and none is ever body ink.
 *
 * NO MARKS. No logo, no wordmark, no company name anywhere, comments included: a skin sheet is
 * served verbatim. The book fixes clear space, minimum size and co-branding order for their
 * mark, and says nothing about third-party use; absence is recorded as absence, and the
 * identity here is carried by shape, scale and pairing alone.
 *
 * DIRECTION. Every inline offset is logical, so the skin flips with the document in ar and he.
 */

:root[data-skin="fern"] {

  /* ========================= BRAND VALUES ========================= */
  --fern-ink:#0a0a0a;
  --fern-black:#000000;      /* the footer plane on the dark face, one step past the ink */
  --fern-paper:#ffffff;
  --fern-body:#676767;        /* 5.3:1 on paper; the body voice */
  --fern-hair:#e6e6e6;
  --fern-mute:#f4f4f4;
  --fern-violet:#460e78;      /* the book value, not the lighter one the page paints */
  --fern-jade:#1da669;
  --fern-amber:#ee7c38;
  --fern-slate:#5a85cb;

  /* geometry: the exception scale the client actually keeps */
  --fern-bar:4.25rem;
  --fern-measure:78rem;
  --fern-gutter:clamp(1.25rem, 5.5vw, 4.5rem);
  --fern-r:4px;               /* the only radius on the site, and never a pill */

  --fern-display:"Aspekta", "Inter", "Helvetica Neue", Arial,
                 "Noto Sans Arabic", "Noto Sans Hebrew",
                 "Hiragino Sans", "Noto Sans JP", "Noto Sans KR", "Noto Sans SC",
                 system-ui, sans-serif;
  --fern-body-face:"Inter", "Helvetica Neue", Arial,
                   "Noto Sans Arabic", "Noto Sans Hebrew",
                   "Hiragino Sans", "Noto Sans JP", "Noto Sans KR", "Noto Sans SC",
                   system-ui, sans-serif;
  --fern-mono:"Geist Mono", "IBM Plex Mono", ui-monospace,
              "Noto Sans Mono CJK JP", "Noto Sans Arabic", "Noto Sans Hebrew", monospace;

  color-scheme: light dark;

  *, *::before, *::after { border-radius:0 !important; box-shadow:none !important; }

  body { background:var(--fern-paper); color:var(--fern-body);
         font-family:var(--fern-body-face); font-size:.875rem; line-height:1.857; }

  /* ===================== A LIGHT BAR ON PAPER ===================== */
  .page > #quartz-body { display:block !important; max-width:none !important;
                         padding-block-start:var(--fern-bar) !important; }
  .page > #quartz-body > * { max-width:none !important; }

  /* ===================== THE RAIL BECOMES A BAR, AND IT IS A GRID =====================
     Corrected 2026-09-11 after rendering the first skin on a served page and measuring it.
     My first version made the rail `display:flex` with a fixed `block-size`, and the children
     spilled down the page: `.flex-component` landed at y=354 and the nav mount at y=414 with
     the bar ending at y=84. The cause is one line of the HOST's own CSS: `.sazai-rail-chrome`
     computes `display: contents`, so it is not a box — its descendants are promoted into
     whatever formatting context the rail declares, they bring their own height, and 84px does
     not hold them. The reference skin solved this before me and I had read the file:
     a GRID with named areas, so the chrome gets a row of its OWN below the bar row, every
     child is placed explicitly, and the chrome is given a real `display` so it stops being
     `contents`. No fixed height on the rail: the rows size themselves. */
  .page > #quartz-body .sidebar.left {
    order:0; position:sticky !important; inset-block-start:0; z-index:120;
    inline-size:100% !important; max-inline-size:none !important;
    display:grid !important;
    grid-template-columns:auto 1fr auto;
    grid-template-areas:"title nav search" "chrome chrome chrome";
    column-gap:1.5rem; row-gap:0; align-items:center;
    /* The host gives the rail a height of its own and the grid rows then stretch to fill
       it: measured 842px, two rows of 431 and 411, with nothing inside taller than 120.
       A bar has to say so. */
    block-size:auto !important; margin:0 !important;
    padding-inline:var(--fern-gutter) !important; padding-block:0 !important;
    background:var(--fern-paper) !important; border-block-end:1px solid var(--fern-hair) !important; }

  .sidebar.left > .page-title { grid-area:title; margin:0 !important;
    block-size:var(--fern-bar); display:flex; align-items:center; }
  .sidebar.left > .sazai-nav-menu-mount { grid-area:nav; display:flex; align-items:center;
    block-size:var(--fern-bar); }
  .sidebar.left > .flex-component { grid-area:search; display:flex !important;
    align-items:center; block-size:var(--fern-bar); }
  .sidebar.left > .sazai-rail-chrome { grid-area:chrome; display:flex !important;
    align-items:center; gap:2rem; min-block-size:var(--fern-bar);
    margin-inline:calc(-1 * var(--fern-gutter)) !important; padding-inline:var(--fern-gutter); }
  .sazai-rail-chrome > .sazai-side-menu-mount { flex:1 1 auto; min-inline-size:0; }

  /* ============ THE SIDE MENU LIES DOWN, AND THIS IS THE OTHER HALF OF THE BAR ============
     Measured 2026-09-11: with the grid alone the bar rendered 842px tall. The chrome row got a
     row of its own, correctly, and then the side-menu component kept its own vertical layout
     inside it. A bar is not a bar until the component in it lies down. 48 of the reference
     skin's 139 rules are this conversion, and it is brand-independent: what follows is that
     structure, parameterised by this skin's own tokens. Every part below is one the component
     publishes; nothing reaches into its internals. */
  sz-side-menu::part(menu), sz-side-menu::part(panel), sz-side-menu::part(variable),
  sz-side-menu::part(vault), sz-side-menu::part(pitch) {
    display:flex; flex-direction:row; align-items:center; gap:1.5rem;
    flex:0 1 auto; min-inline-size:0; min-block-size:0; block-size:auto;
    background:transparent; border:0; outline:0; box-shadow:none; padding:0; margin:0; }
  sz-side-menu::part(menu) { gap:2.5rem; }
  sz-side-menu::part(panel) { flex:1 1 auto; }
  sz-side-menu::part(variable) { flex:1 1 auto; }
  sz-side-menu::part(variable)::before { display:none; }
  sz-side-menu::part(lockup) { display:flex; align-items:center; gap:.75rem;
    margin:0; padding:0; flex:0 0 auto; min-inline-size:0; order:2; }
  sz-side-menu::part(mark) { inline-size:1.25rem; block-size:1.25rem; flex:0 0 auto; opacity:.9; }
  sz-side-menu::part(ways) { display:flex; gap:1.5rem; margin:0; font-size:.75rem;
    text-transform:uppercase; letter-spacing:.08em; font-weight:600; }
  /* the two labels are for a screen reader, not for a bar: hidden visually, never removed */
  sz-side-menu::part(controls-label), sz-side-menu::part(vault-controls-label) {
    position:absolute; inline-size:1px; block-size:1px; overflow:hidden;
    clip-path:inset(50%); white-space:nowrap; margin:0; }
  sz-side-menu::part(controls), sz-user-panel::part(toolbar) { border:0; background:transparent; }
  sz-user-panel::part(panel) { display:flex; align-items:center; gap:1rem;
    background:transparent; border:0; padding:0; margin:0; }
  sz-user-panel::part(identity) { gap:.5rem; }
  sz-user-panel::part(welcome), sz-user-panel::part(email) { font-size:.6875rem; }
  sz-user-panel::part(name) { font-size:.8125rem; }

  .sidebar.left > .page-title a { color:var(--fern-ink); font-family:var(--fern-display);
    font-weight:700; font-size:1.0625rem; letter-spacing:-.02em; text-decoration:none; }

  .sazai-nav-menu-mount > .sazai-nav-content {
    display:flex !important; gap:1.5rem; align-items:center; position:static !important;
    background:transparent !important; border:0 !important; padding:0 !important; }
  sz-nav-menu::part(row) { color:var(--fern-ink); font-family:var(--fern-mono);
    font-size:.75rem; font-weight:600; text-transform:lowercase; }
  sz-nav-menu::part(row):hover { color:var(--fern-violet); }
  sz-nav-menu::part(box) { background:var(--fern-paper);
                           border:1px solid var(--fern-hair); }

  body > .search, .sidebar.left .search { margin-inline-start:auto; }
  .search-button { background:transparent !important; border:0 !important; }
  .search-button p, .search-button svg { color:var(--fern-ink); }

  /* ===================== THE HEAD, LOCKED TO ONE ===================== */
  .center > .page-header { background:var(--fern-paper); padding:7rem var(--fern-gutter) 2.5rem; }
  .center > .page-header h1, .center article h1 {
    font-family:var(--fern-display); font-size:clamp(2.75rem, 7.6vw, 6.25rem);
    line-height:1; letter-spacing:-.035em; font-weight:700; color:var(--fern-ink); }

  sz-lotus { background:var(--fern-paper) !important; }
  sz-lotus::part(stage) { background:var(--fern-paper); }
  sz-lotus > [slot="title"] { font-family:var(--fern-display); color:var(--fern-ink);
    font-weight:700; font-size:clamp(2.25rem, 6vw, 5rem); line-height:1; letter-spacing:-.035em; }

  /* ===================== SECTIONS ARE LABELLED, NOT FRAMED ===================== */
  .center > article { max-inline-size:var(--fern-measure); padding-inline:var(--fern-gutter); }
  .center article h2 { font-family:var(--fern-display); font-size:2.5rem; line-height:1.05;
    letter-spacing:-.03em; font-weight:700; color:var(--fern-ink); }
  .center article h3 { font-family:var(--fern-display); font-size:1.375rem; line-height:1.2;
    letter-spacing:-.02em; font-weight:700; color:var(--fern-ink); }
  .center article p  { font-size:.875rem; line-height:1.857; color:var(--fern-body); }
  .center article p > strong { color:var(--fern-ink); font-weight:600; }
  .center > hr { border:0; border-block-start:1px solid var(--fern-hair); }

  /* the eyebrow pill: the only place colour is allowed to appear */
  .center article h2::before {
    content:""; display:block; inline-size:2rem; block-size:2px;
    background:var(--fern-violet); margin-block-end:1.25rem; }

  .acts { display:grid; grid-template-columns:repeat(auto-fit, minmax(15rem, 1fr)); gap:1.25rem; }
  .act { background:var(--fern-mute); padding:1.75rem 1.5rem;
         border-radius:var(--fern-r) !important; }
  .act > b    { display:block; font-family:var(--fern-mono); font-size:.6875rem;
                font-weight:600; color:var(--fern-jade); margin-block-end:.75rem; }
  .act > span { color:var(--fern-body); font-size:.875rem; }

  a, a.internal { color:var(--fern-ink); text-decoration:underline;
                  text-underline-offset:.2em; text-decoration-thickness:1px; }
  a:hover { color:var(--fern-violet); }

  sz-vault-access::part(google), sz-vault-access::part(microsoft) {
    background:var(--fern-ink); color:var(--fern-paper); border:0;
    border-radius:var(--fern-r) !important; padding:.875rem 1.5rem;
    font-family:var(--fern-mono); font-size:.75rem; font-weight:600; }
  sz-vault-access::part(google):hover, sz-vault-access::part(microsoft):hover {
    background:var(--fern-violet); }
  sz-vault-access::part(heading) { font-family:var(--fern-display); font-weight:700;
                                   letter-spacing:-.02em; color:var(--fern-ink); }

  .page > #quartz-body .sidebar.right { background:var(--fern-paper);
    border-inline-start:1px solid var(--fern-hair); padding:2rem 1.5rem; }
  .sidebar.right h3 { font-family:var(--fern-mono); font-size:.6875rem; font-weight:600;
                      color:var(--fern-amber); text-transform:lowercase; }

  .page > #quartz-body > footer { background:var(--fern-ink); color:var(--fern-paper);
                                  padding-block:4rem; }
  sz-site-footer::part(heading) { font-family:var(--fern-mono); font-size:.6875rem;
    font-weight:600; color:var(--fern-slate); text-transform:lowercase; }
  sz-site-footer::part(row) { color:var(--fern-paper); text-decoration:underline;
                              text-underline-offset:.2em; }
  sz-site-footer::part(row):hover { color:var(--fern-jade); }
  sz-site-footer::part(copyright) { color:var(--fern-hair); font-size:.75rem; }

  sz-side-menu::part(panel) { background:var(--fern-paper); color:var(--fern-ink);
                              border-inline-end:1px solid var(--fern-hair); }
  sz-side-menu::part(pitch) { color:var(--fern-body);
    border-inline-start:1px solid var(--fern-hair); padding-inline-start:1.5rem; }
  sz-side-menu::part(here) { color:var(--fern-violet); }
  sz-user-panel::part(panel) { background:var(--fern-paper); color:var(--fern-ink); }
  sz-user-panel::part(email) { color:var(--fern-body); }

  sz-library::part(card) { background:var(--fern-paper); border:1px solid var(--fern-hair);
                           border-radius:var(--fern-r) !important; }
  sz-library::part(header) { font-family:var(--fern-display); font-weight:700;
                             color:var(--fern-ink); }

  .center article pre { background:var(--fern-ink); color:var(--fern-paper);
                        font-family:var(--fern-mono); }
  .center article :not(pre) > code { background:var(--fern-mute); color:var(--fern-ink);
                                     font-family:var(--fern-mono); }
  .center article table { border-collapse:collapse; }
  .center article th { background:var(--fern-mute); color:var(--fern-ink);
                       font-family:var(--fern-mono); font-size:.75rem; font-weight:600;
                       text-align:start; }
  .center article td { border-block-start:1px solid var(--fern-hair); }
  ::selection { background:var(--fern-jade); color:var(--fern-paper); }
}

/* ===================== THE SECOND FACE ===================== */
:root[data-skin="fern"][data-theme="dark"] {
  body { background:var(--fern-ink); color:var(--fern-hair); }
  .page > #quartz-body .sidebar.left { background:var(--fern-ink) !important;
    border-block-end-color:rgba(255,255,255,.14) !important; }
  .sidebar.left > .page-title a, sz-nav-menu::part(row) { color:var(--fern-paper); }
  .center > .page-header { background:var(--fern-ink); }
  .center > .page-header h1, .center article h1, .center article h2, .center article h3,
  sz-lotus > [slot="title"] { color:var(--fern-paper); }
  sz-lotus, sz-lotus::part(stage) { background:var(--fern-ink) !important; }
  .center article p { color:var(--fern-hair); }
  .center article p > strong { color:var(--fern-paper); }
  .act { background:rgba(255,255,255,.06); }
  .act > span { color:var(--fern-hair); }
  a, a.internal { color:var(--fern-paper); }
  .page > #quartz-body .sidebar.right { background:var(--fern-ink);
    border-inline-start-color:rgba(255,255,255,.14); }
  .page > #quartz-body > footer { background:var(--fern-black); }
  sz-side-menu::part(panel) { background:var(--fern-ink); color:var(--fern-paper);
    border-inline-end-color:rgba(255,255,255,.14); }
  sz-library::part(card) { background:rgba(255,255,255,.05);
    border-color:rgba(255,255,255,.14); }
  sz-library::part(header) { color:var(--fern-paper); }
  .center article :not(pre) > code { background:rgba(255,255,255,.08); color:var(--fern-hair); }
  .center article th { background:rgba(255,255,255,.08); color:var(--fern-paper); }
  .center article td { border-block-start-color:rgba(255,255,255,.14); }
}
