/* Scratch · Lock Screen world. Navy void, one lock, six cells, one action. Square corners, one-pixel rules. */
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/poppins-500.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/poppins-700.woff2") format("woff2"); }

:root {
    --bg: #0b1220;
    --panel: #0f172a;
    --face: #151b27;
    --fg: #e8eef7;
    --muted: #93a0b4;
    --line: #22304a;
    --teal: #17b6a0;
    --teal-ink: #0e7c6d;
    --danger: #ff6b61;
    --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
    --sans: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
    --ease: cubic-bezier(.2, .8, .2, 1);
    color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font: 500 16px/1.55 var(--sans);
    background: var(--bg);
    color: var(--fg);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    caret-color: var(--fg);
    scrollbar-color: var(--line) var(--bg);
}
::selection { background: var(--fg); color: var(--bg); }

main {
    max-width: 560px;
    margin: 0 auto;
    padding: clamp(2.5rem, 10vh, 6rem) 1.5rem 3rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    position: relative;
}
main > * { width: 100%; }
main > button { width: auto; }
/* Pages whose whole job is one object (link ready, code entry, confirm, revealed, gone) centre it; the top line stays pinned. */
main.centered { min-height: 100vh; justify-content: center; padding-top: 6.5rem; padding-bottom: 4rem; }
main.centered .top { position: absolute; top: 2.2rem; left: 1.5rem; right: 1.5rem; width: auto; margin: 0; }
main.compact { max-width: 480px; }

/* Top line: wordmark left, session controls right, one hairline under both. */
.top {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    padding-bottom: .9rem; margin-bottom: 2.4rem; border-bottom: 1px solid var(--line);
}
.wordmark { font-size: 11px; letter-spacing: .3em; text-transform: uppercase; color: var(--fg); text-decoration: none; }
.wordmark:hover { text-decoration: none; color: var(--fg); }
.top nav { display: flex; gap: 1.2rem; align-items: center; }
.logout { display: block; margin: 0; }
.logout button { margin: 0; }

/* The lock: the page's state, drawn once. */
.lock { display: block; width: 48px; height: 60px; margin: 0 0 1.1rem; stroke: var(--fg); fill: none; stroke-width: 2.25; stroke-linecap: square; stroke-linejoin: miter; }
.lock path { transform-box: fill-box; transform-origin: 50% 100%; }
.lock-open { stroke: var(--teal); }
.lock-open path:not(.lock-strike) { animation: shackle .24s var(--ease) both; }
@keyframes shackle { from { transform: translateY(7px); stroke: var(--fg); } to { transform: translateY(0); stroke: var(--teal); } }
.lock-spent { stroke: var(--muted); }
.lock-strike { stroke: var(--fg); stroke-width: 2; }

h1 { font: 700 20px/1.25 var(--sans); letter-spacing: .12em; text-transform: uppercase; margin: 0 0 .55rem; text-wrap: balance; }
.status { font-size: 11px; letter-spacing: .2em; font-variant-numeric: tabular-nums; text-transform: uppercase; color: var(--muted); margin: 0 0 1.7rem; line-height: 1.8; }
.status b { color: var(--fg); font-weight: 700; }
.status.is-open b { color: var(--teal); }
p { color: var(--muted); margin: 0 0 1rem; text-wrap: pretty; }
p strong { color: var(--fg); font-weight: 700; }
a { color: var(--fg); text-decoration: underline; text-underline-offset: .22em; text-decoration-thickness: 1px; text-decoration-color: var(--line); }
a:hover { text-decoration-color: var(--fg); }

/* Six cells: the code never runs as a word. */
.cells { display: flex; gap: 8px; margin: 1.4rem 0 1.6rem; }
.cells i {
    font: 700 42px/1 var(--mono); font-style: normal; width: 56px; height: 76px; position: relative;
    display: grid; place-items: center; background: var(--face); color: var(--fg); border: 1px solid var(--line);
    transform-origin: 50% 50%; animation: flip .16s var(--ease) both;
}
.cells i::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--bg); }
.cells i:nth-child(2) { animation-delay: .06s; } .cells i:nth-child(3) { animation-delay: .12s; }
.cells i:nth-child(4) { animation-delay: .18s; } .cells i:nth-child(5) { animation-delay: .24s; } .cells i:nth-child(6) { animation-delay: .30s; }
@keyframes flip { from { transform: perspective(600px) rotateX(-90deg); opacity: 0; } 55% { opacity: 1; } to { transform: perspective(600px) rotateX(0); opacity: 1; } }

/* Metadata: one fixed label grid. */
.meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, max-content)); gap: .6rem 2rem; margin: 0 0 1.6rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.meta span { display: block; font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); margin-bottom: .15rem; }
.meta b { display: block; font-weight: 500; color: var(--fg); overflow-wrap: anywhere; }

/* Forms: hairline fields with a drawn baseline. */
form { display: grid; gap: .9rem; }
label { display: grid; gap: .45rem; font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
input, textarea, button { font: inherit; }
input:not([type="radio"]):not([type="checkbox"]), textarea {
    width: 100%; background: transparent; color: var(--fg); border: 1px solid var(--line); border-bottom: 2px solid var(--fg);
    border-radius: 0; padding: .7rem .85rem; min-height: 46px; transition: border-color .18s var(--ease);
}
input::placeholder { color: var(--muted); opacity: 1; }
:focus-visible { outline: 2px solid var(--fg); outline-offset: 3px; }
input:not([type="radio"]):focus-visible, textarea:focus-visible { outline: 2px solid var(--fg); outline-offset: 3px; }
textarea { resize: vertical; min-height: 16rem; font: 500 14px/1.6 var(--mono); }
input.link { font: 500 14px/1 var(--mono); letter-spacing: 0; }
input.code { letter-spacing: .32em; text-align: center; font-size: 26px; min-height: 60px; }
input[type="file"] { padding: .55rem .85rem; font-size: 14px; color: var(--muted); }
input[type="file"]::file-selector-button {
    font: 700 11px/1 var(--sans); letter-spacing: .18em; text-transform: uppercase; color: var(--fg); background: transparent;
    border: 1px solid var(--fg); padding: .7rem 1rem; margin-right: 1rem; cursor: pointer; border-radius: 0;
}
.help { font-size: 13px; color: var(--muted); margin: -.3rem 0 .2rem; }
.password-field { display: flex; gap: .5rem; align-items: stretch; }
.password-field input { min-width: 0; flex: 1; }

/* Controls are drawn marks: outlined at rest, filled on press, struck when spent. */
button, .button {
    font: 700 11px/1 var(--sans); letter-spacing: .2em; text-transform: uppercase; cursor: pointer;
    background: transparent; color: var(--fg); border: 1px solid var(--fg); border-radius: 0;
    padding: .95rem 1.4rem; width: auto; justify-self: start; text-decoration: none;
    transition: background-color .16s var(--ease), color .16s var(--ease), border-color .16s var(--ease);
}
button:hover, .button:hover { background: var(--fg); color: var(--bg); }
button:active { background: var(--muted); border-color: var(--muted); color: var(--bg); }
button.primary { border-color: var(--teal); color: var(--teal); }
button.primary:hover { background: var(--teal); color: var(--bg); }
button.primary:active { background: var(--teal-ink); border-color: var(--teal-ink); color: var(--bg); }
button.secondary, .toggle { border-color: var(--line); color: var(--muted); padding: .75rem 1rem; }
button.secondary:hover, .toggle:hover { border-color: var(--fg); color: var(--fg); background: transparent; }
button:disabled { cursor: default; color: var(--muted); border-color: var(--line); background: transparent; text-decoration: line-through; }
form > button { margin-top: .4rem; }

/* Engraved switches: two segments, the chosen one filled. */
.choice { display: flex; gap: 0; border: 0; padding: 0; margin: 0; }
.choice legend { font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); padding: 0; margin-bottom: .45rem; }
.choice label { position: relative; display: block; flex: 1; margin-left: -1px; cursor: pointer; }
.choice label:first-of-type { margin-left: 0; }
.choice input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.choice span { display: block; text-align: center; padding: .85rem .6rem; border: 1px solid var(--muted); font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--fg); transition: background-color .16s var(--ease), color .16s var(--ease); }
.choice input:checked + span { background: var(--fg); color: var(--bg); border-color: var(--fg); position: relative; z-index: 1; }
.choice input:focus-visible + span { outline: 2px solid var(--fg); outline-offset: 2px; position: relative; z-index: 2; }
.choice label:hover span { border-color: var(--fg); position: relative; z-index: 1; }

/* Actions: tracked caps along one hairline. */
.actions { display: flex; flex-wrap: wrap; gap: .6rem 1.6rem; align-items: center; margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--line); font-size: 11px; letter-spacing: .18em; text-transform: uppercase; }
.actions a { color: var(--muted); text-decoration: none; }
.actions a:hover { color: var(--fg); }
.actions button { padding: .75rem 1rem; }
.inline { display: flex; gap: .5rem; align-items: stretch; }
.inline input { min-width: 0; flex: 1; }
.inline button { white-space: nowrap; }

/* Messages. */
.error { border: 1px solid var(--danger); color: var(--danger); padding: .75rem .9rem; font-size: 14px; margin: 0 0 1rem; }
.success { border: 1px solid var(--fg); color: var(--fg); padding: .75rem .9rem; font-size: 14px; margin: 0 0 1rem; }
[hidden] { display: none !important; }

/* Revealed text. */
pre { margin: 0 0 1rem; padding: 1rem 1.1rem; background: var(--panel); border: 1px solid var(--line); border-left: 1px solid var(--fg); overflow-x: auto; white-space: pre-wrap; word-break: break-word; font: 500 14px/1.6 var(--mono); color: var(--fg); }
.file-meta { color: var(--fg); overflow-wrap: anywhere; margin-bottom: 1rem; }
.file-meta strong { font-weight: 700; }

details.recovery { border-top: 1px solid var(--line); margin-top: 2rem; padding-top: 1rem; font-size: 14px; }
summary { cursor: pointer; color: var(--muted); font-size: 11px; letter-spacing: .18em; text-transform: uppercase; }
summary::marker { color: var(--muted); }
summary:hover { color: var(--fg); }
.skip { position: absolute; top: -10rem; left: 1rem; padding: .6rem .8rem; background: var(--fg); color: var(--bg); text-decoration: none; font-size: 11px; letter-spacing: .18em; text-transform: uppercase; }
.skip:focus { top: 1rem; }
.page-heading { display: block; }

@media (max-width: 480px) {
    main { padding: 2rem 1.1rem 2.5rem; }
    main.centered .top { left: 1.1rem; right: 1.1rem; }
    main.centered { padding-top: 5.5rem; }
    .top { margin-bottom: 1.8rem; }
    .cells { gap: 6px; }
    .cells i { width: 44px; height: 62px; font-size: 32px; }
    form > button, .inline { width: 100%; }
    .inline { flex-direction: column; }
    textarea { min-height: 13rem; }
    button { width: 100%; }
    .actions button, .logout button, .toggle { width: auto; }
}
@media (prefers-reduced-motion: reduce) {
    .cells i, .lock-open path { animation: none; }
    .lock path, .lock rect, button, .choice label, input, textarea { transition: none; }
}
