/* Rondom theme: the Orbit direction.
   One canvas tinted blue-grey (never pure black), one signature (the ring you
   walk), the accent in rare doses. Shared by every page; each page adds only
   its own layout. Fonts are served from this box so it works with no internet. */

@font-face { font-family: "Bricolage Grotesque"; font-style: normal; font-weight: 200 800;
             font-display: swap; src: url(/fonts/BricolageGrotesque.woff2) format("woff2"); }
@font-face { font-family: "Instrument Sans"; font-style: normal; font-weight: 400 700;
             font-display: swap; src: url(/fonts/InstrumentSans.woff2) format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 100 800;
             font-display: swap; src: url(/fonts/JetBrainsMono.woff2) format("woff2"); }

:root {
  color-scheme: dark;
  --canvas: #0f141b;
  --panel: #161d27;
  --panel-2: #1d2632;
  --panel-3: #253040;
  --line: #26303d;          /* hairlines, decorative only */
  --line-strong: #4a586b;   /* interactive borders: 3:1 on the panel */
  --text: #eef2f7;
  --text-2: #a9b4c4;
  --text-3: #808c9b;
  --accent: #4c7dfb;
  --accent-hover: #6b95ff;
  --accent-muted: rgba(76, 125, 251, .16);
  --good: #4fc97a;
  --warn: #f4b63a;
  --bad: #ef6a5e;
  --font-display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --font-body: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --radius: 16px;
  --radius-s: 11px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

* { box-sizing: border-box; margin: 0; }
/* The hidden attribute must beat every display rule below (a .btn is
   inline-flex, which would otherwise show a hidden button). */
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { font: 16px/1.5 var(--font-body); background: var(--canvas); color: var(--text);
       -webkit-tap-highlight-color: transparent; }
a { color: var(--accent); }
::selection { background: var(--accent-muted); }

.skip { position: absolute; left: 12px; top: -60px; padding: 10px 14px; z-index: 100;
        background: var(--accent); color: #fff; border-radius: 10px; font-weight: 600;
        text-decoration: none; }
.skip:focus-visible { top: 12px; outline: none; }

/* ---- the environment: one fixed layer behind everything ------------------ */
.env { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.env .glow { position: absolute; left: 10%; right: -30%; top: -34vh; height: 74vh;
             background: radial-gradient(closest-side, rgba(76, 125, 251, .2), transparent 74%);
             filter: blur(12px); }
.env .orbit { position: absolute; width: 96vmin; height: 96vmin; right: -36vmin; top: -32vmin;
              border-radius: 50%; opacity: .085;
              background: repeating-conic-gradient(from -90deg, #a9c0f0 0deg 11.5deg, transparent 11.5deg 15deg);
              -webkit-mask: radial-gradient(circle, transparent 66%, #000 66.5%, #000 80%, transparent 80.5%);
              mask: radial-gradient(circle, transparent 66%, #000 66.5%, #000 80%, transparent 80.5%);
              animation: orbit 180s linear infinite; }
.env .grain { position: absolute; inset: 0; opacity: .05; background-size: 200px 200px;
              background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .6 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
@keyframes orbit { to { transform: rotate(360deg); } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
@keyframes fade { from { opacity: 0; } }

/* ---- type -------------------------------------------------------------- */
h1, h2, h3 { font-family: var(--font-display); font-weight: 700; letter-spacing: -.022em; line-height: 1.08; }
.kicker { font: 600 11.5px/1 var(--font-mono); letter-spacing: .14em; text-transform: uppercase;
          color: var(--text-3); }
.mono { font-family: var(--font-mono); font-size: 12.5px; color: var(--text-2); letter-spacing: .01em; }
.muted { color: var(--text-2); font-size: 14px; }
.err { color: var(--bad); font-size: 14px; margin-top: 8px; white-space: pre-wrap; }
.err:empty { display: none; }

/* ---- surfaces ----------------------------------------------------------- */
.panel { position: relative; background: var(--panel); border: 1px solid var(--line);
         border-radius: var(--radius); padding: 18px; }
.panelhead { display: flex; align-items: baseline; gap: 12px; margin-bottom: 6px; }
.panelhead h2 { font-size: 22px; }
.panelhead .mono { margin-left: auto; text-align: right; }

/* ---- controls ----------------------------------------------------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px;
       padding: 13px 18px; border: 1px solid transparent; border-radius: 12px;
       font: 600 15.5px/1.15 var(--font-body); color: var(--text); background: var(--panel-2);
       cursor: pointer; user-select: none; text-decoration: none; white-space: nowrap;
       transition: background .15s var(--ease), transform .08s, border-color .15s, box-shadow .15s, color .15s; }
.btn:hover { background: var(--panel-3); }
.btn:active { transform: scale(.98); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 1.5px var(--accent), 0 0 0 5px var(--accent-muted); }
.btn-primary { background: var(--accent); color: #fff;
               box-shadow: 0 10px 28px -12px rgba(76, 125, 251, .8); }
.btn-primary:hover { background: var(--accent-hover); }
.btn:disabled, .btn-primary:disabled { background: var(--panel-2); color: var(--text-3);
                                       box-shadow: none; cursor: default; transform: none; }
.btn-secondary { background: transparent; border-color: var(--line-strong); }
.btn-secondary:hover { background: var(--panel-2); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--panel-2); color: var(--text); }
.btn-block { width: 100%; }
.btn-compact { padding: 9px 14px; font-size: 14px; border-radius: 10px; }
.btn-icon { width: 40px; height: 40px; padding: 0; border-radius: 50%; flex: none; }
.btn svg { flex: none; }

label { display: block; font-size: 13px; font-weight: 600; color: var(--text-2);
        margin: 12px 0 6px; letter-spacing: .01em; }
input[type=text], input[type=password], input[type=email], input[type=number], select {
  width: 100%; padding: 12px 13px; border-radius: var(--radius-s);
  border: 1px solid var(--line-strong); background: var(--canvas); color: var(--text);
  font: 16px/1.3 var(--font-body); transition: border-color .15s, box-shadow .15s; }
input::placeholder { color: var(--text-3); }
input:focus-visible, select:focus-visible { outline: none; border-color: var(--accent);
                                            box-shadow: 0 0 0 3px var(--accent-muted); }
select { appearance: none; -webkit-appearance: none; padding-right: 38px;
         background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23a9b4c4' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
         background-repeat: no-repeat; background-position: right 12px center; }
input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--accent); flex: none; margin: 0; }
.check { display: flex; align-items: center; gap: 12px; margin-top: 12px; cursor: pointer;
         font-size: 15px; font-weight: 500; color: var(--text); }
.check .sub { color: var(--text-3); font-weight: 400; }
.row { display: flex; gap: 10px; } .row > * { flex: 1; min-width: 0; }
.filebtn { display: flex; align-items: center; justify-content: center; gap: 8px;
           padding: 13px; margin-top: 14px; border-radius: 12px; cursor: pointer;
           background: transparent; border: 1px dashed var(--line-strong);
           color: var(--text); font-weight: 600; transition: background .15s, border-color .15s; }
.filebtn:hover { background: var(--panel-2); border-color: var(--text-3); }
.bar { height: 6px; background: var(--panel-2); border-radius: 3px; overflow: hidden; margin-top: 12px; }
.bar > div { height: 100%; background: var(--accent); width: 0%; transition: width .25s var(--ease); }

/* disclosures: a row that opens */
details.disclose > summary { list-style: none; display: flex; align-items: center; gap: 10px;
                             cursor: pointer; padding: 4px 0; user-select: none; }
details.disclose > summary::-webkit-details-marker { display: none; }
details.disclose > summary .chev { margin-left: auto; color: var(--text-3);
                                   transition: transform .2s var(--ease); }
details.disclose[open] > summary .chev { transform: rotate(180deg); }
details.disclose > summary:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-muted); border-radius: 8px; }
details.disclose > .body { padding-top: 6px; animation: fade .25s var(--ease); }

/* ---- dialogs and toasts ------------------------------------------------- */
dialog { border: 1px solid var(--line); border-radius: 20px; background: var(--panel);
         color: var(--text); padding: 18px; width: min(96vw, 720px);
         box-shadow: 0 40px 90px -30px rgba(0, 0, 0, .9); }
dialog[open] { animation: rise .22s var(--ease); }
dialog::backdrop { background: rgba(6, 9, 14, .78); backdrop-filter: blur(6px); }
dialog h3 { font-size: 21px; margin-bottom: 10px; }
#toasts { position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom));
          transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px;
          z-index: 50; width: min(92vw, 420px); }
.toast { background: var(--panel-2); border: 1px solid var(--line-strong); color: var(--text);
         border-radius: 12px; padding: 12px 14px; font-size: 14px;
         box-shadow: 0 12px 30px rgba(0, 0, 0, .5); animation: rise .2s var(--ease); }
.toast.bad { border-color: rgba(239, 106, 94, .6); }

/* ---- the ring, small: coverage on every scan ---------------------------- */
.orb { position: relative; width: 60px; height: 60px; flex: none; }
.orb::before { content: ""; position: absolute; inset: 9px; border-radius: 50%; background: var(--panel-2); }
.orb svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.orb .thumb { position: absolute; inset: 9px; width: 42px; height: 42px; border-radius: 50%;
              object-fit: cover; background: var(--panel-2); }
.orb.running svg, .orb.queued svg { animation: orbit 5s linear infinite; }

@media (pointer: coarse) {
  .btn, .filebtn, details.disclose > summary { min-height: 44px; }
  .btn-icon { width: 44px; height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  .env .orbit, .orb svg { animation: none !important; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
