/* Cube dashboard. Flat black, hairline rules, square corners.
   Served with style-src 'self': no inline styles. */

:root {
  color-scheme: dark;
  --bg: #000;
  --surface: #0a0a0a;
  --ink: #f5f5f5;
  --ink-3: #9a9a9a;
  --line: rgba(255, 255, 255, 0.14);
  --line-strong: rgba(255, 255, 255, 0.28);
  --ok: #34d399;
  --bad: #ff453a;
  --font: var(--nv-font, -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--ink); line-height: 1.55; -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }

a { color: inherit; text-underline-offset: 4px; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ------------------------------------------------------- header, footer */
header, footer {
  max-width: 1240px;
  margin: auto;
  padding: 28px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  font-size: 14px;
}
header { border-bottom: 1px solid var(--line); }
footer { border-top: 1px solid var(--line); color: var(--ink-3); font-size: 12px; }

.brand { font-size: 14px; font-weight: 500; letter-spacing: 0.24em; text-transform: uppercase; }
.brand span { display: none; }

main { max-width: 1240px; margin: auto; padding: 32px 40px 80px; }

/* ----------------------------------------------------------- typography */
.eyebrow, .cube-art small {
  margin: 0 0 20px;
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
h1 { margin: 20px 0 28px; font-size: clamp(44px, 7vw, 92px); font-weight: 500; line-height: 1; letter-spacing: -0.03em; }
h2 { margin: 0 0 18px; font-size: 28px; font-weight: 500; line-height: 1.15; letter-spacing: -0.03em; }
h3 { margin: 28px 0 10px; font-size: 17px; font-weight: 500; }
.lede { max-width: 440px; margin: 0; color: var(--ink-3); font-size: 18px; line-height: 1.6; }
.muted { color: var(--ink-3); font-size: 13px; }
.mono, code { font-family: var(--mono); overflow-wrap: anywhere; }

/* --------------------------------------------------------------- layout */
.intro { display: grid; grid-template-columns: 1.2fr 1fr; gap: 50px; align-items: center; padding: 40px 0 64px; }
.grid { display: grid; grid-template-columns: 1fr 1fr; margin-bottom: -1px; }
.grid > .panel { margin: 0; border-width: 1px 0 1px 1px; }
.grid > .panel:last-child { border-right-width: 1px; }

.cube-art {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 350px;
  padding: 26px;
  border: 1px solid var(--line);
}
.cube-art svg { width: 100%; height: 230px; fill: none; stroke: #fff; stroke-width: 1.1; }
.cube-art span { font-family: var(--mono); font-size: 12px; }

.panel, .policy-gate {
  margin: 0 0 -1px;
  padding: 32px;
  border: 1px solid var(--line);
  background: var(--bg);
}
.panel p { line-height: 1.65; }

.data-panel { display: flex; align-items: center; justify-content: space-between; gap: 20px; }

/* -------------------------------------------------------------- controls */
button, .button {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 20px;
  border: 1px solid #fff;
  border-radius: 0;
  background: #fff;
  color: #000;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
button:hover:not(:disabled), .button:hover { background: #000; color: #fff; text-decoration: none; }
button:disabled { opacity: 0.45; cursor: wait; }

.secondary { background: transparent; color: #fff; }
.secondary:hover:not(:disabled), .button.secondary:hover { background: #fff; color: #000; }

.danger-button { background: transparent; border-color: var(--bad); color: var(--bad); }
.danger-button:hover:not(:disabled) { background: var(--bad); border-color: var(--bad); color: #000; }

.actions, .inline { display: flex; gap: 10px; flex-wrap: wrap; }

label { display: block; margin: 16px 0 8px; color: var(--ink-3); font-size: 12px; }
input {
  width: 100%;
  max-width: 100%;
  padding: 12px;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  background: #000;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
}
input:focus { border-color: #fff; }
.inline input { flex: 1; width: auto; min-width: 180px; }

#new-key { margin-top: 20px; padding-top: 10px; border-top: 1px solid var(--line); }
#new-key button { margin-top: 10px; }

#notice { min-height: 24px; margin: 0 0 16px; color: var(--ink-3); font-size: 14px; }
#notice.error { color: var(--bad); }

/* ----------------------------------------------------------- policy gate */
.policy-gate { margin: 20px 0; padding: 16px; }
.policy-gate p { margin: 0 0 10px; font-size: 13px; }
.policy-gate a { font-weight: 500; text-decoration: underline; }
.policy-check { display: flex; gap: 9px; align-items: flex-start; margin: 0; color: var(--ink); font-size: 13px; line-height: 1.45; }
.policy-check input { width: 17px; min-width: 17px; margin: 1px 0 0; accent-color: #fff; }

/* ---------------------------------------------------------------- danger */
.danger-panel { position: relative; border-color: rgba(255, 69, 58, 0.45); }
.danger-panel h2 { color: var(--bad); }
.danger-panel p { max-width: 760px; }
.danger-panel input { max-width: 520px; }
.danger-panel #erase-status { margin-bottom: 0; }

/* ------------------------------------------------------------- readiness */
.readiness-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
.readiness-heading h2 { margin-bottom: 0; }
.readiness-heading strong { font-size: clamp(32px, 5vw, 54px); font-weight: 500; letter-spacing: -0.03em; line-height: 1; }
.readiness-heading h2.ready { color: var(--ok); }
.readiness-panel progress {
  display: block;
  width: 100%;
  height: 6px;
  margin: 28px 0 12px;
  border: 0;
  border-radius: 0;
  background: rgba(255, 255, 255, 0.14);
  accent-color: #fff;
  -webkit-appearance: none;
  appearance: none;
}
.readiness-panel progress::-webkit-progress-bar { background: rgba(255, 255, 255, 0.14); border-radius: 0; }
.readiness-panel progress::-webkit-progress-value { background: #fff; border-radius: 0; }
.readiness-panel progress::-moz-progress-bar { background: #fff; border-radius: 0; }
.readiness-meta { display: flex; justify-content: space-between; gap: 16px; color: var(--ink-3); font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; }
.readiness-detail { margin-bottom: 0; }

pre {
  margin: 16px 0;
  padding: 20px;
  overflow: auto;
  border: 1px solid var(--line);
  background: var(--surface);
  color: #e7e7e7;
  font-size: 12px;
  line-height: 1.8;
}

:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

@media (max-width: 700px) {
  header, footer { padding: 24px 20px; }
  main { padding: 16px 20px 48px; }
  .intro { grid-template-columns: 1fr; gap: 28px; padding: 24px 0 40px; }
  .cube-art { min-height: 250px; }
  .cube-art svg { height: 180px; }
  .grid { grid-template-columns: 1fr; }
  .grid > .panel { border-width: 1px; }
  .grid > .panel + .panel { border-top-width: 0; }
  .panel { padding: 24px; }
  .data-panel { align-items: flex-start; flex-direction: column; }
  .readiness-meta { align-items: flex-start; flex-direction: column; gap: 5px; }
}
