/*
 * Infinity Jewellery · app touches on top of styles.css (public/app-feel.css
 * supplies the shared progress line, launch screen and arrival).
 * Quiet editorial luxury: cream paper, burgundy signal, a hairline of gold.
 */
:root {
  --af-tint: var(--accent);
  --af-tint-2: var(--gold);
  --af-splash-bg: var(--paper);
  --af-splash-ink: var(--ink);
  --af-sheet-radius: 22px;
}
.af-progress i { background: linear-gradient(90deg, var(--gold), var(--accent)); box-shadow: 0 0 8px rgba(176, 133, 40, .45); }
.af-splash { background: radial-gradient(120% 70% at 50% 38%, var(--surface) 0%, var(--paper) 62%); }
.af-splash-mark path { stroke-width: .9; }
.af-splash-word { font: 500 14px/1 var(--sans); letter-spacing: .5em; color: var(--accent); }
.af-splash-word small { color: var(--ink-2); font-weight: 400; }
.af-splash-track i { background: linear-gradient(90deg, var(--gold), var(--accent)); }

/* Skeleton: a slow gold sheen instead of a grey blink. */
.skeleton {
  background: linear-gradient(100deg, var(--surface-2) 30%, color-mix(in srgb, var(--surface) 80%, var(--gold) 20%) 50%, var(--surface-2) 70%);
  background-size: 260% 100%;
  animation: af-sheen 1.8s cubic-bezier(.4, 0, .2, 1) infinite;
}
@keyframes af-sheen { from { background-position: 130% 0; } to { background-position: -130% 0; } }
.loading-label { animation: af-breathe 2.4s ease-in-out infinite; }
@keyframes af-breathe { 50% { opacity: .55; } }

/* Photographs wait on the same paper tone, so a loading grid never looks broken. */
.product-image { background: linear-gradient(100deg, var(--surface-2) 30%, color-mix(in srgb, var(--surface) 70%, var(--surface-2)) 50%, var(--surface-2) 70%) 0 0 / 260% 100%; }
.product-image:has(img.af-img:not(.af-img-in)) { animation: af-sheen 1.8s cubic-bezier(.4, 0, .2, 1) infinite; }

/* Toast: a soft capsule that rises. */
#toast {
  border-radius: 999px;
  padding: 13px 22px;
  background: var(--plate);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  backdrop-filter: blur(16px) saturate(1.4);
  transition: opacity .32s var(--af-ease), transform .42s var(--af-ease);
}

/* Save heart: a small pop when it fills. */
.save-button.saved svg { animation: af-pop .42s var(--af-ease); }
@keyframes af-pop { 40% { transform: scale(1.28); } }

/* Desktop dialog arrives instead of appearing. */
#modal[open] { animation: af-dialog .42s var(--af-ease); }
#modal[open]::backdrop { animation: af-fade .32s ease both; }
@keyframes af-dialog { from { opacity: 0; transform: translateY(14px) scale(.985); } }

@media (max-width: 800px) {
  /* Header: sticky glass that settles into a slim bar once the page moves. */
  .site-header {
    position: sticky;
    top: 0;
    z-index: 7;
    background: color-mix(in srgb, var(--paper) 82%, transparent);
    -webkit-backdrop-filter: blur(18px) saturate(1.3);
    backdrop-filter: blur(18px) saturate(1.3);
    border-bottom-color: transparent;
    transition: height .32s var(--af-ease), border-color .32s var(--af-ease), box-shadow .32s var(--af-ease);
  }
  .site-header .brand, .site-header .brand img { transition: width .32s var(--af-ease), height .32s var(--af-ease); }
  .af-scrolled .site-header { height: 60px; border-bottom-color: var(--line); box-shadow: 0 8px 24px -18px var(--shade); }
  .af-scrolled .site-header .brand, .af-scrolled .site-header .brand img { width: 86px; height: 40px; }
  html { scroll-padding-top: 72px; }

  /* Bottom bar: an accent pill settles behind the current icon. */
  .mobile-nav {
    background: color-mix(in srgb, var(--surface) 86%, transparent);
    -webkit-backdrop-filter: blur(22px) saturate(1.4);
    backdrop-filter: blur(22px) saturate(1.4);
    border-top: 1px solid color-mix(in srgb, var(--line-2) 55%, transparent);
  }
  .mobile-nav a { position: relative; gap: 4px; font-size: 13px; letter-spacing: .01em; transition: color .24s var(--af-ease); }
  .mobile-nav a svg { position: relative; z-index: 1; transition: transform .36s var(--af-ease); }
  .mobile-nav a::before {
    content: "";
    position: absolute;
    top: 3px;
    left: 50%;
    width: 56px;
    height: 30px;
    margin-left: -28px;
    border-radius: 999px;
    background: var(--accent-soft);
    opacity: 0;
    transform: scale(.6);
    transition: opacity .24s var(--af-ease), transform .42s var(--af-ease);
  }
  .mobile-nav a.active::before { opacity: 1; transform: none; }
  .mobile-nav a.active svg { transform: translateY(-1px); }

  /* Dialogs become bottom sheets that slide up from the bar. */
  #modal {
    width: 100% !important;
    max-width: 100%;
    max-height: calc(100dvh - 36px - env(safe-area-inset-top, 0px));
    margin: auto 0 0;
    border: 0;
    border-radius: var(--af-sheet-radius) var(--af-sheet-radius) 0 0;
    padding-bottom: calc(28px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -18px 60px -20px var(--scrim);
  }
  #modal::before {
    content: "";
    position: sticky;
    top: -22px;
    display: block;
    width: 38px;
    height: 4px;
    margin: -18px auto 14px;
    border-radius: 999px;
    background: var(--line-2);
    z-index: 2;
  }
  #modal[open] { animation: af-sheet .48s var(--af-ease); }
  @keyframes af-sheet { from { transform: translateY(100%); } }

  /* Category chips: one swipeable row. */
  .filter-chips { flex-wrap: nowrap; width: calc(100% + 2 * var(--gutter)); max-width: none; margin-inline: calc(-1 * var(--gutter)); padding-inline: var(--gutter); overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity; scroll-padding-inline: var(--gutter); }
  .filter-chips::-webkit-scrollbar, .tabs::-webkit-scrollbar { display: none; }
  .filter-chips > * { flex: none; scroll-snap-align: start; }
  .chip { border-radius: 999px; transition: background-color .24s var(--af-ease), color .24s var(--af-ease), border-color .24s var(--af-ease); }
  .tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }

  /* Touch: a gentle press on pieces. */
  .af-touch .product-image:active img { transform: scale(.985); transition-duration: .12s; }
}

/* Installed app: the announcement bar belongs to the website, not the app. */
.af-standalone .announcement { display: none; }
.af-standalone .site-header { padding-top: env(safe-area-inset-top, 0px); height: calc(79px + env(safe-area-inset-top, 0px)); }
.af-standalone.af-scrolled .site-header { height: calc(60px + env(safe-area-inset-top, 0px)); }

@media (prefers-reduced-motion: reduce) {
  .skeleton, .product-image:has(img.af-img:not(.af-img-in)), .loading-label { animation: none; }
  .save-button.saved svg, #modal[open], #modal[open]::backdrop { animation: none; }
  .mobile-nav a::before, .mobile-nav a svg, .site-header { transition: none; }
}
