:root {
  --ink: #0b0b0b;
  --paper: #ffffff;
  --muted: #6b6b6b;
  --line: #e4e4e4;
  --soft: #f6f6f5;
  --error: #8a1c1c;
  --serif: "Cormorant Garamond", "Times New Roman", Georgia, serif;
  --sans: "Jost", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 300;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

[hidden] { display: none !important; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.page {
  max-width: 640px;
  margin: 0 auto;
  padding: max(56px, env(safe-area-inset-top)) 20px max(40px, env(safe-area-inset-bottom));
}

/* ---------- Header ---------- */

.masthead { text-align: center; margin-bottom: 40px; }

.eyebrow {
  margin: 0 0 18px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .32em;
  text-transform: uppercase;
  color: var(--muted);
}

h1, h2 {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: .01em;
  line-height: 1.1;
  margin: 0;
}

h1 { font-size: clamp(36px, 9vw, 54px); }
h2 { font-size: 34px; }

.rule {
  display: block;
  width: 48px;
  height: 1px;
  margin: 26px auto;
  background: var(--ink);
}

.lede {
  max-width: 420px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 16px;
}

/* ---------- Buttons ---------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 34px;
  border: 1px solid var(--ink);
  border-radius: 0;
  font: 500 12px/1 var(--sans);
  letter-spacing: .24em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color .2s, color .2s, opacity .2s;
  -webkit-tap-highlight-color: transparent;
}

.button--outline { background: transparent; color: var(--ink); }
.button--solid { background: var(--ink); color: var(--paper); width: 100%; }

@media (hover: hover) {
  .button--outline:hover, .dropzone:hover .button--outline { background: var(--ink); color: var(--paper); }
  .button--solid:hover:not(:disabled) { background: #2a2a2a; }
}

.button:disabled { opacity: .45; cursor: not-allowed; }
.button:focus-visible, .dropzone:focus-within { outline: 2px solid var(--ink); outline-offset: 3px; }

/* ---------- Dropzone ---------- */

.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 48px 20px 40px;
  border: 1px solid var(--ink);
  background: var(--paper);
  text-align: center;
  cursor: pointer;
  position: relative;
  transition: background-color .2s;
}

/* fine inner frame for a quiet, engraved feel */
.dropzone::before {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px solid var(--line);
  pointer-events: none;
}

.dropzone.is-dragging { background: var(--soft); }
.dropzone.is-disabled { pointer-events: none; opacity: .5; }

.dropzone__icon { width: 52px; height: 52px; color: var(--ink); }

.dropzone__hint {
  font-size: 12px;
  letter-spacing: .08em;
  color: var(--muted);
}

@media (hover: none), (pointer: coarse) {
  .only-pointer { display: none; }
}

/* ---------- File list ---------- */

.file-list {
  list-style: none;
  margin: 28px 0 0;
  padding: 0;
  border-top: 1px solid var(--line);
}

.file-list:empty { display: none; }

.file {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

/* checkerboard shows off transparent PNG backgrounds */
.file__thumb {
  width: 56px;
  height: 56px;
  object-fit: contain;
  background-color: #fff;
  background-image:
    linear-gradient(45deg, #e9e9e9 25%, transparent 25%, transparent 75%, #e9e9e9 75%),
    linear-gradient(45deg, #e9e9e9 25%, transparent 25%, transparent 75%, #e9e9e9 75%);
  background-size: 12px 12px;
  background-position: 0 0, 6px 6px;
  border: 1px solid var(--line);
}

.file__meta { min-width: 0; }

.file__name {
  margin: 0;
  font-size: 14px;
  font-weight: 400;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file__size {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: .04em;
}

.file__state {
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
}

.file__state--sent { color: var(--ink); }
.file__state--failed { color: var(--error); }

.file__remove {
  width: 40px;
  height: 40px;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.file__remove:hover { color: var(--ink); }

/* ---------- Actions ---------- */

.actions { margin-top: 28px; }

.summary {
  margin: 0 0 14px;
  font-size: 13px;
  letter-spacing: .06em;
  color: var(--muted);
  text-align: center;
}

.progress { margin-top: 20px; }
.progress__track { height: 2px; background: var(--line); overflow: hidden; }
.progress__bar { height: 100%; width: 0; background: var(--ink); transition: width .2s; }
.progress__text { margin: 10px 0 0; font-size: 12px; color: var(--muted); text-align: center; letter-spacing: .04em; }

/* ---------- Notices ---------- */

.notice {
  margin-top: 24px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  background: var(--soft);
  font-size: 14px;
}

.notice--error { border-color: var(--error); background: #fff; color: var(--error); }
.notice ul { margin: 6px 0 0; padding-left: 18px; }

/* ---------- Success ---------- */

.success {
  text-align: center;
  padding: 48px 20px;
  border: 1px solid var(--ink);
}

.success__icon { width: 56px; height: 56px; margin-bottom: 18px; }
.success p { color: var(--muted); margin: 14px auto 28px; max-width: 380px; }


/* ---------- Mailbox ---------- */

.mailbox { margin-top: 72px; }

.mailbox__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--ink);
}

.mailbox__count, .mailbox__empty {
  margin: 0;
  font-size: 12px;
  letter-spacing: .08em;
  color: var(--muted);
}

.mailbox__empty { padding: 28px 0; text-align: center; }

.gallery {
  list-style: none;
  margin: 24px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 20px;
}

.gallery:empty { display: none; }

.tile { display: flex; flex-direction: column; gap: 8px; min-width: 0; }

.tile__view { display: block; border: 1px solid var(--line); }

.tile__img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  background-color: #fff;
  background-image:
    linear-gradient(45deg, #ececec 25%, transparent 25%, transparent 75%, #ececec 75%),
    linear-gradient(45deg, #ececec 25%, transparent 25%, transparent 75%, #ececec 75%);
  background-size: 16px 16px;
  background-position: 0 0, 8px 8px;
}

.tile__name {
  margin: 0;
  font-size: 13px;
  font-weight: 400;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tile__meta { margin: 0; font-size: 11px; color: var(--muted); letter-spacing: .04em; }

.tile__download {
  align-self: flex-start;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 2px;
}

/* ---------- Footer ---------- */

.footer {
  margin-top: 56px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  text-align: center;
  font-size: 11px;
  letter-spacing: .08em;
  color: var(--muted);
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
