:root {
  color-scheme: light;
  --wine: #5b1836;
  --wine-dark: #3c0d24;
  --rose: #b85b75;
  --rose-soft: #efd0d7;
  --blush: #f9eceb;
  --cream: #fffaf3;
  --paper: #fffdf9;
  --gold: #b98b45;
  --ink: #321e27;
  --muted: #74636a;
  --line: rgba(91, 24, 54, 0.14);
  --success: #286245;
  --danger: #a42d42;
  --shadow: 0 18px 55px rgba(74, 26, 45, 0.12);
  --radius-large: 28px;
  --radius-medium: 18px;
}

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

html {
  min-width: 320px;
  background: var(--cream);
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  color: var(--ink);
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  background:
    radial-gradient(circle at 0 4%, rgba(239, 208, 215, 0.8), transparent 32rem),
    radial-gradient(circle at 100% 24%, rgba(236, 213, 171, 0.42), transparent 27rem),
    linear-gradient(180deg, #fff9f3 0%, #fffdf9 50%, #faeeee 100%);
}

body::before,
body::after {
  position: fixed;
  z-index: -1;
  width: 16rem;
  height: 16rem;
  border: 1px solid rgba(184, 91, 117, 0.12);
  border-radius: 48% 52% 61% 39%;
  content: "";
  pointer-events: none;
  transform: rotate(35deg);
}

body::before {
  top: -9rem;
  right: -8rem;
}

body::after {
  bottom: -10rem;
  left: -8rem;
}

button,
input,
textarea {
  font: inherit;
}

button,
label[for] {
  -webkit-tap-highlight-color: transparent;
}

button {
  border: 0;
}

button:not(:disabled),
label[for] {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

[hidden] {
  display: none !important;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.75rem 1rem;
  color: #fff;
  background: var(--wine-dark);
  border-radius: 0.5rem;
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

:focus-visible {
  outline: 3px solid #1678d2;
  outline-offset: 3px;
}

.page-shell {
  width: min(100%, 48rem);
  min-height: 100svh;
  padding: max(1rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) max(2rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
  margin: 0 auto;
}

.masthead {
  display: grid;
  grid-template-columns: minmax(1rem, 1fr) auto minmax(1rem, 1fr);
  gap: 0.85rem;
  align-items: center;
  padding: 0.5rem 0 1.25rem;
}

.masthead-line {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(185, 139, 69, 0.7));
}

.masthead-line:last-child {
  background: linear-gradient(90deg, rgba(185, 139, 69, 0.7), transparent);
}

.wordmark {
  display: flex;
  gap: 0.38rem;
  align-items: baseline;
  color: var(--wine);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.2rem, 5vw, 1.65rem);
  text-decoration: none;
}

.wordmark-ampersand {
  color: var(--gold);
  font-size: 0.82em;
  font-style: italic;
}

.hero {
  padding: 1.2rem 0 1.8rem;
  text-align: center;
}

.eyebrow,
.step-label {
  margin: 0 0 0.35rem;
  color: var(--rose);
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hero h1,
.section-heading h2,
.success-card h2 {
  margin: 0;
  color: var(--wine-dark);
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
  line-height: 1.08;
}

.hero h1 {
  font-size: clamp(2.65rem, 12vw, 4.75rem);
  letter-spacing: -0.035em;
}

.hero-copy {
  max-width: 34rem;
  margin: 1rem auto 0;
  color: var(--muted);
  font-size: 1rem;
}

.privacy-note {
  display: inline-flex;
  gap: 0.45rem;
  align-items: center;
  margin-top: 1rem;
  color: var(--success);
  font-size: 0.78rem;
  font-weight: 650;
}

.privacy-note svg {
  width: 1rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.camera-card,
.preview-card,
.details-card,
.success-card,
.notice {
  padding: 1rem;
  margin-bottom: 1rem;
  background: rgba(255, 253, 249, 0.94);
  border: 1px solid var(--line);
  border-radius: var(--radius-large);
  box-shadow: var(--shadow);
}

.section-heading {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.2rem 0.2rem 0.9rem;
}

.section-heading h2,
.success-card h2 {
  font-size: clamp(1.5rem, 7vw, 2rem);
}

.media-kind {
  padding: 0.28rem 0.58rem;
  color: var(--wine);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--blush);
  border-radius: 99px;
}

.camera-stage {
  position: relative;
  display: grid;
  min-height: min(108vw, 31rem);
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(circle at 50% 40%, rgba(255, 255, 255, 0.13), transparent 40%),
    linear-gradient(145deg, #71324c, #351021);
  border-radius: calc(var(--radius-large) - 8px);
  isolation: isolate;
}

.camera-stage::after {
  position: absolute;
  inset: 0;
  z-index: 2;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: inherit;
  content: "";
  pointer-events: none;
}

#camera-view {
  width: 100%;
  height: 100%;
  min-height: inherit;
  object-fit: cover;
}

#camera-view.is-mirrored {
  transform: scaleX(-1);
}

.camera-placeholder {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  align-items: center;
  justify-content: center;
  min-height: inherit;
  padding: 2rem;
  text-align: center;
}

.camera-placeholder p {
  margin: 0;
  color: rgba(255, 255, 255, 0.84);
}

.camera-icon {
  display: grid;
  width: 5.25rem;
  height: 5.25rem;
  place-items: center;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
}

.camera-icon svg {
  width: 2.65rem;
  fill: none;
  stroke: #fff;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
}

.button {
  display: inline-flex;
  min-height: 3.25rem;
  gap: 0.65rem;
  align-items: center;
  justify-content: center;
  padding: 0.8rem 1.15rem;
  font-weight: 760;
  line-height: 1.2;
  border-radius: 999px;
  transition: transform 150ms ease, box-shadow 150ms ease, background-color 150ms ease;
}

.button:not(:disabled):active,
.capture-choice:not(:disabled):active,
.icon-button:not(:disabled):active {
  transform: scale(0.97);
}

.button svg {
  width: 1.3rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.button-light {
  color: var(--wine-dark);
  background: #fff;
  box-shadow: 0 8px 24px rgba(31, 7, 17, 0.22);
}

.button-primary {
  width: 100%;
  color: #fff;
  background: linear-gradient(135deg, #6a1d40, #4b102c);
  box-shadow: 0 10px 25px rgba(91, 24, 54, 0.24);
}

.button-secondary {
  color: var(--wine);
  background: var(--blush);
  border: 1px solid rgba(91, 24, 54, 0.15);
}

.button-stop {
  grid-column: 1 / -1;
  color: #fff;
  background: var(--danger);
}

.stop-square {
  width: 0.9rem;
  height: 0.9rem;
  background: currentColor;
  border-radius: 2px;
}

.recording-badge {
  position: absolute;
  z-index: 3;
  top: 0.8rem;
  left: 0.8rem;
  display: flex;
  gap: 0.45rem;
  align-items: center;
  padding: 0.45rem 0.65rem;
  color: #fff;
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  font-weight: 750;
  background: rgba(35, 9, 20, 0.76);
  border-radius: 99px;
  backdrop-filter: blur(7px);
}

.recording-dot {
  width: 0.65rem;
  height: 0.65rem;
  background: #ff4a5f;
  border-radius: 50%;
  animation: pulse 1.2s infinite;
}

@keyframes pulse {
  50% { opacity: 0.42; }
}

.icon-button {
  display: grid;
  width: 2.8rem;
  height: 2.8rem;
  place-items: center;
  color: #fff;
  background: rgba(35, 9, 20, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  backdrop-filter: blur(7px);
}

.icon-button svg {
  width: 1.35rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.flip-button {
  position: absolute;
  z-index: 3;
  top: 0.75rem;
  right: 0.75rem;
}

.camera-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  padding-top: 0.75rem;
}

.capture-choice {
  display: flex;
  min-height: 4.7rem;
  gap: 0.7rem;
  align-items: center;
  padding: 0.7rem;
  color: var(--ink);
  text-align: left;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-medium);
  transition: transform 150ms ease, border-color 150ms ease, background-color 150ms ease;
}

.capture-choice strong,
.capture-choice small {
  display: block;
}

.capture-choice strong {
  font-size: 0.85rem;
  line-height: 1.2;
}

.capture-choice small {
  margin-top: 0.18rem;
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.25;
}

.capture-icon {
  position: relative;
  flex: 0 0 auto;
  width: 2.35rem;
  height: 2.35rem;
  background: var(--blush);
  border: 1px solid rgba(91, 24, 54, 0.12);
  border-radius: 50%;
}

.photo-icon::before {
  position: absolute;
  inset: 0.6rem;
  border: 2px solid var(--wine);
  border-radius: 50%;
  content: "";
}

.video-icon::before {
  position: absolute;
  inset: 0.65rem;
  background: var(--rose);
  border-radius: 50%;
  content: "";
}

.picker-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
  justify-content: center;
  padding: 0.95rem 0.25rem 0.15rem;
  color: var(--muted);
  font-size: 0.78rem;
}

.file-picker {
  display: inline-flex;
  min-height: 2.75rem;
  gap: 0.45rem;
  align-items: center;
  padding: 0.5rem 0.75rem;
  color: var(--wine);
  font-weight: 750;
  background: transparent;
  border-radius: 99px;
}

.file-picker:hover {
  background: var(--blush);
}

.file-picker svg {
  width: 1.15rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.camera-status,
.upload-footnote,
.upload-panel p {
  margin: 0.6rem 0 0;
  color: var(--muted);
  font-size: 0.76rem;
  text-align: center;
}

.camera-status.is-error {
  color: var(--danger);
  font-weight: 650;
}

.media-preview {
  overflow: hidden;
  background: #24131b;
  border-radius: var(--radius-medium);
}

.media-preview img,
.media-preview video {
  display: block;
  width: 100%;
  max-height: 34rem;
  object-fit: contain;
}

.text-button {
  min-height: 2.75rem;
  padding: 0.45rem 0.6rem;
  color: var(--wine);
  font-weight: 750;
  text-decoration: underline;
  text-decoration-color: rgba(91, 24, 54, 0.25);
  text-underline-offset: 0.2em;
  background: transparent;
}

.field {
  margin-bottom: 1rem;
}

.field label {
  display: block;
  margin: 0 0 0.4rem 0.15rem;
  color: var(--wine-dark);
  font-size: 0.83rem;
  font-weight: 750;
}

.field label span {
  color: var(--muted);
  font-weight: 500;
}

.field input,
.field textarea {
  width: 100%;
  padding: 0.88rem 0.95rem;
  color: var(--ink);
  background: #fff;
  border: 1px solid rgba(91, 24, 54, 0.18);
  border-radius: 14px;
  appearance: none;
}

.field input {
  min-height: 3.2rem;
}

.field textarea {
  min-height: 6.5rem;
  resize: vertical;
}

.field input::placeholder,
.field textarea::placeholder {
  color: #9a8990;
}

.field input:focus,
.field textarea:focus {
  border-color: var(--rose);
  box-shadow: 0 0 0 4px rgba(184, 91, 117, 0.12);
}

.field-meta {
  margin: 0.25rem 0.3rem 0;
  color: var(--muted);
  font-size: 0.68rem;
  text-align: right;
}

.upload-panel {
  padding: 1rem;
  background: var(--blush);
  border-radius: var(--radius-medium);
}

.upload-panel-heading {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  color: var(--wine-dark);
  font-size: 0.86rem;
}

.upload-panel-heading span {
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}

.upload-panel progress {
  width: 100%;
  height: 0.62rem;
  margin-top: 0.8rem;
  overflow: hidden;
  color: var(--wine);
  background: rgba(91, 24, 54, 0.12);
  border: 0;
  border-radius: 99px;
  appearance: none;
}

.upload-panel progress::-webkit-progress-bar {
  background: rgba(91, 24, 54, 0.12);
  border-radius: 99px;
}

.upload-panel progress::-webkit-progress-value {
  background: linear-gradient(90deg, var(--rose), var(--wine));
  border-radius: 99px;
}

.upload-panel progress::-moz-progress-bar {
  background: linear-gradient(90deg, var(--rose), var(--wine));
  border-radius: 99px;
}

.upload-panel .text-button {
  display: block;
  margin: 0.35rem auto 0;
}

.error-panel {
  text-align: center;
  background: #fff0f0;
  border: 1px solid rgba(164, 45, 66, 0.18);
}

.error-panel strong {
  color: var(--danger);
}

.error-panel .button {
  margin-top: 0.8rem;
}

.success-card {
  padding: 2rem 1.4rem;
  text-align: center;
  background:
    radial-gradient(circle at 50% 0, rgba(239, 208, 215, 0.7), transparent 18rem),
    rgba(255, 253, 249, 0.97);
}

.success-card > p:not(.eyebrow) {
  max-width: 27rem;
  margin: 0.8rem auto 1.25rem;
  color: var(--muted);
}

.success-heart {
  display: grid;
  width: 5.25rem;
  height: 5.25rem;
  margin: 0 auto 1rem;
  place-items: center;
  color: var(--rose);
  background: var(--blush);
  border-radius: 50%;
}

.success-heart svg {
  width: 3.25rem;
  fill: rgba(184, 91, 117, 0.15);
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.notice {
  display: grid;
  gap: 0.2rem;
  font-size: 0.9rem;
}

.notice-error {
  color: #792136;
  background: #fff0f0;
  border-color: rgba(164, 45, 66, 0.22);
}

footer {
  display: flex;
  gap: 0.65rem;
  align-items: center;
  justify-content: center;
  padding: 1.6rem 0 0.6rem;
  color: rgba(91, 24, 54, 0.62);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.82rem;
}

footer p {
  margin: 0;
}

footer span {
  color: var(--rose);
  font-size: 0.68rem;
}

@media (min-width: 38rem) {
  .page-shell {
    padding-right: 1.5rem;
    padding-left: 1.5rem;
  }

  .camera-card,
  .preview-card,
  .details-card,
  .success-card,
  .notice {
    padding: 1.35rem;
  }

  .camera-stage {
    min-height: 31rem;
  }

  .capture-choice {
    padding: 0.85rem 1rem;
  }

  .capture-choice strong {
    font-size: 0.94rem;
  }

  .capture-choice small {
    font-size: 0.74rem;
  }
}

@media (hover: hover) {
  .button:not(:disabled):hover {
    transform: translateY(-1px);
  }

  .capture-choice:not(:disabled):hover {
    background: var(--blush);
    border-color: rgba(91, 24, 54, 0.28);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (prefers-contrast: more) {
  :root {
    --line: rgba(91, 24, 54, 0.42);
    --muted: #55464c;
  }

  .camera-card,
  .preview-card,
  .details-card,
  .success-card,
  .notice {
    border-width: 2px;
  }
}
