:root {
  color-scheme: light;
  --ink: #24302b;
  --muted: #69766f;
  --paper: #fffdf9;
  --surface: #f7f4ee;
  --mist: #edf4f1;
  --line: #d9dfd9;
  --sage: #587665;
  --sage-strong: #365c4d;
  --rose: #b77969;
  --rose-soft: #f1ded9;
  --white: #ffffff;
  --shadow: 0 18px 50px rgba(39, 48, 43, 0.14);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family:
    "Noto Serif KR",
    "Noto Sans KR",
    "Apple SD Gothic Neo",
    "Malgun Gothic",
    ui-serif,
    Georgia,
    "Apple SD Gothic Neo",
    serif;
  line-height: 1.65;
}

body.modal-open {
  overflow: hidden;
}

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

a {
  color: inherit;
}

.hero {
  position: relative;
  min-height: 86dvh;
  overflow: hidden;
  display: grid;
  align-items: center;
  padding: max(32px, env(safe-area-inset-top)) 24px 72px;
  isolation: isolate;
}

.hero__media {
  position: absolute;
  inset: 0;
  z-index: -2;
  background-image: url("/wedding/assets/hero-wedding.png");
  background-size: cover;
  background-position: center;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(255, 253, 249, 0.72), rgba(255, 253, 249, 0.22) 44%, rgba(255, 253, 249, 0.84)),
    linear-gradient(90deg, rgba(255, 253, 249, 0.78), rgba(255, 253, 249, 0.28));
}

.hero__content {
  width: min(520px, 100%);
  margin: 0 auto;
  text-align: center;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--sage-strong);
  font-size: 0.78rem;
  font-family:
    "Noto Sans KR",
    "Apple SD Gothic Neo",
    "Malgun Gothic",
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  text-transform: uppercase;
  letter-spacing: 0;
  font-weight: 700;
}

h1,
h2 {
  margin: 0;
  line-height: 1.22;
  font-weight: 600;
}

.hero h1 {
  display: grid;
  gap: 6px;
  font-size: 3.2rem;
}

.hero h1 small {
  color: var(--muted);
  font-size: 1rem;
  font-weight: 500;
}

.hero__date {
  margin: 24px 0 0;
  color: var(--sage-strong);
  font-size: 1.02rem;
  font-family:
    "Noto Sans KR",
    "Apple SD Gothic Neo",
    "Malgun Gothic",
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  font-weight: 700;
}

.hero__link,
.submit-button,
.ghost-button,
.map-links a,
.map-toolbar button {
  appearance: none;
  min-height: 44px;
  border-radius: 8px;
  border: 1px solid var(--line);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color 140ms ease,
    color 140ms ease,
    border-color 140ms ease;
}

.hero__link {
  margin-top: 28px;
  padding: 0 22px;
  color: var(--white);
  background: var(--sage-strong);
  border-color: var(--sage-strong);
  font-family:
    "Noto Sans KR",
    "Apple SD Gothic Neo",
    "Malgun Gothic",
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
  "Segoe UI",
    sans-serif;
  font-weight: 700;
}

button.hero__link {
  margin-left: auto;
  margin-right: auto;
}

.section {
  width: min(720px, 100%);
  margin: 0 auto;
  padding: 72px 24px;
}

.section--tint {
  width: 100%;
  max-width: none;
  background: var(--mist);
}

.section--tint > * {
  width: min(720px, 100%);
  margin-left: auto;
  margin-right: auto;
}

.intro {
  font-size: 1.08rem;
  text-align: center;
}

.intro p {
  margin: 0;
}

.section__heading {
  margin-bottom: 28px;
  text-align: center;
}

.section__heading h2 {
  font-size: 1.9rem;
}

.info-list {
  margin: 0;
  display: grid;
  gap: 14px;
  font-family:
    "Noto Sans KR",
    "Apple SD Gothic Neo",
    "Malgun Gothic",
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

.info-list div {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 16px;
  align-items: start;
  padding: 18px 0;
  border-top: 1px solid rgba(54, 92, 77, 0.2);
}

.info-list div:last-child {
  border-bottom: 1px solid rgba(54, 92, 77, 0.2);
}

.info-list dt {
  color: var(--sage-strong);
  font-weight: 800;
}

.info-list dd {
  margin: 0;
  color: var(--ink);
}

.map-toolbar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
  font-family:
    "Noto Sans KR",
    "Apple SD Gothic Neo",
    "Malgun Gothic",
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

.map-toolbar button {
  background: var(--white);
  color: var(--sage-strong);
  font-weight: 800;
}

.map-toolbar button.is-active {
  background: var(--sage-strong);
  border-color: var(--sage-strong);
  color: var(--white);
}

.map-shell {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.map-canvas {
  width: 100%;
  height: 340px;
  display: grid;
  place-items: center;
  color: var(--muted);
  text-align: center;
  padding: 24px;
  font-family:
    "Noto Sans KR",
    "Apple SD Gothic Neo",
    "Malgun Gothic",
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

.map-fallback {
  width: min(420px, 100%);
  display: grid;
  gap: 10px;
}

.map-fallback strong {
  color: var(--ink);
  font-size: 1.12rem;
}

.map-fallback span,
.map-fallback p {
  margin: 0;
}

.map-fallback__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}

.map-fallback__actions a {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  color: var(--sage-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-weight: 800;
}

.map-links {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 12px;
  font-family:
    "Noto Sans KR",
    "Apple SD Gothic Neo",
    "Malgun Gothic",
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

.map-links a {
  padding: 0 10px;
  background: var(--white);
  color: var(--sage-strong);
  font-size: 0.92rem;
  font-weight: 800;
}

.rsvp-form,
.admin-login,
.admin-panel {
  font-family:
    "Noto Sans KR",
    "Apple SD Gothic Neo",
    "Malgun Gothic",
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

.rsvp-form {
  display: grid;
  gap: 18px;
}

.rsvp-cta {
  display: grid;
  gap: 18px;
  justify-items: center;
  text-align: center;
}

.rsvp-cta p {
  margin: 0;
}

.rsvp-cta .submit-button {
  width: min(280px, 100%);
}

.choice-group {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.choice-group:has(label:nth-of-type(3)) {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.choice-group legend,
.field span {
  grid-column: 1 / -1;
  margin-bottom: 8px;
  color: var(--sage-strong);
  font-size: 0.92rem;
  font-weight: 800;
}

.choice-group label,
.privacy {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.choice-group label {
  justify-content: center;
  position: relative;
  font-weight: 800;
  text-align: center;
}

.choice-group label:has(input:checked) {
  border-color: var(--sage-strong);
  background: var(--sage-strong);
  color: var(--white);
}

.choice-group label:has(input:focus-visible),
.privacy:has(input:focus-visible) {
  outline: 2px solid var(--rose);
  outline-offset: 2px;
}

.privacy input {
  accent-color: var(--sage-strong);
}

.choice-group input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.field {
  display: grid;
}

.field input,
.field textarea,
.rsvp-table input,
.rsvp-table select,
.rsvp-table textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  color: var(--ink);
  font-size: 16px;
  padding: 12px 14px;
}

.field textarea,
.rsvp-table textarea {
  resize: vertical;
}

.privacy {
  align-items: flex-start;
  color: var(--muted);
  font-size: 0.92rem;
}

.submit-button {
  width: 100%;
  border-color: var(--sage-strong);
  background: var(--sage-strong);
  color: var(--white);
  font-weight: 800;
}

.submit-button:disabled {
  opacity: 0.65;
  cursor: progress;
}

.ghost-button {
  padding: 0 14px;
  background: var(--white);
  color: var(--sage-strong);
  font-weight: 800;
}

.form-status {
  min-height: 26px;
  margin: 0;
  color: var(--sage-strong);
  font-weight: 800;
}

.form-status.is-error {
  color: #9b3f36;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  align-items: center;
  justify-items: center;
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
  background: rgba(36, 48, 43, 0.44);
  overflow-y: auto;
}

.modal-panel {
  width: min(640px, 100%);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 24px 70px rgba(24, 31, 28, 0.28);
  padding: 24px;
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.modal-header h2 {
  font-size: 1.55rem;
}

.close-button {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  color: var(--sage-strong);
  cursor: pointer;
  font-size: 1.45rem;
  font-weight: 800;
  line-height: 1;
}

body[data-template="2"] {
  --paper: #fbfaf7;
  --surface: #f1ebe3;
  --mist: #f7f2ec;
  --line: #d8cfc4;
  --sage-strong: #424d48;
  --rose: #9f786d;
}

body[data-template="2"] .hero {
  min-height: 82dvh;
  align-items: end;
  padding-bottom: 96px;
}

body[data-template="2"] .hero::after {
  background:
    linear-gradient(180deg, rgba(251, 250, 247, 0.38), rgba(251, 250, 247, 0.9)),
    linear-gradient(90deg, rgba(251, 250, 247, 0.84), rgba(251, 250, 247, 0.38));
}

body[data-template="2"] .hero__content {
  border-top: 1px solid rgba(66, 77, 72, 0.22);
  border-bottom: 1px solid rgba(66, 77, 72, 0.22);
  padding: 30px 0;
}

body[data-template="2"] .hero h1 {
  font-size: 2.8rem;
}

body[data-template="2"] .section {
  padding-top: 80px;
  padding-bottom: 80px;
}

body[data-template="2"] .section--tint {
  background: var(--surface);
}

body[data-template="2"] .map-shell,
body[data-template="2"] .modal-panel,
body[data-template="2"] .table-wrap {
  box-shadow: none;
}

body[data-template="3"] {
  --paper: #fffdf8;
  --surface: #f5f0e6;
  --mist: #eef7f1;
  --sage-strong: #2f6a5b;
  --rose: #cf796e;
  --rose-soft: #f5dfd9;
}

body[data-template="3"] .hero {
  min-height: 88dvh;
  align-items: center;
}

body[data-template="3"] .hero::after {
  background:
    linear-gradient(180deg, rgba(255, 253, 248, 0.56), rgba(255, 253, 248, 0.18) 46%, rgba(255, 253, 248, 0.82)),
    radial-gradient(circle at 50% 58%, rgba(245, 223, 217, 0.5), rgba(245, 223, 217, 0) 38%);
}

body[data-template="3"] .hero__link,
body[data-template="3"] .submit-button,
body[data-template="3"] .map-toolbar button.is-active {
  background: var(--rose);
  border-color: var(--rose);
}

body[data-template="3"] .section--tint {
  background: linear-gradient(180deg, var(--mist), var(--surface));
}

body[data-template="3"] .choice-group label {
  border-radius: 999px;
}

body[data-template="3"] .modal-overlay {
  align-items: end;
  padding: 0;
}

body[data-template="3"] .modal-panel {
  width: 100%;
  max-height: 88dvh;
  border-right: 0;
  border-bottom: 0;
  border-left: 0;
  border-radius: 18px 18px 0 0;
  padding: 22px 20px max(22px, env(safe-area-inset-bottom));
}

.admin-page {
  background: var(--surface);
  font-family:
    "Noto Sans KR",
    "Apple SD Gothic Neo",
    "Malgun Gothic",
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

.admin-layout {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: max(24px, env(safe-area-inset-top)) 20px 48px;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.admin-header h1 {
  font-size: 2rem;
}

.admin-login {
  width: min(420px, 100%);
  display: grid;
  gap: 14px;
}

.admin-panel {
  display: grid;
  gap: 18px;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

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

.stat {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  padding: 14px;
}

.stat b {
  display: block;
  font-size: 1.6rem;
  color: var(--sage-strong);
}

.stat span {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.rsvp-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
}

.rsvp-table th,
.rsvp-table td {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  text-align: left;
}

.rsvp-table th {
  color: var(--sage-strong);
  background: var(--mist);
  font-size: 0.88rem;
}

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

.row-actions button {
  min-height: 36px;
}

@media (max-width: 640px) {
  .hero {
    min-height: 84dvh;
    padding-left: 20px;
    padding-right: 20px;
  }

  .hero h1 {
    font-size: 2.7rem;
  }

  .section {
    padding: 56px 20px;
  }

  .section__heading h2 {
    font-size: 1.65rem;
  }

  .info-list div {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .choice-group,
  .choice-group:has(label:nth-of-type(3)),
  .map-links,
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .map-canvas {
    height: 300px;
  }

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