/* Aldea glass: the one look for aldeaops.com and /demo. Tokens, surfaces, header, controls, motion.
   Pages add only their own layout. Every color is a light/dark pair; no light-dark() (older Safari). */
@font-face { font-family: "DM Sans"; src: url("/site/fonts/dm-sans-regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "DM Sans"; src: url("/site/fonts/dm-sans-medium.woff2") format("woff2"); font-weight: 500 700; font-display: swap; }

:root {
  color-scheme: light;
  --ground: #edebe8;
  --ground-2: #e4e1df;
  --ink: #191714;
  --ink-2: #44413e;     /* 8.5:1 on ground */
  --ink-3: #5a5652;     /* 6.1:1 on ground */
  --hair: rgba(25, 23, 20, .08);
  --hair-2: rgba(25, 23, 20, .14);
  --accent: #b13e00;    /* the one accent, hue 42 in both themes, 5.0:1 on ground */
  --accent-wash: rgba(177, 62, 0, .1);
  --ok: #1d6f5b;
  --ok-wash: rgba(29, 111, 91, .1);
  --warn: #8a5a00;
  --warn-wash: rgba(138, 90, 0, .1);
  --no: #b42318;
  --glass: rgba(255, 255, 255, .72);
  --glass-2: rgba(255, 255, 255, .8);
  --glass-solid: #f8f6f5;
  --blur: blur(28px) saturate(1.4);
  --sh-glass: inset 0 1px 0 rgba(255, 255, 255, .85), 0 0 0 1px rgba(25, 23, 20, .06), 0 1px 2px rgba(25, 23, 20, .05),
    0 14px 30px -14px rgba(30, 25, 20, .18), 0 44px 80px -40px rgba(30, 25, 20, .24);
  --sh-row: inset 0 1px 0 rgba(255, 255, 255, .9), 0 0 0 1px rgba(25, 23, 20, .05), 0 1px 2px rgba(25, 23, 20, .06);
  --key-bg: #191714; --key-ink: #f3f1ee;
  --sh-key: inset 0 1px 0 rgba(255, 255, 255, .16), inset 0 -2px 0 rgba(0, 0, 0, .5), 0 1px 2px rgba(0, 0, 0, .22), 0 10px 18px -10px rgba(0, 0, 0, .5);
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n' color-interpolation-filters='sRGB'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 .5 0 0 0 0 .5 0 0 0 .12 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-sheet: cubic-bezier(.32, .72, 0, 1);
  --r-card: 24px; --r-row: 16px; --r-ctl: 12px;
  --glow-a: rgba(120, 170, 150, .26); --glow-b: rgba(222, 138, 86, .2);
  --max: 1200px; --gut: 16px;
  --sans: "DM Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --ground: #0f0e0c;
  --ground-2: #161513;
  --ink: #efedea;
  --ink-2: #c8c5c1;
  --ink-3: #aca7a3;     /* 8.0:1 on ground */
  --hair: rgba(255, 255, 255, .08);
  --hair-2: rgba(255, 255, 255, .14);
  --accent: #fd9156;
  --accent-wash: rgba(253, 145, 86, .12);
  --ok: #73d3b8; --ok-wash: rgba(115, 211, 184, .1);
  --warn: #f0be67; --warn-wash: rgba(240, 190, 103, .1);
  --no: #ff8f86;
  --glass: rgba(28, 27, 25, .7);
  --glass-2: rgba(34, 33, 31, .84);
  --glass-solid: #1c1b19;
  --sh-glass: inset 0 1px 0 rgba(255, 255, 255, .09), 0 0 0 1px rgba(255, 255, 255, .06), 0 1px 2px rgba(0, 0, 0, .4),
    0 14px 30px -14px rgba(0, 0, 0, .6), 0 44px 80px -40px rgba(0, 0, 0, .8);
  --sh-row: inset 0 1px 0 rgba(255, 255, 255, .06), 0 0 0 1px rgba(255, 255, 255, .05), 0 1px 2px rgba(0, 0, 0, .4);
  --key-bg: #efedea; --key-ink: #141311;
  --glow-a: rgba(36, 104, 92, .38); --glow-b: rgba(176, 86, 34, .26);
  --sh-key: inset 0 1px 0 #fff, inset 0 -2px 0 rgba(0, 0, 0, .14), 0 1px 2px rgba(0, 0, 0, .5), 0 10px 18px -10px rgba(0, 0, 0, .9);
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n' color-interpolation-filters='sRGB'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 .5 0 0 0 0 .5 0 0 0 .16 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}
@media (prefers-reduced-transparency: reduce) { :root, :root[data-theme="dark"] { --glass: var(--glass-solid); --glass-2: var(--glass-solid); --blur: none; } }
@media (min-width: 720px) { :root { --gut: 28px; } }
@media (min-width: 980px) { :root { --gut: 40px; } }

@view-transition { navigation: auto; }
::view-transition-group(*) { animation-duration: .5s; animation-timing-function: var(--ease-sheet); }
@keyframes page-out { to { opacity: 0; } }
@keyframes page-in { from { opacity: 0; } }
::view-transition-old(root) { animation: page-out .16s var(--ease-out) both; }
::view-transition-new(root) { animation: page-in .28s var(--ease-out) .12s both; }
/* the demo window is the same on both pages: move it, do not cross-fade two copies */
::view-transition-old(demo-window) { animation: none; opacity: 0; }
::view-transition-new(demo-window) { animation: none; }

/* theme switch: the whole page cross-fades once; the shared window and header must not fly */
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; } }
.theming::view-transition-group(*) { animation: none; }
.theming::view-transition-old(*) { animation: vt-out .4s var(--ease-out) both; }
.theming::view-transition-new(*) { animation: vt-in .4s var(--ease-out) both; }

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--ground); color: var(--ink); font: 400 16px/1.5 var(--sans); -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%; overflow-x: clip; }
body { margin: 0; overflow-x: clip; }
h1, h2, h3, p, ul, ol, figure, dl, dd { margin: 0; }
h1, h2, h3 { font-weight: 500; line-height: 1.1; text-wrap: balance; }
a { color: inherit; }
button { font: inherit; color: inherit; }
img { max-width: 100%; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--accent-wash); color: var(--ink); }
html { accent-color: var(--accent); caret-color: var(--accent); scrollbar-color: var(--hair-2) transparent; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 50; padding: 10px 14px; border-radius: 10px; background: var(--key-bg); color: var(--key-ink); }
.skip:focus { left: 8px; }
.hit { position: relative; }
.hit::after { content: ""; position: absolute; inset: min(0px, calc((1lh - 2.75rem) / 2)) 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; letter-spacing: -.02em; }

/* surfaces */
/* every surface carries the same fine grain as the backdrop, so the blur never reads as plastic */
.glass { background: var(--grain) 0 0 / 160px 160px, var(--glass); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); box-shadow: var(--sh-glass); }
.row { background: var(--grain) 0 0 / 160px 160px, var(--glass-2); box-shadow: var(--sh-row); border-radius: var(--r-row); }

/* the backdrop, soft blurred light: one pre-drawn image per theme and screen shape, AVIF with a WebP fallback (scripts/bg/render.mjs) */
.paper { position: fixed; inset: 0; z-index: -1; pointer-events: none; background: var(--ground) center / cover no-repeat; background-image: url("/site/bg/light-wide.webp"); background-image: image-set(url("/site/bg/light-wide.avif") type("image/avif"), url("/site/bg/light-wide.webp") type("image/webp")); }
:root[data-theme="dark"] .paper { background-image: url("/site/bg/dark-wide.webp"); background-image: image-set(url("/site/bg/dark-wide.avif") type("image/avif"), url("/site/bg/dark-wide.webp") type("image/webp")); }
/* a fine grain over the backdrop dithers its soft gradients, so no bands show on any screen */
.paper::after { content: ""; position: absolute; inset: 0; background: var(--grain) 0 0 / 160px 160px; }
@media (max-aspect-ratio: 4 / 5) {
  .paper { background-image: url("/site/bg/light-tall.webp"); background-image: image-set(url("/site/bg/light-tall.avif") type("image/avif"), url("/site/bg/light-tall.webp") type("image/webp")); }
  :root[data-theme="dark"] .paper { background-image: url("/site/bg/dark-tall.webp"); background-image: image-set(url("/site/bg/dark-tall.avif") type("image/avif"), url("/site/bg/dark-tall.webp") type("image/webp")); }
}
/* the demo's own backdrop: basalt joints lit by ember light in two corners */
.paper.basalt { background-image: url("/site/bg/demo-light-wide.webp"); background-image: image-set(url("/site/bg/demo-light-wide.avif") type("image/avif"), url("/site/bg/demo-light-wide.webp") type("image/webp")); }
:root[data-theme="dark"] .paper.basalt { background-image: url("/site/bg/demo-dark-wide.webp"); background-image: image-set(url("/site/bg/demo-dark-wide.avif") type("image/avif"), url("/site/bg/demo-dark-wide.webp") type("image/webp")); }
@media (max-aspect-ratio: 4 / 5) {
  .paper.basalt { background-image: url("/site/bg/demo-light-tall.webp"); background-image: image-set(url("/site/bg/demo-light-tall.avif") type("image/avif"), url("/site/bg/demo-light-tall.webp") type("image/webp")); }
  :root[data-theme="dark"] .paper.basalt { background-image: url("/site/bg/demo-dark-tall.webp"); background-image: image-set(url("/site/bg/demo-dark-tall.avif") type("image/avif"), url("/site/bg/demo-dark-tall.webp") type("image/webp")); }
}

/* header, the same bar on every page */
header.bar { position: sticky; top: 12px; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: min(var(--max) - 2 * var(--gut) + 16px, 100% - 2 * var(--gut) + 16px); margin: 12px auto 0; padding: 6px 6px 6px 14px; border-radius: 999px;
  view-transition-name: site-bar; background: var(--glass-solid); -webkit-backdrop-filter: none; backdrop-filter: none; }
.brand { display: inline-flex; align-items: center; gap: 11px; min-height: 44px; text-decoration: none; }
.mark { width: 28px; height: 28px; flex: none; color: var(--ink); }
/* the wordmark as it has always been set: DM Sans 500, tight, with OPERATIONS small beside it */
.wordmark { font-size: 24px; font-weight: 500; letter-spacing: -1.1px; line-height: 1; white-space: nowrap; }
.wordmark small { margin-left: 9px; font-size: 9px; font-weight: 400; letter-spacing: 1.3px; }
header.bar nav { display: flex; gap: 2px; }
header.bar nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: 999px; text-decoration: none; font-size: .9375rem; color: var(--ink-3); transition: color .2s, background .2s; }
header.bar nav a:hover, header.bar nav a[aria-current] { color: var(--ink); background: var(--hair); }
.bar-r { display: flex; align-items: center; gap: 6px; }

/* footer, the same on every page */
footer.foot { display: grid; gap: 4px; margin-top: 112px; padding-top: 20px; padding-bottom: 32px; border-top: 1px solid var(--hair); color: var(--ink-2); font-size: .875rem; }
.foot .brand { justify-self: start; color: var(--ink); }
.foot .mark { width: 22px; height: 22px; }
.foot .wordmark { font-size: 19px; letter-spacing: -.85px; }
.foot nav { display: flex; flex-wrap: wrap; gap: 0 4px; margin: 0 -10px; }
.foot nav a, .foot .in { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; padding: 0 10px; border-radius: 999px; color: var(--ink-2); text-decoration: none; transition: color .2s; }
.foot nav a:hover, .foot .in:hover { color: var(--ink); }
.foot-r { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 20px; margin: 0; }
.foot .in { margin: 0 -10px 0 auto; }
.foot svg:not(.mark) { width: 16px; height: 16px; fill: currentColor; }
@media (min-width: 720px) {
  .foot { grid-template-columns: auto 1fr auto; align-items: center; gap: 24px; }
  .foot nav { justify-content: center; }
  .foot .in { margin-left: -4px; }
}

/* light and dark switch */
.seg.theme { position: relative; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 2px; border-radius: 999px; background: var(--hair); }
.seg.theme button { position: relative; z-index: 1; min-height: 40px; padding: 0 14px; border: 0; border-radius: 999px; background: none; color: var(--ink-3); font-size: .8125rem; font-weight: 500; cursor: pointer; transition: color .3s; }
.seg.theme button[aria-pressed="true"] { color: var(--ink); }
.seg.theme button::after { content: ""; position: absolute; inset: -2px 0; }
.seg.theme .thumb { position: absolute; top: 2px; bottom: 2px; left: 2px; width: calc(50% - 2px); border-radius: 999px; background: var(--glass-2); box-shadow: var(--sh-row); transition: translate .45s var(--ease-sheet); }
:root[data-theme="dark"] .seg.theme .thumb { translate: 100% 0; }

/* buttons */
.key { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 24px; border: 0; border-radius: 999px; background: var(--key-bg); color: var(--key-ink);
  text-decoration: none; font-weight: 500; box-shadow: var(--sh-key); cursor: pointer; transition: translate .24s var(--ease-out), box-shadow .24s var(--ease-out); }
@media (hover: hover) { .key:hover { translate: 0 -1px; } }
.key:focus-visible { outline: 2px solid transparent; box-shadow: 0 0 0 2px var(--ground), 0 0 0 4px var(--accent), var(--sh-key); }
.key:active { transition-duration: 70ms; translate: 0 1px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), inset 0 -1px 0 rgba(0, 0, 0, .4), 0 1px 1px rgba(0, 0, 0, .25); }
.link { display: inline-flex; align-items: center; min-height: 44px; font-weight: 500; text-decoration: underline; text-decoration-color: var(--hair-2); text-decoration-thickness: 2px; text-underline-offset: 6px; transition: text-decoration-color .2s, text-underline-offset .2s var(--ease-out); }
.link:hover { text-decoration-color: currentColor; text-underline-offset: 4px; }

/* one entrance: sheets rise once, everything else is already there */
@keyframes rise { from { opacity: 0; translate: 0 32px; scale: .985; } }
.rise { animation: rise .9s var(--ease-sheet) backwards; }
.js .reveal { opacity: 0; translate: 0 22px; transition: opacity .64s var(--ease-out), translate .64s var(--ease-out); }
.js .reveal.in { opacity: 1; translate: 0 0; }

@media (max-width: 719px) { header.bar nav { display: none; } header.bar .wordmark small { display: none; } .seg.theme button { padding: 0 11px; } }
/* more contrast asked for: solid surfaces, darker hairlines, muted text one step stronger */
@media (prefers-contrast: more) {
  :root, :root[data-theme="dark"] { --glass: var(--glass-solid); --glass-2: var(--glass-solid); --blur: none; --ink-3: var(--ink-2); }
  :root { --hair: rgba(25, 23, 20, .3); } :root[data-theme="dark"] { --hair: rgba(255, 255, 255, .3); }
}
/* Windows high contrast: system colors, every surface outlined */
@media (forced-colors: active) {
  .glass, .row, .key, .seg.theme .thumb { border: 1px solid CanvasText; box-shadow: none; }
  .paper { display: none; }
}
/* less motion: nothing moves, but things still fade in and out */
@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  *, *::before, *::after { animation: none !important; transition-property: opacity, color, background-color, border-color !important; }
  .js .reveal { translate: none; }
  .key:hover, .key:active { translate: none; }
}
@media print { .js .reveal { opacity: 1; translate: none; } .paper { display: none; } }

/* back to home: an arrow at the top of /privacy and /jai */
.back { display: inline-grid; place-items: center; width: 44px; height: 44px; margin: 24px 0 0 -12px; border-radius: 50%; color: var(--ink-2); transition: color .2s, background .2s; }
.back svg { width: 20px; height: 20px; }
@media (hover: hover) { .back:hover { color: var(--ink); background: var(--hair); } }
.back:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
