/* Big Day — the night garden, in one hand */

@font-face { font-family: "Poiret One"; src: url("../fonts/poiretone-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Urbanist"; src: url("../fonts/urbanist-var.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  --loam: #07090C;
  --panel: #0D1117;
  --panel-2: #121722;
  --cyan: #38E1F0;
  --lilac: #B48CFF;
  --vein: #7CF0A8;
  --bloom: #FFFFFF;
  --text: #D6E2EC;
  --text-2: #93A6B8;
  --text-3: #6C7E90;
  --danger: #FF6B7A;
  --display: "Poiret One", "Avenir Next", "Helvetica Neue", sans-serif;
  --sans: "Urbanist", "Avenir Next", "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --dock: 72px;
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; height: 100%; }
body {
  margin: 0; min-height: 100%; background: var(--loam) url("../img/loam.png") repeat; background-size: 256px 256px; color: var(--text);
  font-family: var(--sans); font-size: 16px; line-height: 1.45; font-weight: 400;
  -webkit-tap-highlight-color: transparent; overscroll-behavior-y: contain;
  font-feature-settings: "tnum" 1;
}
::selection { background: rgba(180,140,255,0.45); color: #fff; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; border-radius: 6px; }
input, button { font: inherit; caret-color: var(--cyan); }
p { margin: 0; }
h1, h2 { margin: 0; font-weight: 400; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ico { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ico--xl { width: 40px; height: 40px; }

.app { min-height: 100svh; display: flex; flex-direction: column; padding-bottom: calc(var(--dock) + var(--sab)); }
.app.is-camera { height: 100svh; overflow: hidden; }

/* ---------- top ---------- */
.top {
  position: sticky; top: 0; z-index: 5;
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px;
  padding: calc(10px + var(--sat)) 18px 10px;
  background: linear-gradient(to bottom, rgba(7,9,12,0.98), rgba(7,9,12,0.86));
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(147,166,184,0.08);
}
.top__names { font-family: var(--display); font-size: 1.35rem; color: #fff; text-decoration: none; white-space: nowrap; }
.top__names span { color: var(--lilac); font-size: 0.85em; }
.top__day { color: var(--text-2); font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top__guest {
  display: inline-flex; align-items: center; gap: 6px; max-width: 34vw;
  background: none; border: 0; color: var(--text-2); padding: 6px 0; cursor: pointer;
  font-size: 0.9rem; transition: color 200ms var(--ease);
}
.top__guest:hover { color: #fff; }
.top__guest span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top__guest .ico { width: 18px; height: 18px; color: var(--lilac); }

/* ---------- views ---------- */
.view { flex: 1; padding: 22px 18px 24px; animation: wake 320ms var(--ease); }
@keyframes wake { from { opacity: 0.4; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.view__h { font-family: var(--display); font-size: 2.2rem; color: #fff; line-height: 1; }
.view__sub { color: var(--text-2); margin: 8px 0 22px; font-size: 0.98rem; }

/* itinerary as the vein */
.vein { list-style: none; margin: 0; padding: 0 0 0 30px; position: relative; display: grid; gap: 10px; }
.vein::before {
  content: ""; position: absolute; left: 10px; top: 8px; bottom: -120px; width: 1px;
  background: linear-gradient(to bottom, rgba(124,240,168,0.9), rgba(124,240,168,0.12));
  box-shadow: 0 0 8px rgba(124,240,168,0.5);
}
.ev {
  position: relative; display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: start;
  padding: 14px 14px 14px 16px; border-radius: 16px;
  background: rgba(13,17,23,0.55); border: 1px solid rgba(147,166,184,0.08);
  transition: opacity 250ms var(--ease), border-color 250ms var(--ease), box-shadow 250ms var(--ease), background 250ms var(--ease);
}
.ev::before {
  content: ""; position: absolute; left: -25px; top: 20px; width: 11px; height: 11px; border-radius: 50%;
  background: var(--loam); border: 1px solid rgba(124,240,168,0.55); transition: all 250ms var(--ease);
}
.ev__time { grid-column: 1; font-size: 0.85rem; color: var(--text-2); letter-spacing: 0.03em; font-variant-numeric: tabular-nums; }
.ev__name { grid-column: 1; font-size: 1.15rem; font-weight: 500; color: #fff; }
.ev__where { grid-column: 1; color: var(--text-2); font-size: 0.95rem; }
.ev__note { grid-column: 1 / -1; color: var(--text-3); font-size: 0.9rem; margin-top: 6px; max-width: 44ch; }
.ev__state { grid-column: 2; grid-row: 1; font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-3); align-self: start; white-space: nowrap; }
.ev__go {
  grid-column: 2; grid-row: 2 / span 2; align-self: center;
  display: inline-flex; align-items: center; gap: 6px; padding: 9px 12px; border-radius: 999px;
  border: 1px solid rgba(56,225,240,0.35); color: var(--cyan); text-decoration: none; font-size: 0.85rem; white-space: nowrap;
  transition: box-shadow 250ms var(--ease), border-color 250ms var(--ease), background 250ms var(--ease);
}
.ev__go .ico { width: 16px; height: 16px; }
.ev__go:hover { border-color: var(--cyan); box-shadow: 0 0 16px rgba(56,225,240,0.3); }

.ev.is-done { opacity: 0.42; }
.ev.is-done::before { background: rgba(124,240,168,0.5); border-color: transparent; }
.ev.is-now {
  border-color: rgba(255,255,255,0.55); background: rgba(18,23,34,0.95);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.15), 0 0 40px -6px rgba(255,255,255,0.35), 0 0 70px -10px rgba(180,140,255,0.4);
}
.ev.is-now::before { background: #fff; border-color: #fff; box-shadow: 0 0 12px #fff, 0 0 24px rgba(180,140,255,0.8); }
.ev.is-now .ev__state { color: #fff; }
.ev.is-next { border-color: rgba(124,240,168,0.35); box-shadow: 0 0 30px -12px rgba(124,240,168,0.5); }
.ev.is-next::before { background: var(--vein); border-color: var(--vein); box-shadow: 0 0 10px rgba(124,240,168,0.9); }
.ev.is-next .ev__state { color: var(--vein); }
.ev.is-soon::before { background: rgba(124,240,168,0.35); }
.ev.is-soon .ev__state { color: rgba(124,240,168,0.7); }
.preview { margin: 22px 0 0; font-size: 0.85rem; color: var(--text-3); }
.preview button { background: none; border: 0; color: var(--cyan); text-decoration: underline; text-underline-offset: 0.2em; padding: 0; cursor: pointer; }

/* ---------- camera ---------- */
.view--camera { padding: 0; display: flex; flex-direction: column; min-height: 0; }
.cam { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.cam__finder {
  position: relative; flex: 1; min-height: 0; background: #000; overflow: hidden;
  border-bottom: 1px solid rgba(147,166,184,0.1);
}
#video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
#video.is-mirrored { transform: scaleX(-1); }
.cam__corners { position: absolute; inset: 14px; pointer-events: none; z-index: 2; }
.cam__corners i { position: absolute; width: 22px; height: 22px; border: 1.5px solid rgba(255,255,255,0.75); }
.cam__corners i:nth-child(1) { left: 0; top: 0; border-right: 0; border-bottom: 0; border-top-left-radius: 6px; }
.cam__corners i:nth-child(2) { right: 0; top: 0; border-left: 0; border-bottom: 0; border-top-right-radius: 6px; }
.cam__corners i:nth-child(3) { left: 0; bottom: 0; border-right: 0; border-top: 0; border-bottom-left-radius: 6px; }
.cam__corners i:nth-child(4) { right: 0; bottom: 0; border-left: 0; border-top: 0; border-bottom-right-radius: 6px; }
.cam__stamp { position: absolute; z-index: 2; right: 22px; bottom: 18px; font-family: "Courier New", ui-monospace, monospace; font-weight: 700; color: #FFB347; text-shadow: 0 0 6px rgba(255,140,0,0.8); letter-spacing: 0.08em; font-size: 0.95rem; pointer-events: none; opacity: 0.9; }
.cam__rec { position: absolute; left: 22px; top: 18px; display: flex; align-items: center; gap: 8px; color: #fff; font-variant-numeric: tabular-nums; font-size: 0.95rem; }
.cam__rec i { width: 10px; height: 10px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 10px var(--danger); animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0.25; } }
.cam__off { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 12px; text-align: center; color: var(--text-2); padding: 24px; background: radial-gradient(60% 50% at 50% 45%, rgba(180,140,255,0.12), rgba(7,9,12,0) 70%), #000; }
.cam__off .ico { color: var(--lilac); filter: drop-shadow(0 0 10px rgba(180,140,255,0.7)); }
.cam__off p { max-width: 28ch; }
.cam__finder.is-live .cam__off { display: none; }
.cam__finder.is-flash::after { content: ""; position: absolute; inset: 0; background: #fff; animation: flash 260ms var(--ease) forwards; }
@keyframes flash { from { opacity: 0.9; } to { opacity: 0; } }

.cam__finder { position: relative; }
.cam__deck { flex: none; padding: 16px 18px 14px; display: grid; gap: 10px; background: linear-gradient(to bottom, var(--panel), var(--loam)); }
.cam__counter { display: flex; align-items: baseline; gap: 8px; justify-self: end; }
.cam__counterN {
  font-family: var(--sans); font-weight: 600; font-size: 1.5rem; color: #fff; font-variant-numeric: tabular-nums;
  background: #000; border: 1px solid rgba(124,240,168,0.35); border-radius: 6px; padding: 2px 10px; min-width: 3.2ch; text-align: center; letter-spacing: 0.14em;
  box-shadow: inset 0 0 12px rgba(0,0,0,0.9), 0 0 0 3px rgba(13,17,23,0.9);
}
.cam__counter { position: absolute; right: 30px; top: 28px; z-index: 2; }
.cam__counterL { color: rgba(255,255,255,0.6); }
.cam__counterL { font-size: 0.8rem; color: var(--text-3); letter-spacing: 0.06em; text-transform: uppercase; }
.cam__controls { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; }
.cam__flip { justify-self: start; width: 48px; height: 48px; border-radius: 50%; border: 1px solid rgba(147,166,184,0.25); background: rgba(13,17,23,0.8); color: var(--text); display: grid; place-items: center; cursor: pointer; transition: border-color 200ms; }
.cam__flip:hover { border-color: var(--cyan); }

.shutter { position: relative; width: 84px; height: 84px; border-radius: 50%; border: 0; background: none; cursor: pointer; padding: 0; display: grid; place-items: center; }
.shutter__ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.shutter__ring circle { fill: none; stroke: rgba(255,255,255,0.35); stroke-width: 2; stroke-dasharray: 289; stroke-dashoffset: 0; transition: stroke 200ms; }
.shutter__core {
  width: 64px; height: 64px; border-radius: 50%; background: #fff; display: block;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.7), 0 0 26px rgba(255,255,255,0.45), 0 0 70px rgba(180,140,255,0.35);
  transition: transform 150ms var(--ease), box-shadow 250ms var(--ease), background 200ms;
}
.shutter:active .shutter__core { transform: scale(0.9); }
.shutter[disabled] { cursor: default; }
.shutter[disabled] .shutter__core { background: #3a3f4a; box-shadow: none; }
.shutter.is-clip .shutter__core { width: 58px; height: 58px; }
.shutter.is-clip .shutter__ring circle { stroke: var(--danger); }
.shutter.is-recording .shutter__core { border-radius: 10px; width: 34px; height: 34px; background: var(--danger); box-shadow: 0 0 24px rgba(255,107,122,0.7); }
.shutter.is-recording .shutter__ring circle { stroke: var(--danger); stroke-width: 3; }

.mode { justify-self: end; display: inline-flex; padding: 3px; border-radius: 999px; background: rgba(13,17,23,0.9); border: 1px solid rgba(147,166,184,0.2); }
.mode input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.mode label { padding: 8px 12px; border-radius: 999px; font-size: 0.82rem; color: var(--text-2); cursor: pointer; white-space: nowrap; transition: background 200ms, color 200ms; }
.mode input:checked + label { background: #fff; color: var(--loam); font-weight: 500; }
.mode input:focus-visible + label { outline: 2px solid var(--cyan); }
.cam__hint { text-align: center; color: var(--text-3); font-size: 0.85rem; min-height: 1.3em; }

/* ---------- gallery ---------- */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
@media (min-width: 720px) { .grid { grid-template-columns: repeat(4, 1fr); gap: 6px; } }
.tile { position: relative; aspect-ratio: 1; overflow: hidden; border-radius: 8px; background: var(--panel-2); border: 0; padding: 0; cursor: pointer; animation: bloomIn 600ms var(--ease) backwards; }
@keyframes bloomIn { from { opacity: 0; filter: brightness(2) blur(6px); } to { opacity: 1; filter: none; } }
.tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile__clip { position: absolute; left: 6px; top: 6px; display: inline-flex; align-items: center; gap: 4px; padding: 3px 7px; border-radius: 999px; background: rgba(7,9,12,0.7); color: #fff; font-size: 0.7rem; letter-spacing: 0.06em; }
.tile__clip .ico { width: 12px; height: 12px; }
.tile__pending { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(7,9,12,0.45); color: #fff; font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; }
.tile__pending::after { content: ""; width: 22px; height: 22px; border-radius: 50%; border: 2px solid rgba(255,255,255,0.35); border-top-color: #fff; animation: spin 900ms linear infinite; position: absolute; }
@keyframes spin { to { transform: rotate(360deg); } }
.tile__who { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 8px 6px; font-size: 0.72rem; color: #fff; background: linear-gradient(to top, rgba(7,9,12,0.8), rgba(7,9,12,0)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: left; }
.empty { display: grid; justify-items: center; gap: 14px; text-align: center; padding: 60px 20px; color: var(--text-2); }
.empty .ico { color: var(--lilac); filter: drop-shadow(0 0 10px rgba(180,140,255,0.6)); }

/* ---------- dock ---------- */
.dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 6;
  display: grid; grid-template-columns: repeat(3, 1fr);
  height: calc(var(--dock) + var(--sab)); padding-bottom: var(--sab);
  background: linear-gradient(to top, rgba(7,9,12,1), rgba(7,9,12,0.9));
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid rgba(124,240,168,0.18);
}
.dock__g {
  background: none; border: 0; color: var(--text-2); display: grid; justify-items: center; align-content: center; gap: 4px;
  font-size: 0.72rem; letter-spacing: 0.06em; cursor: pointer; position: relative;
  transition: color 200ms var(--ease);
}
.dock__g .ico { width: 24px; height: 24px; transition: filter 250ms var(--ease); }
.dock__g::before { content: ""; position: absolute; top: -5px; left: 50%; margin-left: -4px; width: 8px; height: 8px; border-radius: 50%; background: var(--loam); border: 1px solid rgba(124,240,168,0.55); transition: background 250ms var(--ease), box-shadow 250ms var(--ease), border-color 250ms var(--ease); }
.dock__g::after { content: ""; position: absolute; top: 3px; left: 50%; width: 1px; height: 10px; background: rgba(124,240,168,0.35); }
.dock__g.is-active { color: #fff; }
.dock__g.is-active .ico { filter: drop-shadow(0 0 8px rgba(255,255,255,0.6)); }
.dock__g.is-active::before { background: #fff; border-color: #fff; box-shadow: 0 0 10px #fff, 0 0 22px rgba(180,140,255,0.8); }
.dock__g.is-active::after { background: var(--vein); box-shadow: 0 0 6px var(--vein); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 10px 20px; border-radius: 999px;
  border: 1px solid rgba(147,166,184,0.3); background: rgba(13,17,23,0.9); color: #fff; cursor: pointer; font-weight: 500;
  transition: border-color 200ms var(--ease), box-shadow 250ms var(--ease), transform 150ms var(--ease);
}
.btn:hover { border-color: var(--cyan); }
.btn--ghost { background: none; color: var(--text-2); }
.btn--bloom { background: #fff; color: var(--loam); border-color: #fff; box-shadow: 0 0 22px rgba(255,255,255,0.35), 0 0 50px rgba(180,140,255,0.25); }
.btn--bloom:hover { box-shadow: 0 0 30px rgba(255,255,255,0.55), 0 0 70px rgba(56,225,240,0.3); }
.btn[disabled] { opacity: 0.55; cursor: progress; }

/* ---------- sheets ---------- */
.sheet { position: fixed; inset: 0; z-index: 20; background: rgba(7,9,12,0.8); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); display: flex; align-items: flex-end; justify-content: center; }
.sheet[hidden] { display: none; }
.sheet__body {
  width: 100%; max-width: 560px; margin: 0; padding: 22px 20px calc(22px + var(--sab));
  background: var(--panel); border-radius: 22px 22px 0 0; border: 1px solid rgba(147,166,184,0.14); border-bottom: 0;
  display: grid; gap: 14px; animation: rise 320ms var(--ease);
}
@media (min-width: 600px) { .sheet { align-items: center; } .sheet__body { border-radius: 22px; border-bottom: 1px solid rgba(147,166,184,0.14); padding-bottom: 22px; } }
@keyframes rise { from { transform: translateY(24px); opacity: 0.5; } to { transform: none; opacity: 1; } }
.sheet__h { font-family: var(--display); font-size: 1.7rem; color: #fff; }
.sheet__p { color: var(--text-2); }
.sheet__actions { display: flex; gap: 10px; justify-content: flex-end; }
.sheet__actions .btn { flex: 1; }
.preview__media { border-radius: 14px; overflow: hidden; background: #000; max-height: 52svh; display: grid; place-items: center; }
.preview__media img, .preview__media video { max-width: 100%; max-height: 52svh; display: block; object-fit: contain; }
.preview__cap input { width: 100%; background: rgba(7,9,12,0.8); border: 1px solid rgba(147,166,184,0.22); color: #fff; border-radius: 12px; padding: 13px 14px; transition: border-color 200ms, box-shadow 250ms; }
.preview__cap input::placeholder { color: var(--text-3); }
.preview__cap input:focus { outline: 0; border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(56,225,240,0.16); }

/* ---------- lightbox ---------- */
.light { position: fixed; inset: 0; z-index: 30; background: #000; display: grid; grid-template-rows: 1fr auto; }
.light[hidden] { display: none; }
.light__close { position: absolute; right: 14px; top: calc(14px + var(--sat)); z-index: 2; width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(255,255,255,0.3); background: rgba(7,9,12,0.6); color: #fff; display: grid; place-items: center; cursor: pointer; }
.light__media { display: grid; place-items: center; min-height: 0; }
.light__media img, .light__media video, .light__media iframe { max-width: 100%; max-height: calc(100svh - 70px); width: auto; display: block; border: 0; }
.light__media iframe { width: 100vw; height: 56.25vw; max-height: calc(100svh - 70px); }
.light__meta { padding: 14px 18px calc(14px + var(--sab)); color: var(--text-2); font-size: 0.9rem; text-align: center; }

.toast { position: fixed; left: 50%; bottom: calc(var(--dock) + var(--sab) + 14px); transform: translateX(-50%); z-index: 40; padding: 10px 16px; border-radius: 999px; background: #fff; color: var(--loam); font-size: 0.9rem; box-shadow: 0 0 24px rgba(255,255,255,0.35); animation: rise 250ms var(--ease); max-width: calc(100vw - 32px); text-align: center; }
.toast[hidden] { display: none; }

@media (prefers-reduced-motion: reduce) {
  .view, .tile, .sheet__body, .toast { animation: none; }
  .cam__rec i { animation: none; }
  * { transition-duration: 0ms !important; }
}
