:root {
  --paper: #f6efe4;
  --paper-deep: #eadcc9;
  --ink: #213128;
  --ink-soft: #4b5e53;
  --accent: #a73d2a;
  --accent-soft: rgba(167, 61, 42, 0.12);
  --gold: #d7a34d;
  --gold-soft: rgba(215, 163, 77, 0.18);
  --white: #fffdf8;
  --shadow: 0 24px 50px rgba(54, 37, 22, 0.13);
  --shadow-soft: 0 14px 30px rgba(54, 37, 22, 0.08);
  --line: rgba(33, 49, 40, 0.1);
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Nunito Sans", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(215, 163, 77, 0.14), transparent 24%),
    linear-gradient(180deg, #fbf7f1 0%, var(--paper) 42%, #efe2cf 100%);
  color: var(--ink);
  line-height: 1.6;
}

img,
video {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.brand,
h1,
h2,
h3,
h4 {
  font-family: "Fraunces", serif;
}

.page,
.editor-page {
  min-height: 100vh;
}

.shell {
  width: min(1180px, calc(100vw - 2.5rem));
  margin: 0 auto;
}

.header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  backdrop-filter: blur(18px);
  background: rgba(246, 239, 228, 0.82);
  border-bottom: 1px solid var(--line);
}

.brand {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-decoration: none;
}

.nav {
  display: flex;
  gap: 0.9rem;
  flex-wrap: wrap;
  align-items: center;
}

.nav a {
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
}

.nav a:hover,
.nav a:focus-visible {
  color: var(--accent);
}

.nav-action {
  padding: 0.65rem 0.95rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--white);
  box-shadow: var(--shadow-soft);
}

.hero {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 2rem;
  align-items: center;
  padding: 3.5rem 0 2rem;
}

.note,
.polaroid,
.video-card,
.footer-note,
.album-card,
.editor-card,
.editor-item,
.stat-card,
.helper-card,
.lightbox-sheet {
  background: rgba(255, 251, 245, 0.94);
  border: 1px solid var(--line);
  border-radius: 1.5rem;
  box-shadow: var(--shadow);
}

.note,
.editor-card,
.helper-card {
  padding: 2rem;
}

.photo-frame {
  background: var(--white);
  padding: 14px;
  border-radius: 1.8rem;
  box-shadow: var(--shadow);
}

.photo-frame img {
  width: 100%;
  border-radius: 1.2rem;
}

.eyebrow {
  margin: 0 0 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-weight: 800;
  font-size: 0.74rem;
  color: var(--accent);
}

h1,
h2,
h3,
h4 {
  line-height: 1.05;
  margin: 0 0 1rem;
}

h1 {
  font-size: clamp(2.8rem, 6vw, 5.2rem);
  max-width: 10ch;
}

h2 {
  font-size: clamp(2rem, 4vw, 3.2rem);
  max-width: 14ch;
}

h3 {
  font-size: 1.55rem;
}

h4 {
  font-size: 1.18rem;
}

.lead,
.section-copy p,
.footer-note p,
figcaption,
.video-card p,
.album-card p,
.editor-card p,
.helper-card p,
.stat-card p,
.editor-item p,
.editor-list-empty,
.small-note,
.status-text {
  font-size: 1.02rem;
  color: var(--ink-soft);
}

.tags,
.album-meta,
.helper-pill-row,
.quick-links,
.editor-summary-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.tags span,
.album-meta span,
.helper-pill,
.quick-link {
  padding: 0.65rem 0.95rem;
  border-radius: 999px;
  background: var(--accent-soft);
  font-weight: 800;
}

.hero-actions,
.editor-actions,
.item-actions,
.file-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1.4rem;
}

.action,
.secondary-action,
.ghost-action,
.delete-action,
.download-action {
  border: 0;
  border-radius: 999px;
  padding: 0.8rem 1.15rem;
  font-weight: 800;
  text-decoration: none;
}

.action,
.download-action {
  background: var(--accent);
  color: var(--white);
}

.secondary-action {
  background: var(--gold-soft);
  color: var(--ink);
}

.ghost-action {
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink);
  border: 1px solid var(--line);
}

.delete-action {
  background: rgba(167, 61, 42, 0.14);
  color: var(--accent);
}

.section {
  padding: 2rem 0 0.5rem;
}

.section-header,
.heading {
  padding: 0.7rem 0 1.4rem 1.4rem;
  border-left: 6px solid rgba(167, 61, 42, 0.5);
}

.album-overview {
  padding: 0.7rem 0 2.2rem;
}

.album-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.album-card {
  padding: 1.3rem;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.album-card:hover,
.album-card:focus-visible {
  transform: translateY(-4px);
  box-shadow: 0 26px 52px rgba(54, 37, 22, 0.16);
}

.album-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
  background: var(--gold-soft);
  font-weight: 800;
}

.split {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 1.5rem;
  align-items: start;
}

.split.reverse {
  grid-template-columns: 1.1fr 0.9fr;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.together-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.2rem;
}

.polaroid {
  padding: 0.75rem;
  margin: 0;
}

.polaroid button {
  width: 100%;
  border: 0;
  background: transparent;
  padding: 0;
}

.polaroid img,
.polaroid video {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 0.9rem;
}

.polaroid figcaption {
  padding: 0.65rem 0.2rem 0.1rem;
  font-size: 0.92rem;
}

.wide {
  grid-column: span 2;
}

.wide img,
.wide video {
  aspect-ratio: 16 / 10;
}

.achievement img {
  border-radius: 1.35rem;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  box-shadow: var(--shadow);
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}

.video-card {
  padding: 0.9rem;
}

.video-card video {
  width: 100%;
  border-radius: 1rem;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: #000;
}

.footer {
  padding: 2rem 0 4rem;
}

.footer-note {
  padding: 1.2rem 1.35rem;
}

.loading,
.error-state {
  min-height: 100vh;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--ink-soft);
}

.loading-card,
.error-card {
  max-width: 42rem;
  padding: 2rem;
}

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(20, 17, 12, 0.72);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  z-index: 30;
}

.lightbox.open {
  display: flex;
}

.lightbox-sheet {
  width: min(960px, 100%);
  padding: 1rem;
}

.lightbox-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}

.lightbox-body {
  display: grid;
  gap: 1rem;
}

.lightbox-media {
  width: 100%;
  max-height: 72vh;
  object-fit: contain;
  border-radius: 1rem;
  background: rgba(33, 49, 40, 0.06);
}

.icon-button {
  border: 0;
  border-radius: 999px;
  width: 2.5rem;
  height: 2.5rem;
  background: rgba(33, 49, 40, 0.08);
  font-size: 1.35rem;
}

.editor-layout {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 1.5rem;
  padding: 2.25rem 0 3rem;
}

.editor-stack {
  display: grid;
  gap: 1.5rem;
}

.stat-grid,
.editor-section-grid,
.editor-item-grid {
  display: grid;
  gap: 1rem;
}

.stat-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stat-card {
  padding: 1rem 1.1rem;
}

.stat-card strong {
  display: block;
  font-size: 1.8rem;
}

.editor-section-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.editor-label {
  display: grid;
  gap: 0.45rem;
  font-weight: 700;
  color: var(--ink);
}

.editor-input,
.editor-textarea,
.editor-select {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.88);
  border-radius: 1rem;
  padding: 0.85rem 1rem;
  color: var(--ink);
}

.editor-textarea {
  min-height: 7rem;
  resize: vertical;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.8rem 0.95rem;
  border-radius: 1rem;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.7);
}

.file-input {
  display: block;
  width: 100%;
}

.preview-card {
  display: grid;
  gap: 0.85rem;
  padding: 1rem;
  border-radius: 1.2rem;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
}

.preview-media {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 1rem;
  background: rgba(33, 49, 40, 0.06);
}

.editor-list {
  display: grid;
  gap: 1rem;
}

.editor-item {
  padding: 1rem 1.05rem;
}

.editor-item-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}

.editor-item-grid {
  grid-template-columns: 110px 1fr;
  align-items: start;
}

.editor-thumb {
  width: 110px;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 0.9rem;
  background: rgba(33, 49, 40, 0.08);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.38rem 0.7rem;
  border-radius: 999px;
  background: var(--gold-soft);
  font-size: 0.9rem;
  font-weight: 800;
}

.small-note {
  margin: 0;
}

code.inline-code {
  padding: 0.16rem 0.38rem;
  border-radius: 0.45rem;
  background: rgba(33, 49, 40, 0.08);
  font-size: 0.92em;
}

@media (max-width: 1080px) {
  .album-grid,
  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .editor-layout,
  .hero,
  .split,
  .split.reverse,
  .together-grid,
  .video-grid {
    grid-template-columns: 1fr;
  }

  .wide {
    grid-column: span 1;
  }
}

@media (max-width: 720px) {
  .shell {
    width: min(100vw - 1.2rem, 1180px);
  }

  .header {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.7rem;
  }

  .grid,
  .album-grid,
  .editor-section-grid,
  .stat-grid,
  .editor-item-grid {
    grid-template-columns: 1fr;
  }

  .note,
  .photo-frame,
  .video-card,
  .footer-note,
  .editor-card,
  .helper-card {
    padding: 1rem;
  }

  .editor-thumb {
    width: 100%;
    aspect-ratio: 16 / 10;
  }
}
