:root {
  color-scheme: light;
  --bg: #f7f4ee;
  --surface: #ffffff;
  --ink: #22201d;
  --muted: #6f6960;
  --line: #ded8cd;
  --sage: #667761;
  --terracotta: #b8654b;
  --gold: #d7a84f;
  --sky: #6a8fac;
  --inline-bg: #fbfaf7;
  --soft-surface: rgba(255, 255, 255, 0.6);
  --member-active-bg: #edf1eb;
  --upload-bg: #f2f5f0;
  --photo-bg: #f4efe6;
  --placeholder-bg: #ebe5da;
  --shadow: 0 18px 45px rgba(42, 34, 26, 0.12);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #171614;
  --surface: #24221f;
  --ink: #f4efe6;
  --muted: #beb5a8;
  --line: #49443d;
  --sage: #a5ba9d;
  --terracotta: #df9277;
  --gold: #e5bf6c;
  --sky: #91b5d0;
  --inline-bg: #302d28;
  --soft-surface: rgba(36, 34, 31, 0.74);
  --member-active-bg: #2f3a2d;
  --upload-bg: #263126;
  --photo-bg: #302d28;
  --placeholder-bg: #302d28;
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family:
    Inter, Pretendard, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
  transition:
    background-color 180ms ease,
    color 180ms ease;
}

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

button,
input,
select {
  font: inherit;
}

code {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--inline-bg);
  padding: 0.12rem 0.35rem;
  font-size: 0.92em;
}

.site-header {
  min-height: 92vh;
  background:
    linear-gradient(rgba(35, 31, 27, 0.26), rgba(35, 31, 27, 0.34)),
    url("https://images.unsplash.com/photo-1511895426328-dc8714191300?auto=format&fit=crop&w=1800&q=80")
      center/cover;
  color: #fff;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0;
}

.brand {
  font-weight: 800;
  letter-spacing: 0;
}

.nav-links {
  display: flex;
  gap: 0.9rem;
  font-size: 0.95rem;
}

.nav-links a {
  border-bottom: 1px solid transparent;
}

.nav-links a:hover,
.nav-links a:focus-visible {
  border-bottom-color: currentColor;
}

.theme-toggle {
  min-height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  cursor: pointer;
  padding: 0.55rem 0.8rem;
  font-weight: 800;
  backdrop-filter: blur(12px);
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
  background: rgba(255, 255, 255, 0.24);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  align-items: end;
  gap: 2rem;
  width: min(1120px, calc(100% - 32px));
  min-height: calc(92vh - 88px);
  margin: 0 auto;
  padding: 48px 0 80px;
}

.hero-copy {
  max-width: 760px;
}

.eyebrow {
  margin: 0 0 0.7rem;
  color: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 780px;
  margin-bottom: 1rem;
  font-size: clamp(3rem, 7vw, 6.6rem);
  line-height: 0.98;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0.75rem;
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1.08;
  letter-spacing: 0;
}

.hero-copy p:last-child {
  max-width: 650px;
  margin-bottom: 0;
  font-size: 1.1rem;
}

.hero-panel {
  display: grid;
  gap: 0.35rem;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.15);
  padding: 1.2rem;
  backdrop-filter: blur(12px);
}

.panel-label {
  font-size: 0.85rem;
  opacity: 0.9;
}

.hero-panel strong {
  font-size: 3rem;
  line-height: 1;
}

.section {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 72px 0;
}

.intro {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(280px, 1.1fr);
  gap: 2rem;
  border-bottom: 1px solid var(--line);
}

.intro .eyebrow,
.section-heading .eyebrow,
.guide .eyebrow {
  color: var(--terracotta);
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.section-note {
  max-width: 320px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.95rem;
  text-align: right;
}

.family {
  border-bottom: 1px solid var(--line);
}

.member-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.member-tab {
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  font-weight: 800;
}

.member-tab:hover,
.member-tab:focus-visible,
.member-tab.is-active {
  border-color: var(--sage);
  background: var(--member-active-bg);
  color: var(--sage);
}

.member-panel {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(220px, 0.6fr) minmax(0, 1.6fr);
  gap: 1rem;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 1rem;
  box-shadow: var(--shadow);
}

.member-panel-copy {
  display: grid;
  gap: 0.75rem;
}

.name-field {
  display: grid;
  gap: 0.45rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.name-field input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  padding: 0.75rem;
}

.member-status {
  margin: 0;
  color: var(--muted);
}

.upload-box {
  display: grid;
  min-height: 130px;
  place-items: center;
  border: 1px dashed var(--sage);
  border-radius: 8px;
  background: var(--upload-bg);
  color: var(--sage);
  cursor: pointer;
  font-weight: 800;
  text-align: center;
}

.upload-box input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.photo-preview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  min-height: 130px;
}

.photo-tile {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--photo-bg);
  aspect-ratio: 1;
}

.photo-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.empty-photos {
  display: grid;
  min-height: 130px;
  grid-column: 1 / -1;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.filter {
  display: grid;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.filter select {
  min-width: 150px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  padding: 0.65rem 0.75rem;
  font: inherit;
}

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

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

.memory-image {
  display: grid;
  min-height: 210px;
  place-items: center;
  background:
    linear-gradient(135deg, rgba(102, 119, 97, 0.18), rgba(215, 168, 79, 0.2)),
    var(--placeholder-bg);
  color: var(--sage);
  font-weight: 800;
}

.memory-image img {
  width: 100%;
  height: 240px;
  object-fit: cover;
}

.memory-body {
  padding: 1.1rem;
}

.memory-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.tag {
  border-radius: 999px;
  background: var(--member-active-bg);
  color: var(--sage);
  padding: 0.15rem 0.55rem;
  font-size: 0.82rem;
  font-weight: 700;
}

.memory-card h3 {
  margin: 0 0 0.45rem;
  font-size: 1.2rem;
  line-height: 1.25;
}

.memory-card p {
  margin-bottom: 0;
  color: var(--muted);
}

.guide {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(280px, 1.2fr);
  gap: 2rem;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.steps {
  display: grid;
  gap: 0.85rem;
  margin: 0;
  padding-left: 1.35rem;
}

.timeline {
  display: grid;
  gap: 0.75rem;
}

.timeline-item {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 1rem;
  border-left: 4px solid var(--sky);
  background: var(--soft-surface);
  padding: 1rem;
}

.timeline-date {
  color: var(--terracotta);
  font-weight: 800;
}

.timeline-title {
  margin: 0;
  font-weight: 800;
}

.timeline-place {
  margin: 0.2rem 0 0;
  color: var(--muted);
}

.footer {
  border-top: 1px solid var(--line);
  padding: 28px 16px;
  color: var(--muted);
  text-align: center;
}

.footer p {
  margin: 0;
}

@media (max-width: 820px) {
  .nav {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav-links {
    flex-wrap: wrap;
  }

  .hero,
  .intro,
  .guide {
    grid-template-columns: 1fr;
  }

  .hero {
    align-items: end;
    min-height: calc(92vh - 126px);
  }

  .hero-panel {
    max-width: 320px;
  }

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

  .section-note {
    max-width: none;
    text-align: left;
  }

  .member-tabs,
  .member-panel,
  .photo-preview {
    grid-template-columns: 1fr;
  }

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

  .timeline-item {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
