/* capture/style.css
 *
 * Minimal, mobile-first. No build step, no framework.
 * Designed for the primary use case: iOS Safari, "Add to Home Screen" PWA,
 * portrait orientation, one tap to camera, one tap to upload, done.
 */

:root {
  --bg: #0a0a0a;
  --fg: #f4f4f5;
  --muted: #a1a1aa;
  --primary: #1a73e8;
  --primary-fg: #ffffff;
  --ok: #16a34a;
  --err: #dc2626;
  --border: #27272a;
  --radius: 14px;
  --tap: 48px;
  --safe-top: env(safe-area-inset-top, 0);
  --safe-bottom: env(safe-area-inset-bottom, 0);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family:
    -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", "Yu Gothic",
    "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding-top: var(--safe-top);
  padding-bottom: var(--safe-bottom);
}

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

.app {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 24px 20px 32px;
  gap: 20px;
  max-width: 520px;
  width: 100%;
  margin: 0 auto;
}

.app__header {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.app__title {
  font-size: 22px;
  font-weight: 600;
  margin: 0;
}

.app__hint {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.app__screen {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: stretch;
  flex: 1;
  justify-content: center;
  animation: screen-in 180ms ease-out;
}

@keyframes screen-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.app__lead {
  font-size: 18px;
  margin: 0;
  line-height: 1.6;
}

.app__lead--ok {
  color: var(--ok);
  font-size: 22px;
  font-weight: 600;
}

.app__lead--err {
  color: var(--err);
  font-size: 20px;
  font-weight: 600;
}

.app__sub {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  word-break: break-all;
}

.app__sub--muted {
  font-size: 13px;
}

.app__alert {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--err);
  color: var(--err);
  border-radius: var(--radius);
  font-size: 15px;
}

code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  background: #18181b;
  padding: 1px 6px;
  border-radius: 6px;
  font-size: 0.9em;
}

.btn {
  appearance: none;
  border: 0;
  border-radius: var(--radius);
  font-size: 17px;
  font-weight: 600;
  padding: 0 20px;
  min-height: var(--tap);
  cursor: pointer;
  transition: filter 0.1s ease;
}

.btn:active {
  filter: brightness(0.9);
}

.btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.btn--primary {
  background: var(--primary);
  color: var(--primary-fg);
}

.btn--ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}

.capture {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--primary);
  color: var(--primary-fg);
  border-radius: var(--radius);
  min-height: 180px;
  font-size: 20px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.capture:active {
  filter: brightness(0.92);
}

.capture:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.capture__icon {
  font-size: 48px;
  line-height: 1;
}

.app__row {
  display: flex;
  gap: 12px;
}

.app__row .btn {
  flex: 1;
}

.spinner {
  width: 40px;
  height: 40px;
  align-self: center;
  border-radius: 50%;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  animation: spin 800ms linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.thumb {
  align-self: center;
  max-width: 100%;
  max-height: 220px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  object-fit: cover;
}

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