:root {
  color-scheme: dark;
  --bg: #08111f;
  --panel: rgba(11, 23, 40, 0.88);
  --panel-strong: rgba(12, 28, 49, 0.96);
  --text: #edf6ff;
  --muted: #9db0c5;
  --accent: #60e6c5;
  --accent-strong: #21b795;
  --danger: #ff6b6b;
  --line: rgba(255, 255, 255, 0.16);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  background:
    radial-gradient(circle at top left, rgba(96, 230, 197, 0.18), transparent 32rem),
    linear-gradient(135deg, #07101e 0%, #102239 55%, #07101e 100%);
  color: var(--text);
}

button,
input,
textarea {
  font: inherit;
}

button {
  border: 0;
}

.app-shell {
  min-height: 100vh;
  padding: max(1rem, env(safe-area-inset-top)) 1rem max(1rem, env(safe-area-inset-bottom));
}

.hero,
.help-panel {
  width: min(48rem, 100%);
  margin: 0 auto 1rem;
  padding: clamp(1.25rem, 5vw, 2.5rem);
  border: 1px solid var(--line);
  border-radius: 1.5rem;
  background: var(--panel);
  box-shadow: 0 1.5rem 4rem rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(20px);
}

.eyebrow {
  margin: 0 0 0.5rem;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 12ch;
  margin-bottom: 1rem;
  font-size: clamp(2.45rem, 14vw, 5.5rem);
  line-height: 0.9;
  letter-spacing: -0.08em;
}

h2 {
  margin-bottom: 0.75rem;
  font-size: clamp(1.25rem, 5vw, 1.75rem);
}

.lede {
  max-width: 42rem;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.6;
}

.action-row,
.loader-grid {
  display: grid;
  gap: 0.75rem;
}

.action-row {
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  margin: 1.5rem 0;
}

.loader-grid {
  margin-top: 1rem;
}

.primary-action,
.secondary-action,
.ghost-button,
.file-picker {
  min-height: 3.2rem;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 800;
}

.primary-action {
  background: linear-gradient(135deg, var(--accent), #91f2ff);
  color: #04111d;
  box-shadow: 0 1rem 2.5rem rgba(33, 183, 149, 0.28);
}

.secondary-action,
.file-picker {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.wide {
  width: 100%;
}

.file-picker {
  display: grid;
  place-items: center;
  padding: 0 1rem;
  text-align: center;
}

.file-picker input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

.paste-box {
  display: grid;
  gap: 0.5rem;
  color: var(--muted);
  font-weight: 700;
}

textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.28);
  color: var(--text);
  resize: vertical;
}

.privacy-note,
.help-panel p {
  color: var(--muted);
  line-height: 1.6;
}

.privacy-note {
  margin-bottom: 0;
  font-size: 0.9rem;
}

.ar-view {
  position: fixed;
  inset: 0;
  display: none;
  overflow: hidden;
  background: #000;
}

.ar-view.is-active {
  display: block;
}

#cameraFeed,
#overlayCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

#cameraFeed {
  object-fit: cover;
}

#overlayCanvas {
  z-index: 2;
}

.top-bar,
.info-card,
.crosshair {
  position: absolute;
  z-index: 3;
}

.top-bar {
  top: max(0.75rem, env(safe-area-inset-top));
  left: 0.75rem;
  right: 0.75rem;
  display: flex;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
}

.top-bar-actions {
  display: flex;
  flex-shrink: 0;
  gap: 0.5rem;
  align-items: center;
}

.top-bar .status-pill {
  min-width: 0;
  flex: 1;
}

.ghost-button,
.status-pill,
.info-card {
  border: 1px solid var(--line);
  background: var(--panel-strong);
  color: var(--text);
  box-shadow: 0 0.75rem 2rem rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(18px);
}

.ghost-button {
  min-height: 2.75rem;
  padding: 0 1.1rem;
}

.status-pill {
  min-height: 2.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0 1rem;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.status-pill.is-ready {
  color: var(--accent);
}

.status-pill.is-error {
  color: var(--danger);
}

.info-card {
  left: 0.75rem;
  right: 0.75rem;
  bottom: max(0.75rem, env(safe-area-inset-bottom));
  display: grid;
  gap: 0.25rem;
  border-radius: 1rem;
  padding: 0.9rem 1rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.info-card strong {
  color: var(--text);
  font-size: 1rem;
}

.crosshair {
  top: 50%;
  left: 50%;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 999px;
  transform: translate(-50%, -50%);
}

.crosshair::before,
.crosshair::after {
  position: absolute;
  content: "";
  background: rgba(255, 255, 255, 0.42);
}

.crosshair::before {
  top: 50%;
  left: -0.75rem;
  right: -0.75rem;
  height: 1px;
}

.crosshair::after {
  top: -0.75rem;
  bottom: -0.75rem;
  left: 50%;
  width: 1px;
}

body.ar-active {
  overflow: hidden;
}

body.ar-active .hero,
body.ar-active .help-panel {
  display: none;
}

@media (min-width: 42rem) {
  .loader-grid {
    grid-template-columns: 1fr;
  }
}
