/* Nila 03 five logins: the school office's key rack on Naalai-blue paper. Five paper key tags (principal, office,
   class teacher, HR, finance), each with its paper icon, hang on steel rings and swing when a fine pointer brushes them
   (03-logins.js). Round 3 (owner: "a lot of things should be there"): beside the words, a page torn from the audit log
   shows who changed what and when (sample rows, labelled), written in one by one when it is seen. */
.nl { padding-block: clamp(80px, 9vw, 128px); }
/* the office wall on the left (the key rack, the log page pinned under it), the words on the right */
.ni__roles { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto; column-gap: clamp(40px, 6vw, 96px); row-gap: 0; align-items: center; }
.ni__keys { grid-column: 1; grid-row: 1; }
.ni__roles-copy { grid-column: 2; grid-row: 1 / span 2; }
.ni-log { grid-column: 1; grid-row: 2; justify-self: center; width: min(100%, 32rem); }
.ni__roles-copy { max-width: 34rem; }
.ni__h3 { color: #FFFFFF; font-size: var(--t-h2); }
.ni__roles-copy p { margin-top: 14px; color: #F0F3FF; font-size: var(--t-lead); line-height: 1.55; }
/* the key rack of the school office: a wooden strip with five hooks; each paper key tag hangs on a steel ring and
   swings about its hook (06-nila.js writes --swing) */
.ni__keys { position: relative; display: grid; grid-template-columns: repeat(5, 96px); gap: 12px; padding-top: 46px; }
.ni__rack { position: absolute; left: -16px; right: -16px; top: 8px; height: 26px; border-radius: 6px 8px 7px 5px / 7px 5px 8px 6px;
  background: linear-gradient(rgba(255, 255, 255, .12), rgba(60, 25, 0, 0) 40%, rgba(60, 25, 0, .28)), #B97A3E url(/assets/art/textures/kraft-tile.webp) 0 0 / 512px 512px; background-blend-mode: normal, multiply;
  box-shadow: 0 1px 1.5px rgba(11, 26, 85, .45), 0 10px 16px -8px rgba(11, 26, 85, .6); }
.ni__key { position: relative; display: grid; justify-items: center; align-content: center; gap: 5px; height: 132px; padding: 18px 6px 10px; text-align: center;
  font: 800 15px/1.15 var(--font-body); color: var(--ink); background: var(--k, var(--card));
  border-radius: 9px 9px 14px 14px / 9px 9px 16px 16px; transform-origin: 50% -16px; transform: rotate(var(--swing, 0deg));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6), 0 1px 1px rgba(11, 26, 85, .4), 0 9px 14px -7px rgba(11, 26, 85, .6); }
.ni__key::before { content: ""; position: absolute; left: 50%; top: -22px; width: 16px; height: 16px; margin-left: -8px; border-radius: 50%;
  box-shadow: inset 0 0 0 2.5px #C4CDDD, inset 0 0 0 3.5px #8E9BB4, 0 1px 1px rgba(11, 26, 85, .5); }
.ni__key::after { content: ""; position: absolute; left: 50%; top: 7px; width: 9px; height: 9px; margin-left: -4.5px; border-radius: 50%;
  background: rgba(11, 26, 85, .45); box-shadow: 0 0 0 2.5px rgba(255, 255, 255, .55); }
.ni__key img { width: 44px; height: 44px; }
.ni__key b { font: inherit; }
.ni__key i { margin-top: 1px; padding: 2px 7px 3px; border-radius: 6px; font: 900 12.5px/1 var(--font-body); font-style: normal; letter-spacing: .04em; text-transform: uppercase;
  color: #8A2440; box-shadow: inset 0 0 0 1.5px currentColor; rotate: -6deg; }
.ni__key--1 { --k: var(--sun); }
.ni__key--2 { --k: var(--sky); }
.ni__key--3 { --k: var(--card); }
.ni__key--4 { --k: var(--mint); }
.ni__key--5 { --k: var(--pink); }


/* the audit log: a ruled page torn from the office's log book, its rows written in on twos (03-logins.js) */
.ni-log { position: relative; margin: clamp(34px, 3.4vw, 46px) 0 0; padding: 18px 20px 20px; rotate: -.8deg; color: var(--ink);
  border-radius: 6px 9px 7px 5px / 5px 7px 9px 6px; background: var(--card) url(/assets/art/textures/paper-tile.webp) 0 0 / 512px 512px;
  box-shadow: inset 0 1px 0 #FFFFFF, 0 1px 1.5px rgba(11, 26, 85, .4), 0 18px 30px -14px rgba(11, 26, 85, .6); }
/* the torn top edge where it came out of the book */
.ni-log::before { content: ""; position: absolute; left: 0; right: 0; top: -7px; height: 8px; background: inherit;
  clip-path: polygon(0 100%, 0 40%, 4% 70%, 9% 20%, 14% 60%, 20% 10%, 26% 55%, 31% 25%, 37% 70%, 43% 15%, 49% 60%, 55% 30%, 61% 75%, 67% 20%, 73% 60%, 79% 10%, 85% 55%, 91% 25%, 96% 65%, 100% 30%, 100% 100%); }
.ni-log__head { display: flex; align-items: center; gap: 10px; padding-bottom: 10px; border-bottom: 2px solid rgba(229, 99, 90, .45); }
.ni-log__head b { font: 800 19px/1.2 var(--font-display); }
.ni-log__day { margin-left: auto; font: 700 15px/1.2 var(--font-body); color: var(--ink-2); }
.ni-log__rows { display: grid; }
.ni-log__rows li { display: grid; grid-template-columns: 5.4em minmax(0, 1fr); gap: 12px; align-items: baseline; padding: 9px 0; font: 600 16px/1.4 var(--font-body);
  border-bottom: 1.5px solid rgba(35, 70, 198, .12); }
.ni-log__rows li:last-child { border-bottom: 0; padding-bottom: 0; }
.ni-log__rows time { font: 800 15px/1.4 var(--font-body); color: var(--blue-deep); white-space: nowrap; }
.ni-log__rows b { font-weight: 800; }
@media (prefers-reduced-motion: no-preference) {
  html.js:not(.rm) .ni-log.b-wait:not(.b-in) { opacity: 0; }
  .ni-log.b-in { animation: ni-log-in 500ms steps(1, end) var(--b-at, 0ms) both; }
  html.js:not(.rm) .ni-log.b-wait:not(.b-in) .ni-log__rows li { opacity: 0; }
  .ni-log.b-in .ni-log__rows li { animation: ni-log-row 166ms linear both; } /* two frames; not steps(): a 1 ms stepped end can stick at 0 */
  .ni-log.b-in .ni-log__rows li:nth-child(1) { animation-delay: calc(var(--b-at, 0ms) + 520ms); }
  .ni-log.b-in .ni-log__rows li:nth-child(2) { animation-delay: calc(var(--b-at, 0ms) + 860ms); }
  .ni-log.b-in .ni-log__rows li:nth-child(3) { animation-delay: calc(var(--b-at, 0ms) + 1200ms); }
  .ni-log.b-in .ni-log__rows li:nth-child(4) { animation-delay: calc(var(--b-at, 0ms) + 1540ms); }
}
@keyframes ni-log-in {
  0% { opacity: 0; transform: translate(18px, -14px) rotate(4deg); }
  16.67% { opacity: 1; transform: translate(9px, -6px) rotate(2deg); }
  33.33% { transform: translate(2px, -1px) rotate(.5deg); }
  50%, 100% { opacity: 1; transform: none; }
}
@keyframes ni-log-row { from { opacity: 0; } to { opacity: 1; } }

@media (max-width: 899.98px) {
  .ni__roles { grid-template-columns: minmax(0, 1fr); justify-items: start; row-gap: 36px; }
  .ni__keys, .ni__roles-copy, .ni-log { grid-column: 1; grid-row: auto; }
  .ni-log { justify-self: start; margin-top: -8px; }
}
@media (max-width: 599.98px) {
  .ni__keys { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; width: 100%; max-width: 420px; }
  .ni__key { font-size: 13.5px; height: 112px; padding-inline: 2px; hyphens: auto; }
  .ni__key img { width: 34px; height: 34px; }
  .ni__key i { font-size: 11px; padding-inline: 4px; }
  .ni-log { padding: 16px 16px 18px; rotate: -.4deg; }
  .ni-log__rows li { grid-template-columns: minmax(0, 1fr); gap: 0; }
}
@media (prefers-reduced-motion: reduce) { .ni-log, .ni-log__rows li { animation: none !important; opacity: 1 !important; transform: none !important; } }
@media (forced-colors: active) { .ni-log { border: 1px solid CanvasText; } }
@media (prefers-reduced-motion: reduce) { .ni__key { transition: none; } }
@media (forced-colors: active) { .ni__key { border: 1px solid CanvasText; } }
