/* Mackie's Art Gallery 2.0 – Apple-inspiriert */
:root {
  --bg: #f5f5f7; --elev: #ffffff; --text: #1d1d1f; --text-2: #6e6e73; --text-3: #86868b;
  --fill: rgba(120,120,128,.12); --fill-2: rgba(120,120,128,.2); --sep: rgba(60,60,67,.14);
  --accent: #0071e3; --red: #ff3b30; --glass: rgba(255,255,255,.72);
  --shadow: 0 2px 6px rgba(0,0,0,.04), 0 18px 48px rgba(0,0,0,.08); --shadow-lg: 0 30px 80px rgba(0,0,0,.22);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Inter", "Segoe UI", system-ui, sans-serif;
  --serif: "New York", "Instrument Serif", ui-serif, Georgia, serif;
  --ease: cubic-bezier(.32,.72,0,1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-mood="light"]) { --bg: #000; --elev: #1c1c1e; --text: #f5f5f7; --text-2: #a1a1a6; --text-3: #8e8e93; --fill: rgba(120,120,128,.24); --fill-2: rgba(120,120,128,.36); --sep: rgba(84,84,88,.55); --accent: #2997ff; --red: #ff453a; --glass: rgba(22,22,24,.72); --shadow: 0 0 0 1px rgba(255,255,255,.06); --shadow-lg: 0 30px 80px rgba(0,0,0,.7); color-scheme: dark; } }
:root[data-mood="dark"] { --bg: #000; --elev: #1c1c1e; --text: #f5f5f7; --text-2: #a1a1a6; --text-3: #8e8e93; --fill: rgba(120,120,128,.24); --fill-2: rgba(120,120,128,.36); --sep: rgba(84,84,88,.55); --accent: #2997ff; --red: #ff453a; --glass: rgba(22,22,24,.72); --shadow: 0 0 0 1px rgba(255,255,255,.06); --shadow-lg: 0 30px 80px rgba(0,0,0,.7); color-scheme: dark; }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); line-height: 1.47; letter-spacing: -.012em; -webkit-font-smoothing: antialiased; transition: background .5s var(--ease), color .5s var(--ease); min-height: 100vh; }
body.locked { overflow: hidden; }
button, input, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
button:disabled { cursor: default; opacity: .35; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; }
p { margin: 0; }
img { display: block; }
.ic { width: 18px; height: 18px; flex: none; }
.muted { color: var(--text-2); } .small { font-size: 13px; }
em { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: -.01em; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; padding: 0 18px; border-radius: 999px; background: var(--fill); font-weight: 500; font-size: 15px; transition: transform .2s var(--ease), background .2s, opacity .2s; white-space: nowrap; }
.btn:hover:not(:disabled) { background: var(--fill-2); }
.btn:active:not(:disabled) { transform: scale(.97); }
.btn.primary { background: var(--accent); color: #fff; } .btn.primary:hover:not(:disabled) { filter: brightness(1.08); background: var(--accent); }
.btn.white { background: #fff; color: #000; } .btn.white:hover { background: #fff; transform: scale(1.03); }
.btn.danger { color: var(--red); }
.btn.destructive { background: var(--red); color: #fff; } .btn.destructive:hover { background: var(--red); filter: brightness(1.08); }
.btn.plain { background: transparent; color: var(--accent); }
.btn.big { min-height: 52px; font-size: 17px; padding: 0 30px; }
.btn.block { display: flex; width: 100%; margin-top: 12px; }
.icon-btn { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--fill); color: var(--text); transition: background .2s; }
.icon-btn:hover { background: var(--fill-2); }

/* Nav */
.nav { position: sticky; top: 0; z-index: 30; background: var(--glass); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); border-bottom: .5px solid var(--sep); padding-top: env(safe-area-inset-top); }
.nav-in { max-width: 1280px; margin: 0 auto; height: 54px; padding: 0 22px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 17px; letter-spacing: -.02em; }
.brand img { border-radius: 7px; }
.nav-actions { display: flex; gap: 10px; align-items: center; }
@media (max-width: 520px) { .brand span { display: none; } .nav-actions .btn span { display: none; } .nav-actions .btn { width: 38px; padding: 0; min-height: 38px; } }

/* Layout */
.wrap { max-width: 1280px; margin: 0 auto; padding: 0 22px 60px; }
.hero { text-align: center; padding: 72px 0 44px; animation: rise .9s var(--ease) both; }
.hero h1 { font-size: clamp(48px, 9vw, 104px); font-weight: 700; line-height: .98; letter-spacing: -.045em; }
.hero h1 em { background: linear-gradient(90deg, #ff9f0a, #ff375f 45%, #bf5af2 75%, #5e5ce6); -webkit-background-clip: text; background-clip: text; color: transparent; padding-right: .06em; }
.lead { max-width: 560px; margin: 22px auto 0; font-size: clamp(17px, 2vw, 21px); color: var(--text-2); }
.eyebrow { font-size: 13px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--text-2); margin-bottom: 12px; }
.eyebrow.light { color: rgba(255,255,255,.75); }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }

/* Featured */
.featured { position: relative; display: grid; grid-template-columns: 1.35fr 1fr; align-items: center; width: 100%; text-align: left; border-radius: 30px; overflow: hidden; background: #111; color: #fff; min-height: 460px; box-shadow: var(--shadow-lg); isolation: isolate; animation: rise 1s .1s var(--ease) both; }
.featured-glow { position: absolute; inset: -40px; background-size: cover; background-position: center; filter: blur(60px) saturate(1.4) brightness(.55); transform: scale(1.2); z-index: -1; }
.featured img { width: 100%; height: 100%; max-height: 560px; object-fit: contain; padding: 36px; transition: transform 1.2s var(--ease); filter: drop-shadow(0 30px 40px rgba(0,0,0,.45)); }
.featured:hover img { transform: scale(1.025); }
.featured-info { padding: 40px 44px 40px 8px; }
.featured h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(38px, 5vw, 64px); line-height: 1; letter-spacing: -.01em; margin-bottom: 10px; }
.featured p { color: rgba(255,255,255,.72); font-size: 17px; }
.pill-btn { display: inline-flex; align-items: center; gap: 4px; margin-top: 24px; padding: 10px 18px; border-radius: 999px; background: rgba(255,255,255,.92); color: #000; font-weight: 600; font-size: 15px; }
@media (max-width: 820px) { .featured { grid-template-columns: 1fr; min-height: 0; } .featured img { max-height: 420px; padding: 24px 24px 0; } .featured-info { padding: 20px 26px 30px; text-align: center; } }

/* Filter */
.filters { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin: 56px 0 30px; }
.chip { padding: 8px 16px; border-radius: 999px; background: var(--fill); font-size: 14px; font-weight: 500; transition: background .2s, color .2s, transform .15s; }
.chip:hover { background: var(--fill-2); }
.chip.on { background: var(--text); color: var(--bg); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips .chip { padding: 6px 13px; font-size: 13px; }

/* Grid (Masonry) */
.grid { columns: 3 320px; column-gap: 26px; }
.art { display: block; width: 100%; break-inside: avoid; margin: 0 0 30px; text-align: left; animation: rise .8s var(--d) var(--ease) both; }
.art-img { border-radius: 20px; overflow: hidden; background: var(--fill); box-shadow: var(--shadow); transition: transform .6s var(--ease), box-shadow .6s var(--ease); }
.art-img img { width: 100%; height: auto; transition: transform 1s var(--ease); }
.art:hover .art-img { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.art:hover .art-img img { transform: scale(1.03); }
.art-meta { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 14px 4px 0; }
.art-cat { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); }
.art h3 { font-family: var(--serif); font-weight: 400; font-size: 26px; line-height: 1.1; margin-top: 2px; }
.badges { display: flex; gap: 6px; color: var(--text-3); padding-top: 4px; }
.badges .ic { width: 16px; height: 16px; }

.empty { text-align: center; padding: 80px 20px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty-frame { width: 140px; height: 110px; border-radius: 6px; border: 10px solid var(--elev); box-shadow: var(--shadow-lg), inset 0 0 0 1px var(--sep); background: linear-gradient(135deg, var(--fill), transparent); margin-bottom: 18px; }
.empty h2 { font-family: var(--serif); font-weight: 400; font-size: 34px; }
.empty .btn { margin-top: 16px; }
.foot { text-align: center; color: var(--text-3); font-size: 12px; margin-top: 50px; padding-top: 20px; border-top: .5px solid var(--sep); }

/* Detail */
.detail { position: relative; min-height: 100vh; color: #f5f5f7; isolation: isolate; overflow: hidden; }
body.in-detail { background: #000; }
.ambient { position: fixed; inset: -80px; z-index: -1; background-size: cover; background-position: center; filter: blur(80px) saturate(1.5) brightness(.42); transform: scale(1.15); animation: fadeIn 1s var(--ease); }
.ambient::after { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at center, transparent 30%, rgba(0,0,0,.55)); }
@keyframes fadeIn { from { opacity: 0; } }
.detail-bar { position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center; padding: calc(14px + env(safe-area-inset-top)) 22px 14px; }
.detail-nav { display: flex; gap: 8px; }
.glass-btn { display: inline-flex; align-items: center; gap: 4px; height: 40px; padding: 0 16px 0 10px; border-radius: 999px; color: #fff; font-weight: 500; background: rgba(255,255,255,.14); backdrop-filter: blur(20px) saturate(160%); -webkit-backdrop-filter: blur(20px) saturate(160%); border: .5px solid rgba(255,255,255,.18); transition: background .2s; }
.glass-btn:hover:not(:disabled) { background: rgba(255,255,255,.24); }
.glass-btn.round { width: 40px; padding: 0; justify-content: center; }
.flip { display: inline-flex; transform: scaleX(-1); }
.detail-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(320px, 1fr); gap: 44px; align-items: center; max-width: 1400px; margin: 0 auto; padding: 10px 28px 60px; min-height: calc(100vh - 80px); }
.stage { display: flex; justify-content: center; align-items: center; animation: rise 1s var(--ease) both; }
.stage img { max-width: 100%; max-height: 80vh; border-radius: 6px; box-shadow: 0 40px 100px rgba(0,0,0,.55); transition: transform .5s var(--ease), opacity .3s; will-change: transform; }
.info { padding: 30px; border-radius: 28px; background: rgba(28,28,30,.48); backdrop-filter: blur(40px) saturate(170%); -webkit-backdrop-filter: blur(40px) saturate(170%); border: .5px solid rgba(255,255,255,.12); animation: rise 1s .12s var(--ease) both; }
.info .eyebrow { color: rgba(255,255,255,.6); margin-bottom: 8px; }
.info h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(40px, 5vw, 64px); line-height: 1; letter-spacing: -.01em; }
.desc { margin-top: 18px; font-size: 17px; color: rgba(255,255,255,.86); }
.desc .muted { color: rgba(255,255,255,.5); }
.meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 20px; }
.meta span { font-size: 12px; font-weight: 500; padding: 4px 10px; border-radius: 999px; background: rgba(255,255,255,.12); color: rgba(255,255,255,.8); }
.views { display: flex; gap: 10px; margin-top: 22px; }
.view { display: flex; flex-direction: column; gap: 6px; align-items: center; font-size: 12px; color: rgba(255,255,255,.65); }
.view img { width: 76px; height: 58px; object-fit: cover; border-radius: 10px; opacity: .65; transition: opacity .2s, box-shadow .2s; }
.view.on { color: #fff; } .view.on img { opacity: 1; box-shadow: 0 0 0 2px #fff; }
.sound { margin-top: 24px; padding-top: 20px; border-top: .5px solid rgba(255,255,255,.14); }
.sound-h { display: flex; align-items: center; gap: 8px; font-weight: 600; margin-bottom: 12px; }
.embed { width: 100%; height: 166px; border: 0; border-radius: 14px; background: rgba(0,0,0,.25); }
.embed.spotify { height: 152px; } .embed.yt { height: auto; aspect-ratio: 16 / 9; }
.sound audio { width: 100%; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.info .btn { background: rgba(255,255,255,.14); color: #fff; } .info .btn:hover { background: rgba(255,255,255,.24); }
.info .btn.danger { color: #ff6961; }
@media (max-width: 900px) { .detail-layout { grid-template-columns: 1fr; gap: 24px; padding: 0 16px 40px; min-height: 0; } .stage img { max-height: 70vh; } .info { padding: 22px; } }

/* Intro */
.intro { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; background: #000; color: #fff; text-align: center; padding: 24px; transition: opacity .7s var(--ease), transform .7s var(--ease); }
.intro.out { opacity: 0; transform: scale(1.04); pointer-events: none; }
.intro-glow { position: absolute; inset: 0; background: radial-gradient(40% 40% at 30% 35%, rgba(255,159,10,.35), transparent 70%), radial-gradient(45% 45% at 70% 60%, rgba(94,92,230,.38), transparent 70%), radial-gradient(35% 35% at 55% 25%, rgba(255,55,95,.28), transparent 70%); filter: blur(30px); animation: drift 12s ease-in-out infinite alternate; }
@keyframes drift { to { transform: translate3d(3%, -2%, 0) scale(1.08); } }
.intro-in { position: relative; display: flex; flex-direction: column; align-items: center; animation: rise 1.2s var(--ease) both; }
.intro-logo { border-radius: 16px; margin-bottom: 26px; box-shadow: 0 20px 50px rgba(0,0,0,.5); }
.intro h1 { font-size: clamp(54px, 11vw, 120px); font-weight: 700; letter-spacing: -.05em; line-height: .95; }
.intro h1 em { font-weight: 400; }
.intro p { color: rgba(255,255,255,.7); font-size: 19px; margin: 22px 0 36px; max-width: 460px; }

/* Layer / Sheet */
#layer { position: fixed; inset: 0; z-index: 60; display: none; }
#layer.open { display: flex; align-items: center; justify-content: center; padding: 20px; }
.backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.45); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); animation: fadeIn .25s; }
.sheet { position: relative; width: min(920px, 100%); max-height: calc(100vh - 40px); overflow: auto; background: var(--elev); color: var(--text); border-radius: 28px; padding: 26px; box-shadow: var(--shadow-lg); animation: sheetIn .45s var(--ease); }
.small-sheet { width: min(420px, 100%); text-align: center; }
.small-sheet h2 { font-size: 22px; margin-bottom: 6px; }
.small-sheet .pw { margin-top: 18px; }
.del-thumb { width: 110px; height: 110px; margin: 0 auto 16px; border-radius: 18px; overflow: hidden; box-shadow: var(--shadow-lg); }
.del-thumb img { width: 100%; height: 100%; object-fit: cover; }
@keyframes sheetIn { from { transform: translateY(30px) scale(.97); opacity: 0; } }
.sheet-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.sheet-head h2 { font-size: 28px; letter-spacing: -.03em; }
.up-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.up-media { display: flex; flex-direction: column; gap: 12px; }
.up-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.up-row .drop { min-height: 120px; }
.drop { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 260px; border-radius: 20px; background: var(--fill); border: 1.5px dashed var(--fill-2); text-align: center; padding: 16px; cursor: pointer; overflow: hidden; transition: background .2s, border-color .2s; }
.drop:hover { border-color: var(--accent); }
.drop.has { border-style: solid; border-color: transparent; }
.drop img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.drop.has .drop-t, .drop.has .drop-s { position: relative; background: rgba(0,0,0,.55); color: #fff; padding: 2px 10px; border-radius: 999px; backdrop-filter: blur(10px); max-width: 90%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drop:has(img) { justify-content: flex-end; }
.drop-ic { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: var(--elev); color: var(--accent); margin-bottom: 6px; box-shadow: var(--shadow); }
.drop-ic .ic { width: 22px; height: 22px; }
.drop-t { font-weight: 600; font-size: 15px; }
.drop-s { font-size: 12px; color: var(--text-3); }
.toggle { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 16px; background: var(--fill); cursor: pointer; }
.toggle > span:first-child { flex: 1; display: flex; flex-direction: column; }
.toggle small { color: var(--text-2); font-size: 12px; line-height: 1.35; margin-top: 2px; }
.toggle input { display: none; }
.switch { width: 51px; height: 31px; border-radius: 999px; background: var(--fill-2); position: relative; flex: none; transition: background .25s; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 3px 8px rgba(0,0,0,.15); transition: transform .25s var(--ease); }
.toggle input:checked + .switch { background: #34c759; }
.toggle input:checked + .switch::after { transform: translateX(20px); }
.up-fields { display: flex; flex-direction: column; gap: 14px; }
.field-l { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.field { width: 100%; border: 0; border-radius: 12px; background: var(--fill); padding: 12px 14px; font-size: 16px; color: var(--text); outline: none; transition: box-shadow .2s; resize: vertical; font-weight: 400; }
.field:focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 40%, transparent); }
.field::placeholder { color: var(--text-3); }
.pw { position: relative; display: block; }
.pw .ic { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--text-3); }
.pw .field { padding-left: 40px; }
.progress { margin-top: 18px; display: flex; flex-direction: column; gap: 6px; }
.progress-bar { height: 6px; border-radius: 3px; background: var(--fill); overflow: hidden; }
.progress-bar span { display: block; height: 100%; background: var(--accent); border-radius: 3px; transition: width .25s; }
@media (max-width: 760px) {
  .up-grid { grid-template-columns: 1fr; } .drop { min-height: 200px; }
  #layer.open { align-items: flex-end; padding: 0; }
  .sheet { border-radius: 28px 28px 0 0; max-height: 92vh; padding-bottom: calc(26px + env(safe-area-inset-bottom)); }
  @keyframes sheetIn { from { transform: translateY(100%); } }
}

/* Toast */
.toast { position: fixed; z-index: 100; left: 50%; bottom: calc(28px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); opacity: 0; pointer-events: none; padding: 12px 22px; border-radius: 999px; font-weight: 500; font-size: 15px; background: rgba(28,28,30,.86); color: #fff; backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); box-shadow: var(--shadow-lg); transition: all .45s var(--ease); white-space: nowrap; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.boot { display: grid; place-items: center; height: 80vh; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--fill-2); border-top-color: var(--text); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 60%, transparent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
