:root {
    color-scheme: dark;
    --paper: #e9e7de;
    --muted: #8d9ca5;
    --accent: #d9c49a;
    font-family: "Segoe UI", sans-serif;
    background: #101c24;
    color: var(--paper);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-width: 280px; min-height: 100%; }
button { font: inherit; }
button:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; }
[hidden] { display: none !important; }
.access-screen {
    min-height: 100svh;
    position: relative;
    isolation: isolate;
    display: flex;
    flex-direction: column;
    background: #101c24 url('access-background.webp') center / cover no-repeat;
    overflow: hidden;
}
.access-haze {
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(90deg, #07131ce6, #09151c9c 44%, #09151c0f 80%), linear-gradient(0deg, #08131b8c, transparent 35%);
}
.access-header, .access-footer {
    display: flex;
    align-items: center;
    gap: 13px;
    margin: 0;
    padding: 30px 42px;
    font-size: 9px;
    letter-spacing: 3px;
    color: #a9b1b4;
}
.seal-mark { width: 29px; height: 29px; color: var(--accent); }
.seal-mark svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.25; }
.access-panel {
    width: 370px;
    max-width: calc(100% - 48px);
    margin: auto 0 auto clamp(30px, 12vw, 250px);
    padding: 24px 0;
    text-align: center;
}
.access-eyebrow { font-size: 9px; letter-spacing: 4px; color: var(--accent); margin: 0 0 22px; }
.access-eyebrow span { display: inline-block; width: 4px; height: 4px; background: var(--accent); border-radius: 50%; margin: 0 9px 2px 0; box-shadow: 0 0 12px #d9c49a80; }
h1 { font-family: Georgia, serif; font-size: clamp(38px, 4.2vw, 63px); font-weight: 400; line-height: 1.08; letter-spacing: -2px; margin: 0; }
.access-instructions { font-size: 12px; line-height: 1.7; color: #b0b8ba; margin: 23px 0 8px; }
.pattern-board {
    position: relative;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    width: min(300px, 100%);
    aspect-ratio: 1;
    margin: 4px auto 3px;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    background: radial-gradient(ellipse, #728da00c, transparent 70%);
}
.pattern-node {
    position: relative;
    place-self: center;
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    padding: 0;
    background: none;
    border: 1px solid transparent;
    border-radius: 50%;
    color: #b5c1c6;
    cursor: pointer;
    z-index: 1;
    -webkit-tap-highlight-color: transparent;
}
.pattern-node::before { content: ''; position: absolute; inset: 7px; border: 1px solid #9eafb630; border-radius: 50%; transition: border-color .18s, background .18s; }
.pattern-node span { width: 10px; height: 10px; background: #c3cbcb; border-radius: 50%; box-shadow: 0 0 14px #b3c4cf26; transition: background .18s, box-shadow .18s; }
.pattern-node:hover::before, .pattern-node:focus-visible::before { border-color: #d9c49a80; background: #d9c49a08; }
.pattern-node.selected span { background: #ecd8ac; box-shadow: 0 0 18px #d9c49a80; }
.pattern-node.selected::before { border-color: #d9c49a9c; background: #d9c49a12; }
.pattern-node:disabled { cursor: default; }
.pattern-lines { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.pattern-lines polyline, .pattern-lines line { fill: none; stroke: #d9c49aa6; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pattern-lines line { stroke: #d9c49a60; stroke-dasharray: 3 6; }
.pattern-board.is-error .pattern-lines polyline { stroke: #d5948c; }
.pattern-board.is-error .pattern-node.selected span { background: #e9a79e; box-shadow: 0 0 16px #d5948c60; }
.pattern-board.is-error .pattern-node.selected::before { border-color: #d5948c80; }
.pattern-board.is-success .pattern-lines polyline { stroke: #c1ddc6; }
.pattern-board.is-success .pattern-node.selected span { background: #d3ecda; box-shadow: 0 0 22px #c1ddc690; }
.access-status { min-height: 36px; margin: 5px 0 0; color: var(--muted); font-size: 11px; line-height: 1.65; }
.access-status.is-error { color: #d9a79f; }
.access-actions { display: flex; align-items: center; justify-content: center; gap: 28px; min-height: 44px; margin-top: 9px; }
.access-actions button { background: transparent; color: #a5b2b8; border: 0; padding: 10px 11px; font-size: 11px; cursor: pointer; }
.access-actions button:hover:not(:disabled) { color: var(--paper); }
#submit-pattern { border: 1px solid #b39b6c60; border-radius: 5px; color: var(--accent); padding: 10px 17px; background: #d9c49a08; }
#submit-pattern span { margin-left: 15px; }
.access-actions button:disabled { opacity: .3; cursor: default; }
.keyboard-hint { margin: 17px 0 0; color: #6f838e; font-size: 9px; line-height: 1.6; }
.access-footer { padding-top: 23px; padding-bottom: 23px; font-size: 7px; letter-spacing: 2px; color: #7d8c95; }
.access-footer i { height: 1px; background: #a3926d40; flex: 1; margin: 0 12px; }
.footer-coordinate { color: #a89770; }
#unsealed-content, #unsealed-content iframe { position: fixed; inset: 0; width: 100%; height: 100%; border: 0; background: #101c24; }
.no-script { position: fixed; bottom: 10px; left: 15px; color: var(--paper); font-size: 13px; }
@media (max-width: 600px) {
    .access-screen { background-position: 65% center; }
    .access-haze { background: linear-gradient(90deg, #07131cdb, #09151ca6 65%, #09151c70); }
    .access-header { padding: 20px 24px; font-size: 8px; letter-spacing: 2.2px; }
    .access-panel { margin-left: auto; margin-right: auto; padding: 20px 0; }
    h1 { font-size: 47px; }
    .access-eyebrow { margin-bottom: 17px; font-size: 8px; }
    .access-instructions { margin-top: 20px; }
    .access-footer { padding: 20px 24px; font-size: 6px; letter-spacing: 1.2px; gap: 9px; }
    .access-footer i { margin: 0; }
    .footer-coordinate { display: none; }
}
@media (max-width: 350px), (max-height: 740px) {
    .access-header { padding: 15px 24px; }
    .access-panel { padding-top: 10px; padding-bottom: 10px; }
    h1 { font-size: 39px; }
    .pattern-board { width: 255px; }
    .access-instructions { margin-top: 14px; }
    .access-eyebrow { margin-bottom: 13px; }
    .keyboard-hint { margin-top: 8px; }
    .access-footer { padding-top: 15px; padding-bottom: 15px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
