@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Playfair+Display:ital,wght@0,500;0,600;1,500;1,600&display=swap");

:root {
  color-scheme: light;
  --paper: #f6f2ec;
  --ink: #292a25;
  --muted: #77766d;
  --line: #e4ded4;
  --olive: #65704f;
  --olive-dark: #4c573c;
  --rose: #d7a698;
  --white: #fffefa;
  font-family: "DM Sans", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(ellipse at 87% 1%, rgba(231, 211, 191, .24), transparent 30rem),
    var(--paper);
  color: var(--ink);
}

button, input, select { font: inherit; }
button, label { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
.hidden { display: none !important; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app-shell {
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto;
  padding: 28px 0 24px;
}

.topbar, .wordmark, .album-heading, .auth-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.wordmark { justify-content: flex-start; gap: 12px; text-decoration: none; color: inherit; }
.wordmark-mark {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 25px;
  letter-spacing: -.08em;
}
.wordmark-mark span { color: var(--rose); padding: 0 3px; }
.wordmark-copy, .footer {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.text-button {
  border: 0;
  padding: 10px 0 10px 12px;
  background: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
}

.welcome {
  display: grid;
  grid-template-columns: 1fr 320px;
  align-items: center;
  min-height: 300px;
  margin: 35px 0 30px;
}
.welcome-copy { position: relative; z-index: 1; }
.eyebrow {
  margin: 0 0 13px;
  color: var(--olive);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .17em;
}
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { font-family: "Playfair Display", Georgia, serif; font-weight: 500; }
h1 {
  margin-bottom: 15px;
  font-size: clamp(42px, 6vw, 68px);
  letter-spacing: -.045em;
  line-height: 1.06;
}
h1 em { color: var(--olive); font-weight: 500; }
.welcome-description {
  max-width: 390px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.8;
}
.welcome-art {
  position: relative;
  display: grid;
  width: 260px;
  height: 240px;
  margin: auto;
  place-items: center;
  border-radius: 48% 52% 43% 57% / 49% 42% 58% 51%;
  background: #e9e3d8;
  transform: rotate(4deg);
}
.sun {
  position: absolute;
  top: 34px;
  right: 41px;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #dcbba6;
}
.art-caption {
  margin-top: 35px;
  color: #77766d;
  font-family: "Playfair Display", Georgia, serif;
  font-size: 22px;
  font-style: italic;
  line-height: 1.35;
  text-align: center;
  transform: rotate(-4deg);
}
.art-sparkle { position: absolute; bottom: 34px; left: 44px; color: var(--olive); font-size: 23px; }

.auth-card, .setup-notice {
  width: min(470px, 100%);
  margin: 4px auto 68px;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 254, 250, .72);
}
.auth-heading { justify-content: flex-start; gap: 14px; margin-bottom: 25px; }
.auth-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 50%;
  background: #efe8dc;
  color: var(--olive);
  font-size: 22px;
}
.auth-heading .eyebrow { margin-bottom: 5px; }
.auth-heading h2 { margin: 0; font-size: 23px; }
.auth-card form { display: grid; gap: 9px; }
.auth-card label, .upload-tools label {
  color: #54554e;
  font-size: 12px;
  font-weight: 600;
}
.auth-card input, .intimate-gate input, .upload-tools input, .upload-tools select {
  width: 100%;
  min-height: 46px;
  margin: 0 0 8px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 4px;
  outline: none;
  background: var(--white);
  color: var(--ink);
  font-size: 14px;
}
input:focus, select:focus { border-color: var(--olive); box-shadow: 0 0 0 3px rgba(101, 112, 79, .12); }
.primary-button, .secondary-button, .upload-button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 16px;
  border: 0;
  border-radius: 4px;
  background: var(--olive);
  color: #fff;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: background .18s ease, transform .18s ease;
}
.primary-button { margin-top: 7px; }
.primary-button:hover, .upload-button:hover { background: var(--olive-dark); }
.primary-button:active, .upload-button:active { transform: translateY(1px); }
.primary-button:disabled { cursor: wait; opacity: .7; }
.auth-footnote { margin: 18px 0 0; color: var(--muted); font-size: 11px; line-height: 1.7; }
.form-message { min-height: 16px; margin: 5px 0 0; color: #9a5147; font-size: 12px; line-height: 1.5; }
.form-message.success { color: var(--olive-dark); }

.setup-notice {
  display: flex;
  gap: 15px;
  margin-top: 0;
  margin-bottom: 36px;
  border-color: #dfc5a7;
  background: #f9f2e7;
}
.setup-notice h2 { margin-bottom: 5px; font-size: 20px; }
.setup-notice p { margin-bottom: 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.notice-icon { color: var(--olive); font-size: 22px; }

.album { margin: 15px 0 65px; }
.album-heading { align-items: flex-end; gap: 18px; }
.album-heading .eyebrow { margin-bottom: 7px; }
.album-heading h2 { margin: 0; font-size: 34px; letter-spacing: -.025em; }
.upload-button { min-width: 142px; padding: 0 15px; }
.upload-button > span:first-child { font-size: 19px; font-weight: 400; }
.category-nav {
  display: flex;
  gap: 7px;
  margin: 28px 0 24px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  scrollbar-width: none;
}
.category-nav::-webkit-scrollbar { display: none; }
.category-tab {
  position: relative;
  display: inline-flex;
  min-height: 43px;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  padding: 0 14px 12px;
  border: 0;
  background: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
}
.category-tab.active { color: var(--ink); font-weight: 700; }
.category-tab.active::after {
  position: absolute;
  right: 14px;
  bottom: -1px;
  left: 14px;
  height: 2px;
  background: var(--olive);
  content: "";
}
.category-tab > span:not(.lock-indicator) { font-size: 16px; }
.category-tab.active > span:not(.lock-indicator) { color: var(--rose); }
.category-tab > span[id] { color: var(--muted); font-size: 10px; }
.lock-indicator { color: var(--olive); font-size: 14px; }
.upload-tools {
  display: grid;
  grid-template-columns: 1fr 180px;
  gap: 5px 12px;
  margin: -8px 0 20px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 254, 250, .62);
}
.upload-tools label { grid-column: 1 / -1; }
.upload-tools input, .upload-tools select { min-height: 40px; margin: 0; }
.upload-tools .upload-category-label { grid-column: 1 / -1; }
.gallery-status { min-height: 18px; margin: -8px 0 12px; color: var(--muted); font-size: 12px; }
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.photo-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border-radius: 5px;
  background: #e8e1d7;
  aspect-ratio: 1 / 1.05;
}
.photo-card img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.photo-card:hover img { transform: scale(1.025); }
.photo-caption {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  padding: 35px 13px 12px;
  background: linear-gradient(transparent, rgba(28, 29, 25, .6));
  color: white;
  font-size: 12px;
}
.empty-state {
  padding: 52px 15px 58px;
  border: 1px dashed #d5cec2;
  border-radius: 5px;
  text-align: center;
}
.empty-mark { color: var(--rose); font-size: 28px; }
.empty-state h3 { margin: 10px 0 6px; font-size: 24px; }
.empty-state p { margin-bottom: 18px; color: var(--muted); font-size: 13px; }
.secondary-button { min-height: 40px; padding: 0 14px; background: transparent; color: var(--olive-dark); border: 1px solid #bec3b1; cursor: pointer; }
.secondary-button:hover { background: #eef0e8; }
.intimate-gate {
  max-width: 440px;
  margin: 8px auto 30px;
  padding: 31px 25px;
  border: 1px solid #e6d9cd;
  border-radius: 7px;
  background: rgba(255, 254, 250, .68);
  text-align: center;
}
.gate-lock { margin-bottom: 11px; color: var(--rose); font-size: 27px; }
.intimate-gate h3 { margin-bottom: 8px; font-size: 27px; }
.intimate-gate > p:not(.eyebrow):not(.form-message) { margin-bottom: 20px; color: var(--muted); font-size: 13px; }
.intimate-gate form { display: grid; grid-template-columns: 1fr; gap: 4px; }
.intimate-gate input { margin: 0; text-align: center; }
.lock-button {
  display: block;
  margin: 22px auto 0;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
}
.footer {
  display: flex;
  justify-content: space-between;
  padding: 16px 0 4px;
  border-top: 1px solid var(--line);
  font-size: 9px;
}
.footer span:last-child { color: var(--rose); font-size: 14px; }

@media (min-width: 780px) {
  .auth-card { margin-bottom: 76px; }
  .photo-grid { grid-template-columns: repeat(4, 1fr); gap: 17px; }
}
@media (max-width: 620px) {
  .app-shell { width: min(100% - 34px, 470px); padding-top: 21px; }
  .wordmark-copy { font-size: 9px; }
  .welcome { grid-template-columns: 1fr; min-height: auto; margin: 47px 0 31px; }
  .welcome-art { width: 174px; height: 155px; margin: 25px 14px 0 auto; }
  .sun { top: 20px; right: 25px; width: 42px; height: 42px; }
  .art-caption { margin-top: 25px; font-size: 17px; }
  .art-sparkle { bottom: 19px; left: 27px; font-size: 18px; }
  h1 { font-size: 47px; }
  .welcome-description { max-width: 345px; font-size: 13px; }
  .auth-card { margin: 0 auto 54px; padding: 23px 20px; }
  .auth-heading h2 { font-size: 21px; }
  .album { margin-top: 12px; }
  .album-heading { align-items: flex-start; }
  .album-heading h2 { font-size: 28px; }
  .upload-button { min-width: 46px; width: 46px; height: 46px; min-height: 46px; padding: 0; }
  .upload-label { display: none; }
  .category-nav { gap: 1px; margin: 22px -2px 20px; }
  .category-tab { padding-right: 11px; padding-left: 11px; font-size: 11px; }
  .photo-grid { grid-template-columns: repeat(2, 1fr); gap: 9px; }
  .photo-card { aspect-ratio: 1 / 1.12; }
  .upload-tools { grid-template-columns: 1fr; }
  .upload-tools .upload-category-label { grid-column: auto; margin-top: 5px; }
  .footer { margin-top: 15px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
