/* Guarden skin for the Anubis challenge / deny page (docs/ANUBIS.md, "Page skin").
   Loaded ONLY on Anubis-generated pages: the gate proxy injects the <link> next to
   Anubis' own <script id="anubis_version"> marker, which Drupal pages never contain.
   Tokens and header rules are copied from drupal/web/themes/custom/guarden/css/style.css
   (dark default theme). Keep them in sync when the theme tokens change.

   Robustness: Anubis' xess.min.css is driven by CSS custom properties, so most of the
   look is set by overriding those variables. If an Anubis upgrade renames them or the
   markup, the page falls back to the stock Anubis look; it does not break. */

@font-face { font-family: 'Atkinson Hyperlegible'; font-style: normal; font-weight: 400; font-display: swap; src: url('fonts/atkinson-hyperlegible-400-latin.woff2') format('woff2'); }
@font-face { font-family: 'Atkinson Hyperlegible'; font-style: normal; font-weight: 700; font-display: swap; src: url('fonts/atkinson-hyperlegible-700-latin.woff2') format('woff2'); }
@font-face { font-family: 'Zilla Slab'; font-style: normal; font-weight: 700; font-display: swap; src: url('fonts/zilla-slab-700-latin.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 600; font-display: swap; src: url('fonts/ibm-plex-mono-600-latin.woff2') format('woff2'); }

:root {
  /* Guarden theme tokens (dark default) */
  --g-bg: #050706; --g-surface: #0B100D; --g-surface-2: #101712; --g-fg: #EAF4EE; --g-muted: #A3BFB0;
  --g-line: #1E2B24; --g-link: #B9E0CC; --g-moss: #7FD1A7; --g-band-2: #030504; --g-focus: #7FD1A7;
  --g-font-display: "Zilla Slab", "Rockwell", "Roboto Slab", Georgia, serif;
  --g-font-body: "Atkinson Hyperlegible", "Segoe UI", system-ui, -apple-system, sans-serif;
  --g-font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --g-wrap: 1180px; --g-radius: 14px;

  /* xess (Anubis) variables mapped onto the Guarden tokens */
  --body-sans-font: var(--g-font-body);
  --body-title-font: var(--g-font-display);
  --body-preformatted-font: var(--g-font-mono);
  --background: var(--g-bg);
  --text: var(--g-fg);
  --text-selection: #0E4D35;
  --preformatted-background: var(--g-surface-2);
  --link-foreground: var(--g-link);
  --link-background: transparent;
  --blockquote-border-left: 1px solid var(--g-line);
  --progress-bar-outline: var(--g-moss) solid 4px;
  --progress-bar-fill: var(--g-moss);
  color-scheme: dark;
}
/* xess switches to a light palette on prefers-color-scheme: light; the Guarden
   default is dark, so pin the dark tokens there too. */
@media (prefers-color-scheme: light) {
  :root { --background: var(--g-bg); --text: var(--g-fg); --preformatted-background: var(--g-surface-2); --link-foreground: var(--g-link); --link-background: transparent; }
}

/* Page layout: replace Anubis' centred flex box with the theme's header + container. */
html, body { display: block !important; height: auto !important; min-height: 100%; margin: 0 !important; max-width: none !important; padding: 0 !important; }
body {
  background: var(--g-bg); color: var(--g-fg);
  font-family: var(--g-font-body); font-size: clamp(1rem, .97rem + .15vw, 1.08rem); line-height: 1.65;
}
*, *::before, *::after { box-sizing: border-box; }
a { color: var(--g-link); text-underline-offset: .18em; text-decoration-thickness: 1px; }
:focus-visible { outline: 3px solid var(--g-focus); outline-offset: 3px; border-radius: 4px; }

/* Theme .wrap */
.gg-wrap { width: 100%; max-width: calc(var(--g-wrap) + 2 * 24px); margin-inline: auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
@media (min-width: 720px) { .gg-wrap { padding-left: max(24px, env(safe-area-inset-left, 0px)); padding-right: max(24px, env(safe-area-inset-right, 0px)); } }

/* Theme .site-header / .nav / .brand */
.gg-header { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--g-bg) 88%, transparent); -webkit-backdrop-filter: saturate(1.4) blur(10px); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--g-line); }
.gg-nav { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 72px; }
.gg-brand { display: inline-flex; align-items: center; gap: .7rem; text-decoration: none; color: var(--g-fg); }
.gg-brand img { width: 44px; height: 44px; display: block; }
.gg-brand-name { font-family: var(--g-font-display); font-weight: 700; font-size: 1.4rem; line-height: 1; letter-spacing: .005em; }
.gg-brand-name small { display: block; font-family: var(--g-font-mono); font-size: .62rem; font-weight: 600; letter-spacing: .22em; text-transform: uppercase; color: var(--g-muted); margin-top: .3rem; }

/* Anubis content inside the theme container */
main { display: block; width: 100%; max-width: calc(var(--g-wrap) + 2 * 24px) !important; margin: 0 auto !important; padding: clamp(2.5rem, 2rem + 3vw, 5rem) max(16px, env(safe-area-inset-right, 0px)) 2rem !important; }
@media (min-width: 720px) { main { padding-left: 24px !important; padding-right: 24px !important; } }
main > .centered-div, main > h1 { max-width: 46rem; margin-inline: auto; }
main h1, #title { font-family: var(--g-font-display); font-weight: 700; font-size: clamp(1.9rem, 1.55rem + 1.6vw, 2.8rem); line-height: 1.12; letter-spacing: -.005em; color: var(--g-fg); margin: 0 auto 1.5rem; text-wrap: balance; }
main p { color: var(--g-fg); }
#status { color: var(--g-muted); font-family: var(--g-font-mono); font-size: .95rem; }
#image { margin-inline: auto; border-radius: var(--g-radius); }
#progress { margin-inline: auto !important; outline-color: var(--g-moss) !important; background: var(--g-surface-2); }
.bar-inner { background-color: var(--g-moss) !important; }
details { text-align: left; background: var(--g-surface); border: 1px solid var(--g-line); border-radius: var(--g-radius); padding: 1rem 1.25rem; margin-top: 1.5rem; }
details summary { cursor: pointer; font-weight: 700; }
details p { color: var(--g-muted); margin: .75rem 0 0; }
code { font-family: var(--g-font-mono); font-size: .9em; background: var(--g-surface-2); padding: .1em .35em; border-radius: 4px; }
/* Anubis credit footer stays visible (upstream asks not to remove its branding). */
main footer { margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--g-line); color: var(--g-muted); font-size: .85rem; }
main footer p { color: var(--g-muted); margin: .25rem 0; }
