/* ==========================================================================
   Arteria — App-tier layout patterns
   Screen-specific composition rules for the 24 /app screens. Shared
   primitives (buttons, cards, sheets) live in components.css.
   ========================================================================== */

/* ---- Screen scaffolding ---- */
.screen { display: flex; flex-direction: column; min-height: 100%; }
.screen-pad { padding: 0 var(--space-5); }
.screen-header { padding: var(--space-2) var(--space-5) var(--space-4); }

/* ---- Home: three-path entry ---- */
.path-card {
  position: relative; border-radius: var(--radius-lg); overflow: hidden; height: 168px;
  cursor: pointer; transition: transform var(--dur-sm) var(--ease-out);
}
.path-card:active { transform: scale(0.98); }
.path-card-art { position: absolute; inset: 0; }
.path-card-scrim { position: absolute; inset: 0; background: linear-gradient(180deg, transparent 30%, oklch(0.10 0.02 32 / 0.75) 100%); }
.path-card-body { position: absolute; left: 0; right: 0; bottom: 0; padding: var(--space-4) var(--space-5); color: #fff; }
.path-card-kicker { font-family: var(--font-mono); font-size: 0.6875rem; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.8; margin-bottom: 4px; }
.path-card-title { font-family: var(--font-display); font-size: 1.4rem; font-weight: 600; letter-spacing: -0.015em; }

/* ---- City switcher pill ---- */
.city-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px 8px 8px; border-radius: var(--radius-full);
  background: var(--surface-3); border: 1px solid var(--border);
}
.city-pill-flag { width: 26px; height: 26px; border-radius: 50%; overflow: hidden; flex-shrink: 0; }
.city-pill-flag img { width: 100%; height: 100%; object-fit: cover; }

/* ---- Tour card (grid + list variants) ---- */
.tour-card { display: flex; flex-direction: column; }
.tour-card-media { aspect-ratio: 5/4; border-radius: var(--radius-md); overflow: hidden; position: relative; margin-bottom: var(--space-3); }
.tour-card-badges { position: absolute; top: 10px; left: 10px; display: flex; gap: 6px; }
.tour-card-meta { display: flex; align-items: center; gap: var(--space-3); margin-top: 6px; color: var(--text-muted); font-size: 0.8125rem; font-family: var(--font-mono); }
.tour-card-meta-item { display: flex; align-items: center; gap: 4px; }
.tour-card-meta-item svg { width: 13px; height: 13px; }

.tour-list-row { display: flex; gap: var(--space-4); padding: var(--space-3) 0; cursor: pointer; }
.tour-list-row-media { width: 88px; height: 88px; border-radius: var(--radius-md); overflow: hidden; flex-shrink: 0; }

/* ---- Stop timeline (tour-detail) ---- */
.timeline { position: relative; padding-left: 34px; }
.timeline::before { content: ''; position: absolute; left: 13px; top: 8px; bottom: 8px; width: 2px; background: var(--border); }
.timeline-item { position: relative; padding-bottom: var(--space-6); display: flex; gap: var(--space-3); }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-marker {
  position: absolute; left: -34px; top: 2px; width: 28px; height: 28px; border-radius: 50%;
  background: var(--surface-3); border: 2px solid var(--border-strong); display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 0.75rem; font-weight: 600; color: var(--text-secondary); flex-shrink: 0; z-index: 1;
}
.timeline-item.is-done .timeline-marker { background: var(--verde); border-color: var(--verde); color: #fff; }
.timeline-item.is-current .timeline-marker { background: var(--brand); border-color: var(--brand); color: var(--text-on-brand); box-shadow: 0 0 0 4px var(--brand-ring); }
.timeline-thumb { width: 64px; height: 64px; border-radius: var(--radius-sm); overflow: hidden; flex-shrink: 0; }

/* ---- Map (SVG canvas) ---- */
.map-canvas { position: relative; width: 100%; height: 100%; overflow: hidden; background: var(--map-bg, var(--ink-1)); }
.map-canvas svg { width: 100%; height: 100%; display: block; }
.map-block { fill: var(--map-block, var(--ink-2)); }
.map-park { fill: var(--map-park, color-mix(in oklch, var(--verde) 16%, var(--ink-1))); }
.map-street-label { fill: var(--text-faint); font-family: var(--font-mono); font-size: 8px; letter-spacing: 0.03em; }

.map-pin { cursor: pointer; transition: transform var(--dur-press) var(--ease-out); transform-box: fill-box; transform-origin: center; }
.map-pin:hover, .map-pin:active { transform: scale(1.12); }
.map-pin-shadow { fill: oklch(0 0 0 / 0.35); }
.map-pin-dot { fill: var(--brand); stroke: var(--ink-0); stroke-width: 3; }
.map-pin-dot.is-visited { fill: var(--verde); }
.map-pin-dot.is-live { fill: var(--live); }
.map-pin-glyph { fill: none; stroke: var(--ink-0); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }

.map-user-dot { fill: var(--live); }
.map-user-ring { fill: none; stroke: var(--ink-0); stroke-width: 3; }
.map-user-halo { fill: var(--live); opacity: 0.25; animation: user-pulse 2.4s var(--ease-in-out) infinite; transform-origin: center; transform-box: fill-box; }
@keyframes user-pulse { 0% { transform: scale(0.6); opacity: 0.4; } 100% { transform: scale(2.6); opacity: 0; } }

.map-route-shadow { fill: none; stroke: oklch(0 0 0 / 0.3); stroke-width: 6; stroke-linecap: round; }
.map-route { fill: none; stroke: var(--brand); stroke-width: 4; stroke-linecap: round; stroke-dasharray: 1 11; opacity: 0.95; animation: route-march 22s linear infinite; }
@keyframes route-march { to { stroke-dashoffset: -400; } }

/* ---- Floating map controls (compass / locate / zoom) ---- */
.map-controls { position: absolute; right: var(--space-4); display: flex; flex-direction: column; gap: 10px; z-index: 3; }
.map-fab {
  width: 42px; height: 42px; border-radius: 50%;
  background: color-mix(in oklch, var(--ink-1) 68%, transparent); backdrop-filter: blur(14px);
  border: 1px solid oklch(1 0 0 / 0.1); color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-md); transition: transform var(--dur-press) var(--ease-out), background-color var(--dur-sm) var(--ease-out);
}
.map-fab:hover { background: color-mix(in oklch, var(--ink-1) 85%, transparent); }
.map-fab:active { transform: scale(0.92); }
.map-fab svg { width: 19px; height: 19px; }
.map-fab.is-compass { font-family: var(--font-mono); font-size: 0.7rem; font-weight: 700; }

/* ---- Bottom sheet dock (map screens) ---- */
.map-floating-card {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: linear-gradient(180deg, transparent 0%, var(--ink-0) 14%);
  padding-top: var(--space-8);
  z-index: 3;
}
.map-sheet {
  background: var(--surface-2); border: 1px solid var(--border-strong); border-bottom: none;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: var(--space-3) var(--space-4) calc(var(--space-5) + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -12px 40px oklch(0 0 0 / 0.45), 0 -2px 0 oklch(1 0 0 / 0.03) inset;
  cursor: grab;
}
.map-sheet:active { cursor: grabbing; }

/* ---- Audio player ---- */
.player-art { aspect-ratio: 1; width: 72%; margin: 0 auto; border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-lg); }
.player-scrubber { display: flex; flex-direction: column; gap: 6px; }
.player-transport { display: flex; align-items: center; justify-content: center; gap: var(--space-6); }
.player-transport-play {
  width: 68px; height: 68px; border-radius: 50%; background: var(--brand); color: var(--text-on-brand);
  display: flex; align-items: center; justify-content: center; transition: transform var(--dur-press) var(--ease-out);
}
.player-transport-play:active { transform: scale(0.94); }
.transcript-line { padding: var(--space-2) 0; color: var(--text-muted); transition: color var(--dur-sm) var(--ease-out); }
.transcript-line.is-active { color: var(--text); font-weight: 600; }

/* ---- AR viewfinder ---- */
.ar-stage { position: relative; flex: 1; overflow: hidden; background: var(--ink-0); }
.ar-stage-photo { position: absolute; inset: 0; }
.ar-stage-photo svg { width: 100%; height: 100%; }
.ar-stage-photo::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, oklch(0.10 0.02 32/0.5) 0%, transparent 20%, transparent 70%, oklch(0.10 0.02 32/0.65) 100%); }
.ar-hud { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; z-index: 2; pointer-events: none; }
.ar-status-bar { position: absolute; top: 0; left: 0; right: 0; padding: var(--space-4) var(--space-5); display: flex; align-items: center; justify-content: space-between; z-index: 3; }
.ar-status-pill {
  display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: var(--radius-full);
  background: color-mix(in oklch, var(--ink-1) 55%, transparent); backdrop-filter: blur(16px);
  color: #fff; font-size: 0.8125rem; font-weight: 500; border: 1px solid oklch(1 0 0/0.1);
}
.ar-points { position: absolute; inset: 20%; }
.ar-points.is-hidden { display: none; }
.ar-point { position: absolute; width: 3px; height: 3px; border-radius: 50%; background: var(--live); box-shadow: 0 0 6px var(--live); opacity: 0; animation: point-in 0.4s var(--ease-out) forwards; }
@keyframes point-in { to { opacity: 0.9; } }
.ar-progress-track { position: absolute; bottom: 0; left: 0; right: 0; height: 3px; background: oklch(1 0 0/0.12); z-index: 3; }
.ar-progress-fill { height: 100%; background: var(--live); transition: width 0.4s var(--ease-out); width: 0%; }
.ar-result-panel {
  position: absolute; left: var(--space-4); right: var(--space-4); bottom: var(--space-6); z-index: 4;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-xl);
  padding: var(--space-5); box-shadow: var(--shadow-lg);
  opacity: 0; transform: translateY(16px) scale(0.97); pointer-events: none;
  transition: opacity var(--dur-ar) var(--ease-out), transform var(--dur-ar) var(--ease-out);
}
.ar-result-panel.is-revealed { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }

/* ---- Marketplace ---- */
.artwork-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }
.artist-header { display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--space-2); padding: var(--space-6) var(--space-5) var(--space-4); }
.artist-avatar { width: 92px; height: 92px; border-radius: 50%; overflow: hidden; border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--border); }
.social-row { display: flex; gap: var(--space-2); justify-content: center; }
.social-icon { width: 38px; height: 38px; border-radius: 50%; background: var(--surface-3); display: flex; align-items: center; justify-content: center; color: var(--text-secondary); transition: all var(--dur-sm) var(--ease-out); }
.social-icon:hover { background: var(--brand-subtle); color: var(--brand); }
.social-icon svg { width: 17px; height: 17px; }

.price-row { display: flex; align-items: baseline; gap: 8px; }
.price-current { font-family: var(--font-mono); font-size: 1.5rem; font-weight: 600; }
.price-edition { font-family: var(--font-mono); font-size: 0.8125rem; color: var(--text-muted); }

.cart-line { display: flex; gap: var(--space-3); padding: var(--space-4) 0; align-items: flex-start; }
.cart-line-media { width: 72px; height: 72px; border-radius: var(--radius-sm); overflow: hidden; flex-shrink: 0; }
.qty-stepper { display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: var(--radius-full); }
.qty-stepper button { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; color: var(--text-secondary); }
.qty-stepper span { min-width: 24px; text-align: center; font-family: var(--font-mono); font-size: 0.875rem; }

.summary-row { display: flex; justify-content: space-between; padding: var(--space-2) 0; font-size: 0.9375rem; }
.summary-row.is-total { font-weight: 700; font-size: 1.05rem; padding-top: var(--space-3); border-top: 1px solid var(--border); margin-top: var(--space-2); }

.pay-method { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-4); border: 1.5px solid var(--border); border-radius: var(--radius-md); cursor: pointer; transition: all var(--dur-sm) var(--ease-out); }
.pay-method.is-selected { border-color: var(--brand); background: var(--brand-subtle); }
.pay-method-icon { width: 40px; height: 28px; border-radius: 6px; background: var(--surface-3); display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-family: var(--font-mono); font-size: 0.6875rem; font-weight: 700; }

/* ---- Onboarding ---- */
.onboard-hero { position: relative; height: 46vh; min-height: 320px; }
.onboard-hero-art { position: absolute; inset: 0; }
.onboard-hero::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 40%, var(--surface) 96%); }
.dots-progress { display: flex; gap: 6px; justify-content: center; }
.dots-progress span { width: 6px; height: 6px; border-radius: 50%; background: var(--border-strong); transition: all var(--dur-sm) var(--ease-out); }
.dots-progress span.is-active { width: 18px; border-radius: var(--radius-full); background: var(--brand); }

/* ---- Passport / profile ---- */
.passport-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-3); }
.passport-slot { aspect-ratio: 1; border-radius: var(--radius-md); overflow: hidden; position: relative; }
.passport-slot.is-locked { background: var(--surface-3); display: flex; align-items: center; justify-content: center; color: var(--text-faint); }

@media (min-width: 501px) {
  .device-scroll { scrollbar-width: thin; }
}
