:root {
  --bg-main: #f3f8fd;
  --bg-soft: #e6f0fb;
  --card-bg: rgba(255, 255, 255, 0.82);
  --ink: #173455;
  --ink-soft: #4f6f93;
  --line: #9cb9d8;
  --line-strong: #6f93be;
  --accent: #2f629d;
  --accent-2: #5f8fc4;
  --shadow: 0 18px 45px rgba(20, 58, 99, 0.14);
  --rose: #b0485c;
  --rose-soft: #d98a98;
  --blue: #2f5f96;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Manrope", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 9%, rgba(101, 157, 208, 0.26), transparent 27%),
    radial-gradient(circle at 86% 16%, rgba(73, 128, 183, 0.22), transparent 30%),
    linear-gradient(180deg, var(--bg-main), #eff6fd 45%, #f8fbff 100%);
  min-height: 100vh;
  overflow-x: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  z-index: -3;
  width: 38vmax;
  height: 38vmax;
  border-radius: 999px;
  filter: blur(2px);
  opacity: 0.22;
  pointer-events: none;
}
body::before {
  top: -16vmax;
  left: -14vmax;
  background:
    repeating-linear-gradient(35deg, rgba(55, 115, 177, 0.26) 0 7px, rgba(55, 115, 177, 0.04) 7px 16px),
    radial-gradient(circle, rgba(116, 170, 220, 0.34), rgba(116, 170, 220, 0.08));
}
body::after {
  right: -14vmax;
  bottom: -18vmax;
  background:
    repeating-radial-gradient(circle at center, rgba(49, 101, 163, 0.24) 0 11px, rgba(49, 101, 163, 0.03) 11px 22px),
    radial-gradient(circle, rgba(143, 187, 228, 0.32), rgba(143, 187, 228, 0.06));
}

.wash {
  position: fixed;
  z-index: -2;
  border-radius: 50%;
  filter: blur(34px);
  opacity: 0.46;
  pointer-events: none;
}
.wash-a { width: 35vw; height: 35vw; left: -8vw; top: 20vh; background: radial-gradient(circle, rgba(129, 177, 224, 0.38), transparent 67%); }
.wash-b { width: 33vw; height: 33vw; right: -10vw; top: 43vh; background: radial-gradient(circle, rgba(105, 154, 207, 0.35), transparent 67%); }
.wash-c { width: 30vw; height: 30vw; left: 34vw; top: -9vw; background: radial-gradient(circle, rgba(145, 188, 228, 0.28), transparent 70%); }

/* ---- top bar ---- */
.topbar {
  position: sticky;
  top: 0.9rem;
  z-index: 40;
  width: fit-content;
  margin: 0.9rem auto 0;
  padding: 0.42rem;
  border-radius: 999px;
  background:
    linear-gradient(150deg, rgba(247, 251, 255, 0.92), rgba(223, 237, 251, 0.88)),
    repeating-linear-gradient(-35deg, rgba(82, 127, 177, 0.11) 0 7px, rgba(82, 127, 177, 0.03) 7px 14px);
  border: 1px solid rgba(111, 152, 196, 0.52);
  box-shadow: 0 10px 28px rgba(35, 76, 119, 0.14);
  backdrop-filter: blur(10px);
}
.nav-links { display: flex; flex-wrap: nowrap; align-items: center; gap: 0.35rem; }
.nav-links a {
  color: #2f5985;
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 0.5rem 0.78rem;
  transition: color 180ms ease, background-color 180ms ease, transform 180ms ease;
}
.nav-links a:hover,
.nav-links a:focus-visible {
  color: #1f4772;
  background: rgba(255, 255, 255, 0.64);
  transform: translateY(-1px);
}

/* ---- typography ---- */
h1, h2, h3 {
  font-family: "Cormorant Garamond", serif;
  color: #143558;
  margin: 0;
  line-height: 1.15;
}
.script {
  font-family: "Great Vibes", cursive;
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  font-weight: 400;
  line-height: 1.35;
  color: var(--blue);
  margin: 0.4rem 0 0;
  padding: 0.15em 0;
}
.script .name-livia { color: var(--rose); }
.script .name-julius { color: var(--blue); }
.script .name-amp { color: #ffffff; text-shadow: 0 1px 2px rgba(33, 73, 117, 0.35); }

.eyebrow {
  display: inline-flex;
  margin: 0 0 0.4rem;
  padding: 0.22rem 0.8rem;
  border: 1px solid rgba(101, 146, 193, 0.4);
  border-radius: 999px;
  background: rgba(232, 242, 253, 0.74);
  color: var(--accent);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.75rem;
  font-weight: 700;
}
.hero-date {
  font-family: "Manrope", sans-serif;
  font-size: clamp(0.95rem, 1.6vw, 1.15rem);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0.15rem 0 0.7rem;
}
.muted { color: var(--ink-soft); }

/* ---- buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: 1px solid rgba(81, 126, 177, 0.5);
  border-radius: 999px;
  color: #245182;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.98rem;
  letter-spacing: 0.04em;
  background: linear-gradient(180deg, rgba(246, 251, 255, 0.95), rgba(230, 241, 252, 0.9));
  padding: 0.95rem 1.7rem;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 200ms ease, border-color 180ms ease;
}
.btn.primary {
  background: linear-gradient(180deg, #5f8fc4, #2d629b);
  border-color: rgba(40, 87, 135, 0.72);
  color: #f7fbff;
  box-shadow: 0 10px 24px rgba(45, 98, 155, 0.28);
}
.btn.ghost {
  background: transparent;
  border-color: rgba(81, 126, 177, 0.4);
  color: #245182;
}
.btn:hover,
.btn:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(27, 73, 121, 0.26);
  border-color: rgba(55, 105, 159, 0.72);
}
.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; box-shadow: none; }

/* ---- layout helpers ---- */
.page { width: min(1150px, 92vw); margin: 0 auto; padding: clamp(2rem, 5vw, 4rem) 0 3rem; }
.page-narrow { width: min(720px, 92vw); margin: 0 auto; padding: clamp(2rem, 5vw, 4rem) 0 3rem; }
.section { width: min(1150px, 92vw); margin: 0 auto; padding: clamp(2.2rem, 5vw, 4rem) 0 3rem; }
.container { width: 100%; }
.panel { background: var(--card-bg); border: 1px solid rgba(115, 157, 201, 0.34); border-radius: 26px; box-shadow: var(--shadow); padding: clamp(1.5rem, 4vw, 2.6rem); backdrop-filter: blur(8px); }

.card {
  background: var(--card-bg);
  border: 1px solid rgba(115, 157, 201, 0.34);
  border-radius: 26px;
  box-shadow: var(--shadow);
  padding: clamp(1.5rem, 4vw, 2.6rem);
  backdrop-filter: blur(8px);
}

.footer { text-align: center; padding: 2.5rem 1rem 3.5rem; color: var(--ink-soft); }
.footer .script { font-size: clamp(1.8rem, 3.4vw, 2.6rem); }
.footer p:last-child { margin: 0.3rem 0 0; font-size: 0.85rem; letter-spacing: 0.08em; text-transform: uppercase; }

/* ---- forms ---- */
label {
  display: block;
  font-weight: 700;
  font-size: 0.82rem;
  color: #2a598e;
  margin: 0 0 8px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
label .muted { text-transform: none; letter-spacing: 0; font-weight: 500; }
input[type="text"],
input[type="password"],
input[type="number"],
input[type="email"],
textarea {
  width: 100%;
  border: 1px solid rgba(112, 151, 191, 0.58);
  border-radius: 16px;
  padding: 1rem 1.1rem;
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.8);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}
textarea { resize: vertical; min-height: 90px; }
input:focus-visible,
textarea:focus-visible {
  outline: none;
  border-color: rgba(53, 111, 170, 0.85);
  box-shadow: 0 0 0 3px rgba(99, 152, 206, 0.2);
}
form .field { margin-bottom: 1rem; }
form button[type="submit"].btn { margin-top: 0.6rem; width: 100%; }

/* ---- modern floating-label fields ---- */
.float-field { position: relative; }
.float-field input,
.float-field textarea {
  padding: 1.55rem 1.15rem 0.6rem;
  font-size: 1.02rem;
  border-radius: 16px;
  background: #ffffff;
  border: 1px solid rgba(112, 151, 191, 0.55);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}
.float-field input:focus,
.float-field textarea:focus {
  border-color: rgba(53, 111, 170, 0.9);
  box-shadow: 0 0 0 4px rgba(99, 152, 206, 0.18), 0 8px 18px rgba(45, 98, 155, 0.07);
  background: #fff;
}
.float-field label {
  position: absolute;
  left: 1.15rem;
  top: 1.15rem;
  margin: 0;
  color: var(--ink-soft);
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  pointer-events: none;
  transition: top 160ms ease, font-size 160ms ease, color 160ms ease, letter-spacing 160ms ease;
}
.float-field input:focus + label,
.float-field input:not(:placeholder-shown) + label,
.float-field textarea:focus + label,
.float-field textarea:not(:placeholder-shown) + label {
  top: 0.55rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.float-field .optional-tag {
  position: absolute;
  right: 1.05rem;
  top: 1.05rem;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--ink-soft);
  background: rgba(232, 242, 253, 0.85);
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  pointer-events: none;
}

/* ---- notices ---- */
.notice {
  border-radius: 14px;
  padding: 0.85rem 1rem;
  font-size: 0.9rem;
  border: 1px solid rgba(111, 152, 196, 0.5);
  background: rgba(232, 242, 253, 0.7);
  color: var(--ink);
}
.notice.error { color: #9b2430; border-color: rgba(155, 36, 48, 0.35); background: rgba(251, 236, 238, 0.7); }
.notice.warning { color: #8a6d1a; border-color: rgba(180, 145, 40, 0.4); background: rgba(253, 247, 228, 0.7); }
.notice.success { color: #1f6b43; border-color: rgba(31, 107, 67, 0.4); background: rgba(230, 246, 237, 0.7); }

/* ---- lock page ---- */
.hero-lock { display: grid; place-items: center; min-height: calc(100vh - 180px); padding: 2rem 0; }
.lock-card { width: min(560px, 96vw); text-align: center; }
.lock-card form { text-align: left; margin-top: 1.2rem; }
.lock-card form button[type="submit"].btn { width: 100%; }

/* ---- upload page ---- */
.upload-wrap { display: flex; justify-content: center; padding: clamp(1.5rem, 4vw, 2.8rem) 0 2.5rem; }
.upload-shell { width: min(760px, 96vw); }
.upload-head { text-align: center; margin-bottom: 1.9rem; }
.upload-head .script { font-size: clamp(2.7rem, 7vw, 4.4rem); margin-top: 1.1rem; }
.upload-head .muted { font-size: 1.02rem; max-width: 54ch; margin: 1.1rem auto 0; }

.upload-card {
  background:
    linear-gradient(165deg, rgba(255, 255, 255, 0.92), rgba(243, 248, 254, 0.86));
  border: 1px solid rgba(115, 157, 201, 0.42);
  border-radius: 30px;
  box-shadow: 0 26px 60px rgba(20, 58, 99, 0.18);
  padding: clamp(1.7rem, 4vw, 2.7rem);
  backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
}
.upload-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, var(--rose), #8f7bd1, var(--blue), var(--accent-2));
  opacity: 0.85;
}

/* dropzone */
.dropzone {
  border: 2px dashed rgba(95, 143, 196, 0.62);
  border-radius: 24px;
  background:
    radial-gradient(circle at 12% 18%, rgba(217, 138, 152, 0.12), transparent 44%),
    radial-gradient(circle at 88% 82%, rgba(95, 143, 196, 0.18), transparent 46%),
    linear-gradient(160deg, #f6faff, #eef3fb);
  padding: clamp(2.2rem, 5vw, 3.4rem) 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 180ms ease, background-color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}
.dropzone:hover,
.dropzone.dragover {
  border-color: rgba(53, 111, 170, 0.9);
  background:
    radial-gradient(circle at 12% 18%, rgba(217, 138, 152, 0.2), transparent 48%),
    radial-gradient(circle at 88% 82%, rgba(95, 143, 196, 0.3), transparent 50%),
    linear-gradient(160deg, #eef6ff, #e7eefb);
  transform: translateY(-3px);
  box-shadow: 0 16px 38px rgba(45, 98, 155, 0.2);
}
.dropzone.dragover { border-style: solid; }
.dropzone.has-files { border-style: solid; border-color: rgba(45, 98, 155, 0.55); }
.dropzone input[type="file"] { display: none; }

.dz-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 1.1rem;
  border-radius: 24px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #5f8fc4, #2d629b);
  color: #fff;
  box-shadow: 0 12px 26px rgba(45, 98, 155, 0.38);
  transition: transform 180ms ease;
}
.dropzone:hover .dz-icon,
.dropzone.dragover .dz-icon { transform: translateY(-3px) scale(1.04); }
.dz-icon svg { width: 34px; height: 34px; }
.dz-title {
  font-family: "Cormorant Garamond", serif;
  font-size: 1.75rem;
  font-weight: 600;
  color: #143558;
  margin: 0 0 0.35rem;
}
.dz-sub { margin: 0; color: var(--ink-soft); font-size: 0.95rem; }
.dz-browse { color: var(--rose); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }

/* file list */
.file-list { margin-top: 1.1rem; display: flex; flex-direction: column; gap: 0.5rem; }
.file-list[hidden] { display: none; }
.file-chip {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.62rem 0.85rem;
  border-radius: 15px;
  background: linear-gradient(135deg, rgba(95, 143, 196, 0.14), rgba(217, 138, 152, 0.12));
  border: 1px solid rgba(115, 157, 201, 0.32);
}
.file-chip .chip-name { flex: 1; font-size: 0.9rem; color: var(--ink); font-weight: 600; word-break: break-word; }
.file-chip .chip-size { font-size: 0.78rem; color: var(--ink-soft); white-space: nowrap; }
.file-chip .chip-remove {
  all: unset;
  cursor: pointer;
  font-size: 1.15rem;
  line-height: 1;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: var(--rose);
  background: rgba(176, 72, 92, 0.12);
  transition: background-color 160ms ease, color 160ms ease;
}
.file-chip .chip-remove:hover { background: var(--rose); color: #fff; }

/* fields */
.fields-grid { display: grid; grid-template-columns: 1fr; gap: 0.3rem; margin-top: 1.5rem; }
.fields-grid .field { margin-bottom: 0.85rem; }

.upload-progress { margin-top: 1.1rem; padding: 0.95rem 1.05rem; border-radius: 16px; background: rgba(232, 242, 253, 0.55); border: 1px solid rgba(111, 152, 196, 0.4); }
.progress-row { display: flex; justify-content: space-between; font-size: 0.82rem; color: var(--ink-soft); }
.progress-row.total { margin-top: 0.6rem; }
.progress-track { height: 9px; border-radius: 999px; background: rgba(143, 180, 216, 0.3); overflow: hidden; margin-top: 0.3rem; }
.progress-fill { height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, var(--rose), #8f7bd1, #4d82b9, #2d629b); transition: width 180ms ease; }

.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.4rem; }
.actions .btn { flex: 1 1 auto; min-width: 200px; }

/* ---- gallery ---- */
.gallery-hero { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 1rem; }
.gallery-hero h1 { font-size: clamp(1.9rem, 3.4vw, 2.6rem); margin-top: 0.3rem; }
.gallery-stats { display: flex; flex-wrap: wrap; align-items: center; gap: 0.8rem; font-size: 0.85rem; color: var(--ink-soft); }
.gallery-stats strong { color: var(--ink); }
.gallery-lock { font-size: 0.8rem; color: #245182; text-decoration: none; border: 1px solid rgba(81, 126, 177, 0.45); border-radius: 999px; padding: 0.4rem 0.8rem; }
.gallery-lock:hover { background: rgba(255, 255, 255, 0.6); }

.gallery-filters { display: flex; gap: 0.4rem; margin: 1.4rem 0 1.2rem; }
.gallery-filters a {
  padding: 0.55rem 1.2rem;
  border-radius: 999px;
  border: 1px solid rgba(111, 152, 196, 0.45);
  color: #245182;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.03em;
  background: rgba(255, 255, 255, 0.5);
  transition: background-color 160ms ease;
}
.gallery-filters a.active { background: linear-gradient(180deg, #4d82b9, #2d629b); color: #f7fbff; border-color: rgba(40, 87, 135, 0.72); }

.media-browser { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; }
.media-card {
  background: var(--card-bg);
  border: 1px solid rgba(115, 157, 201, 0.34);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 10px 26px rgba(34, 79, 128, 0.1);
  display: flex;
  flex-direction: column;
  transition: transform 180ms ease, box-shadow 180ms ease;
}
.media-card:hover { transform: translateY(-4px); box-shadow: 0 18px 34px rgba(29, 72, 120, 0.16); }
.media-frame { aspect-ratio: 1; background: var(--bg-soft); display: flex; align-items: center; justify-content: center; overflow: hidden; position: relative; }
.media-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-thumb-button { all: unset; width: 100%; height: 100%; cursor: zoom-in; display: block; }
.media-placeholder { background: linear-gradient(160deg, #e6f0fb, #d3e5f7); }
.file-badge { font-family: "Cormorant Garamond", serif; font-size: 1.3rem; color: #2f5f96; position: absolute; }
.no-preload-note { position: absolute; bottom: 0.5rem; font-size: 0.72rem; color: var(--ink-soft); background: rgba(255, 255, 255, 0.75); padding: 0.15rem 0.5rem; border-radius: 999px; }
.media-meta { padding: 0.8rem 0.9rem; display: flex; flex-direction: column; gap: 0.15rem; }
.media-meta strong { font-size: 0.85rem; color: var(--ink); word-break: break-word; }
.media-meta span { font-size: 0.75rem; color: var(--ink-soft); }
.media-meta em { font-size: 0.8rem; color: var(--ink-soft); font-style: italic; }
.media-actions { display: flex; gap: 0.5rem; margin-top: 0.4rem; flex-wrap: wrap; }
.media-open {
  font-size: 0.78rem;
  color: #245182;
  text-decoration: none;
  border: 1px solid rgba(81, 126, 177, 0.45);
  border-radius: 999px;
  padding: 0.3rem 0.7rem;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
}
.media-open:hover { background: rgba(255, 255, 255, 0.8); }

/* lightbox */
.media-lightbox { position: fixed; inset: 0; z-index: 100; }
.media-lightbox[hidden] { display: none; }
.media-lightbox-backdrop { position: absolute; inset: 0; background: rgba(16, 40, 68, 0.72); backdrop-filter: blur(4px); }
.media-lightbox-dialog {
  position: relative;
  z-index: 2;
  max-width: min(1100px, 94vw);
  max-height: 92vh;
  margin: 4vh auto 0;
  background: #fff;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(10, 30, 55, 0.5);
  display: flex;
  flex-direction: column;
}
.media-lightbox-head { display: flex; justify-content: space-between; align-items: center; padding: 0.8rem 1.1rem; border-bottom: 1px solid var(--line); background: #f3f8fd; }
.media-lightbox-head strong { font-size: 0.9rem; color: var(--ink); word-break: break-word; }
.media-lightbox-head button { all: unset; cursor: pointer; font-size: 1.6rem; line-height: 1; color: var(--ink-soft); padding: 0 0.4rem; }
.media-lightbox-body { overflow: auto; display: grid; place-items: center; }
.media-lightbox-body img, .media-lightbox-body video { max-width: 100%; max-height: 78vh; object-fit: contain; }

/* ---- admin ---- */
.admin-folder h2 { font-size: 1.5rem; margin: 1.2rem 0 0.7rem; }
.admin-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0.8rem; }
.admin-card { background: var(--card-bg); border: 1px solid rgba(115, 157, 201, 0.3); border-radius: 15px; overflow: hidden; }
.admin-preview { aspect-ratio: 1; background: var(--bg-soft); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.admin-preview img { width: 100%; height: 100%; object-fit: cover; }
.admin-meta { padding: 0.55rem 0.7rem; display: flex; flex-direction: column; }
.admin-meta strong { font-size: 0.8rem; word-break: break-word; }
.admin-meta span { font-size: 0.72rem; color: var(--ink-soft); }
.admin-pagination, .gallery-pagination { margin-top: 1.4rem; }
.admin-pagination nav { display: flex; gap: 0.4rem; justify-content: center; flex-wrap: wrap; }
.admin-pagination a, .admin-pagination span {
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  border: 1px solid rgba(111, 152, 196, 0.4);
  color: #245182;
  text-decoration: none;
  font-size: 0.82rem;
  background: rgba(255, 255, 255, 0.5);
}
.admin-pagination span[aria-current="page"] { background: linear-gradient(180deg, #4d82b9, #2d629b); color: #fff; border-color: rgba(40, 87, 135, 0.72); }

/* ---- responsive ---- */
@media (max-width: 640px) {
  .topbar { top: 0.6rem; margin-top: 0.6rem; }
  .nav-links a { font-size: 0.7rem; padding: 0.4rem 0.55rem; }
  .media-browser { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .card, .upload-card { border-radius: 20px; }
  .actions { flex-direction: column; }
  .actions .btn { width: 100%; }
}
