/* ALYSSIUN STORE v2: the shell. Header with the search bar, navigation, the
 * "Publish Now" button, account menu, the search sheet on phones, the ambient
 * backdrop and the footer. Tokens only (style.css, LUX / NEO): thin display
 * type, hairlines, frosted glass, small radii, no pill shapes, no colour fills.
 * Notes on every choice: DESIGN-NOTES.md at the root of this repository. */
:root {
  --sv-max: 1280px;
  --sv-pad: clamp(16px, 3.4vw, 40px);
  --sv-r-s: 4px;            /* controls */
  --sv-r-m: 8px;            /* fields, small panels */
  --sv-r-l: 12px;           /* cards */
  --sv-ease: cubic-bezier(.2, .7, .2, 1);
  --sv-glass: var(--glass);
  --sv-glass-strong: var(--glass-2);
  --sv-sheen: rgba(255, 255, 255, .55);
  --sv-shadow: 0 24px 60px -36px rgba(20, 20, 26, .38);
  --sv-panel: rgba(244, 243, 238, .96);
  --sv-check: var(--store-accent-ink, #156f9c);
}
:root[data-alyssiun-atmosphere="neo"], :root[data-atmosphere="void"] {
  --sv-sheen: rgba(255, 255, 255, .12);
  --sv-shadow: 0 30px 70px -36px rgba(0, 0, 0, .9);
  --sv-panel: rgba(12, 12, 17, .96);
}
html { scroll-behavior: smooth; }
body.sv { padding: 0; min-height: 100vh; overflow-x: hidden; }
body.sv a:hover { text-decoration: none; }
.sv-skip { position: absolute; left: -999px; top: 8px; z-index: 100; padding: 10px 14px; background: var(--primary); color: var(--primary-ink); border-radius: var(--sv-r-s); }
.sv-skip:focus { left: 8px; }

/* Ambient backdrop: two slow lights behind everything. Mist in LUX, void in NEO. */
.sv-ambient { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.sv-ambient::before, .sv-ambient::after { content: ""; position: absolute; width: 70vmax; height: 70vmax; border-radius: 50%; filter: blur(70px); opacity: .5; will-change: transform; }
.sv-ambient::before { left: -22vmax; top: -30vmax; background: radial-gradient(closest-side, rgba(255, 255, 255, .95), rgba(255, 255, 255, 0)); animation: sv-drift-a 46s ease-in-out infinite alternate; }
.sv-ambient::after { right: -28vmax; top: 18vmax; background: radial-gradient(closest-side, rgba(92, 200, 242, .16), rgba(92, 200, 242, 0)); animation: sv-drift-b 58s ease-in-out infinite alternate; }
:root[data-alyssiun-atmosphere="neo"] .sv-ambient::before, :root[data-atmosphere="void"] .sv-ambient::before { background: radial-gradient(closest-side, rgba(120, 130, 190, .2), rgba(120, 130, 190, 0)); }
:root[data-alyssiun-atmosphere="neo"] .sv-ambient::after, :root[data-atmosphere="void"] .sv-ambient::after { background: radial-gradient(closest-side, rgba(92, 200, 242, .13), rgba(92, 200, 242, 0)); }
@keyframes sv-drift-a { to { transform: translate3d(14vmax, 10vmax, 0) scale(1.12); } }
@keyframes sv-drift-b { to { transform: translate3d(-16vmax, -8vmax, 0) scale(.92); } }

/* Header */
.sv-header { position: sticky; top: 0; z-index: 40; background: var(--nav-bg); border-bottom: 1px solid var(--hair);
  -webkit-backdrop-filter: blur(20px) saturate(1.2); backdrop-filter: blur(20px) saturate(1.2); }
.sv-header-row { max-width: var(--sv-max); margin: 0 auto; padding: 0 var(--sv-pad); min-height: 64px; display: flex; align-items: center; gap: clamp(12px, 2vw, 26px); }
.sv-brand { flex: none; display: inline-flex; align-items: center; gap: 9px; min-height: 44px; }
.sv-brand .alyssiun-appname { color: var(--text); letter-spacing: .24em; }
.sv-nav { display: flex; align-items: center; gap: clamp(14px, 1.8vw, 26px); }
.sv-nav a { position: relative; display: inline-flex; align-items: center; min-height: 44px; color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; white-space: nowrap; transition: color .18s ease; -webkit-user-select: none; user-select: none; }
.sv-nav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 8px; height: 1px; background: var(--text); transform: scaleX(0); transform-origin: left; transition: transform .28s var(--sv-ease); }
.sv-nav a:hover, .sv-nav a[aria-current="page"] { color: var(--text); }
.sv-nav a[aria-current="page"]::after, .sv-nav a:hover::after { transform: scaleX(1); }
.sv-actions { flex: none; display: flex; align-items: center; gap: 10px; margin-left: auto; }

/* The search bar: category picker, field, button. Always there on a desktop. */
.sv-search { position: relative; flex: 1 1 320px; min-width: 0; max-width: 620px; margin-left: auto; }
.sv-search + .sv-actions { margin-left: 0; }
.sv-search-bar { display: flex; align-items: stretch; height: 44px; border: 1px solid var(--hair-2); border-radius: var(--sv-r-m); background: var(--input); transition: border-color .18s ease, background .18s ease, box-shadow .18s ease; }
.sv-search-bar:focus-within { border-color: var(--btn-hover-border); background: var(--input-2); box-shadow: 0 0 0 3px var(--hair); }
.sv-search-cat { flex: none; width: auto; max-width: 132px; height: 100%; border: 0; border-right: 1px solid var(--hair); border-radius: var(--sv-r-m) 0 0 var(--sv-r-m); background-color: transparent; padding: 0 30px 0 12px; font-size: 12px; color: var(--muted); text-overflow: ellipsis; background-position: calc(100% - 15px) 50%, calc(100% - 10px) 50%; }
.sv-search-cat:focus { background-color: transparent; color: var(--text); }
.sv-search-input { flex: 1 1 auto; min-width: 0; height: 100%; border: 0; background: transparent; padding: 0 10px 0 12px; font-size: 15px; }
.sv-search-input:focus { background: transparent; }
.sv-search-input::-webkit-search-cancel-button { -webkit-appearance: none; }
.sv-search-go { flex: none; width: 46px; border: 0; border-left: 1px solid var(--hair); border-radius: 0 var(--sv-r-m) var(--sv-r-m) 0; background: transparent; color: var(--text); cursor: pointer; display: grid; place-items: center; }
.sv-search-go:hover { background: var(--glass-2); }
.sv-icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* The dropdown under the bar (and the body of the phone sheet). */
.sv-suggest { position: absolute; left: 0; right: 0; top: calc(100% + 8px); z-index: 45; max-height: min(70vh, 560px); overflow: auto; padding: 8px; border: 1px solid var(--hair-2); border-radius: var(--sv-r-l); background: var(--sv-panel); box-shadow: var(--sv-shadow); -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px); }
.sv-suggest[hidden] { display: none; }
.sv-suggest h4 { margin: 10px 10px 4px; font-size: 10px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); display: flex; justify-content: space-between; align-items: center; }
.sv-suggest h4 button { border: 0; background: none; color: var(--muted); font: inherit; letter-spacing: .1em; cursor: pointer; padding: 6px 0; }
.sv-suggest h4 button:hover { color: var(--text); }
.sv-suggest-item { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; padding: 6px 10px; border: 0; border-radius: var(--sv-r-m); background: none; color: var(--text); font: inherit; font-size: 14px; text-align: left; cursor: pointer; }
.sv-suggest-item:hover, .sv-suggest-item.is-active { background: var(--glass-2); }
.sv-suggest-item img, .sv-suggest-item .sv-suggest-glyph { flex: none; width: 34px; height: 34px; border-radius: 8px; object-fit: cover; }
.sv-suggest-glyph { display: grid; place-items: center; border: 1px solid var(--hair); color: var(--muted); }
.sv-suggest-item span { min-width: 0; display: grid; }
.sv-suggest-item small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sv-suggest-all { justify-content: center; color: var(--muted); border-top: 1px solid var(--hair); border-radius: 0 0 var(--sv-r-m) var(--sv-r-m); margin-top: 6px; }
.sv-suggest-empty { margin: 0; padding: 14px 10px; color: var(--muted); font-size: 13px; }

/* Buttons that belong to the shell */
.sv-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border: 1px solid var(--hair-2); border-radius: var(--sv-r-s); background: var(--sv-glass); color: var(--text); font: inherit; font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; white-space: nowrap; cursor: pointer; -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); transition: transform .18s var(--sv-ease), border-color .18s ease, background .18s ease; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.sv-btn:hover { transform: translateY(-1px); border-color: var(--btn-hover-border); background: var(--sv-glass-strong); }
.sv-btn:active { transform: scale(.97); }
.sv-btn:focus-visible, .sv-nav a:focus-visible, .sv-icon-btn:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.sv-btn.is-primary { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
.sv-btn.is-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.sv-btn.is-quiet { border-color: transparent; background: transparent; color: var(--muted); }
.sv-btn.is-quiet:hover { color: var(--text); border-color: var(--hair); }
.sv-btn[disabled] { opacity: .55; cursor: default; transform: none; }
.sv-btn.is-large { min-height: 52px; padding: 0 26px; font-size: 13px; }
.sv-icon-btn { width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid var(--hair); border-radius: var(--sv-r-s); background: var(--sv-glass); color: var(--text); cursor: pointer; }
.sv-icon-btn:hover { border-color: var(--btn-hover-border); }

/* Publish Now: the one button that stands out. Ink, with a slow light crossing it. */
.sv-publish { position: relative; overflow: hidden; isolation: isolate; }
.sv-publish::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(110deg, transparent 30%, var(--sv-sheen) 50%, transparent 70%); transform: translateX(-120%); animation: sv-sweep 5.5s var(--sv-ease) infinite; }
@keyframes sv-sweep { 0%, 55% { transform: translateX(-120%); } 100% { transform: translateX(120%); } }

/* Account menu */
.sv-account { position: relative; }
.sv-account-menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 200px; padding: 6px; border: 1px solid var(--hair-2); border-radius: var(--sv-r-l); background: var(--sv-panel); box-shadow: var(--sv-shadow); display: grid; }
.sv-account-menu[hidden] { display: none; }
.sv-account-menu a, .sv-account-menu button { display: flex; align-items: center; min-height: 44px; padding: 0 12px; border: 0; border-radius: var(--sv-r-m); background: none; color: var(--text); font: inherit; font-size: 14px; text-align: left; cursor: pointer; }
.sv-account-menu a:hover, .sv-account-menu button:hover { background: var(--glass-2); }
.sv-account-status { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 0 0 12px; color: var(--muted); font-size: 13px; }
.sv-account-menu .sv-account-status button { color: var(--text); font-weight: 600; white-space: nowrap; }
.sv-account-name { padding: 10px 12px 8px; color: var(--muted); font-size: 12px; border-bottom: 1px solid var(--hair); margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Page frame + footer */
.sv-main { width: min(var(--sv-max), 100%); margin: 0 auto; padding: 0 var(--sv-pad); min-height: calc(100vh - 300px); }
.sv-footer { margin-top: clamp(48px, 8vw, 96px); border-top: 1px solid var(--hair); color: var(--muted); --alyssiun-footer-padding: clamp(34px, 6vw, 60px) var(--sv-pad) calc(clamp(34px, 6vw, 60px) + env(safe-area-inset-bottom, 0px)); }
.sv-footer alyssiun-footer { display: block; color: var(--muted); }
.sv-footer-fallback { max-width: 720px; margin: 0 auto; padding: 40px var(--sv-pad); text-align: center; font-size: 13px; line-height: 1.7; }
.sv-footer-fallback strong { display: block; letter-spacing: .3em; color: var(--text); margin-bottom: 10px; }
.sv-footer-fallback a { color: inherit; text-decoration: underline; }
.sv-toast { position: fixed; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom, 0px)); z-index: 80; transform: translate(-50%, 20px); opacity: 0; max-width: min(92vw, 460px); padding: 13px 18px; border: 1px solid var(--hair-2); border-radius: var(--sv-r-m); background: var(--sv-panel); box-shadow: var(--sv-shadow); font-size: 14px; transition: opacity .2s ease, transform .3s var(--sv-ease); pointer-events: none; }
.sv-toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* The phone search sheet: the whole screen, field on top. */
.sv-sheet { position: fixed; inset: 0; z-index: 90; display: flex; flex-direction: column; background: var(--bg); padding: calc(10px + env(safe-area-inset-top, 0px)) 14px 0; }
.sv-sheet[hidden] { display: none; }
.sv-sheet-top { display: flex; gap: 8px; align-items: center; }
.sv-sheet .sv-search { max-width: none; margin: 0; flex: 1 1 auto; }
.sv-sheet .sv-suggest { position: static; margin-top: 10px; max-height: none; flex: 1 1 auto; border: 0; background: none; box-shadow: none; padding: 0 0 24px; -webkit-backdrop-filter: none; backdrop-filter: none; }
.sv-sheet-body { flex: 1 1 auto; overflow: auto; -webkit-overflow-scrolling: touch; }
.sv-search-open { display: none; }

@media (max-width: 1119px) {
  .sv-header-row { flex-wrap: wrap; row-gap: 0; }
  .sv-nav { order: 5; flex: 1 0 100%; min-height: 44px; overflow-x: auto; scrollbar-width: none; border-top: 1px solid var(--hair); margin: 0 calc(var(--sv-pad) * -1); padding: 0 var(--sv-pad); }
  .sv-nav::-webkit-scrollbar { display: none; }
  .sv-nav a::after { bottom: 6px; }
}
@media (max-width: 719px) {
  .sv-header-row { min-height: 56px; gap: 8px; }
  .sv-header .sv-search { display: none; }
  .sv-search-open { display: grid; }
  .sv-header-row { padding: 0 12px; flex-wrap: nowrap; }
  .sv-header { display: block; }
  .sv-publish { padding: 0 10px; letter-spacing: .08em; font-size: 10.5px; }
  .sv-brand { gap: 7px; }
  .sv-brand .alyssiun-wordmark { width: 70px; }
  .sv-actions { gap: 6px; }
  .sv-search-input { font-size: 16px; }   /* no zoom on focus in iOS */
  .sv-nav { gap: 22px; position: absolute; left: 0; right: 0; top: 100%; margin: 0; padding: 0 12px; background: var(--nav-bg); border-bottom: 1px solid var(--hair); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); }
  .sv-header-row { position: relative; }
  .sv-main { padding-top: 45px; }
}
@media (max-width: 359px) { .sv-brand .alyssiun-appname { display: none; } }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .sv-ambient::before, .sv-ambient::after, .sv-publish::before { animation: none; }
  .sv-btn, .sv-nav a::after, .sv-toast { transition: none; }
  .sv-btn:hover { transform: none; }
}
