/* kodakGP — cross-platform polish, smoother scroll, safe-area, motion */

/* iOS/Android polish */
html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
  overscroll-behavior-y: none;
}
body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overscroll-behavior-y: none;
  min-height: 100vh;
  min-height: 100dvh;
}
body,
main {
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}
.footer,
.site-footer {
  padding-bottom: max(30px, env(safe-area-inset-bottom));
}
.kodak-fab,
.toast-host,
#desk-prefs {
  bottom: max(20px, env(safe-area-inset-bottom)) !important;
}

/* Larger tap targets on touch */
@media (pointer: coarse) {
  button,
  .button,
  a.button,
  .btn,
  input[type="submit"],
  input[type="button"] {
    min-height: 44px;
  }
  select,
  input[type="text"],
  input[type="email"],
  input[type="number"],
  input[type="password"] {
    min-height: 44px;
    font-size: 16px; /* prevent iOS zoom on focus */
  }
}

/* Smoother momentum scroll for scrollable regions */
main,
.wrap,
.admin-wrap,
.kodak-rail-body,
.rate-board,
.qr-vault-grid {
  -webkit-overflow-scrolling: touch;
}

/* Sticky-safe backdrop for the topbar during scroll */
.nav,
.site-header {
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
}

/* Motion — richer entrance for reveals */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.55s cubic-bezier(0.23, 1, 0.32, 1),
    transform 0.55s cubic-bezier(0.23, 1, 0.32, 1);
  will-change: opacity, transform;
}
.reveal.in {
  opacity: 1;
  transform: none;
}

/* Subtle hover lift for actionable cards */
.lot,
.pay-method,
.qr-vault-card,
.rail-vault-card {
  transition: background 0.22s cubic-bezier(0.23, 1, 0.32, 1),
    transform 0.22s cubic-bezier(0.23, 1, 0.32, 1),
    box-shadow 0.22s cubic-bezier(0.23, 1, 0.32, 1);
}
@media (hover: hover) {
  .lot:hover,
  .pay-method:hover,
  .qr-vault-card:hover,
  .rail-vault-card:hover {
    transform: translateY(-2px);
  }
}

/* Selection color aligned to brand */
::selection {
  background: #d83b32;
  color: #efede7;
}

/* Focus rings — visible + on-brand */
:focus-visible {
  outline: 2px solid #ff6b56;
  outline-offset: 2px;
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

/* Admin orders table */
.orders-table {
  width: 100%;
  border-collapse: collapse;
  font: 11px "DM Mono", monospace;
  margin-top: 12px;
}
.orders-table th,
.orders-table td {
  padding: 10px 8px;
  border-bottom: 1px solid rgba(239, 237, 231, 0.08);
  text-align: left;
  vertical-align: top;
}
.orders-table th {
  color: #96938a;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 9px;
}
.orders-table td code {
  color: #ff6b56;
}
.orders-empty {
  color: #96938a;
  font: 11px "DM Mono", monospace;
  padding: 14px 0;
}

/* Fix admin card full-width */
.admin-card.full {
  grid-column: 1 / -1;
}

/* Order status pill */
.status-pill {
  display: inline-block;
  padding: 2px 8px;
  background: rgba(216, 59, 50, 0.15);
  color: #ff6b56;
  border: 1px solid rgba(216, 59, 50, 0.35);
  font: 9px "DM Mono", monospace;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-left: 8px;
}
.status-pill.paid {
  background: rgba(145, 189, 155, 0.15);
  color: #91bd9b;
  border-color: rgba(145, 189, 155, 0.4);
}

/* Anchor scroll offset for sticky header */
:target {
  scroll-margin-top: 90px;
}

/* Smooth mobile nav dropdown */
.nav nav {
  transition: max-height 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}

/* Hero rate flicker mitigation */
#hero-rate,
#rate-updated,
#fresh-label {
  transition: color 0.3s ease;
}

/* Sparkline glow on hover */
.rate-board:hover svg path[stroke] {
  filter: drop-shadow(0 0 6px rgba(216, 59, 50, 0.5));
}

/* Prevent text overflow on tiny screens */
@media (max-width: 380px) {
  .mast-copy h1 {
    font-size: 46px !important;
  }
  .rate-number strong {
    font-size: 58px !important;
  }
  .section-head h2 {
    font-size: 42px !important;
  }
}


/* Commerce catalog: accounts, items, cart, payment, checkout */
.commerce-section { content-visibility: auto; contain-intrinsic-size: 720px; }
.commerce-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 28px; border-bottom: 1px solid var(--line); }
.commerce-tab { min-height: 44px; border: 1px solid var(--line); border-bottom: 0; background: #171715; color: #9a9891; padding: 12px 16px; cursor: pointer; font: 11px "DM Mono", monospace; text-transform: uppercase; }
.commerce-tab.active { background: var(--red); border-color: var(--red); color: #fff; }
.commerce-tab span { display: inline-grid; min-width: 1.4em; min-height: 1.4em; place-items: center; margin-left: 4px; border-radius: 999px; background: rgba(255,255,255,.12); }
.commerce-subhead { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin: 32px 0 14px; }
.commerce-subhead h3 { margin: 0; font: 600 24px "Space Grotesk", sans-serif; letter-spacing: -.04em; }
.commerce-subhead p { margin: 0; max-width: 42ch; color: #89877f; font-size: 12px; }
.commerce-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.commerce-card { display: flex; min-height: 250px; flex-direction: column; gap: 12px; padding: 18px; border: 1px solid var(--line); background: #171715; }
.commerce-card__top { display: flex; justify-content: space-between; gap: 12px; color: var(--red2); font: 10px "DM Mono", monospace; }
.commerce-card__top strong { color: var(--paper); font-weight: 500; text-align: right; }
.commerce-kicker { color: var(--red2); text-transform: uppercase; letter-spacing: .08em; }
.commerce-card h3 { margin: 0; font: 600 20px "Space Grotesk", sans-serif; letter-spacing: -.04em; }
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 0; }
.stat-grid div { padding: 8px; background: rgba(255,255,255,.03); }
.stat-grid dt, .item-line span { color: #77756e; font: 9px "DM Mono", monospace; text-transform: uppercase; letter-spacing: .06em; }
.stat-grid dd { margin: 4px 0 0; color: var(--paper); font: 12px "DM Mono", monospace; }
.item-line { margin: 0; color: #a5a29a; font: 11px/1.6 "DM Mono", monospace; }
.item-line span { margin-right: 6px; }
.commerce-add { width: 100%; margin-top: auto; }
.commerce-empty { display: grid; gap: 6px; padding: 26px 18px; border: 1px dashed var(--line); color: #aaa79f; font: 12px/1.6 Manrope, sans-serif; }
.commerce-empty span { color: #77756e; }
.commerce-action-panel { max-width: 640px; padding: 28px; border: 1px solid var(--line); background: #171715; }
.commerce-action-panel h3 { margin: 0 0 10px; font: 600 24px "Space Grotesk", sans-serif; }
.commerce-action-panel p { max-width: 52ch; color: #96938a; font-size: 13px; line-height: 1.7; }
.cart-list { display: grid; gap: 8px; }
.cart-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; border: 1px solid var(--line); background: #171715; }
.cart-row div { display: grid; gap: 4px; }
.cart-row span { color: #96938a; font: 11px "DM Mono", monospace; }
.cart-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
@media (max-width: 820px) { .commerce-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .commerce-tabs { display: grid; grid-template-columns: repeat(2, 1fr); } .commerce-tab { width: 100%; } .commerce-grid { grid-template-columns: 1fr; } .commerce-subhead { display: grid; gap: 6px; } .cart-row { align-items: flex-start; flex-direction: column; } .cart-row .button { width: 100%; } }
@media (prefers-reduced-motion: reduce) { .commerce-tab, .commerce-card { transition: none !important; } }
