:root {
  color-scheme: light;
  --ink: #20211e;
  --muted: #6d7068;
  --paper: #f4f1eb;
  --surface: #fffdf9;
  --line: #d9d5cc;
  --accent: #356854;
  --accent-dark: #28513f;
  --error: #a34339;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100dvh; background: var(--paper); color: var(--ink); font-family: "Outfit", system-ui, sans-serif; }
button, input { font: inherit; }
button, label { -webkit-tap-highlight-color: transparent; }
.hidden { display: none !important; }
.shell { width: min(1180px, calc(100% - 48px)); margin: 0 auto; padding-bottom: 80px; }
.topbar { height: 88px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 600; letter-spacing: -.02em; }
.brand-mark { width: 34px; height: 34px; display: grid; place-items: center; background: var(--ink); color: var(--surface); border-radius: 10px; }
.brand-mark svg { width: 21px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.text-button { color: var(--muted); border: 0; background: transparent; padding: 10px; cursor: pointer; }
.text-button:hover { color: var(--ink); }
.login-view { min-height: calc(100dvh - 168px); display: grid; grid-template-columns: 1.3fr .7fr; gap: clamp(60px, 10vw, 150px); align-items: center; }
.login-copy { align-self: center; }
.eyebrow { margin: 0 0 16px; color: var(--accent); font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
h1, h2, p { margin-top: 0; }
.login-copy h1 { margin-bottom: 28px; font-size: clamp(44px, 6.5vw, 80px); line-height: .98; letter-spacing: -.055em; font-weight: 600; }
.login-copy > p:last-child, .intro > p { color: var(--muted); font-size: 18px; line-height: 1.55; max-width: 48ch; }
.login-form { padding: 34px; background: var(--surface); border: 1px solid var(--line); border-radius: 24px; box-shadow: 0 20px 50px -35px rgba(43, 47, 40, .38); }
.login-form label { display: block; margin-bottom: 9px; font-size: 14px; font-weight: 600; }
.login-form input { width: 100%; height: 64px; padding: 0 18px; background: #f8f6f1; border: 1px solid var(--line); border-radius: 14px; color: var(--ink); font-size: 28px; letter-spacing: .4em; text-align: center; outline: none; }
.login-form input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(53, 104, 84, .12); }
.primary-button, .secondary-button { border: 0; cursor: pointer; transition: transform .2s ease, background .2s ease, color .2s ease; }
.primary-button:active, .secondary-button:active { transform: translateY(1px) scale(.99); }
.primary-button { width: 100%; min-height: 54px; margin-top: 8px; border-radius: 14px; background: var(--accent); color: white; font-weight: 600; }
.primary-button:hover { background: var(--accent-dark); }
.primary-button:disabled { opacity: .65; cursor: wait; }
.helper { margin: 14px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; text-align: center; }
.form-error { min-height: 20px; margin: 7px 0 0; color: var(--error); font-size: 13px; }
.app-view { padding-top: 72px; }
.intro { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: end; margin-bottom: 42px; }
.intro h1 { margin: 0; font-size: clamp(42px, 5vw, 64px); line-height: 1; letter-spacing: -.05em; font-weight: 600; }
.intro > p { margin-bottom: 4px; }
.drop-zone { min-height: 310px; padding: 36px; display: flex; flex-direction: column; align-items: center; justify-content: center; background: var(--surface); border: 1.5px dashed #aaa79f; border-radius: 28px; cursor: pointer; text-align: center; transition: border-color .25s ease, background .25s ease, transform .25s ease; }
.drop-zone:hover, .drop-zone.dragging { border-color: var(--accent); background: #f9fbf8; transform: translateY(-2px); }
.drop-zone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.upload-icon { width: 52px; height: 52px; margin-bottom: 18px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); color: var(--accent); }
.upload-icon svg { width: 26px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.drop-zone strong { font-size: 20px; }
.drop-zone > span:not(.upload-icon) { margin-top: 5px; color: var(--muted); }
.drop-zone small { margin-top: 22px; color: #8a8b85; }
.queue-panel { margin-top: 22px; padding: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; }
.queue-heading, .gallery-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.queue-heading div { display: flex; flex-direction: column; gap: 4px; }
.queue-heading span { color: var(--muted); font-size: 13px; }
.secondary-button { min-height: 42px; padding: 0 16px; border: 1px solid var(--line); border-radius: 12px; background: transparent; color: var(--ink); font-weight: 500; }
.secondary-button:hover { background: #ece9e2; }
.progress-track { height: 7px; margin: 22px 0 14px; overflow: hidden; border-radius: 99px; background: #e7e3db; }
.progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--accent); transition: width .3s ease; }
.queue-list { max-height: 260px; margin: 0; padding: 0; list-style: none; overflow: auto; }
.queue-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px; padding: 12px 0; border-top: 1px solid #ebe7df; font-size: 14px; }
.queue-item:first-child { border-top: 0; }
.queue-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.queue-status { color: var(--muted); }
.queue-status.success { color: var(--accent); }
.queue-status.error { color: var(--error); }
.gallery-section { margin-top: 100px; }
.gallery-heading { margin-bottom: 30px; align-items: end; }
.gallery-heading .eyebrow { margin-bottom: 8px; }
.gallery-heading h2 { margin: 0; font-size: clamp(28px, 3vw, 38px); letter-spacing: -.04em; }
.gallery { display: grid; grid-template-columns: repeat(12, 1fr); gap: 14px; }
.photo { position: relative; grid-column: span 3; aspect-ratio: 1; overflow: hidden; border-radius: 16px; background: #dedbd4; animation: reveal .45s both; animation-delay: calc(var(--i) * 55ms); }
.photo:nth-child(5n + 1) { grid-column: span 6; grid-row: span 2; }
.photo img { width: 100%; height: 100%; display: block; object-fit: cover; transition: transform .4s cubic-bezier(.16,1,.3,1); }
.photo:hover img { transform: scale(1.025); }
.photo-download { position: absolute; right: 10px; bottom: 10px; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; background: rgba(255,253,249,.92); color: var(--ink); box-shadow: 0 8px 22px rgba(29,31,27,.16); opacity: 0; transform: translateY(5px); transition: opacity .2s ease, transform .2s ease; }
.photo:hover .photo-download, .photo-download:focus { opacity: 1; transform: none; }
.photo-download svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.gallery-loading { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 14px; }
.gallery-loading span { height: 240px; border-radius: 16px; background: linear-gradient(100deg,#e4e0d8 25%,#eeebe5 40%,#e4e0d8 55%); background-size: 240% 100%; animation: shimmer 1.5s infinite; }
.empty-state { padding: 65px 20px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); text-align: center; }
.empty-state p { margin-bottom: 5px; font-size: 20px; font-weight: 600; }
.empty-state span { color: var(--muted); }
.toast { position: fixed; left: 50%; bottom: 24px; padding: 12px 18px; border-radius: 12px; background: var(--ink); color: white; font-size: 14px; opacity: 0; pointer-events: none; transform: translate(-50%, 12px); transition: opacity .25s ease, transform .25s ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@keyframes reveal { from { opacity: 0; transform: translateY(8px); } }
@keyframes shimmer { to { background-position-x: -240%; } }

@media (max-width: 760px) {
  .shell { width: min(100% - 32px, 1180px); padding-bottom: 56px; }
  .topbar { height: 72px; }
  .login-view { min-height: auto; padding: 58px 0 40px; grid-template-columns: 1fr; gap: 42px; }
  .login-copy h1 { font-size: clamp(42px, 13vw, 58px); }
  .login-form { padding: 24px; border-radius: 20px; }
  .app-view { padding-top: 48px; }
  .intro { grid-template-columns: 1fr; gap: 18px; margin-bottom: 32px; }
  .intro > p { font-size: 16px; }
  .drop-zone { min-height: 280px; padding: 28px 20px; }
  .queue-panel { padding: 18px; }
  .gallery-section { margin-top: 74px; }
  .gallery-heading { align-items: flex-end; }
  .gallery { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .photo, .photo:nth-child(5n + 1) { grid-column: span 1; grid-row: span 1; border-radius: 12px; }
  .photo:first-child { grid-column: span 2; aspect-ratio: 1.55; }
  .photo-download { opacity: 1; transform: none; }
  .gallery-loading { grid-template-columns: 1fr 1fr; gap: 8px; }
  .gallery-loading span { height: 180px; }
  .gallery-loading span:last-child { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
