:root {
  color-scheme: dark;
  --paper: #f3efe7;
  --gold: #e7c99c;
  --muted: #c0c2cc;
  --line: rgb(221 222 233 / 17%);
  --edge: clamp(22px, 3.7vw, 76px);
  font-family: "Helvetica Neue", Arial, sans-serif;
  background: #080b15;
  color: var(--paper);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  isolation: isolate;
}
.sky {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  background: #060812 url("upload-preview.webp") center / cover no-repeat;
}
.sky::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #080b15eb 1%, #080b15c7 21%, transparent 57%),
              linear-gradient(0deg, #080b15eb 0%, transparent 25%);
}
.sky canvas { position: absolute; inset: 0 auto auto 0; display: block; width: 100%; height: 100%; opacity: 0; }
.sky canvas.rendered { opacity: 1; }
#preview-motion {
  margin-left: auto;
  padding: 8px 13px;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgb(8 11 21 / 68%);
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
#preview-motion:hover { color: var(--paper); border-color: var(--gold); }
header, footer { margin-inline: var(--edge); display: flex; align-items: center; }
header { height: 84px; border-bottom: 1px solid var(--line); gap: 17px; }
a { color: inherit; }
a:focus-visible, button:focus-visible, .file-choice:focus-within {
  outline: 2px solid var(--gold); outline-offset: 4px;
}
main { display: flex; align-items: center; padding: 50px var(--edge); }
main section { width: min(100%, 420px); }
h1 {
  margin: 0;
  font: normal clamp(76px, 8.8vw, 145px)/.84 Baskerville, "Iowan Old Style", "Times New Roman", serif;
  letter-spacing: -.065em;
}
h1 em { display: block; color: var(--gold); font-weight: 400; }
.intro { max-width: 320px; margin: 27px 0 29px; color: #d2d4dd; font-size: 16px; line-height: 1.55; }
.file-choice, #submit-file {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  border: 0;
  border-radius: 100px;
  padding: 0 23px;
  background: #efe3cc;
  color: #252124;
  font: 600 14px/1.15 "Helvetica Neue", Arial, sans-serif;
  cursor: pointer;
}
.file-choice:hover, #submit-file:hover { background: #fff1d8; }
.file-choice input {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  opacity: 0;
  cursor: pointer;
}
.upload-icon { font-size: 18px; font-weight: 400; }
#submit-file { margin: 8px 0; }
[hidden] { display: none !important; }
form[aria-busy="true"] .drop-choice { opacity: .8; pointer-events: none; }
#file-hint, #feedback { max-width: 320px; font-size: 12px; line-height: 1.5; }
#file-hint { margin: 10px 0 0; color: #b8bac8; }
#feedback { margin: 10px 0 0; color: var(--gold); }
#feedback:empty { display: none; }
#feedback.error { color: #ffbead; }
footer { border-top: 1px solid var(--line); justify-content: space-between; gap: 20px; padding: 20px 0 max(20px, env(safe-area-inset-bottom)); }
footer p { margin: 0; font-size: 12px; line-height: 1.5; }
footer p { color: var(--muted); }

@media (max-width: 700px) {
  .sky { background-position: 63% 6%; background-size: auto 66%; }
  .sky canvas { position: absolute; top: -3%; width: 120%; left: -10%; height: 66%; }
  .sky::after { background: linear-gradient(0deg, #080b15 31%, transparent 65%); }
  main { align-items: flex-end; padding-block: clamp(135px, 24svh, 245px) 32px; }
  main section { width: 100%; }
  h1 { font-size: clamp(60px, 13vw, 88px); line-height: .96; }
  h1 em { display: inline; }
  .intro { max-width: 320px; font-size: 15px; line-height: 1.45; margin: 15px 0 23px; }
  .file-choice { min-height: 50px; }
  footer { flex-direction: column; align-items: flex-start; gap: 6px; padding-block: 14px max(15px, env(safe-area-inset-bottom)); }
  footer p { max-width: 340px; }
}
@media (max-height: 540px) and (min-width: 701px) {
  header { height: 58px; }
  main { padding-block: 27px; }
  h1 { font-size: 60px; }
  h1 em { display: inline; }
  .intro { margin: 12px 0 15px; }
}

@media (max-width: 680px) {
  :root { --edge: 18px; }
  header { height: 61px; gap: 11px; }
}

#open-upload { text-decoration: none; }
dialog {
  color: var(--paper); background: #101520; border: 1px solid #454650;
  border-radius: 18px; width: min(460px, calc(100% - 32px));
  max-height: calc(100dvh - 36px); overflow: auto; padding: clamp(22px, 4vw, 34px);
  box-shadow: 0 24px 96px #0009;
}
dialog:target:not([open]) { display: block; position: fixed; inset: 0; margin: auto; height: max-content; z-index: 2; }
dialog::backdrop { background: #030610b8; backdrop-filter: blur(6px); }
dialog h2 { font: 400 32px/1.05 Baskerville, Georgia, serif; letter-spacing: -.035em; margin: 0 30px 22px 0; }
.close-guide { position: absolute; right: 14px; top: 12px; display: grid; place-items: center; width: 36px; height: 36px; color: var(--muted); font-size: 25px; text-decoration: none; }
.archive-steps { margin: 0 0 22px; padding-left: 22px; }
.archive-steps li { padding-left: 5px; margin: 10px 0; color: #c7cbd6; font-size: 14px; line-height: 1.5; }
.archive-steps li::marker { color: var(--gold); font: 12px ui-monospace, monospace; }
dialog a, dialog strong { color: var(--paper); }
dialog a { text-underline-offset: 3px; }
.drop-choice {
  position: relative; display: grid; justify-items: center; gap: 5px; padding: 16px;
  border: 1px dashed #aa967a; background: #e7c99c0a; border-radius: 10px;
  color: var(--gold); font-size: 15px; font-weight: 600; cursor: pointer;
}
.drop-choice small, .reminder-note { color: var(--muted); font-size: 12px; font-weight: 400; }
.drop-choice input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.drop-choice:focus-within, dialog :focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
#reminder { border-top: 1px solid var(--line); margin-top: 22px; padding-top: 18px; font-size: 14px; }
#reminder summary { color: var(--gold); cursor: pointer; }
#reminder-form label { display: block; font-size: 12px; margin: 14px 0 6px; }
.reminder-controls { display: flex; flex-wrap: wrap; gap: 8px; }
.reminder-controls input, .reminder-controls button { border: 1px solid #4b505d; border-radius: 7px; background: #0b101a; color: var(--paper); padding: 11px; font: inherit; }
.reminder-controls input { min-width: 0; flex: 1 1 135px; }
.reminder-controls button { cursor: pointer; background: #292a30; }
#reminder-status { color: var(--gold); line-height: 1.45; }
#reminder-status:empty { display: none; }
.reminder-controls button:disabled { opacity: .6; cursor: wait; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
