:root {
  --bg-1: #f6f2ed;
  --bg-2: #f6f2ed;
  --paper: #ffffff;
  --line: #d9d0c5;
  --ink: #292420;
  --muted: #776f67;
  --accent: #b8a088;
  --soft-accent: #f4ece3;
  --shell: #1f1a16;
  --shadow: 0 24px 60px rgba(31, 26, 22, 0.2);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(145deg, var(--bg-1), var(--bg-2));
  color: var(--ink);
  font-family: "Manrope", "Segoe UI", sans-serif;
  line-height: 1.5;
  padding: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

.site-shell {
  width: 100%;
  background: var(--paper);
  overflow: visible;
  position: relative;
}

.wedding-banner {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: linear-gradient(135deg, #b89f86, #d1c0ae);
  color: #fff;
  text-align: center;
  padding: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  display: none;
  z-index: 9999;
  animation: fadeDown 0.8s ease forwards;
}

@keyframes fadeDown {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid #ede4d8;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 24px;
  background: transparent;
  border: 0;
  border-radius: 0;
  backdrop-filter: none;
}

.brand {
  display: inline-flex;
  flex-direction: column;
  color: #221d19;
  font-family: "Cormorant Garamond", Georgia, serif;
  letter-spacing: 0.03em;
}

.brand span {
  font-size: 1rem;
  font-weight: 700;
}

.brand small {
  font-size: 0.78rem;
  color: var(--muted);
}

.links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.links a {
  font-size: 0.68rem;
  color: #2f2823;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 600;
  padding: 8px 6px;
  border-radius: 8px;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
}

.token-only {
  display: none;
}

.wrap {
  padding-bottom: 56px;
}

.hero-cover {
  margin-top: 0;
  min-height: 72vh;
  padding: 0;
  background:
    linear-gradient(rgba(41, 36, 32, 0.28), rgba(41, 36, 32, 0.28)),
    url("./assets/story/banner4.jpg") center 20% / cover no-repeat;
  position: relative;
}

.hero-overlay {
  min-height: 72vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #fff;
  padding: 90px 24px 48px;
}

.hero-kicker {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  font-size: 0.86rem;
  font-weight: 700;
}

h1,
h2,
h3 {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.hero-names {
  margin: 12px 0 6px;
  font-family: "Allura", cursive;
  font-size: clamp(3.3rem, 7vw, 6.3rem);
  font-weight: 400;
  line-height: 0.95;
  text-shadow: 0 8px 26px rgba(0, 0, 0, 0.25);
}

.hero-date {
  margin: 0 0 18px;
  font-size: 0.95rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 999px;
  background: linear-gradient(135deg, #c5ad94, #e4d6c8);
  color: #2b241f;
  padding: 10px 18px;
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
  box-shadow: 0 10px 22px rgba(110, 92, 74, 0.2);
  transition: transform 0.2s ease, filter 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
  filter: brightness(0.98);
}

.btn-small {
  padding: 10px 14px;
  font-size: 0.65rem;
}

.hero-btn {
  background: rgba(255, 255, 255, 0.94);
  color: #2a241f;
  box-shadow: 0 14px 25px rgba(17, 13, 10, 0.25);
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
  box-shadow: none;
}

section:not(.hero-cover):not(.invite) {
  max-width: 1140px;
  padding: 0 24px;
  margin: 28px auto 0;
  scroll-margin-top: 108px;
}

.invite {
  margin-top: 0;
  padding: 58px 24px 54px;
  text-align: center;
  background: #ffffff;
  border-top: 1px solid #ebe3d9;
  border-bottom: 1px solid #ebe3d9;
}

.invite-script {
  margin: 0;
  font-family: "Allura", cursive;
  font-size: clamp(2rem, 5vw, 3rem);
  color: #3b332c;
}

.invite-sub {
  margin: 8px 0 0;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.7rem;
  font-weight: 700;
}

.invite-date {
  margin: 18px auto;
  width: fit-content;
  display: flex;
  align-items: center;
  background: transparent;
}

.invite-date span {
  min-width: 0;
  padding: 0 22px;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.65rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.08em;
}

.invite-date span + span {
  border-left: 1px solid #cdbda9;
}

.invite-text {
  margin: 0;
  color: #5e554d;
}

.hero-info-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 16px;
}

.card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 26px;
  box-shadow: 0 10px 24px rgba(43, 36, 31, 0.07);
}

.card-flat {
  box-shadow: none;
}

.section-title {
  margin: 0 0 10px;
  font-size: clamp(1.8rem, 3vw, 2.3rem);
}

.center {
  text-align: center;
}

.sep {
  border: none;
  border-top: 1px solid var(--line);
  margin: 18px 0;
}

.sub,
.muted {
  color: var(--muted);
}

.cta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.info-rows {
  display: flex;
  flex-direction: column;
  margin: 0;
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
  gap: 16px;
}

.info-row:first-child {
  border-top: 1px solid var(--line);
}

.ir-k {
  color: var(--muted);
  font-size: 0.76rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  flex-shrink: 0;
}

.ir-v {
  font-weight: 600;
}

.tip-callout {
  background: var(--soft-accent);
  border-radius: 12px;
  padding: 11px 14px;
  font-size: 0.87rem;
  color: var(--muted);
  margin: 16px 0 0;
}

.notice {
  border: 1px dashed #ccb9a6;
  border-radius: 16px;
  padding: 12px 14px;
  background: var(--soft-accent);
}

.countdown-kicker {
  font-family: "Allura", cursive;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  color: var(--accent);
  margin: 0 0 4px;
  line-height: 1.2;
}

.countdown-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  margin-top: 20px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.count-box {
  padding: 28px 12px;
  border-right: 1px solid var(--line);
}

.count-box:last-child {
  border-right: 0;
}

.count-box div {
  font-size: clamp(2.2rem, 4vw, 3rem);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 600;
  line-height: 1;
}

.count-box span {
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  display: block;
  margin-top: 7px;
}

.story-split {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 16px;
  margin-top: 10px;
}

.story-detail {
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.story-detail.is-fading {
  opacity: 0;
  transform: translateY(6px);
}

.story-photo {
  width: 100%;
  height: 320px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background:
    radial-gradient(circle at 20% 18%, rgba(184, 160, 136, 0.28), transparent 60%),
    linear-gradient(180deg, #f8f3ee, #eee5db);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.story-photo img {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
  background: #fff;
  padding: 10px 10px 22px;
  border-radius: 5px;
  box-shadow: 0 12px 28px rgba(63, 58, 54, 0.2);
  transform: rotate(-0.4deg);
  transition: transform 0.5s ease;
}

.story-photo:hover img {
  transform: rotate(0deg) scale(1.02);
}

.story-meta {
  margin-top: 12px;
}

.story-meta .year {
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.story-meta h3 {
  margin: 4px 0 8px;
  font-size: 1.8rem;
}

.story-meta p {
  margin: 0;
  color: var(--muted);
}

.milestones {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  overflow: hidden;
}

.milestones button {
  width: 100%;
  text-align: left;
  padding: 14px;
  border: 0;
  border-top: 1px solid #efe7dd;
  background: #fff;
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.milestones button:first-child {
  border-top: 0;
}

.ms-dot {
  width: 11px;
  height: 11px;
  border-radius: 999px;
  margin-top: 4px;
  background: #d7cbbb;
  flex: 0 0 auto;
}

.ms-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.ms-year {
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.ms-title {
  font-weight: 700;
}

.milestones button[aria-pressed="true"] {
  background: #f6efe8;
}

.milestones button[aria-pressed="true"] .ms-dot {
  background: linear-gradient(135deg, #c7ad92, #b79979);
  box-shadow: 0 4px 10px rgba(150, 117, 85, 0.25);
}

.timeline {
  display: grid;
  gap: 9px;
}

.titem {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.titem b {
  font-weight: 700;
}

.two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.faq details {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  background: #fff;
}

.faq details + details {
  margin-top: 10px;
}

.faq details summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.faq details summary::-webkit-details-marker {
  display: none;
}

.faq details summary::after {
  content: '▾';
  font-size: .9rem;
  color: var(--muted);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.faq details[open] summary::after {
  transform: rotate(-180deg);
}

.faq details[open] > :not(summary) {
  animation: faqFadeDown 0.18s ease;
}

@keyframes faqFadeDown {
  from { opacity: 0; transform: translateY(-5px); }
  to   { opacity: 1; transform: translateY(0); }
}

.cal-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  flex-wrap: wrap;
}

footer {
  text-align: center;
  color: var(--muted);
  margin-top: 32px;
  font-size: 0.88rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.admin-head {
  max-width: 1140px;
  margin: 0 auto;
  padding: 24px 24px 0;
}

.admin-head-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.stat-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  background: #fff;
}

.stat-card .k {
  color: var(--muted);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.stat-card .v {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
  margin-top: 4px;
}

.admin-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.form-grid {
  display: grid;
  gap: 10px;
}

.compact-grid {
  grid-template-columns: 1fr 1fr;
}

.form-grid label {
  display: grid;
  gap: 6px;
  font-size: 0.9rem;
  color: #3e3832;
}

.input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

.input:focus {
  outline: 2px solid #cfb89f;
  outline-offset: 0;
}

.checkline {
  display: flex;
  align-items: center;
  gap: 8px;
}

.checkline input {
  accent-color: #b99f83;
}

.table-wrap {
  overflow: auto;
}

.table-toolbar {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 10px;
  margin-bottom: 10px;
  align-items: end;
}

.table-toolbar label {
  display: grid;
  gap: 5px;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #4a433d;
}

.table-toolbar .input {
  height: 44px;
  border-radius: 12px;
  padding: 10px 12px;
}

.table-toolbar select.input {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 36px;
  background-image: linear-gradient(45deg, transparent 50%, #7a7066 50%), linear-gradient(135deg, #7a7066 50%, transparent 50%);
  background-position: calc(100% - 16px) calc(50% - 3px), calc(100% - 10px) calc(50% - 3px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.guest-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.93rem;
}

.guest-table th,
.guest-table td {
  border-bottom: 1px solid #eee4d8;
  padding: 10px 8px;
  vertical-align: top;
}

.guest-table th {
  text-align: left;
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
}

.sort-btn {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  cursor: pointer;
}

.sort-btn:hover {
  color: #4e4237;
}

.empty-cell {
  text-align: center;
  color: var(--muted);
  padding: 16px 8px;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tiny {
  font-size: 0.78rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.badge.pending {
  background: #f3ede6;
  color: #8a7460;
}

.badge.accepted {
  background: #e5f4eb;
  color: #24694a;
}

.badge.declined {
  background: #f7e8e8;
  color: #8a3d3d;
}

.badge.maybe {
  background: #eceafa;
  color: #514193;
}

.flash {
  border-radius: 10px;
  padding: 10px 12px;
  margin-top: 10px;
  font-size: 0.9rem;
}

.flash.ok {
  background: #e5f4eb;
  color: #24694a;
}

.flash.warn {
  background: #f8ece1;
  color: #8a5c2d;
}

.qr-box {
  margin-top: 8px;
  display: grid;
  gap: 8px;
  width: fit-content;
}

.qr-box img {
  width: 140px;
  height: 140px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.rsvp-card {
  max-width: 760px;
  margin: 0 auto;
}

.status-set {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  margin: 0;
}

.status-set legend {
  padding: 0 6px;
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.radio-line {
  display: flex;
  align-items: center;
  gap: 8px;
}

.radio-line input {
  accent-color: #b99f83;
}

@media (max-width: 1024px) {
  .links a {
    letter-spacing: 0.08em;
  }

  .hero-info-grid {
    grid-template-columns: 1fr;
  }

  .story-split {
    grid-template-columns: 1fr;
  }

  .countdown-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .count-box:nth-child(2) {
    border-right: 0;
  }

  .count-box:nth-child(3) {
    border-top: 1px solid var(--line);
  }

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

  .admin-grid {
    grid-template-columns: 1fr;
  }

  .admin-head-row {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 760px) {
  .nav {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    padding: 10px 16px;
  }

  .links {
    justify-content: flex-start;
    gap: 6px;
  }

  .links a {
    min-height: 42px;
    padding: 10px 8px;
  }

  .hero-cover,
  .hero-overlay {
    min-height: 62vh;
  }

  section:not(.hero-cover):not(.invite) {
    padding: 0 16px;
  }

  .invite {
    padding: 42px 16px;
  }

  .invite-date {
    width: auto;
    max-width: none;
  }

  .invite-date span {
    width: auto;
    text-align: left;
    font-size: 1.35rem;
    padding: 0 14px;
  }

  .two {
    grid-template-columns: 1fr;
  }

  .cta {
    flex-direction: column;
    align-items: flex-start;
  }

  .compact-grid {
    grid-template-columns: 1fr;
  }

  .table-toolbar {
    grid-template-columns: 1fr;
  }

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

  .milestones {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    border-radius: 14px;
  }

  .milestones button {
    flex: 0 0 auto;
    width: auto;
    min-width: 110px;
    border-top: 0;
    border-left: 1px solid var(--line);
    scroll-snap-align: start;
  }

  .milestones button:first-child {
    border-left: 0;
  }
}
