/* Wedding photos, beach theme. Palette: deep sea navy, sea teal, coral, warm sand, sunrise peach.
   Type: Fraunces (headings), Great Vibes (the one script word), Atkinson Hyperlegible (body, made for low-vision readers).
   --leaf is the primary action colour (sea teal), kept under its old name. */

:root {
  --ink: #15324a;
  --mist: #f7f1e7;          /* sand */
  --paper: #fffdf9;
  --leaf: #1d6b74;          /* sea teal: white text on it is 6.2:1 */
  --leaf-dark: #154f56;
  --brass: #c4553b;         /* coral: decoration and large text only */
  --sky-top: #fde7d6;
  --sky-low: #d7eef0;
  --sea-1: #9fd3d6;
  --sea-2: #5fb0b7;
  --foam: #f7f1e7;
  --muted: #4c6170;
  --line: #e4d9c6;
  --ok: #2e7d4f;
  --bad: #b3412f;
  --display: 'Fraunces', 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
  --script: 'Great Vibes', 'Snell Roundhand', 'Segoe Script', cursive;
  --body: 'Atkinson Hyperlegible', 'Segoe UI', system-ui, -apple-system, Roboto, sans-serif;
  --gutter: clamp(18px, 5vw, 56px);
  --shadow: 0 1px 2px rgba(21, 50, 74, 0.06), 0 12px 32px -12px rgba(21, 50, 74, 0.18);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background-color: var(--mist);
  /* a faint scatter of sand grains */
  background-image:
    radial-gradient(rgba(196, 160, 110, 0.16) 1px, transparent 1.2px),
    radial-gradient(rgba(196, 160, 110, 0.1) 1px, transparent 1.2px);
  background-size: 22px 22px, 31px 31px;
  background-position: 0 0, 11px 7px;
  color: var(--ink);
  font: 400 19px/1.55 var(--body);
  -webkit-font-smoothing: antialiased;
}

body.lb-open { overflow: hidden; }

h1, h2 { margin: 0; font-family: var(--display); font-weight: 400; letter-spacing: -0.01em; }
p { margin: 0 0 1em; max-width: 60ch; }

:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }

.offscreen { position: fixed; left: -9999px; top: 0; width: 1px; height: 1px; opacity: 0; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ---------- Hero: sunrise sky over the sea ---------- */

.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, var(--sky-top) 0%, #fdf1e6 45%, var(--sky-low) 100%);
  margin-bottom: clamp(28px, 5vw, 48px);
}

.hero__sky { position: absolute; inset: 0; pointer-events: none; }
.hero__sun {
  position: absolute;
  right: -56px;
  top: -64px;
  width: clamp(170px, 40vw, 320px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, #ffd9a8 0 52%, rgba(255, 210, 160, 0.5) 53%, rgba(255, 210, 160, 0) 70%);
}
.hero__gulls { position: absolute; right: clamp(110px, 34vw, 340px); top: 12px; color: rgba(21, 50, 74, 0.4); }
@media (min-width: 880px) {
  .hero__sun { right: 9%; top: 56px; }
  .hero__gulls { right: calc(9% + 300px); top: 70px; }
  .hero:has(.hero__photo:not([hidden])) .hero__sun { right: 1%; top: 18px; }
  .hero:has(.hero__photo:not([hidden])) .hero__gulls { right: calc(4% + 420px); top: 48px; }
}

.hero__inner {
  position: relative;
  display: grid;
  gap: 32px;
  max-width: 1280px;
  margin: 0 auto;
  padding: clamp(44px, 9vw, 112px) var(--gutter) clamp(96px, 14vw, 170px);
}
.hero__inner:has(.hero__photo:not([hidden])) { gap: 20px; }

.hero__when { margin: 0 0 18px; font-size: 1.05rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }

.names { display: flex; flex-direction: column; align-items: flex-start; }
.names__couple {
  font-size: clamp(2.9rem, 12vw, 6.6rem);
  line-height: 1;
  font-variation-settings: 'SOFT' 100, 'opsz' 144;
  font-weight: 350;
}
.names__and { font-family: var(--script); font-size: 1.05em; color: var(--brass); padding: 0 0.04em; }
.names__script {
  margin: -0.08em 0 0 0.25em;
  font: 400 clamp(3.4rem, 15vw, 8rem)/1.1 var(--script);
  color: var(--leaf);
}

.hero__lead { margin: 22px 0 0; font-size: 1.2rem; max-width: 34ch; }

.hero__photo {
  /* framed like a beach-hut snapshot */
  position: relative;
  justify-self: center;
  width: min(54%, 220px);
  aspect-ratio: 3 / 4;
  border: 8px solid #fff;
  border-bottom-width: 26px;
  border-radius: 4px;
  box-shadow: var(--shadow), 0 18px 40px -18px rgba(21, 50, 74, 0.45);
  background-color: var(--sky-low);
  background-size: cover;
  background-position: center 35%;
  transform: rotate(2deg);
}

.hero__waves { position: absolute; left: 0; right: 0; bottom: -1px; width: 100%; height: clamp(70px, 10vw, 120px); }
.wave--back { fill: var(--sea-1); }
.wave--mid { fill: var(--sea-2); opacity: 0.85; }
.wave--foam { fill: var(--foam); }

@media (min-width: 880px) {
  .hero__inner { grid-template-columns: 1.3fr 1fr; align-items: end; }
  .hero__photo { justify-self: end; width: min(100%, 380px); margin-right: 4%; border-width: 10px 10px 34px; }
  .names__couple { white-space: nowrap; font-size: clamp(3.5rem, 6.2vw, 6.6rem); }
  .hero__inner:has(.hero__photo[hidden]) { grid-template-columns: 1fr; }
}

/* ---------- Layout ---------- */

main { max-width: 1280px; margin: 0 auto; padding: 0 var(--gutter) 64px; }

.panel {
  position: relative;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
  padding: clamp(22px, 4vw, 44px);
  max-width: 640px;
  margin: 0 0 64px;
}
.panel::before {
  /* a little shell-pink band along the top edge */
  content: '';
  position: absolute;
  left: 28px;
  right: 28px;
  top: -1px;
  height: 4px;
  border-radius: 0 0 4px 4px;
  background: linear-gradient(90deg, var(--sea-2), var(--brass));
  opacity: 0.8;
}

.panel h2 { font-size: clamp(1.7rem, 5vw, 2.3rem); line-height: 1.15; margin-bottom: 14px; }

.big { font-size: 1.3rem; font-weight: 700; }
.notice { color: var(--muted); }

/* ---------- Form bits ---------- */

.field { display: block; margin: 22px 0; }
.field > span { display: block; margin-bottom: 8px; font-weight: 700; }

.field input {
  width: 100%;
  min-height: 60px;
  padding: 0 18px;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.3rem var(--body);
}

.field input:focus { border-color: var(--leaf); outline: none; box-shadow: 0 0 0 3px rgba(29, 107, 116, 0.3); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 56px;
  padding: 0 30px;
  border: 2px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font: 700 1.1rem var(--body);
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.btn--primary { background: var(--leaf); color: #fff; box-shadow: 0 10px 22px -12px rgba(21, 79, 86, 0.8); }
.btn--primary:hover { background: var(--leaf-dark); }
.btn--primary:active { transform: translateY(1px); }
.btn--quiet { border-color: var(--line); background: transparent; }
.btn--quiet:hover { border-color: var(--ink); }
.btn--xl { display: flex; width: 100%; min-height: 80px; font-size: 1.5rem; }
.btn--small { min-height: 44px; padding: 0 22px; font-size: 1rem; background: #fff; color: var(--ink); }
.panel .btn + .btn { margin-top: 14px; }
.panel .btn--quiet { width: 100%; }

.msg { color: var(--muted); }
.msg--error { color: var(--bad); font-weight: 700; margin-top: 16px; }

/* ---------- Upload progress ---------- */

.bar { height: 16px; border-radius: 999px; background: var(--line); overflow: hidden; margin: 18px 0 22px; }
.bar__fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--sea-2), var(--leaf)); border-radius: 999px; transition: width 0.3s ease; }

.tick { color: var(--ok); margin-bottom: 8px; }
.tick__path { stroke-dasharray: 40; stroke-dashoffset: 40; animation: draw 0.6s 0.1s ease forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }

.failbox { border: 2px solid var(--bad); border-radius: 16px; padding: 18px; margin: 18px 0 24px; }
.failbox p { color: var(--bad); font-weight: 700; margin-bottom: 14px; }

/* ---------- Gallery ---------- */

.gallery__head { display: flex; flex-wrap: wrap; gap: 18px 32px; align-items: end; justify-content: space-between; margin-bottom: 26px; }
.gallery__head h2 { font-size: clamp(1.8rem, 5vw, 2.6rem); line-height: 1.1; }
.gallery__head h2::after {
  content: '';
  display: block;
  width: 120px;
  height: 12px;
  margin-top: 10px;
  background: no-repeat left center / 120px 12px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 12'%3E%3Cpath d='M2 6q7.5-6 15 0t15 0 15 0 15 0 15 0 15 0 15 0 15 0' fill='none' stroke='%235fb0b7' stroke-width='2.5' stroke-linecap='round'/%3E%3C/svg%3E");
}
.gallery__count { margin: 8px 0 0; color: var(--muted); }

.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  min-height: 48px;
  padding: 0 20px;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font: 700 1rem var(--body);
  cursor: pointer;
}
.chip[aria-pressed='true'] { background: var(--ink); border-color: var(--ink); color: #fff; }

.grid { columns: 2 150px; column-gap: 10px; }
@media (min-width: 640px) { .grid { columns: 3 200px; column-gap: 14px; } }
@media (min-width: 1100px) { .grid { columns: 4 240px; } }

.tile {
  position: relative;
  display: block;
  width: 100%;
  margin: 0 0 10px;
  padding: 0;
  border: 0;
  border-radius: 12px;
  box-shadow: 0 6px 16px -10px rgba(21, 50, 74, 0.45);
  overflow: hidden;
  background: var(--line);
  break-inside: avoid;
  cursor: zoom-in;
}
@media (min-width: 640px) { .tile { margin-bottom: 14px; } }
.tile img { display: block; width: 100%; height: 100%; object-fit: cover; }
.tile:hover img { filter: brightness(0.94); }
.tile__play {
  position: absolute;
  right: 10px;
  bottom: 10px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(21, 50, 74, 0.72);
  color: #fff;
}

.footer { padding: 8px var(--gutter) 56px; max-width: 1280px; margin: 0 auto; color: var(--muted); text-align: center; }
.footer p { margin-left: auto; margin-right: auto; }
.footer__love { font: 400 clamp(2rem, 7vw, 2.8rem)/1.2 var(--script); color: var(--leaf); }
.footer__love:empty { display: none; }

/* ---------- Full-screen viewer ---------- */

.lb {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-rows: 1fr auto;
  background: rgba(10, 24, 36, 0.97);
  color: #fff;
}
.lb[hidden] { display: none; }
.lb__stage { grid-column: 2; grid-row: 1; display: grid; place-items: center; min-height: 0; padding: 12px 0; }
.lb__stage img, .lb__stage video { max-width: 100%; max-height: 100%; object-fit: contain; }
.lb__close, .lb__nav {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  cursor: pointer;
}
.lb__close { position: absolute; top: max(12px, env(safe-area-inset-top)); right: 12px; z-index: 2; }
.lb__nav { align-self: center; margin: 0 8px; }
.lb__prev { grid-column: 1; grid-row: 1; }
.lb__next { grid-column: 3; grid-row: 1; }
.lb__nav[disabled] { opacity: 0.25; cursor: default; }
.lb__bar {
  grid-column: 1 / -1;
  grid-row: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 18px max(16px, env(safe-area-inset-bottom));
}
.lb__by { color: #cfd8d3; }
.lb :focus-visible { outline-color: #fff; }

@media (max-width: 600px) {
  .lb { grid-template-columns: 1fr; }
  .lb__stage { grid-column: 1; padding: 64px 0 8px; }
  .lb__nav { position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 48px; margin: 0; background: rgba(0, 0, 0, 0.45); }
  .lb__prev { left: 6px; }
  .lb__next { right: 6px; }
}

/* ---------- Admin ---------- */

.admin-bar { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: center; margin: 0 0 24px; }
.admin-bar .spacer { flex: 1; }
.admin-bar select { min-height: 48px; padding: 0 14px; border: 2px solid var(--line); border-radius: 12px; background: #fff; font: 400 1rem var(--body); }
.btn--danger { background: var(--bad); color: #fff; }
.btn[disabled] { opacity: 0.45; cursor: default; }

.tile .pick {
  position: absolute;
  left: 8px;
  top: 8px;
  width: 30px;
  height: 30px;
  margin: 0;
  accent-color: var(--leaf);
  cursor: pointer;
}
.tile--selected { outline: 4px solid var(--leaf); outline-offset: -4px; }
.tile__by {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 18px 8px 6px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.65));
  color: #fff;
  font-size: 0.85rem;
  text-align: left;
  pointer-events: none;
}

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.admin-title { font-size: clamp(2.4rem, 8vw, 4rem); line-height: 1.05; }
.hero--small .hero__inner { padding-top: clamp(32px, 6vw, 64px); padding-bottom: clamp(80px, 10vw, 120px); }
.tile--pick { cursor: pointer; }
.tile--pick:has(.pick:focus-visible) { outline: 3px solid var(--ink); outline-offset: 2px; }
.tile__open {
  position: absolute;
  right: 8px;
  top: 8px;
  min-height: 36px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
}
.tile__open:focus-visible { outline: 3px solid var(--ink); }
