/*
 * The destination blind (includes/pieces/blind.php): a steel blind box on the station's stone wall,
 * an enamel plate, a window onto a drum of black linen printed in white (a CSS 3D prism, one face
 * for each year of birth, the lines above and below curving away into the dark), and the winding
 * crank on its side. The line at rest faces you flat, so it reads as print.
 */

.piece--blind { background: var(--stone); }
.piece--blind .piece__foot { border-color: var(--stone-2); background: var(--paper); border-radius: 0 0 calc(var(--radius) - 1px) calc(var(--radius) - 1px); }
.blind { --fh: 98px; --sl: 24px; --r: calc(var(--fh) * 2.8356); --step: calc(360deg / var(--n)); --rot: calc(var(--at) * var(--step)); --crank: 0deg; }

/* The box: enamelled steel, lit from above, screwed to the wall. */
.blind__box { position: relative; padding: 12px 12px 14px; border-radius: 12px; background: linear-gradient(#41464e, #2a2e34 22%, #1d2025 100%);
	box-shadow: inset 0 1px 0 #6a717b, inset 0 -2px 0 #0b0c0e, 0 2px 0 rgba(0, 0, 0, .35), 0 22px 30px -18px rgba(0, 0, 0, .7); }
.blind__box::before, .blind__box::after { content: ""; position: absolute; top: 12px; width: 9px; height: 9px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #c9ced5, #6f757e 60%, #2b2f35); box-shadow: 0 1px 1px #000; }
.blind__box::before { left: 12px; }
.blind__box::after { right: 12px; }
.piece p.blind__plate { display: table; margin: 0 auto 12px; padding: 6px 14px 5px; border-radius: 4px; background: #f3efe5; color: #15171a; font: 700 .95rem/1.2 var(--board-font); letter-spacing: .1em; text-transform: uppercase; text-align: center; box-shadow: var(--p-enamel), 0 1px 0 rgba(0, 0, 0, .6); }

.blind__row { display: grid; grid-template-columns: minmax(0, 1fr) 50px; align-items: center; gap: 8px; }

/* The window and the drum behind it. */
.blind__window { position: relative; height: calc(var(--fh) + 2 * var(--sl)); overflow: hidden; border-radius: 6px; background: #050607; perspective: 900px; touch-action: pan-y; cursor: grab;
	box-shadow: 0 0 0 3px #0b0c0e, 0 0 0 5px #8e949d, 0 0 0 6px #2b2f35; }
.blind__window.is-held { cursor: grabbing; }
.piece .blind__drum { position: absolute; left: 0; right: 0; top: var(--sl); height: var(--fh); margin: 0; padding: 0; list-style: none; transform-style: preserve-3d;
	transform: translateZ(calc(var(--r) * -1)) rotateX(var(--rot)); }
.piece .blind__line { position: absolute; margin: 0; inset: 0; display: grid; grid-template-columns: auto auto minmax(0, 1fr); grid-template-areas: "yr fra fra" "yr p62 p70"; justify-content: start; align-content: center; column-gap: 12px; row-gap: 5px; padding: 0 14px;
	background: #121417; box-shadow: inset 0 1px 0 #24272c, inset 0 -1px 0 #050607; backface-visibility: hidden;
	transform: rotateX(calc(var(--i) * var(--step) * -1)) translateZ(var(--r)); }
.blind__yr { grid-area: yr; align-self: center; min-width: 3.2em; padding: 6px 8px 4px; border: 2px solid #f3efe5; border-radius: 4px; font: 700 1.55rem/1 var(--board-font); letter-spacing: .02em; text-align: center; color: #f3efe5; font-variant-numeric: tabular-nums; }
.blind__fra { grid-area: fra; align-self: end; font: 700 1.9rem/1 var(--board-font); letter-spacing: .01em; color: #f3efe5; white-space: nowrap; }
.blind__pct { align-self: start; font: 700 1rem/1.2 var(--board-font); letter-spacing: .04em; color: #c9c4ba; white-space: nowrap; }
.blind__pct b { color: var(--signal); font-weight: 700; }
.blind__pct--62 { grid-area: p62; }
.blind__pct--70 { grid-area: p70; }
.blind__shade { position: absolute; inset: 0; pointer-events: none;
	background: linear-gradient(rgba(5, 6, 7, .9), rgba(5, 6, 7, .3) var(--sl), transparent calc(var(--sl) + 6px), transparent calc(100% - var(--sl) - 6px), rgba(5, 6, 7, .3) calc(100% - var(--sl)), rgba(5, 6, 7, .9)); }

/* The winding crank on the side of the box. */
.blind__crank { display: block; width: 50px; height: 50px; margin-right: -4px; }
.blind__crank-svg { display: block; width: 100%; height: 100%; overflow: visible; transform: rotate(var(--crank)); }
.blind__plate-r { fill: #15171a; stroke: #4b5058; stroke-width: 1.5; }
.blind__boss { fill: #6f757e; stroke: #0b0c0e; stroke-width: 1.5; }
.blind__arm { fill: #c2c7ce; stroke: #2b2f35; stroke-width: 1.5; }
.blind__knob { fill: #2a1d0d; stroke: #0b0c0e; stroke-width: 1.5; }
.blind__knob-hi { fill: #7a5a35; }
.blind__pivot { fill: #e4e7eb; stroke: #4b5058; stroke-width: 1; }

.piece p.blind__say { margin: 16px 0 0; font-size: 1.15rem; line-height: 1.5; color: var(--ink); }
.piece p.blind__you { margin: 6px 0 0; font-size: 1rem; line-height: 1.5; color: var(--ink-2); }

.js .blind__ctrl.needs-js { display: grid; }
.blind__ctrl { grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px 14px; margin-top: 14px; }
.blind__step { padding: 8px 12px; font-size: .98rem; }
.blind__scrub { display: block; min-width: 0; }
.blind__ends { display: flex; justify-content: space-between; margin-top: -6px; font: 700 .95rem/1 var(--board-font); letter-spacing: .04em; color: var(--ink-2); }

@media (min-width: 600px) {
	.blind { --fh: 116px; --sl: 30px; }
	.blind__box { padding: 14px 18px 18px; }
	.blind__row { grid-template-columns: minmax(0, 1fr) 72px; gap: 14px; }
	.blind__crank { width: 72px; height: 72px; }
	.piece .blind__line { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "yr fra p62" "yr fra p70"; column-gap: 22px; padding: 0 24px; justify-content: stretch; }
	.blind__yr { font-size: 2rem; }
	.blind__fra { align-self: center; font-size: 3rem; }
	.blind__pct { font-size: 1.2rem; text-align: right; }
	.blind__pct--62 { align-self: end; }
	.blind__pct b { font-size: 1.5rem; }
}
@media (max-width: 599px) {
	.blind__row { grid-template-columns: minmax(0, 1fr); }
	.blind__crank { position: absolute; top: 8px; right: 8px; width: 42px; height: 42px; margin: 0; }
	.blind__box::after { display: none; }
	.piece p.blind__plate { max-width: calc(100% - 88px); letter-spacing: .06em; }
	.piece .blind__line { column-gap: 10px; padding: 0 10px; }
	.blind__yr { min-width: 0; padding: 5px 6px 3px; font-size: 1.25rem; }
	.blind__fra { font-size: 1.65rem; }
	.blind__ctrl { grid-template-columns: 1fr 1fr; }
	.blind__scrub { grid-column: 1 / -1; grid-row: 2; }
	.blind__step { justify-self: start; }
	.blind__step[data-step="1"] { justify-self: end; }
}
@media (max-width: 359px) {
	.piece .blind__line { grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "yr fra" "yr p62" "yr p70"; row-gap: 2px; }
	.blind__fra { font-size: 1.45rem; }
	.blind__yr { font-size: 1.1rem; }
}
