:root {
  color-scheme: light;
  --ink: #25231f;
  --muted: #6f695e;
  --paper: #fffdf8;
  --canvas: #f1ece2;
  --sage: #70806b;
  --sage-dark: #53624f;
  --sage-pale: #e7ede3;
  --line: #ded6c8;
  --error: #a54439;
  font-family: Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100svh;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 5%, rgba(255,255,255,.9), transparent 32rem),
    linear-gradient(145deg, #f5f0e6, #e9e2d6);
}

button, input { font: inherit; }

.page-shell {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: max(20px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
}

.card {
  width: min(100%, 560px);
  padding: clamp(28px, 7vw, 52px) clamp(22px, 7vw, 48px);
  background: color-mix(in srgb, var(--paper) 96%, transparent);
  border: 1px solid rgba(83, 70, 50, .14);
  border-radius: 28px;
  box-shadow: 0 26px 70px rgba(67, 57, 43, .14);
  text-align: center;
}

.monogram {
  width: auto;
  height: 125px;
  margin: 0 auto 20px;
  display: block;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--sage-dark);
  font-family: system-ui, sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(38px, 10vw, 56px);
  font-weight: 400;
  line-height: .98;
  letter-spacing: -.035em;
}

.intro {
  max-width: 410px;
  margin: 20px auto 28px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.55;
}

.name-input {
  width: 100%;
  min-height: 50px;
  margin: 0 0 14px;
  padding: 12px 14px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 13px;
  font-family: system-ui, sans-serif;
  font-size: 16px;
}

.name-input:focus { outline: 3px solid rgba(112, 128, 107, .24); border-color: var(--sage); }

.primary-button {
  width: 100%;
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 14px 20px;
  color: #fff;
  background: var(--sage-dark);
  border: 0;
  border-radius: 15px;
  box-shadow: 0 10px 24px rgba(83, 98, 79, .22);
  cursor: pointer;
  font-family: system-ui, sans-serif;
  font-size: 17px;
  font-weight: 750;
}

.primary-button:hover { background: #465543; }
.primary-button:focus-visible { outline: 3px solid rgba(83, 98, 79, .35); outline-offset: 3px; }
.button-icon { font-size: 25px; font-weight: 350; line-height: 1; }

.upload-panel { margin-top: 28px; text-align: left; }
.upload-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.upload-heading h2 { margin: 0; font-size: 19px; font-weight: 500; }
.upload-heading span { color: var(--muted); font-family: system-ui, sans-serif; font-size: 12px; }
.upload-list { margin: 12px 0 0; padding: 0; list-style: none; }

.upload-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 12px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  font-family: system-ui, sans-serif;
}

.file-name { overflow: hidden; font-size: 14px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.file-status { color: var(--muted); font-size: 12px; }
.file-status.success { color: var(--sage-dark); font-weight: 750; }
.file-status.error { color: var(--error); }
.progress-track { grid-column: 1 / -1; height: 6px; overflow: hidden; background: #e9e4db; border-radius: 99px; }
.progress-bar { width: 0; height: 100%; background: var(--sage); border-radius: inherit; transition: width .18s ease; }
.retry-button { padding: 0; color: var(--error); background: none; border: 0; text-decoration: underline; cursor: pointer; }

.complete-message {
  margin-top: 24px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: var(--sage-pale);
  border-radius: 15px;
  text-align: left;
}

.complete-message[hidden] { display: none; }
.complete-check { flex: 0 0 38px; height: 38px; display: grid; place-items: center; color: #fff; background: var(--sage-dark); border-radius: 50%; font-family: system-ui, sans-serif; font-weight: 800; }
.complete-message strong { font-family: system-ui, sans-serif; }
.complete-message p { margin: 3px 0 0; color: var(--muted); font-size: 14px; }
.offline-message { margin-top: 18px; padding: 12px; color: #6c3c23; background: #f8e9d7; border-radius: 12px; font-family: system-ui, sans-serif; font-size: 13px; }
.stay-note { margin: 28px auto 0; color: var(--muted); font-family: system-ui, sans-serif; font-size: 12px; line-height: 1.5; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (max-width: 520px) {
  .page-shell { padding-inline: 0; padding-block: 0; }
  .card { min-height: 100svh; border: 0; border-radius: 0; box-shadow: none; }
}

@media (prefers-reduced-motion: reduce) {
  .progress-bar { transition: none; }
}
