/* ==========================================================================
   hAIku - open-form editions (Vilnius)

   Look: a gallery wall, not a poster. A light graphite wall, works hung without
   frames or borders and lit softly from above, museum wall labels in a grotesque
   set flush left, and one serif voice on the page - the poem. Nothing is a heavy
   block: actions are outlines and rules, never filled slabs.

   One stylesheet, three layouts chosen in vilnius.html before first paint:
     html[data-layout="phone"]  scrolling page (phones, small tablets)
     html[data-layout="wide"]   landscape split screen, fills the viewport
     html[data-layout="tall"]   portrait totem (1080x1920 ... 2160x3840), fills the viewport
   Everything is sized in rem and the root size follows the viewport, so a 4K
   totem shows the same composition as a Full HD one, only sharper.
   Works are never cropped and never sit under text.
   ========================================================================== */

:root {
    color-scheme: dark;
    --wall: #343433;
    --wall-lit: #424241;
    --wall-deep: #2a2a29;
    --panel: #2b2b2a;
    --raise: rgba(255, 255, 255, .045);
    --raise-2: rgba(255, 255, 255, .09);
    --line: rgba(255, 255, 255, .11);
    --line-2: rgba(255, 255, 255, .36);
    --ink: #f5f2ec;
    --ink-2: #c6c1b7;
    --ink-3: #ada8a0;
    --sand: #dcc297;
    --sand-hi: #ead6b3;
    --on-sand: #17130c;
    --err: #eda291;
    --ok: #a9cfa6;
    --serif: 'Instrument Serif', 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
    --sans: 'Instrument Sans', 'Helvetica Neue', Helvetica, Arial, system-ui, sans-serif;
    --shadow-art: 0 .1rem .3rem rgba(0, 0, 0, .22), 0 1.1rem 2.2rem -.6rem rgba(0, 0, 0, .42), 0 2.8rem 5rem -1.6rem rgba(0, 0, 0, .38);
    --shadow-art-sm: 0 .08rem .2rem rgba(0, 0, 0, .22), 0 .7rem 1.4rem -.5rem rgba(0, 0, 0, .42);
    --ease: cubic-bezier(.2, .7, .2, 1);
    /* icons: drawn once, in one stroke weight, so no font is ever asked for a symbol */
    --ico-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.5'%3E%3Cpath d='M3 12h17.5M14 5.5l6.5 6.5-6.5 6.5'/%3E%3C/svg%3E");
    --ico-arrow-left: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.5'%3E%3Cpath d='M21 12H3.5M10 5.5 3.5 12l6.5 6.5'/%3E%3C/svg%3E");
    --ico-arrow-down: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.5'%3E%3Cpath d='M12 3v17.5M5.5 14l6.5 6.5 6.5-6.5'/%3E%3C/svg%3E");
    --ico-check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.5'%3E%3Cpath d='M4.5 12.5l5 5 10-10.5'/%3E%3C/svg%3E");
    --ico-cross: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.5'%3E%3Cpath d='M6 6l12 12M18 6 6 18'/%3E%3C/svg%3E");
    --ico-backspace: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.5'%3E%3Cpath d='M9.2 5.5H21v13H9.2L3 12zM12.5 9.5l5 5M17.5 9.5l-5 5'/%3E%3C/svg%3E");
    --pad: 1.25rem;
    /* a very fine grain: keeps the dark gradients from banding on large screens */
    --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23n)'/%3E%3C/svg%3E");
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; -webkit-text-size-adjust: 100%; scrollbar-color: rgba(255, 255, 255, .22) transparent; }
html[data-layout="wide"] { font-size: max(14px, min(calc(100vw / 90), calc(100vh / 56))); }
html[data-layout="tall"] { font-size: max(16px, min(calc(100vw / 67.5), calc(100vh / 120))); }

body {
    background: var(--wall);
    color: var(--ink);
    font-family: var(--sans);
    font-weight: 400;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

html[data-layout="wide"] body,
html[data-layout="tall"] body { height: 100vh; height: 100dvh; overflow: hidden; }

[hidden] { display: none !important; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
a { color: var(--sand); -webkit-tap-highlight-color: transparent; }

.ico, i.arrow {
    display: inline-block; flex: none; width: 1.15em; height: 1.15em; vertical-align: -.22em;
    background-color: currentColor;
    -webkit-mask: var(--ico) center / contain no-repeat; mask: var(--ico) center / contain no-repeat;
}
i.arrow { --ico: var(--ico-arrow); transition: transform .3s var(--ease); }
i.arrow-left { --ico: var(--ico-arrow-left); }
i.arrow-down { --ico: var(--ico-arrow-down); }
.ico-cross { --ico: var(--ico-cross); }
.ico-backspace { --ico: var(--ico-backspace); }

:focus-visible { outline: 2px solid var(--sand); outline-offset: 3px; }
/* headings that receive focus when a step changes: announced, not outlined */
[tabindex="-1"]:focus { outline: none; }
::selection { background: var(--sand); color: var(--on-sand); }

/* Kiosk: nothing selectable, no long-press menus, no pinch zoom */
html[data-kiosk] body { user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; touch-action: manipulation; overscroll-behavior: none; }
html[data-kiosk] #home-link { pointer-events: none; }
html[data-kiosk] .web-only { display: none !important; }
html:not([data-kiosk]) .kiosk-only { display: none !important; }

/* -------------------------------------------------------------- shared bits */

.app { min-height: 100vh; min-height: 100dvh; }
html[data-layout="wide"] .app,
html[data-layout="tall"] .app { height: 100%; }

.view { animation: view-in .6s var(--ease) both; }
@keyframes view-in { from { opacity: 0; } to { opacity: 1; } }

/* the wall: graphite, lit softly from above like a gallery */
.wall { background: var(--grain), radial-gradient(125% 80% at 50% 22%, var(--wall-lit) 0%, var(--wall) 48%, var(--wall-deep) 100%); }

.logo { height: 1.75rem; width: auto; flex: none; align-self: flex-start; object-fit: contain; }

.edition-tag, .eyebrow {
    font-size: max(.72rem, 11px); font-weight: 500; letter-spacing: .22em; text-transform: uppercase;
    color: var(--sand); white-space: nowrap;
}
.eyebrow { margin-bottom: 1.1rem; }

h1, h2 { font-family: var(--serif); font-weight: 400; line-height: 1.02; letter-spacing: -.012em; text-wrap: balance; }
h1 { font-size: 3.5rem; }
h2 { font-size: 2.7rem; }
.sub, .lede { color: var(--ink-2); font-size: 1.05rem; line-height: 1.45; max-width: 32em; text-wrap: pretty; }

.link-btn { position: relative; font-size: .9rem; font-weight: 400; color: var(--ink-2); padding: .5rem 0; border-bottom: 1px solid var(--line); transition: color .2s, border-color .2s; }
.link-btn:active { color: var(--ink); border-color: var(--ink-2); }
/* small text controls keep their look and get a finger-sized target around it */
.link-btn::after, .logo-link::after, .chip-btn::after { content: ''; position: absolute; inset: -.55rem -.7rem; }

/* Buttons are light: the main action is an outline with an arrow, the others are
   words on a hairline. Nothing is a filled slab until it is touched. */
.btn {
    display: inline-flex; align-items: center; justify-content: space-between; gap: 1.4rem;
    min-height: 3.3rem; padding: .75rem 1.25rem .75rem 1.4rem;
    font-size: 1rem; font-weight: 500; letter-spacing: .005em; line-height: 1.2; text-align: left;
    border: 1px solid transparent; border-radius: 2px;
    transition: background .3s var(--ease), color .3s var(--ease), border-color .3s var(--ease), transform .15s var(--ease), opacity .2s;
}
.btn > span:only-child { margin: 0; }
.btn:active { transform: scale(.985); }
.btn-primary { color: var(--sand); border-color: var(--sand); }
.btn-primary:active { background: var(--sand); color: var(--on-sand); }
.btn-primary[disabled] { color: var(--ink-3); border-color: var(--line); cursor: not-allowed; }
.btn-ghost { color: var(--ink-2); min-width: 2.75rem; padding-left: 0; padding-right: .3rem; border-radius: 0; border-bottom-color: var(--line); }
.btn-ghost:active { color: var(--ink); border-bottom-color: var(--ink-2); }
@media (hover: hover) {
    .link-btn:hover { color: var(--ink); border-color: var(--ink-2); }
    .btn:hover .arrow { transform: translateX(.3rem); }
    .btn-primary:hover { background: var(--sand); color: var(--on-sand); }
    .btn-ghost:hover { color: var(--ink); border-bottom-color: var(--ink-2); }
}
.btn[disabled] { pointer-events: none; }
.btn.is-busy { opacity: .6; pointer-events: none; }
.btn-xl { min-height: 4.4rem; padding: 1rem 1.6rem 1rem 1.9rem; font-size: 1.25rem; gap: 2.4rem; }

/* a work on the wall: no frame, no border - only its own edge and a shadow */
.hang { display: flex; align-items: center; justify-content: center; min-height: 0; min-width: 0; }
.hang img {
    max-width: 100%; max-height: 100%; width: auto; height: auto;
    box-shadow: var(--shadow-art);
    transition: opacity .7s var(--ease);
}
.hang img.is-loading { opacity: 0; }

/* the wall label, as beside a work in a museum */
.label { display: flex; flex-direction: column; align-items: flex-start; gap: .1rem; text-align: left; max-width: 36rem; }
.label::before { content: ''; width: 2.4rem; height: 1px; background: var(--ink-2); margin-bottom: .9rem; }
.label-artist { font-size: 1.08rem; font-weight: 500; color: var(--ink); line-height: 1.3; }
.label-title { font-size: 1.08rem; color: var(--ink); line-height: 1.3; }
.label-title i { font-style: italic; }
.label-orig { font-size: .9rem; font-style: italic; color: var(--ink-2); }
.label-detail { font-size: .8rem; color: var(--ink-3); line-height: 1.45; }
.label-orig + .label-detail, .label-title + .label-detail { margin-top: .35rem; }

/* a poem, anywhere: the only serif voice on the page */
.poem {
    font-family: var(--serif); font-style: italic; font-weight: 400;
    font-size: 2.2rem; line-height: 1.42; letter-spacing: .008em; word-spacing: .05em; color: var(--ink);
}
/* A line of verse stays one line: the type is fitted to the widest line (verse.js),
   and only if that is not enough does a line turn, with a hanging indent. */
.poem .line { display: block; white-space: nowrap; }
/* a line that must turn does so in two even parts, the second one indented */
.poem.wraps .line { white-space: normal; text-wrap: balance; padding-left: 1.4em; text-indent: -1.4em; }
/* the visitor's own words, wherever the poem uses them */
.poem mark.hit { background: none; color: var(--sand); }

.poem.reveal .line { opacity: 0; transform: translateY(.45em); animation: line-in 1s var(--ease) forwards; }
.poem.reveal .line:nth-child(1) { animation-delay: .15s; }
.poem.reveal .line:nth-child(2) { animation-delay: .75s; }
.poem.reveal .line:nth-child(3) { animation-delay: 1.35s; }
.poem.reveal .line:nth-child(4) { animation-delay: 1.95s; }
.poem.reveal .line:nth-child(5) { animation-delay: 2.55s; }
.poem.reveal .line:nth-child(6) { animation-delay: 3.15s; }
@keyframes line-in { to { opacity: 1; transform: none; } }

.words-line { font-size: .9rem; font-weight: 500; color: var(--sand); }
.words-line .lbl { color: var(--ink-3); font-weight: 400; margin-right: .7em; }
.words-line .sep { color: var(--ink-3); margin: 0 .55em; }

.form-msg { min-height: 1.5em; font-size: .92rem; color: var(--err); }
.form-msg.is-note { color: var(--ink-2); }

.foot-by { font-size: max(.74rem, 11px); color: var(--ink-3); }
a.foot-by, .about-partners a { color: inherit; text-decoration: none; transition: color .2s; }
a.foot-by:hover, .about-partners a:hover { color: var(--ink); }
/* the totem never leaves the edition: the signature stays, the link does not */
html[data-kiosk] a.foot-by, html[data-kiosk] .about-partners a { pointer-events: none; }

/* ================================================================== BOOT */

.view-boot {
    min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 1.6rem; padding: 2rem; text-align: center;
}
.view-boot .logo { height: 2.4rem; align-self: center; animation: breathe 2.4s ease-in-out infinite; }
.boot-msg { color: var(--ink-2); min-height: 1.5em; }
@keyframes breathe { 50% { opacity: .35; } }

/* =============================================================== GALLERY */

.view-gallery { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; padding: var(--pad); gap: 1.8rem; }

.head-row { display: flex; align-items: center; gap: 1.2rem; }
.head-row .about-open { margin-left: auto; }
.logo-link { position: relative; display: inline-flex; }
.head-copy { margin-top: 1.8rem; }
.head-copy .lede { margin-top: .9rem; }

/* The hang: rows of works at their own proportions, every row the same width.
   Sizes are set by edition.js (layoutGallery); these are the no-script fallback. */
.grid-wrap { flex: 1; min-height: 0; display: flex; justify-content: center; align-items: flex-start; }
.grid { display: flex; flex-wrap: wrap; align-content: flex-start; gap: 1.9rem 1.6rem; width: 100%; }

.work {
    display: flex; flex-direction: column; gap: .75rem; text-align: left; min-width: 0;
    width: calc(50% - .8rem);
    opacity: 0; animation: work-in .8s var(--ease) forwards;
}
.work:nth-child(1) { animation-delay: .05s; } .work:nth-child(2) { animation-delay: .1s; }
.work:nth-child(3) { animation-delay: .15s; } .work:nth-child(4) { animation-delay: .2s; }
.work:nth-child(5) { animation-delay: .25s; } .work:nth-child(6) { animation-delay: .3s; }
.work:nth-child(7) { animation-delay: .35s; } .work:nth-child(8) { animation-delay: .4s; }
@keyframes work-in { from { opacity: 0; transform: translateY(.9rem); } to { opacity: 1; transform: none; } }

.pic {
    display: block; width: 100%; aspect-ratio: var(--ar, 4 / 3); overflow: hidden;
    background: var(--wall-deep); box-shadow: var(--shadow-art-sm);
    transition: transform .5s var(--ease), box-shadow .5s var(--ease);
}
.pic img { width: 100%; height: 100%; object-fit: cover; }
.work:focus-visible .pic { transform: translateY(-.35rem); box-shadow: var(--shadow-art); }
.work:active .pic { transform: translateY(-.1rem) scale(.99); }

/* A caption takes the room its words need: an artist's name is never cut short.
   edition.js measures the captions and gives the works what is left. */
.work-cap { display: flex; flex-direction: column; gap: .08rem; min-height: 3.7rem; }
.work-artist { font-size: .9rem; font-weight: 500; color: var(--ink); line-height: 1.3; overflow-wrap: break-word; transition: color .3s; }
.work-title { font-size: .86rem; color: var(--ink-2); line-height: 1.3; overflow-wrap: break-word; }
.work-title i { font-style: italic; }
.work:focus-visible .work-artist { color: var(--sand); }
@media (hover: hover) {
    .work:hover .pic { transform: translateY(-.35rem); box-shadow: var(--shadow-art); }
    .work:hover .work-artist { color: var(--sand); }
}

.gallery-foot { display: flex; align-items: center; flex-wrap: wrap; gap: .8rem 1.6rem; margin-top: auto; padding-top: .4rem; }
.foot-partners { display: inline-flex; align-items: center; gap: 2rem; }
.foot-partners img { width: auto; opacity: .82; }
.foot-partners .logo-mnw { height: 1.25rem; }
.foot-partners .logo-lndm { height: 2.1rem; }
.gallery-foot .foot-by { margin-left: auto; }

/* header and footer take the width of the hang (set by edition.js), so all three share their edges */
html[data-layout="wide"] .gallery-head, html[data-layout="wide"] .gallery-foot,
html[data-layout="tall"] .gallery-head, html[data-layout="tall"] .gallery-foot { width: min(100%, var(--hang-w, 100%)); align-self: center; }

/* wide: headline band, the hang, footer - all in one screen */
html[data-layout="wide"] .view-gallery { height: 100%; min-height: 0; padding: 1.7rem 3rem 1.3rem; gap: 1.6rem; }
html[data-layout="wide"] .gallery-head { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: end; gap: 1.1rem 3rem; }
html[data-layout="wide"] .head-row { grid-column: 1 / -1; }
html[data-layout="wide"] .head-copy { display: contents; }
html[data-layout="wide"] .head-copy h1 { font-size: 4.2rem; white-space: nowrap; }
html[data-layout="wide"] .head-copy .lede { margin: 0; max-width: 24em; padding-bottom: .5rem; justify-self: end; }
html[data-layout="wide"] .grid-wrap { align-items: center; }
html[data-layout="wide"] .gallery-foot { margin-top: 0; }
/* a short window (set by edition.js): the works hang at full width and the wall scrolls */
html[data-layout="wide"] .view-gallery[data-scroll] { overflow-y: auto; overscroll-behavior: contain; }
html[data-layout="wide"] .view-gallery[data-scroll] > * { flex: none; }
html[data-layout="wide"] .view-gallery[data-scroll] .grid-wrap { align-items: flex-start; }
html[data-layout="wide"] .view-gallery[data-scroll] .gallery-foot { margin-top: auto; padding-top: 1rem; }

/* tall: headline, then the hang as one centred block */
html[data-layout="tall"] .view-gallery { height: 100%; min-height: 0; padding: 3rem 2.8rem 2rem; gap: 2.2rem; }
html[data-layout="tall"] .head-copy { margin-top: 2.6rem; }
html[data-layout="tall"] .head-copy h1 { font-size: 5.4rem; }
html[data-layout="tall"] .head-copy .lede { font-size: 1.4rem; margin-top: 1.2rem; }
html[data-layout="tall"] .logo { height: 2.3rem; }
html[data-layout="tall"] .grid-wrap { align-items: center; }
html[data-layout="tall"] .grid { gap: 2.2rem 2rem; }
html[data-layout="tall"] .work-cap { min-height: 4.6rem; }
html[data-layout="tall"] .work-artist { font-size: 1.12rem; }
html[data-layout="tall"] .work-title { font-size: 1.05rem; }
html[data-layout="tall"] .edition-tag, html[data-layout="tall"] .eyebrow { font-size: .88rem; }
html[data-layout="tall"] .link-btn { font-size: 1.05rem; }
html[data-layout="tall"] .foot-partners .logo-mnw { height: 1.7rem; }
html[data-layout="tall"] .foot-partners .logo-lndm { height: 2.9rem; }
html[data-layout="tall"] .foot-by { font-size: .9rem; }

/* =============================================================== COMPOSE */

.view-compose { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }

.stage { position: relative; display: flex; flex-direction: column; gap: 1.5rem; padding: 4.4rem var(--pad) 1.8rem; }
.stage .hang { width: 100%; }
.stage .hang img { max-height: 46vh; }

.chip-btn {
    position: absolute; top: 1.1rem; left: var(--pad); z-index: 2;
    display: inline-flex; align-items: center; gap: .7rem; min-height: 2.75rem; padding: .4rem .2rem;
    font-size: .92rem; font-weight: 500; color: var(--ink-2);
    transition: color .2s;
}
.chip-btn:active { color: var(--ink); }
@media (hover: hover) {
    .chip-btn:hover { color: var(--ink); }
    .chip-btn:hover .arrow { transform: translateX(-.3rem); }
}

.panel { flex: 1; display: flex; flex-direction: column; background: var(--grain), var(--panel); padding: var(--pad); }
.panel-top { display: none; align-items: center; gap: 1.1rem; }
.panel-body { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 1.2rem 0 1.4rem; }
.panel-foot { display: flex; justify-content: flex-end; }

.step { display: flex; flex-direction: column; animation: step-in .6s var(--ease) both; }
@keyframes step-in { from { opacity: 0; transform: translateY(.9rem); } to { opacity: 1; transform: none; } }
.step .sub { margin-top: .9rem; }

/* words: written on a line, like a note */
.fields { display: flex; flex-direction: column; gap: .35rem; margin-top: 1.7rem; }
.field { position: relative; display: flex; align-items: baseline; gap: .9rem; border-bottom: 1px solid var(--line-2); transition: border-color .3s var(--ease); }
.field .num { font-size: max(.7rem, 11px); font-weight: 400; color: var(--ink-3); width: 1.1em; }
.field input {
    flex: 1; min-width: 0; padding: .7rem 0 .55rem; background: none; border: 0; outline: 0;
    font-family: var(--serif); font-style: italic; font-size: 1.95rem; line-height: 1.2; color: var(--ink);
    caret-color: var(--sand);
}
.field input::placeholder { color: var(--ink-3); opacity: 1; }
.field.is-active, .field:focus-within { border-color: var(--sand); }
.field .state { flex: none; width: 1.4rem; height: 1.4rem; align-self: center; display: grid; place-items: center; }
.field.is-ok .state::before, .field.is-bad .state::before {
    content: ''; width: 1.2rem; height: 1.2rem; background-color: var(--ok);
    -webkit-mask: var(--ico-check) center / contain no-repeat; mask: var(--ico-check) center / contain no-repeat;
}
.field.is-bad { border-color: var(--err); }
.field.is-bad .state::before { background-color: var(--err); -webkit-mask-image: var(--ico-cross); mask-image: var(--ico-cross); }
.field.is-checking .state::before {
    content: ''; display: inline-block; width: .85rem; height: .85rem; border-radius: 50%;
    border: 1.5px solid var(--line-2); border-top-color: var(--sand); animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
/* kiosk: a blinking caret, because a readonly input shows none */
html[data-kiosk] .field.is-active input { background-image: linear-gradient(var(--sand), var(--sand)); background-size: 2px 1.05em; background-repeat: no-repeat; background-position: var(--caret-x, 0) 55%; animation: caret 1.1s steps(1) infinite; }
@keyframes caret { 50% { background-size: 0 0; } }

.actions { display: flex; flex-wrap: wrap; align-items: stretch; gap: .9rem 2rem; margin-top: 1.9rem; }
.actions .btn-ghost { flex: 0 1 auto; }
.actions .btn-primary { flex: 1 1 14rem; }

/* on-screen keyboard (kiosk) */
.keyboard { display: flex; flex-direction: column; gap: .45rem; margin-top: 1.5rem; }
.kb-row { display: flex; justify-content: center; gap: .45rem; }
.key {
    flex: 1 1 0; max-width: 5rem; min-height: 3.5rem; display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem; font-weight: 400; color: var(--ink);
    background: var(--raise); border: 1px solid var(--line); border-radius: .35rem;
    transition: background .12s, color .12s, transform .08s, border-color .12s;
}
.key:active, .key.is-down { background: var(--sand); border-color: var(--sand); color: var(--on-sand); transform: scale(.95); }
.key-wide { flex: 1.7 1 0; max-width: 9rem; font-size: .92rem; color: var(--ink-2); }
.key .ico { width: 1.7em; height: 1.7em; }
.key-space { flex: 5 1 0; max-width: 26rem; }
.key.is-on { background: var(--raise-2); color: var(--sand); }

/* writing */
.step-writing { align-items: flex-start; }
.writing-words { display: flex; flex-wrap: wrap; gap: .2rem 1.5rem; margin-bottom: 1.2rem; min-height: 2.8rem; }
.writing-words span { font-family: var(--serif); font-style: italic; font-size: 2.3rem; line-height: 1.2; color: var(--sand); animation: word-pulse 3.6s ease-in-out infinite; }
.writing-words span:nth-child(2) { animation-delay: 1.2s; }
.writing-words span:nth-child(3) { animation-delay: 2.4s; }
@keyframes word-pulse { 0%, 100% { opacity: .25; } 35% { opacity: 1; } }
.dots i { font-style: normal; animation: dot 1.5s infinite both; }
.dots i:nth-child(2) { animation-delay: .25s; } .dots i:nth-child(3) { animation-delay: .5s; }
@keyframes dot { 0%, 100% { opacity: .15; } 40% { opacity: 1; } }
.writing-bar { width: 100%; max-width: 22rem; height: 1px; background: var(--line); margin-top: 1.7rem; overflow: hidden; }
.writing-bar i { display: block; height: 100%; width: 35%; background: var(--sand); animation: slide 2.2s var(--ease) infinite; }
@keyframes slide { from { transform: translateX(-110%); } to { transform: translateX(300%); } }
.step-writing .sub { min-height: 3.2em; transition: opacity .4s; }

/* poem */
.step-poem .poem { margin-bottom: 1.2rem; }
.keep { margin-top: 1.9rem; }
.qr-box { display: flex; align-items: center; gap: 1.3rem; }
.qr { background: #fff; padding: .6rem; border-radius: .3rem; width: 8.5rem; height: 8.5rem; flex: none; }
.qr img, .qr canvas { width: 100% !important; height: 100% !important; display: block; image-rendering: pixelated; }
.qr-label { font-size: 1.05rem; color: var(--ink-2); max-width: 9em; line-height: 1.35; }
.share-row { display: flex; flex-wrap: wrap; align-items: stretch; gap: .9rem 2rem; }
.share-row .btn-primary { flex: 1 1 14rem; }
.share-row .btn-ghost { flex: 0 1 auto; }
.actions-poem { margin-top: 1.4rem; }
.actions-poem .btn-primary { flex: 0 1 auto; margin-left: auto; }

/* wide: the work on the wall to the left, the conversation to the right */
html[data-layout="wide"] .view-compose { flex-direction: row; height: 100%; min-height: 0; }
html[data-layout="wide"] .stage { flex: 0 0 56%; height: 100%; padding: 5.2rem 3.6rem 2.6rem; gap: 2rem; }
html[data-layout="wide"] .stage .hang { flex: 1; }
html[data-layout="wide"] .stage .hang img { max-height: 100%; }
html[data-layout="wide"] .chip-btn { top: 1.6rem; left: 3rem; }
html[data-layout="wide"] .panel { height: 100%; padding: 1.7rem 3.6rem 1.3rem; overflow-y: auto; border-left: 1px solid var(--line); }
html[data-layout="wide"] .panel-top { display: flex; }
html[data-layout="wide"] .panel-top .edition-tag { margin-left: auto; }
html[data-layout="wide"] .panel-body { justify-content: flex-start; padding: clamp(1.5rem, calc((100vh - 46rem) * .7), 7rem) 0 1.5rem; }
html[data-layout="wide"] h2 { font-size: 3.1rem; }
html[data-layout="wide"] .poem { font-size: 2.45rem; }

/* tall: the work above, the conversation below, controls within reach */
html[data-layout="tall"] .view-compose { height: 100%; min-height: 0; }
html[data-layout="tall"] .stage { flex: 0 0 44%; min-height: 0; padding: 5.8rem 2.8rem 1.9rem; gap: 1.7rem; }
html[data-layout="tall"] .stage .hang { flex: 1; }
html[data-layout="tall"] .stage .hang img { max-height: 100%; }
html[data-layout="tall"] .chip-btn { top: 2.1rem; left: 2.8rem; min-height: 3.2rem; font-size: 1.15rem; }
html[data-layout="tall"] .label-artist, html[data-layout="tall"] .label-title { font-size: 1.35rem; }
html[data-layout="tall"] .label-orig { font-size: 1.12rem; }
html[data-layout="tall"] .label-detail { font-size: .98rem; }
html[data-layout="tall"] .label::before { width: 3rem; margin-bottom: 1rem; }
html[data-layout="tall"] .panel { flex: 1; min-height: 0; padding: 2.1rem 2.8rem 1.6rem; border-top: 1px solid var(--line); }
html[data-layout="tall"] .panel-top { display: flex; }
html[data-layout="tall"] .panel-top .edition-tag { margin-left: auto; }
html[data-layout="tall"] .panel-body { justify-content: flex-start; padding-top: 2.6rem; }
html[data-layout="tall"] h2 { font-size: 3.7rem; }
html[data-layout="tall"] .sub { font-size: 1.3rem; }
html[data-layout="tall"] .field input { font-size: 2.5rem; }
html[data-layout="tall"] .field .num { font-size: .85rem; }
html[data-layout="tall"] .poem { font-size: 3.5rem; }
html[data-layout="tall"] .words-line { font-size: 1.15rem; }
html[data-layout="tall"] .btn { min-height: 4.3rem; font-size: 1.2rem; }
html[data-layout="tall"] .qr { width: 13.5rem; height: 13.5rem; }
html[data-layout="tall"] .qr-label { font-size: 1.35rem; }
html[data-layout="tall"] .key { min-height: 4.4rem; font-size: 1.6rem; max-width: 6rem; }
html[data-layout="tall"] .key-wide { font-size: 1.05rem; max-width: 11rem; }
html[data-layout="tall"] .key-space { max-width: 30rem; }
html[data-layout="tall"] .writing-words span { font-size: 3.2rem; }
html[data-layout="tall"] .step-poem .poem { margin-bottom: 1.8rem; }
html[data-layout="tall"] .keep { margin-top: 2.6rem; }
html[data-layout="tall"] .form-msg { font-size: 1.1rem; }

/* phone */
html[data-layout="phone"] h1 { font-size: 3.1rem; }
html[data-layout="phone"] h2 { font-size: 2.3rem; }
html[data-layout="phone"] .poem { font-size: 1.75rem; }
html[data-layout="phone"] .panel-body { justify-content: flex-start; }
html[data-layout="phone"] .panel { padding-top: 1.8rem; border-top: 1px solid var(--line); }
html[data-layout="phone"] .grid { gap: 1.6rem 1rem; }
html[data-layout="phone"] .actions .btn-primary, html[data-layout="phone"] .share-row .btn-primary { flex-basis: 100%; margin-left: 0; }
html[data-layout="phone"] .actions-poem { margin-top: .9rem; }
html[data-layout="phone"] #poem-msg:empty { min-height: 0; }
html[data-layout="phone"] .work-cap { min-height: 0; }
/* words step: keep the fields above the native keyboard */
html[data-layout="phone"] .view-compose[data-step="words"] .stage .hang img { max-height: 30vh; }
html[data-layout="phone"] .view-compose[data-step="words"] .label-detail,
html[data-layout="phone"] .view-compose[data-step="words"] .label-orig { display: none; }

/* =============================================================== ATTRACT */

.view-attract { position: relative; height: 100vh; height: 100dvh; display: flex; overflow: hidden; cursor: pointer; }
.attract-progress { position: absolute; top: 0; left: 0; right: 0; height: 2px; background: var(--line); z-index: 3; }
.attract-progress i { display: block; height: 100%; width: 0; background: var(--sand); }
.attract-progress i.run { animation: attract-bar linear forwards; }
@keyframes attract-bar { to { width: 100%; } }

.attract-art { display: flex; flex-direction: column; gap: 1.6rem; min-width: 0; min-height: 0; padding: var(--pad); }
.attract-art .hang { flex: 1; width: 100%; }
.attract-text { display: flex; flex-direction: column; background: var(--grain), var(--panel); min-width: 0; padding: var(--pad); }
.attract-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.attract-poem-wrap { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 1.3rem; min-height: 0; }
.attract-art .hang, .attract-art .label, .attract-poem-wrap { transition: opacity .7s var(--ease); }
.is-swapping .attract-poem-wrap, .is-swapping .attract-art .hang, .is-swapping .attract-art .label { opacity: 0; }
.attract-cta { display: flex; align-items: center; flex-wrap: wrap; gap: 1.2rem 2rem; }
.attract-hint { font-size: 1rem; color: var(--ink-3); max-width: 16em; line-height: 1.35; }
#attract-start .arrow { animation: beckon 3.4s var(--ease) infinite; }
@keyframes beckon { 0%, 55%, 100% { transform: none; } 78% { transform: translateX(.6rem); } }

html[data-layout="wide"] .view-attract { flex-direction: row; }
html[data-layout="wide"] .attract-art { flex: 0 0 56%; padding: 3.4rem 3.6rem 2.6rem; }
html[data-layout="wide"] .attract-text { flex: 1; padding: 1.7rem 3.6rem 2.8rem; }
html[data-layout="wide"] .attract-text .poem { font-size: 2.6rem; }

html[data-layout="tall"] .view-attract { flex-direction: column; }
html[data-layout="tall"] .attract-art { flex: 0 0 50%; padding: 3.6rem 2.8rem 2rem; }
html[data-layout="tall"] .attract-text { flex: 1; padding: 2.1rem 2.8rem 3.2rem; min-height: 0; }
html[data-layout="tall"] .attract-text .poem { font-size: 3.7rem; }
html[data-layout="tall"] .attract-text .words-line { font-size: 1.2rem; }
html[data-layout="tall"] .btn-xl { min-height: 5.8rem; font-size: 1.7rem; padding: 1.3rem 2.2rem 1.3rem 2.6rem; gap: 3.5rem; }
html[data-layout="tall"] .attract-hint { font-size: 1.3rem; }

html[data-layout="phone"] .view-attract { flex-direction: column; height: auto; min-height: 100vh; min-height: 100dvh; }
html[data-layout="phone"] .attract-art { padding: 1.8rem var(--pad) 1.4rem; }
html[data-layout="phone"] .attract-art .hang img { max-height: 42vh; }
html[data-layout="phone"] .attract-text { flex: 1; padding: 1.6rem var(--pad) 2rem; gap: 1.4rem; }
html[data-layout="phone"] .attract-text .poem { font-size: 1.7rem; }

/* phones with a notch or rounded corners (the page asks for the whole screen) */
html[data-layout="phone"] .view-gallery, html[data-layout="phone"] .stage, html[data-layout="phone"] .panel,
html[data-layout="phone"] .attract-art, html[data-layout="phone"] .attract-text {
    padding-left: max(var(--pad), env(safe-area-inset-left)); padding-right: max(var(--pad), env(safe-area-inset-right));
}
html[data-layout="phone"] .view-gallery, html[data-layout="phone"] .panel { padding-bottom: max(var(--pad), env(safe-area-inset-bottom)); }
html[data-layout="phone"] .chip-btn { left: max(var(--pad), env(safe-area-inset-left)); }

/* ================================================================= ABOUT */

.about { position: fixed; inset: 0; z-index: 20; background: rgba(20, 20, 20, .6); display: flex; justify-content: flex-end; animation: view-in .3s both; }
.about-sheet { position: relative; width: min(100%, 38rem); height: 100%; overflow-y: auto; background: var(--panel); padding: 4.2rem 2.4rem 3rem; animation: sheet-in .5s var(--ease) both; }
@keyframes sheet-in { from { transform: translateX(2rem); opacity: 0; } to { transform: none; opacity: 1; } }
.about-close { position: absolute; top: 1rem; right: 1.2rem; width: 3rem; height: 3rem; display: grid; place-items: center; font-size: 1.5rem; color: var(--ink-2); transition: color .2s; }
.about-close:active { color: var(--ink); }
@media (hover: hover) { .about-close:hover { color: var(--ink); } }
.about-sheet h2 { margin-bottom: 1.4rem; }
.about-sheet nav + h2 { margin-top: 3rem; }
.about-sheet h3.menu-first { margin-top: 0; }
.about-sheet h3 { font-size: max(.72rem, 11px); font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--sand); margin: 2.4rem 0 1.1rem; }
.about-sheet p { color: var(--ink-2); margin-bottom: 1rem; text-wrap: pretty; }
/* a note set apart the way a wall label is: by a short rule, not a coloured bar */
.about-note { font-size: .92rem; margin-top: 1.7rem; }
.about-note::before { content: ''; display: block; width: 2.4rem; height: 1px; background: var(--ink-2); margin-bottom: .9rem; }
.about-works { list-style: none; display: flex; flex-direction: column; gap: 1.1rem; }
.about-works li { font-size: .86rem; color: var(--ink-3); line-height: 1.5; }
.about-works b { display: block; font-weight: 600; font-size: .98rem; color: var(--ink); }
.about-works a { color: var(--ink-2); }
.about-partners { margin-top: 2.4rem; font-size: .8rem; color: var(--ink-3) !important; }
.noscript { color: var(--ink-2); max-width: 22em; }
.about-sheet { border-left: 1px solid var(--line); }
/* menu entries: other editions and the way home */
.menu-list { list-style: none; display: flex; flex-direction: column; margin-bottom: .6rem; }
.menu-list a {
    display: flex; align-items: baseline; justify-content: space-between; gap: 1.2rem;
    padding: .95rem 0; border-bottom: 1px solid var(--line);
    color: var(--ink); text-decoration: none; font-size: 1.05rem; transition: color .2s, border-color .2s;
}
.menu-list a:active { color: var(--sand); border-color: var(--sand); }
@media (hover: hover) {
    .menu-list a:hover { color: var(--sand); border-color: var(--sand); }
    .menu-list a:hover .arrow { transform: translateX(.3rem); }
}
.menu-list small { display: block; font-size: .8rem; color: var(--ink-3); margin-top: .15rem; }
.about-logos { display: flex; align-items: center; flex-wrap: wrap; gap: 1.6rem 2.4rem; margin-top: 2.2rem; }
.about-logos img { width: auto; opacity: .85; }
.about-logos .logo-mnw { height: 1.4rem; }
.about-logos .logo-lndm { height: 2.4rem; }
html[data-layout="tall"] .about-sheet { width: 100%; padding: 5rem 3rem 3rem; font-size: 1.15rem; }
html[data-layout="tall"] .about-close { width: 4.5rem; height: 4.5rem; font-size: 3rem; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
    /* what would pulse for ever simply rests in its plain state */
    .view-boot .logo, .writing-words span, .dots i, #attract-start .arrow, html[data-kiosk] .field.is-active input { animation: none !important; }
    .writing-bar { display: none; }
    /* two signs of life stay: the small spinner beside a word and the attract timer */
    .field.is-checking .state::before { animation-duration: .8s !important; animation-iteration-count: infinite !important; }
    .attract-progress i.run { animation-duration: var(--attract-ms, 13s) !important; }
}
