/* Ora site — shared foundation ("Desk 1984").
   Layout concept: the page is a 1-bit desktop. Every section is a classic window sitting on a
   dithered desktop pattern, under a menu bar. Hard pixel edges, 2px rules, offset shadows.
   The one place colour appears is motion: the six-stripe rainbow that sweeps the screen in
   full-page transitions and fills progress bars. */

:root {
  --paper: #ffffff;
  --ink: #000000;
  --desk-a: #ffffff;            /* desktop dither, light cell */
  --desk-b: #000000;            /* desktop dither, dark cell */
  --mute: #555555;              /* 1-bit-safe grey for secondary text */
  --select: #000000;            /* inverted selection */
  --select-ink: #ffffff;
  --r1: #61bb46; --r2: #fdb827; --r3: #f5821f; --r4: #e03a3e; --r5: #963d97; --r6: #009ddc;

  --font-display: "Pixelify Sans", "Silkscreen", ui-monospace, monospace;
  --font-ui: "Silkscreen", "Pixelify Sans", ui-monospace, monospace;
  --font-body: "VT323", "Cascadia Mono", ui-monospace, monospace;

  /* type scale, in whole pixels so glyphs stay crisp */
  --t-xs: 12px;
  --t-sm: 16px;
  --t-md: 22px;
  --t-lg: 28px;
  --t-xl: 36px;
  --t-2xl: clamp(36px, 22px + 3vw, 56px);
  --t-hero: clamp(44px, 20px + 6.5vw, 104px);

  --px: 2px;                    /* the unit every edge snaps to */
  --gutter: clamp(16px, 4vw, 40px);
  --col: 64ch;
  --wide: 1180px;
  --shadow: 4px 4px 0 var(--ink);
  --shadow-lg: 8px 8px 0 var(--ink);
  --dither: repeating-conic-gradient(var(--desk-b) 0 25%, var(--desk-a) 0 50%) 0 0 / 4px 4px;
  --dither-light: repeating-conic-gradient(var(--desk-b) 0 12.5%, var(--desk-a) 0 50%) 0 0 / 4px 4px;
  --stripes: repeating-linear-gradient(var(--ink) 0 2px, var(--paper) 2px 4px);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #000000; --ink: #f2f2f2; --desk-a: #000000; --desk-b: #f2f2f2; --mute: #a8a8a8; --select: #f2f2f2; --select-ink: #000000;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #000000; --ink: #f2f2f2; --desk-a: #000000; --desk-b: #f2f2f2; --mute: #a8a8a8; --select: #f2f2f2; --select-ink: #000000;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
/* `hidden` must always win: components like #boot set `display`, which would
   otherwise override the browser's own [hidden] rule and leave them on screen. */
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper) var(--dither-light);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--t-md);
  line-height: 1.25;
  -webkit-font-smoothing: none;
  font-smooth: never;
  cursor: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2722%27 height=%2732%27 viewBox=%270 0 11 16%27 shape-rendering=%27crispEdges%27%3E%3Cpath d=%27M0.5 0.5v12l3-3 2 5 2-1-2-5h4z%27 fill=%27white%27 stroke=%27black%27 stroke-width=%271%27/%3E%3C/svg%3E") 1 1, auto;
}
img, svg, canvas { max-width: 100%; }
canvas { image-rendering: pixelated; }
a { color: inherit; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { background: var(--select); color: var(--select-ink); text-decoration: none; }
:focus-visible { outline: 2px dashed var(--ink); outline-offset: 3px; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 700; margin: 0; text-wrap: balance; letter-spacing: 0; line-height: 1; }
p { margin: 0; }
p, li { text-wrap: pretty; }
::selection { background: var(--select); color: var(--select-ink); }

.wrap { width: 100%; max-width: var(--wide); margin-inline: auto; padding-inline: var(--gutter); }
.col { max-width: var(--col); }

/* ---- menu bar ---- */
.menubar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 30;
  background: var(--paper); border-bottom: var(--px) solid var(--ink);
  font-family: var(--font-ui); font-size: var(--t-xs); text-transform: uppercase;
}
.menubar .wrap { display: flex; align-items: stretch; gap: 0; min-height: 34px; padding-inline: calc(var(--gutter) - 10px); }
.menubar a { display: flex; align-items: center; padding: 0 10px; text-decoration: none; }
.menubar a:hover, .menubar a[aria-current="page"] { background: var(--select); color: var(--select-ink); }
.menu-brand { gap: 8px; font-weight: 700; }
.menu-clock { margin-left: auto; display: flex; align-items: center; padding: 0 10px; font-variant-numeric: tabular-nums; }
.menu-links { display: flex; flex-wrap: wrap; }
@media (max-width: 760px) { .menu-links .opt { display: none; } }

/* the Ora mark: a pixel compass rose */
.mark { width: 16px; height: 16px; display: inline-block; flex: none; background:
  conic-gradient(from 45deg, var(--ink) 0 25%, transparent 0 50%, var(--ink) 0 75%, transparent 0) center/8px 8px no-repeat,
  linear-gradient(var(--ink), var(--ink)) center/2px 16px no-repeat,
  linear-gradient(var(--ink), var(--ink)) center/16px 2px no-repeat; }

/* ---- windows ---- */
.window { background: var(--paper); border: var(--px) solid var(--ink); box-shadow: var(--shadow); position: relative; min-width: 0; }
.window.big { box-shadow: var(--shadow-lg); }
.titlebar { position: relative; display: flex; align-items: center; justify-content: center; height: 26px; border-bottom: var(--px) solid var(--ink); background: var(--paper); }
.titlebar::before { content: ""; position: absolute; inset: 5px 4px; background: var(--stripes); }
.titlebar .title { position: relative; z-index: 1; background: var(--paper); padding: 0 10px; font-family: var(--font-ui); font-size: var(--t-xs); text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 70%; }
.titlebar .close, .titlebar .zoom { position: absolute; z-index: 1; top: 6px; width: 14px; height: 14px; border: var(--px) solid var(--ink); background: var(--paper); box-shadow: 0 0 0 3px var(--paper); }
.titlebar .close { left: 10px; }
.titlebar .zoom { right: 10px; }
.titlebar .zoom::after { content: ""; position: absolute; left: 0; top: 0; width: 6px; height: 6px; border-right: var(--px) solid var(--ink); border-bottom: var(--px) solid var(--ink); }
.window-body { padding: clamp(14px, 2.4vw, 28px); }

/* ---- buttons (classic rounded rects) ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-ui); font-size: var(--t-xs); text-transform: uppercase; text-decoration: none;
  padding: 10px 18px; min-height: 36px; border: var(--px) solid var(--ink); border-radius: 10px;
  background: var(--paper); color: var(--ink); cursor: inherit;
}
.btn:hover { background: var(--select); color: var(--select-ink); }
.btn:active { transform: translate(1px, 1px); }
.btn-default { box-shadow: 0 0 0 3px var(--paper), 0 0 0 6px var(--ink); margin: 6px; }

/* ---- labels ---- */
.label { font-family: var(--font-ui); font-size: var(--t-xs); text-transform: uppercase; letter-spacing: 0.04em; }
.inverse { background: var(--ink); color: var(--paper); padding: 2px 8px; display: inline-block; }

/* ---- desktop sections ---- */
.desk { padding-block: clamp(36px, 6vw, 84px); position: relative; }
.section-title { font-size: var(--t-2xl); }
.lead { font-size: var(--t-lg); line-height: 1.15; max-width: 40ch; }

/* ---- alert box (approval) ---- */
.alert { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 14px 16px; padding: 18px; background: var(--paper); border: var(--px) solid var(--ink); box-shadow: 0 0 0 4px var(--paper), 0 0 0 6px var(--ink), var(--shadow-lg); max-width: 440px; }
.alert-icon { width: 44px; height: 44px; border: var(--px) solid var(--ink); display: grid; place-items: center; font-family: var(--font-display); font-size: 30px; line-height: 1; }
.alert-text { display: grid; gap: 6px; min-width: 0; }
.alert-text b { font-family: var(--font-body); font-weight: 400; font-size: var(--t-md); line-height: 1.1; }
.alert-text span { color: var(--mute); font-size: var(--t-sm); line-height: 1.15; }
.alert-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; align-items: center; }

/* ---- progress bar (rainbow fill) ---- */
.progress { height: 14px; border: var(--px) solid var(--ink); background: var(--paper); padding: 2px; }
.progress i { display: block; height: 100%; width: var(--p, 0%); background: linear-gradient(90deg, var(--r1) 0 16.66%, var(--r2) 0 33.33%, var(--r3) 0 50%, var(--r4) 0 66.66%, var(--r5) 0 83.33%, var(--r6) 0); background-size: 100% 100%; transition: width 700ms steps(14, end); }
.progress.mono i { background: var(--ink); }

/* ---- footer ---- */
.site-footer { border-top: var(--px) solid var(--ink); background: var(--paper); padding-block: 22px; font-family: var(--font-ui); font-size: var(--t-xs); text-transform: uppercase; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 12px 28px; justify-content: space-between; align-items: center; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.site-footer a { text-decoration: none; }

/* ---- transition layers (created by transitions.js; nothing here hides content at rest) ---- */
.fx-layer { position: fixed; inset: 0; z-index: 100; pointer-events: none; }
.fx-layer canvas { width: 100%; height: 100%; display: block; }
.fx-stripes { position: fixed; inset: 0; z-index: 101; pointer-events: none; display: grid; grid-template-rows: repeat(6, 1fr); }
.fx-stripes i { display: block; transform: translateX(-101%); }
.fx-stripes i:nth-child(1) { background: var(--r1); } .fx-stripes i:nth-child(2) { background: var(--r2); }
.fx-stripes i:nth-child(3) { background: var(--r3); } .fx-stripes i:nth-child(4) { background: var(--r4); }
.fx-stripes i:nth-child(5) { background: var(--r5); } .fx-stripes i:nth-child(6) { background: var(--r6); }
.zoom-rect { position: absolute; border: var(--px) dashed var(--ink); pointer-events: none; z-index: 40; }

@media (prefers-reduced-motion: reduce) { .progress i { transition: none; } }
