/* Drache Engraver - the studio. Parchment ground, Charcoal Ink type, one
   oxblood accent doing the work, brass for the small labels: the website's
   own palette and faces, so the tool reads as the firm's. */

:root {
	--ox: #4e1520;
	--ox-deep: #341217;
	--ox-mid: #8a2529;
	--ink: #211e1c;
	--ink-600: rgba(33, 30, 28, 0.72);
	--ink-300: rgba(33, 30, 28, 0.55);
	--parch: #f4efe6;
	--parch-2: #eee9e0;
	--white: #fffdf9;
	--brass: #b08d57;
	--line: rgba(33, 30, 28, 0.14);
	--display: "Fraunces", "Iowan Old Style", Georgia, serif;
	--ui: "Instrument Sans", "Helvetica Neue", Arial, sans-serif;
	--ease: cubic-bezier(0.22, 1, 0.36, 1);
	--gutter: clamp(20px, 4vw, 56px);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	min-height: 100svh;
	background: var(--parch);
	color: var(--ink);
	font-family: var(--ui);
	font-size: 16px;
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
}
img { display: block; }
/* the display rules below would otherwise beat the hidden attribute */
[hidden] { display: none !important; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
p { margin: 0; }
h1, h2 { margin: 0; font-weight: 300; }
:focus-visible { outline: 2px solid var(--ox); outline-offset: 3px; }

/* ------------------------------------------------------------- shared */
.brand { display: flex; align-items: baseline; gap: 14px; margin: 0; }
.brand__name { font-family: var(--display); font-variation-settings: "SOFT" 0, "WONK" 1; font-size: 22px; line-height: 1; letter-spacing: -0.01em; }
.brand__tool { font-family: var(--ui); font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--brass); font-weight: 500; }

.pill {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	min-height: 44px; padding: 10px 22px; border-radius: 999px;
	border: 1px solid var(--ink); background: transparent; color: var(--ink);
	font-weight: 500; font-size: 15px; text-decoration: none; line-height: 1;
	transition: background-color 220ms var(--ease), color 220ms var(--ease), border-color 220ms var(--ease), opacity 220ms var(--ease);
}
.pill--fill { background: var(--ox); border-color: var(--ox); color: var(--parch); }
.pill--fill:hover { background: var(--ox-deep); border-color: var(--ox-deep); }
.pill--big { min-height: 56px; padding: 14px 34px; font-size: 17px; }
.pill[disabled] { opacity: 0.35; cursor: not-allowed; }

.link { background: none; border: 0; padding: 4px 0; color: var(--ink-600); text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 4px; transition: color 200ms var(--ease), text-decoration-color 200ms var(--ease); }
.link:hover { color: var(--ox); text-decoration-color: var(--ox); }

.notice { background: var(--white); border-left: 2px solid var(--brass); padding: 12px 16px; margin: 0 0 24px; color: var(--ink-600); }

/* ------------------------------------------------------------- the gate */
.gate { min-height: 100svh; display: grid; place-items: center; padding: var(--gutter); }
.gate__card { width: min(100%, 460px); background: var(--white); border-left: 2px solid var(--ox); padding: clamp(28px, 4vw, 44px); }
.gate__title { font-family: var(--display); font-variation-settings: "SOFT" 0, "WONK" 1; font-size: clamp(34px, 5vw, 44px); line-height: 1.05; letter-spacing: -0.015em; margin: 28px 0 32px; }
.gate__label { display: block; font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--brass); font-weight: 500; margin-bottom: 8px; }
.gate__row { display: flex; gap: 10px; }
.gate__input { flex: 1; min-width: 0; min-height: 44px; padding: 8px 12px; border: 0; border-bottom: 1px solid var(--ink); background: transparent; border-radius: 0; }
.gate__input:focus-visible { outline: none; border-bottom-color: var(--ox); box-shadow: 0 1px 0 var(--ox); }
.gate__status { min-height: 1.6em; margin-top: 14px; font-size: 14px; color: var(--ox-mid); }

/* ------------------------------------------------------------- top bar */
.top { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 22px var(--gutter); border-bottom: 1px solid var(--line); }
.top__nav { display: flex; gap: 22px; font-size: 14px; }

/* ------------------------------------------------------------- studio */
.studio { padding: clamp(24px, 3.5vw, 48px) var(--gutter) 80px; max-width: 1360px; margin: 0 auto; }

.plates { display: grid; grid-template-columns: 1fr; gap: 20px; }
@media (min-width: 900px) { .plates { grid-template-columns: 1fr 1fr; gap: 28px; } }

.plate {
	position: relative; min-height: min(62vw, 520px); display: grid; place-items: center;
	background: var(--white); overflow: hidden;
}
.plate--photo { border: 1px dashed rgba(33, 30, 28, 0.32); cursor: pointer; transition: border-color 200ms var(--ease), background-color 200ms var(--ease); }
.plate--photo:hover, .plate--photo.is-over { border-color: var(--ox); background: var(--parch-2); }
.plate--photo.has-file { border-style: solid; border-color: var(--line); cursor: default; }
.plate--photo.is-busy { cursor: progress; }
.plate--print { border-left: 2px solid var(--ox); }

.plate__empty { text-align: center; padding: 32px; max-width: 34ch; }
.plate__kicker { font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--brass); font-weight: 500; margin-bottom: 14px; }
.plate__big { font-family: var(--display); font-variation-settings: "SOFT" 0, "WONK" 1; font-size: clamp(26px, 3vw, 34px); line-height: 1.1; letter-spacing: -0.01em; }
.plate__small { margin-top: 12px; font-size: 14px; line-height: 1.55; color: var(--ink-600); }
.plate__small--muted { color: var(--ink-300); }
.has-file .plate__empty, .has-print .plate__empty { display: none; }

.plate__img { width: 100%; height: 100%; max-height: 640px; object-fit: contain; }
.plate--photo.is-busy .plate__img { opacity: 0.5; filter: grayscale(1); transition: opacity 400ms var(--ease), filter 400ms var(--ease); }
/* a hairline of ink sweeps the foot of the photograph while the press runs */
.plate--photo.is-busy::after {
	content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--ox);
	transform-origin: 0 50%; animation: sweep 1.8s ease-in-out infinite;
}
@keyframes sweep { 0% { transform: scaleX(0); transform-origin: 0 50%; } 55% { transform: scaleX(1); transform-origin: 0 50%; } 56% { transform-origin: 100% 50%; } 100% { transform: scaleX(0); transform-origin: 100% 50%; } }
.plate__clear { position: absolute; top: 14px; right: 16px; font-size: 13px; background: var(--white); padding: 4px 8px; }

/* the print: pulled onto the plate left to right, like a sheet off the press */
.print { margin: 0; width: 100%; height: 100%; display: grid; grid-template-rows: 1fr auto; }
.print__img { clip-path: inset(0 100% 0 0); }
.is-revealed .print__img { clip-path: inset(0 0 0 0); transition: clip-path 1400ms var(--ease); }
.print__caption { padding: 14px 18px 16px; font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--brass); font-weight: 500; text-align: center; border-top: 1px solid var(--line); }
.print__actions { position: absolute; right: 16px; top: 14px; display: flex; align-items: center; gap: 18px; }
.print__actions .link { font-size: 14px; background: var(--white); padding: 4px 8px; }

/* ------------------------------------------------------------- bench */
.bench { display: grid; grid-template-columns: 1fr; gap: 28px 40px; margin-top: clamp(28px, 3.5vw, 48px); padding-top: clamp(24px, 3vw, 36px); border-top: 1px solid var(--line); align-items: start; }
@media (min-width: 1100px) { .bench { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) auto; } }

.choice { border: 0; padding: 0; margin: 0; min-width: 0; }
.choice__legend { padding: 0; margin-bottom: 12px; font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--brass); font-weight: 500; }
.choice input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }

.choice--kind { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.choice--kind .choice__legend { grid-column: 1 / -1; }
.seg { position: relative; display: block; min-width: 0; }
.seg__face { display: flex; flex-direction: column; gap: 4px; min-height: 84px; padding: 14px 14px 12px; background: var(--white); border-left: 2px solid transparent; transition: border-color 200ms var(--ease), background-color 200ms var(--ease); cursor: pointer; }
.seg__name { font-family: var(--display); font-variation-settings: "SOFT" 0, "WONK" 1; font-size: 22px; line-height: 1; }
.seg__hint { font-size: 12.5px; line-height: 1.45; color: var(--ink-300); }
.seg:hover .seg__face { background: var(--parch-2); }
.seg input:checked + .seg__face { border-left-color: var(--ox); }
.seg input:checked + .seg__face .seg__hint { color: var(--ink-600); }
.seg input:focus-visible + .seg__face { outline: 2px solid var(--ox); outline-offset: 2px; }

.choice--ink { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.choice--ink .choice__legend { grid-column: 1 / -1; }
.ink { position: relative; display: block; min-width: 0; }
.ink__face { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; min-height: 84px; padding: 14px 14px 12px; background: var(--white); border-left: 2px solid transparent; transition: border-color 200ms var(--ease), background-color 200ms var(--ease); cursor: pointer; }
.ink__swatch { width: 40px; height: 28px; background: var(--paper); border: 1px solid var(--line); position: relative; }
/* the swatch is a strip of paper with the ink laid on it, not a coloured dot */
.ink__swatch::after { content: ""; position: absolute; inset: 5px 5px 5px 50%; background: var(--ink); }
.ink__name { font-size: 13.5px; line-height: 1.3; color: var(--ink-600); }
.ink:hover .ink__face { background: var(--parch-2); }
.ink input:checked + .ink__face { border-left-color: var(--ox); }
.ink input:checked + .ink__face .ink__name { color: var(--ink); }
.ink input:focus-visible + .ink__face { outline: 2px solid var(--ox); outline-offset: 2px; }

.bench__go { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
@media (min-width: 1100px) { .bench__go { align-items: flex-end; text-align: right; padding-top: 30px; } }
.status { min-height: 1.6em; font-size: 14px; color: var(--ink-600); max-width: 34ch; }
.status.is-busy { color: var(--ox); }
.status.is-error { color: var(--ox-mid); }
.status.is-ok { color: var(--ink); }
.progress { width: 100%; max-width: 280px; height: 1px; background: var(--line); overflow: hidden; }
.progress span { display: block; height: 100%; width: 0; background: var(--ox); transition: width 900ms linear; }

/* ------------------------------------------------------------- recent */
.recent { margin-top: clamp(48px, 6vw, 88px); }
.recent__head { display: flex; align-items: baseline; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: 20px; }
.recent__title { font-family: var(--display); font-variation-settings: "SOFT" 0, "WONK" 1; font-size: clamp(26px, 3vw, 34px); line-height: 1.1; letter-spacing: -0.01em; }
.recent__note { font-size: 13.5px; color: var(--ink-300); }
.recent__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.recent__empty { grid-column: 1 / -1; color: var(--ink-300); font-size: 14px; }
.tile { display: block; background: var(--white); text-decoration: none; color: inherit; border-bottom: 2px solid transparent; transition: border-color 200ms var(--ease), transform 300ms var(--ease); }
.tile:hover { border-bottom-color: var(--ox); transform: translateY(-2px); }
.tile__img { width: 100%; aspect-ratio: 1; object-fit: cover; background: var(--parch-2); }
.tile__meta { padding: 10px 12px 12px; display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.tile__name { font-size: 13px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile__ink { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--brass); font-weight: 500; flex: none; }

/* ------------------------------------------------------------- settings */
.sheet { border: 0; padding: 0; background: var(--white); border-left: 2px solid var(--ox); width: min(92vw, 520px); color: var(--ink); }
.sheet::backdrop { background: rgba(33, 30, 28, 0.45); }
.sheet__form { padding: clamp(24px, 4vw, 36px); }
.sheet__title { font-family: var(--display); font-variation-settings: "SOFT" 0, "WONK" 1; font-size: 30px; line-height: 1.1; margin-bottom: 12px; }
.sheet__text { font-size: 14px; color: var(--ink-600); margin-bottom: 22px; }
.sheet__label { display: block; font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--brass); font-weight: 500; margin-bottom: 8px; }
.sheet__input { width: 100%; min-height: 44px; padding: 8px 12px; border: 0; border-bottom: 1px solid var(--ink); background: transparent; border-radius: 0; }
.sheet__input:focus-visible { outline: none; border-bottom-color: var(--ox); box-shadow: 0 1px 0 var(--ox); }
.sheet__small { font-size: 13px; line-height: 1.55; color: var(--ink-300); margin: 12px 0 22px; }
.sheet__row { display: flex; align-items: center; gap: 20px; }

@media (max-width: 600px) {
	.top { padding: 16px 20px; }
	.brand__name { font-size: 19px; }
	.plate { min-height: 68vw; }
	.choice--kind, .choice--ink { grid-template-columns: 1fr; }
	.choice--kind .seg__face, .choice--ink .ink__face { min-height: 0; flex-direction: row; align-items: center; gap: 14px; }
	.seg__name { font-size: 20px; min-width: 96px; }
	.pill--big { width: 100%; }
	.print__actions { position: static; padding: 0 16px 16px; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
	.plate--photo.is-busy::after { animation: none; transform: none; }
	.is-revealed .print__img { transition: none; }
	.tile, .tile:hover { transform: none; }
}
