/* Week 06, Set 1 · Vault: the field menu of a sci-fi salvage game, after a holographic file
   database. The menu is a board of glass; its items are boxes laid out on it in sections.
   Shared by the two prototypes (the menu system, the menu in use). Every value the spec
   reports is set here, once, as a token; the pages and the spec read the same numbers.
   The tone: light projected on dark glass, seen straight on. Boxes glow, and are built in stacked layers. */
@import url("https://fonts.googleapis.com/css2?family=Rajdhani:wght@500;600;700&family=Share+Tech+Mono&display=swap");

:root {
  /* colour */
  --void: #03161b;           /* the room */
  --plane: #062a31;          /* the glass plane */
  --glass: rgba(9, 70, 82, .55);   /* the menu */
  --cyan: #39d5ff;           /* light */
  --cyan-hi: #b6f4ff;        /* hot light: hover text, the open folder */
  --ink: #9fe3f2;            /* item text */
  --ink-2: #5fb3c4;          /* icons */
  --ink-3: #3d8796;          /* keys, section labels */
  --ink-off: rgba(95, 179, 196, .32); /* unavailable */
  --line: rgba(57, 213, 255, .28);
  --hot: rgba(57, 213, 255, .22);    /* hover fill */
  --hot-press: rgba(57, 213, 255, .45);
  --alert: #ff8a6b;

  /* type */
  --font: "Rajdhani", "Arial Narrow", sans-serif;
  --mono: "Share Tech Mono", ui-monospace, monospace;
  --size: 16px; --track: .08em;

  /* the board and its tile */
  --tile-w: 188px; --tile-h: 56px; --tile-gap: 10px; --tile-pad: 14px;
  --icon: 26px; --icon-stroke: 1.5;
  --label-size: 17px; --track: .05em;
  --section-gap: 28px;
  --edge: 2px;               /* the corner brackets of the board */

  /* motion */
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-in-out: cubic-bezier(.6, 0, .4, 1);   /* a box drawing back onto what opened it */
  --hover-time: 220ms;
  --lift: 4px;               /* pointed at, a box steps up and to the left by this much */
  --open-time: 380ms;        /* the board grows out of the MENU prompt to the bottom half of the screen */
  --close-time: 240ms;       /* the board draws back onto the prompt */
  /* the tiles are stacked onto the board, one layer at a time */
  --stack-time: 340ms;       /* the box takes this long to rise onto its stack */
  --stack-step: 45ms;        /* the next box starts this much later, left to right */
  --stack-ease: cubic-bezier(.2, .9, .3, 1.12);  /* arrives with the slightest settle */
  --leave-step: 30ms;        /* closing: the boxes are taken down right to left, this far apart */
  /* each box is built in steps, like the reference's stacked frames: corner nodes land, a footprint
     is drawn out of them, a dotted layer rises, then the box itself rises onto the stack */
  --node: #5cffc0;           /* the corner nodes */
  --phase: 75ms;             /* one step of a box's build after the next */
  --draw-time: 200ms;        /* the footprint lines run out of the nodes */
  --mid-z: 3px;              /* the dotted layer sits this far up and left of the footprint */
  --rest: 6px;               /* the box rests this far up and left: the stack shows below it */
  --out-phase: 70ms;         /* taking a box down: one step after the next, so each can be seen */
  /* the Gear rack is built the same way, quicker: it answers a click inside the menu */
  --sub-phase: 35ms; --sub-step: 30ms; --sub-time: 220ms;
  --sub-open: 260ms;         /* the rack grows out of Gear and rises above the board */
  --sub-close: 200ms;        /* once its boxes are down, the rack draws back onto Gear */
  --type-speed: 14ms;        /* the log types a letter at a time */
}

/* ---------- the board: a sheet of projected glass ---------- */
.board-glass { position: absolute; inset: 0; pointer-events: none; border: 1px solid var(--line);
  background: radial-gradient(rgba(57, 213, 255, .16) 1px, transparent 1.4px) 0 0 / 20px 20px, linear-gradient(180deg, rgba(9, 70, 82, .62), rgba(6, 42, 49, .8));
  box-shadow: inset 0 0 60px rgba(57, 213, 255, .1), 0 0 40px rgba(57, 213, 255, .12); }
.board-glass::before, .board-glass::after { content: ""; position: absolute; width: 18px; height: 18px; border: var(--edge) solid var(--cyan); box-shadow: 0 0 8px rgba(57, 213, 255, .6); }
.board-glass::before { left: -3px; top: -3px; border-right: 0; border-bottom: 0; }
.board-glass::after { right: -3px; bottom: -3px; border-left: 0; border-top: 0; }

/* a section: its label and a dotted rule, then its tiles in a grid */
.t-sect { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; font: 400 11px/1 var(--mono); letter-spacing: .16em; color: var(--ink-3); text-transform: uppercase; }
.t-sect::after { content: ""; flex: 1; height: 1px; background: repeating-linear-gradient(90deg, var(--line) 0 6px, transparent 6px 10px); }
.t-grid { display: grid; grid-template-columns: repeat(var(--cols, 2), var(--tile-w)); gap: var(--tile-gap); }

/* ---------- one tile, every configuration ---------- */
/* a menu item is a plain box, wide and low: the icon at the left, the label beside it (a note under
   the label when there is one), and whatever is on its right at the right, all on one line */
.tile { position: relative; display: block; width: var(--tile-w); height: var(--tile-h); margin: 0; padding: 0; border: 0; cursor: pointer; text-align: left; color: var(--ink);
  background: rgba(57, 213, 255, .13); box-shadow: inset 0 0 0 1px rgba(57, 213, 255, .4);
  font: 600 var(--label-size)/1 var(--font); letter-spacing: var(--track); text-transform: uppercase;
  transform: translate(0, 0);
  transition: transform var(--hover-time) var(--ease-out), background-color var(--hover-time) var(--ease-out), box-shadow var(--hover-time) var(--ease-out), color var(--hover-time) var(--ease-out); }
.tile:focus-visible { outline: none; }
.t-ico { position: absolute; left: var(--tile-pad); top: 50%; margin-top: calc(var(--icon) / -2); width: var(--icon); height: var(--icon); color: var(--ink-2); transition: color var(--hover-time); }
.t-ico * { stroke-width: var(--icon-stroke); }
.t-label { position: absolute; left: calc(var(--tile-pad) + var(--icon) + 12px); right: 40px; top: 50%; margin-top: -.5em; white-space: nowrap; }
.tile:not(:has(.t-ico)) .t-label { left: var(--tile-pad); }
.tile:has(.t-note:not(:empty)) .t-label { margin-top: -15px; }
.t-note { position: absolute; left: calc(var(--tile-pad) + var(--icon) + 12px); top: 50%; margin-top: 6px; font: 400 10.5px/1 var(--mono); letter-spacing: .08em; color: var(--ink-3); }
.t-key { position: absolute; right: 12px; top: 50%; margin-top: -10px; min-width: 24px; padding: 3px 5px; border: 1px solid rgba(95, 179, 196, .45); font: 400 12px/1 var(--mono); letter-spacing: .04em; color: var(--ink-3); text-align: center; transition: color var(--hover-time), border-color var(--hover-time); }
.t-badge { position: absolute; right: 12px; top: 50%; margin-top: -10px; min-width: 22px; height: 20px; padding: 0 5px; border: 1px solid var(--alert); color: var(--alert); font: 400 13px/18px var(--mono); text-align: center; box-shadow: 0 0 8px rgba(255, 138, 107, .4); }
.t-end, .t-more { position: absolute; right: 10px; width: 14px; height: 14px; color: var(--ink-3); transition: color var(--hover-time), translate var(--hover-time) var(--ease-out); }
.t-end, .t-more { top: 50%; margin-top: -7px; right: 14px; }
/* hover: the box steps up and left, off its stack, and fills with light */
.tile:hover, .tile:focus-visible, .tile.is-hover { transform: translate(calc(var(--lift) * -1), calc(var(--lift) * -1)); background: rgba(57, 213, 255, .3); color: var(--cyan-hi);
  box-shadow: inset 0 0 0 1px var(--cyan), 0 0 26px rgba(57, 213, 255, .45); }
.tile:hover .t-ico, .tile:focus-visible .t-ico, .tile.is-hover .t-ico, .tile:hover .t-end, .tile.is-hover .t-end, .tile:hover .t-more, .tile.is-hover .t-more { color: var(--cyan-hi); }
.tile:hover .t-key, .tile:focus-visible .t-key, .tile.is-hover .t-key { color: var(--cyan); border-color: var(--cyan); }
.tile:hover .t-more, .tile.is-hover .t-more { translate: 3px 0; }
/* pressed, or holding its submenu open: lit right through, like the open folder in the reference */
.tile:active, .tile.is-press, .tile[aria-expanded="true"] { background: linear-gradient(#bff6ff, #39d5ff); color: #04232b; box-shadow: 0 0 34px 6px rgba(57, 213, 255, .6); }
.tile:active, .tile.is-press { transform: translate(1px, 1px); }
.tile[aria-expanded="true"] { transform: translate(calc(var(--lift) * -1), calc(var(--lift) * -1)); }
.tile:active .t-ico, .tile.is-press .t-ico, .tile[aria-expanded="true"] .t-ico, .tile:active .t-key, .tile.is-press .t-key, .tile[aria-expanded="true"] .t-more, .tile:active .t-more, .tile.is-press .t-more, .tile:active .t-note, .tile.is-press .t-note, .tile[aria-expanded="true"] .t-note, .tile:active .t-end, .tile.is-press .t-end { color: #04232b; border-color: #04232b; }
/* chosen, in a submenu */
.tile[aria-checked="true"] { box-shadow: inset 0 0 0 2px var(--cyan-hi), 0 0 18px rgba(57, 213, 255, .4); }
.tile[aria-checked="true"] .t-note { color: var(--cyan-hi); }
/* unavailable: kept in place, an outline of dashes, never steps up */
.tile[aria-disabled="true"] { cursor: default; color: var(--ink-off); background: rgba(57, 213, 255, .03); box-shadow: none; outline: 1px dashed rgba(95, 179, 196, .35); outline-offset: -1px; transform: translate(0, 0); }
.tile[aria-disabled="true"] .t-ico, .tile[aria-disabled="true"] .t-note, .tile[aria-disabled="true"] .t-key { color: var(--ink-off); border-color: rgba(95, 179, 196, .2); }
.tile.is-no { animation: deny 360ms var(--ease-out); }
@keyframes deny { 30% { outline-color: var(--alert); color: var(--alert); translate: -4px 0; } 60% { translate: 3px 0; } }

/* ---------- the spec, under each prototype ---------- */
.spec { padding: 48px 32px 64px; background: #020f12; color: #9fd8e4; font: 15px/1.5 var(--font); }
.spec h2 { margin: 0 0 4px; font: 700 26px/1.2 var(--font); letter-spacing: .12em; text-transform: uppercase; color: var(--cyan-hi); text-shadow: 0 0 10px rgba(57,213,255,.5); }
.spec > p { margin: 0 0 24px; color: #5f9fae; max-width: 62ch; }
.spec-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.spec-card { padding: 14px 16px 12px; border: 1px solid rgba(57, 213, 255, .22); background: rgba(9, 50, 60, .35); }
.spec-card h3 { margin: 0 0 10px; font: 400 12px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--cyan); }
.spec-card dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; }
.spec-card dt { color: #5f9fae; }
.spec-card dd { margin: 0; color: #d8f7ff; font-variant-numeric: tabular-nums; text-align: right; overflow-wrap: anywhere; }
.spec-card dd i { display: inline-block; width: 10px; height: 10px; margin-right: 6px; vertical-align: -1px; box-shadow: 0 0 0 1px rgba(255,255,255,.3); }
.spec-measure { position: absolute; left: -9999px; top: 0; }
