:root {
  --bg: #fff7ef;
  --bg-accent: #ffd8bf;
  --surface: rgba(255, 255, 255, 0.75);
  --surface-strong: #fffdf9;
  --text: #3f2a22;
  --muted: #7a5b50;
  --line: rgba(105, 72, 58, 0.12);
  --primary: #d65a31;
  --primary-dark: #9f3416;
  --shadow: 0 24px 60px rgba(112, 58, 36, 0.14);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 18px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255, 210, 178, 0.9), transparent 28%),
    radial-gradient(circle at bottom right, rgba(255, 188, 156, 0.7), transparent 22%),
    linear-gradient(135deg, #fff7ef 0%, #ffe9d8 45%, #fffdf9 100%);
}

button,
input,
textarea {
  font: inherit;
}

.page-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 48px;
}

.hero {
  display: grid;
  gap: 24px;
  min-height: 100vh;
  align-content: start;
}

.topbar,
.timeline-section,
.comment-section,
.editor-dialog-content {
  background: var(--surface);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.65);
  box-shadow: var(--shadow);
}

.topbar {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px 22px;
  border-radius: 999px;
}

.brand {
  color: var(--primary-dark);
  text-decoration: none;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
}

.plus-button {
  width: 52px;
  height: 52px;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(180deg, #d65a31, #ab3e1c);
  color: #fff8f2;
  font-size: 2rem;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 16px 34px rgba(171, 62, 28, 0.28);
  transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease;
}

.plus-button:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 20px 40px rgba(171, 62, 28, 0.34);
  filter: saturate(1.05);
}

.eyebrow,
.section-label,
.banner-kicker,
.dialog-chip {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.78rem;
  font-weight: 700;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.05;
}

h1 {
  margin-top: 10px;
  font-size: clamp(2.8rem, 4vw, 4.9rem);
}

.birthday-banner p,
.dialog-subtitle,
.dialog-description {
  line-height: 1.6;
}

.hero-stage {
  position: relative;
  min-height: calc(100vh - 116px);
  border-radius: 38px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.hero-stage-image {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(50, 22, 12, 0.12), rgba(58, 25, 13, 0.58)),
    url("./assets/img/WhatsApp Image 2026-04-01 at 19.37.01.jpeg");
  background-size: cover;
  background-position: center;
  transform: scale(1.02);
}

.birthday-banner {
  position: absolute;
  left: 50%;
  bottom: 44px;
  transform: translateX(-50%);
  z-index: 1;
  width: min(760px, calc(100% - 40px));
  padding: 26px 30px;
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 249, 243, 0.9), rgba(255, 242, 231, 0.82)),
    rgba(255, 255, 255, 0.68);
  backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.72);
  box-shadow: 0 26px 56px rgba(72, 33, 18, 0.2);
  text-align: center;
  display: grid;
  gap: 8px;
}

.birthday-banner h1 {
  margin: 0;
  font-size: clamp(2.8rem, 6vw, 5.4rem);
  color: #7b2815;
  text-shadow: 0 8px 18px rgba(255, 255, 255, 0.35);
}

.birthday-banner .banner-kicker {
  color: rgba(123, 40, 21, 0.88);
}

.birthday-banner .banner-subtitle {
  max-width: 580px;
  margin: 0 auto;
  color: #7a5b50;
}

.section-label,
.dialog-chip {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.78rem;
  font-weight: 700;
}

.dialog-chip {
  color: #1d140f;
}

.layout {
  margin-top: 24px;
}

.timeline-section,
.comment-section,
.editor-dialog-content {
  border-radius: var(--radius-xl);
  padding: 28px;
}

.timeline-section {
  opacity: 0;
  transform: translateY(48px);
  transition: opacity 700ms ease, transform 700ms ease;
}

.timeline-section.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.comment-section {
  margin-top: 24px;
  opacity: 0;
  transform: translateY(48px);
  transition: opacity 700ms ease, transform 700ms ease;
}

.comment-section .section-heading {
  justify-content: center;
  text-align: center;
}

.comment-section.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.comment-copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  color: var(--muted);
  line-height: 1.8;
  font-size: 1rem;
  max-width: 760px;
  margin: 0 auto;
}

.comment-image {
  display: block;
  width: 100%;
  max-width: 760px;
  border-radius: 24px;
  margin-bottom: 18px;
  object-fit: cover;
  box-shadow: 0 18px 42px rgba(112, 58, 36, 0.12);
}

.comment-copy p {
  margin: 0;
}

.section-heading {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 22px;
}

.section-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.steps-grid {
  position: relative;
  display: grid;
  gap: 26px;
  padding: 18px 0 12px;
}

.steps-grid::before {
  content: "";
  position: absolute;
  top: 12px;
  bottom: 12px;
  left: calc(50% - 2px);
  border-left: 4px dashed rgba(214, 90, 49, 0.38);
  pointer-events: none;
}

.steps-grid.is-empty::before {
  display: none;
}

.step-card {
  position: relative;
  width: min(430px, calc(50% - 42px));
  border: 1px solid var(--line);
  background: var(--surface-strong);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 18px 40px rgba(112, 58, 36, 0.08);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.step-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 24px 52px rgba(112, 58, 36, 0.12);
}

.step-card:nth-child(odd) {
  justify-self: start;
}

.step-card:nth-child(even) {
  justify-self: end;
}

.step-card::before {
  content: "";
  position: absolute;
  top: 38px;
  width: 42px;
  border-top: 3px dashed rgba(214, 90, 49, 0.35);
}

.step-card:nth-child(odd)::before {
  right: -42px;
}

.step-card:nth-child(even)::before {
  left: -42px;
}

.step-card::after {
  content: "";
  position: absolute;
  top: 28px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 8px rgba(214, 90, 49, 0.16);
}

.step-card:nth-child(odd)::after {
  right: -51px;
}

.step-card:nth-child(even)::after {
  left: -51px;
}

.step-media {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
}

.step-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.step-index {
  position: absolute;
  top: 14px;
  left: 14px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 248, 242, 0.9);
  color: var(--primary-dark);
  font-weight: 700;
}

.step-body {
  padding: 18px;
}

.step-topline {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.92rem;
}

.step-title {
  margin-top: 10px;
  font-size: 1.45rem;
}

.step-subtitle {
  margin: 8px 0 0;
  color: var(--muted);
  min-height: 48px;
}

.step-meta {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.meta-item {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.96rem;
}

.meta-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  background: rgba(214, 90, 49, 0.12);
  color: var(--primary-dark);
  flex: 0 0 auto;
}

.step-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

.step-actions button,
.primary-button,
.ghost-button {
  border: 0;
  cursor: pointer;
  border-radius: 999px;
  padding: 12px 18px;
  font-weight: 600;
  transition: transform 180ms ease, background-color 180ms ease, color 180ms ease;
}

.primary-button {
  background: var(--primary);
  color: #fffaf6;
}

.ghost-button {
  background: rgba(214, 90, 49, 0.1);
  color: var(--primary-dark);
}

.danger-button {
  background: rgba(160, 35, 35, 0.12);
  color: #8c1f1f;
}

.step-actions button:hover,
.primary-button:hover,
.ghost-button:hover {
  transform: translateY(-1px);
}

.step-form {
  display: grid;
  gap: 14px;
}

.step-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.95rem;
}

.step-form input,
.step-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--text);
}

.step-form textarea {
  resize: vertical;
  min-height: 132px;
}

.image-preview-wrap {
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.72);
}

.image-preview-wrap.is-hidden {
  display: none;
}

.image-preview {
  display: block;
  width: 100%;
  max-height: 220px;
  object-fit: cover;
}

.form-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.step-dialog {
  width: min(760px, calc(100% - 24px));
  max-height: calc(100vh - 24px);
  padding: 0;
  border: 0;
  border-radius: 30px;
  overflow: hidden;
  box-shadow: 0 34px 80px rgba(54, 28, 14, 0.36);
}

.step-dialog[open] {
  display: flex;
  flex-direction: column;
}

.step-dialog::backdrop {
  background: rgba(55, 28, 12, 0.45);
  backdrop-filter: blur(6px);
}

.editor-dialog {
  width: min(620px, calc(100% - 24px));
  max-height: calc(100dvh - 24px);
  padding: 0;
  border: 0;
  border-radius: 30px;
  overflow: hidden;
  box-shadow: 0 34px 80px rgba(54, 28, 14, 0.3);
}

.editor-dialog::backdrop {
  background: rgba(55, 28, 12, 0.45);
  backdrop-filter: blur(6px);
}

.editor-dialog-content {
  position: relative;
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
  padding-top: calc(56px + env(safe-area-inset-top, 0px));
  padding-bottom: calc(28px + env(safe-area-inset-bottom, 0px));
}

.dialog-close {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 5;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 249, 244, 0.88);
  color: var(--primary-dark);
  font-size: 1.8rem;
  cursor: pointer;
  pointer-events: auto;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.dialog-media-wrap {
  flex: 0 0 auto;
  aspect-ratio: 16 / 9;
  max-height: min(42vh, 340px);
  background: #f4d2bf;
}

.dialog-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.dialog-content {
  flex: 1 1 auto;
  min-height: 0;
  max-height: calc(100vh - 320px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
  padding: 26px 28px 32px;
}

.dialog-meta {
  display: grid;
  gap: 12px;
  margin: 18px 0;
}

.dialog-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  padding: 12px 18px;
  border-radius: 999px;
  background: rgba(214, 90, 49, 0.12);
  color: var(--primary-dark);
  text-decoration: none;
  font-weight: 700;
}

.dialog-link.is-hidden {
  display: none;
}

.dialog-description.is-hidden {
  display: none;
}

.is-hidden {
  display: none !important;
}

@media (max-width: 920px) {
  .steps-grid::before {
    left: 18px;
  }

  .step-card,
  .step-card:nth-child(odd),
  .step-card:nth-child(even) {
    width: calc(100% - 38px);
    justify-self: end;
  }

  .step-card::before,
  .step-card:nth-child(odd)::before,
  .step-card:nth-child(even)::before {
    left: -34px;
    right: auto;
    width: 34px;
  }

  .step-card::after,
  .step-card:nth-child(odd)::after,
  .step-card:nth-child(even)::after {
    left: -43px;
    right: auto;
  }
}

@media (max-width: 640px) {
  .page-shell {
    width: min(100% - 20px, 100%);
    padding-top: 16px;
  }

  .timeline-section,
  .comment-section,
  .editor-dialog-content {
    padding: 22px;
  }

  .topbar {
    border-radius: 28px;
    flex-direction: column;
    gap: 14px;
    align-items: stretch;
  }

  .hero-stage {
    min-height: calc(100vh - 142px);
    border-radius: 28px;
  }

  .birthday-banner {
    bottom: 20px;
    width: calc(100% - 28px);
    padding: 22px 18px;
    border-radius: 28px;
  }

  .editor-dialog {
    width: calc(100vw - 2px);
    max-width: calc(100vw - 2px);
    max-height: calc(100dvh - 2px);
    border-radius: 18px;
  }

  .step-dialog {
    width: calc(100% - 12px);
    max-height: calc(100vh - 12px);
    border-radius: 24px;
  }

  .editor-dialog-content {
    max-height: calc(100dvh - 2px);
    padding-top: calc(58px + env(safe-area-inset-top, 0px));
    padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  }

  .dialog-media-wrap {
    max-height: min(34vh, 240px);
  }

  .dialog-content {
    max-height: calc(100vh - 220px);
  }

  .section-heading {
    flex-direction: column;
  }

  .section-actions {
    justify-content: flex-start;
  }

  .step-actions,
  .form-actions {
    flex-direction: column;
  }
}
