/* SPEDALIS Apple design foundations — materials, type, press, a11y.
   Loaded by customer, manager, clock, onboarding, accountant, and kiosk.
   Motion curves stay on each surface's existing --motion-* tokens. */

:root {
  /* Materials — translucent functional layers (WWDC: hierarchy via weight) */
  --apple-glass: rgba(255, 250, 243, 0.72);
  --apple-glass-heavy: rgba(255, 250, 243, 0.88);
  --apple-glass-chip: linear-gradient(160deg, #ffffffb8, #ffffff78);
  --apple-hairline: rgba(255, 255, 255, 0.55);
  --apple-edge: rgba(116, 61, 41, 0.12);
  --apple-blur: blur(22px) saturate(180%);
  --apple-blur-soft: blur(14px) saturate(160%);
  --apple-scrim: rgba(46, 25, 15, 0.42);
  --apple-shadow-chrome: 0 12px 38px rgba(71, 33, 21, 0.22);
  --apple-shadow-sheet: 0 -12px 48px rgba(46, 25, 15, 0.18);

  /* Press — feedback on pointer-down, ≤120ms */
  --apple-press: 100ms;
  --apple-press-ease: cubic-bezier(0.32, 0.72, 0, 1);
  --apple-press-scale: 0.97;

  /* Type — size-specific tracking (never one letter-spacing for all sizes) */
  --apple-tracking-display: -0.045em;
  --apple-tracking-title: -0.03em;
  --apple-tracking-body: 0;
  --apple-tracking-caption: 0.01em;
  --apple-leading-display: 0.94;
  --apple-leading-title: 1.1;
  --apple-leading-body: 1.5;
}

/* Optical sizing where the face supports it */
h1,
h2,
h3,
.hero h1,
.sheet-header h2,
.login h1 {
  font-optical-sizing: auto;
}

h1 {
  letter-spacing: var(--apple-tracking-display);
  line-height: var(--apple-leading-display);
}
h2 {
  letter-spacing: var(--apple-tracking-title);
  line-height: var(--apple-leading-title);
}
h3 {
  letter-spacing: var(--apple-tracking-title);
}

/* Instant press feedback — highlight on down, not click */
.button:active,
.order-trigger:active,
.checkout:active,
.sheet-add:active,
.share-button:active,
.icon-button:active,
.account-link:active,
.item-card:active,
.order-mode-pill:active,
.kiosk-start:active,
.kiosk-product:active,
.clock-numpad-key:active,
.clock-roster-btn:active,
.manager-tabbar__item:active,
.order-tabbar__item:active {
  transition-duration: var(--apple-press);
  transition-timing-function: var(--apple-press-ease);
}

/* Frosted chrome recipe — tab bars / sticky headers / floating bars */
.apple-chrome {
  background: var(--apple-glass);
  border: 1px solid var(--apple-edge);
  box-shadow: var(--apple-shadow-chrome);
  backdrop-filter: var(--apple-blur);
  -webkit-backdrop-filter: var(--apple-blur);
}

.apple-chrome--heavy {
  background: var(--apple-glass-heavy);
}

/* Scroll-edge mask instead of a hard divider under sticky chrome */
.apple-scroll-edge {
  border-bottom: 0;
  box-shadow:
    0 1px 0 var(--apple-hairline),
    0 12px 24px -16px rgba(46, 25, 15, 0.18);
}

@media (prefers-reduced-transparency: reduce) {
  :root {
    --apple-glass: #fffaf3;
    --apple-glass-heavy: #fffaf3;
    --apple-blur: none;
    --apple-blur-soft: none;
  }
  .apple-chrome,
  .apple-chrome--heavy,
  .order-tabbar,
  .manager-tabbar,
  .site-header.is-sticky,
  .manager-shell.is-app .manager-header {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: #fffaf3 !important;
  }
}

@media (prefers-contrast: more) {
  .apple-chrome,
  .order-tabbar,
  .manager-tabbar {
    background: #fffaf3;
    border-color: var(--ink);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .button:active,
  .order-trigger:active,
  .checkout:active,
  .sheet-add:active,
  .share-button:active,
  .item-card:active,
  .order-mode-pill:active,
  .account-link:active,
  .kiosk-start:active,
  .kiosk-product:active,
  .clock-numpad-key:active,
  .manager-tabbar__item:active,
  .order-tabbar__item:active {
    transform: none;
  }
}
