/* Ritual Skin Labs — minimal: full-bleed bg + two floating panels */

:root {
  --ink: #1f1d1a;
  --ink-muted: #4a463f;
  --ink-faint: #8a847a;
  --line: rgba(31, 29, 26, 0.14);
  --line-strong: rgba(31, 29, 26, 0.32);
  --panel-bg: rgba(255, 255, 254, 0.32);
  --panel-bg-solid: #fffefb;
  --field-bg: rgba(255, 255, 254, 0.28);
  --primary: #1f1d1a;
  --serif: 'Cormorant Garamond', 'Times New Roman', serif;
  --sans: 'Inter', system-ui, -apple-system, sans-serif;
}

/* ---------- Stage / background ---------- */

.stage {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: #efece6;
}

body {
  background: #efece6;
}

.stage-image {
  position: absolute;
  /* Slightly oversized so gentle rotation never reveals edges */
  inset: -8%;
  background: url('assets/bg.png') center center / cover no-repeat;
  transform-origin: 50% 50%;
  animation: drift 60s ease-in-out infinite alternate;
  will-change: transform;
}

/* Bubble video sized to sit ENTIRELY INSIDE the right bottle's liquid area. */
.bubbles-wrap {
  position: absolute;
  /* Tightly contained inside the liquid silhouette of the right bottle. */
  left: 24.5%;
  top: 58%;
  width: 7.0%;
  height: 17%;
  overflow: hidden;
  z-index: 1;
  /* Bottle-shaped mask: tapered at the neck, fuller at the body, soft edges all around. */
  -webkit-mask-image: radial-gradient(ellipse 70% 88% at 50% 60%, #000 50%, rgba(0,0,0,0.5) 80%, rgba(0,0,0,0) 100%);
          mask-image: radial-gradient(ellipse 70% 88% at 50% 60%, #000 50%, rgba(0,0,0,0.5) 80%, rgba(0,0,0,0) 100%);
  pointer-events: none;
  opacity: 0.9;
}

.bubbles-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  mix-blend-mode: screen;
  filter: blur(0.3px) saturate(0.9);
}

/* Soft sunbeam overlay — widens the existing top-left light wash without changing the photo. */
.stage-sunbeam {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background:
    radial-gradient(ellipse 95% 75% at 5% -8%,
      rgba(255, 246, 224, 0.30) 0%,
      rgba(255, 246, 224, 0.20) 35%,
      rgba(255, 246, 224, 0.10) 60%,
      rgba(255, 246, 224, 0) 85%);
  mix-blend-mode: screen;
}

@keyframes drift {
  0% {
    transform: scale(1.02) rotate(-0.6deg) translate(-0.4%, 0.2%);
  }
  50% {
    transform: scale(1.04) rotate(0.2deg) translate(0.3%, -0.3%);
  }
  100% {
    transform: scale(1.02) rotate(0.6deg) translate(0.4%, 0.3%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .stage-image {
    animation: none;
    transform: scale(1.02);
  }
}

/* ---------- Wordmark ---------- */

.wordmark {
  position: fixed;
  top: clamp(124px, 11vh, 152px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  width: 75%;
  max-width: 1400px;
  text-align: center;
  user-select: none;
  pointer-events: none;
}

.wordmark-text {
  font-family: 'Syncopate', 'Inter', sans-serif;
  font-weight: 700;
  /* Sized so the whole string spans ~75% of the viewport on desktop. */
  font-size: clamp(28px, 5.3vw, 78px);
  letter-spacing: 0.10em;
  text-transform: uppercase;
  display: inline-block;
  white-space: nowrap;

  /* Filled letters at 80% opacity, softly blurred. */
  color: rgba(255, 255, 255, 0.8);
  -webkit-text-stroke: 0 transparent;
  filter: blur(2px);

  /* Soft halo to lift letters off plaster without hardening edges. */
  text-shadow:
    0 0 14px rgba(255, 255, 255, 0.18),
    0 0 28px rgba(255, 255, 255, 0.10);
}

/* ---------- Panels container ---------- */

.panels {
  position: relative;
  z-index: 5;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-columns: 1fr;
  align-content: end;
  justify-items: end;
  padding: clamp(40px, 6vh, 80px) clamp(28px, 5vw, 72px) clamp(40px, 6vh, 80px);
  gap: clamp(18px, 2.2vh, 26px);
}

/* On wider screens the two panels sit side-by-side. They are shifted leftward
   so the first panel's left edge slightly overlaps the right side of the bottles. */
@media (min-width: 900px) {
  .panels {
    grid-template-columns: minmax(220px, 260px) minmax(220px, 260px);
    /* Pull the panel group to ~25%-from-right so it overlaps bottles. */
    justify-content: end;
    justify-items: stretch;
    align-content: center;
    padding: 48vh 28vw clamp(28px, 4vh, 48px) clamp(28px, 4vw, 56px);
    gap: clamp(14px, 1.2vw, 20px);
  }
}

/* ---------- Panel card ---------- */

.panel {
  background: var(--panel-bg);
  backdrop-filter: blur(6px) saturate(110%);
  -webkit-backdrop-filter: blur(6px) saturate(110%);
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 2px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.5) inset,
    0 18px 40px -28px rgba(31, 29, 26, 0.18);
  width: 100%;
  max-width: 280px;
  align-self: start;
  transition: background 0.25s ease;
}

.panel[data-open="true"] {
  background: rgba(255, 255, 254, 0.55);
}

/* Disclosure toggle (the always-visible header button) */
.panel-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 12px 14px;
  background: transparent;
  border: 0;
  cursor: pointer;
  text-align: left;
  color: var(--ink);
  font-family: var(--sans);
  transition: background 0.2s ease;
}

.panel-toggle:hover {
  background: rgba(255, 255, 255, 0.18);
}

.panel-toggle:focus-visible {
  outline: 2px solid rgba(31, 29, 26, 0.35);
  outline-offset: 1px;
}

.panel-title {
  font-family: 'Syncopate', 'Inter', sans-serif;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink);
}

/* Caret indicator */
.panel-caret {
  width: 8px;
  height: 8px;
  border-right: 1.2px solid var(--ink);
  border-bottom: 1.2px solid var(--ink);
  transform: rotate(45deg);
  margin-top: -3px;
  transition: transform 0.25s ease;
  flex-shrink: 0;
}

.panel[data-open="true"] .panel-caret {
  transform: rotate(-135deg);
  margin-top: 3px;
}

/* Collapsible body */
.panel-body {
  padding: 4px 14px 14px;
  border-top: 1px solid rgba(31, 29, 26, 0.08);
}

.panel-body[hidden] {
  display: none;
}

/* ---------- Form ---------- */

.panel-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 10px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.field label {
  font-family: var(--sans);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.field label .opt {
  letter-spacing: 0.14em;
  color: var(--ink-faint);
  font-weight: 400;
}

.field input {
  appearance: none;
  background: var(--field-bg);
  border: 1px solid rgba(31, 29, 26, 0.18);
  border-radius: 1px;
  padding: 7px 9px;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 400;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.field input:focus {
  outline: none;
  border-color: var(--line-strong);
  background: rgba(255, 255, 254, 0.85);
}

.field input::placeholder {
  color: var(--ink-faint);
}

/* ---------- Button ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--ink);
  color: #fbf9f4;
  border: 1px solid var(--ink);
  padding: 9px 14px;
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  margin-top: 4px;
  border-radius: 1px;
}

.btn:hover {
  background: #2c2925;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn.ghost {
  background: transparent;
  color: var(--ink);
}

.btn.ghost:hover {
  background: rgba(31, 29, 26, 0.06);
}

/* ---------- Form status ---------- */

.form-status {
  min-height: 1em;
  font-family: var(--sans);
  font-size: 11px;
  color: var(--ink-muted);
  margin-top: 2px;
  opacity: 0;
  transform: translateY(-2px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.form-status.show {
  opacity: 1;
  transform: none;
}

.form-status.success {
  color: #2d4a2b;
}

.form-status.error {
  color: #8a3a2a;
}

/* ---------- Admin (hidden unless #admin) ---------- */

.admin {
  display: none;
}

.admin.show {
  display: flex;
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(244, 241, 236, 0.96);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  align-items: center;
  justify-content: center;
  padding: clamp(20px, 4vh, 48px);
  overflow: auto;
}

.admin-card {
  background: var(--panel-bg-solid);
  border: 1px solid var(--line);
  padding: clamp(28px, 3vh, 40px);
  width: 100%;
  max-width: 420px;
  border-radius: 2px;
  box-shadow: 0 30px 80px -40px rgba(31, 29, 26, 0.4);
}

.admin-card h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 28px;
  margin-bottom: 18px;
  color: var(--ink);
}

.admin-dash {
  max-width: 920px;
}

.admin-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.admin-sub {
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-top: 4px;
}

.admin-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-table {
  border-top: 1px solid var(--line);
  overflow-x: auto;
}

.admin-table table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table th,
.admin-table td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink);
}

.admin-table th {
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.admin-table td.muted {
  color: var(--ink-faint);
}

.admin-empty {
  padding: 30px 10px;
  text-align: center;
  color: var(--ink-faint);
  font-family: var(--sans);
  font-size: 13px;
}

.del-btn:hover {
  color: #8a3a2a !important;
}

/* ---------- Mobile layout ---------- */

@media (max-width: 899px) {
  .panels {
    padding: 42vh 20px 28px;
    justify-items: center;
    align-content: end;
  }
  .panel {
    max-width: 340px;
  }
  .wordmark {
    width: 88%;
  }
  .wordmark-text {
    font-size: clamp(26px, 7vw, 56px);
    letter-spacing: 0.10em;
  }
}

@media (max-width: 520px) {
  .panels {
    padding: 40vh 16px 22px;
    gap: 12px;
  }
  .wordmark {
    width: 92%;
  }
  .wordmark-text {
    font-size: clamp(20px, 7vw, 38px);
    letter-spacing: 0.08em;
  }
}
