:root {
  --ink: #171717;
  --ink-soft: #34312d;
  --muted: #6f6a61;
  --quiet: #8b8579;
  --paper: #f7f3eb;
  --surface: #fffdf8;
  --surface-2: #f1eadf;
  --line: #ddd5c8;
  --line-strong: #c9bba9;
  --brass: #9d782d;
  --brass-soft: #efe2c6;
  --sage: #667464;
  --blue: #435a68;
  --shadow: 0 18px 48px rgba(35, 30, 22, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "Apple SD Gothic Neo", "Noto Sans KR", Avenir, "Avenir Next", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

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

button {
  cursor: pointer;
}

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

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

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 0 12px;
}

header.site-shell {
  position: sticky;
  top: 0;
  z-index: 15;
  border-bottom: 1px solid rgba(221, 213, 200, 0.72);
  background: rgba(247, 243, 235, 0.88);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-logo {
  display: block;
  width: 56px;
  height: 56px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  object-fit: contain;
  padding: 3px;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  color: var(--ink);
  font-weight: 900;
}

.brand small {
  color: var(--muted);
  font-size: 0.8rem;
  margin-top: -2px;
}

.nav-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.72);
}

.nav-links a {
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
  padding: 8px 13px;
}

.nav-links a:hover {
  background: var(--ink);
  color: #fffdf8;
}

.ghost-button,
.icon-button,
.admin-form button,
.admin-lock button {
  min-height: 40px;
  border: 1px solid var(--ink);
  border-radius: 8px;
  background: var(--ink);
  color: #fffdf8;
  font-weight: 900;
  padding: 0 16px;
}

.ghost-button {
  background: transparent;
  color: var(--ink);
}

.ghost-button:hover,
.admin-form button:hover,
.admin-lock button:hover {
  background: #000;
}

.practice-strip {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
  padding: 0 0 14px;
}

.practice-strip-label {
  display: flex;
  align-items: center;
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--brass);
  font-size: 0.82rem;
  font-weight: 900;
  padding: 0 13px;
  white-space: nowrap;
}

.practice-strip-months {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.practice-strip-card {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.74);
  padding: 9px 12px;
}

.practice-strip-card.is-current {
  border-color: rgba(23, 23, 23, 0.52);
  background: #fffdf8;
  box-shadow: 0 14px 32px rgba(35, 30, 22, 0.1), inset 4px 0 0 var(--brass);
}

.practice-strip-card > span {
  color: var(--quiet);
  font-size: 0.76rem;
  font-weight: 900;
}

.practice-strip-card.is-current > span {
  border-radius: 999px;
  background: var(--ink);
  color: #fffdf8;
  padding: 3px 8px;
}

.practice-strip-card h2 {
  color: var(--ink);
  font-size: 1rem;
  white-space: nowrap;
}

.practice-strip-card div {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.practice-strip-card div span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fbf8f1;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  padding: 3px 8px;
  white-space: nowrap;
}

.practice-strip-card.is-current div span {
  border-color: var(--line-strong);
  background: #fff;
  color: var(--ink-soft);
}

.practice-strip-card div strong {
  color: var(--ink);
}

.hero-band {
  display: flex;
  align-items: end;
  min-height: 276px;
  margin: 0 0 22px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(90deg, rgba(23, 23, 23, 0.88) 0%, rgba(23, 23, 23, 0.52) 44%, rgba(23, 23, 23, 0.1) 100%),
    url("assets/atlanta-bethel-stage.png") center 54% / cover no-repeat;
}

.hero-copy {
  padding: 44px 0 38px;
  color: #fffdf8;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--brass);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
}

.hero-copy .eyebrow {
  color: #ead8b7;
}

h1,
h2,
h3,
p {
  overflow-wrap: break-word;
  word-break: keep-all;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.12;
  letter-spacing: 0;
}

h1 {
  max-width: 860px;
  font-size: clamp(2.4rem, 5.1vw, 4.65rem);
  font-weight: 900;
}

h2 {
  color: var(--ink);
  font-size: clamp(1.7rem, 2.55vw, 2.45rem);
}

h3 {
  color: var(--ink);
  font-size: 1.15rem;
}

.lede {
  max-width: 760px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.4vw, 1.12rem);
}

.hero-copy .lede {
  color: rgba(255, 253, 248, 0.82);
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin: 14px 0 16px;
}

.status-pill,
.file-pill,
.practice-label {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 900;
  padding: 4px 10px;
}

.song-workspace,
.reference-videos,
.onboarding,
.practice {
  padding: 20px 0 36px;
}

.song-guidance {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  margin: 0 0 14px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--brass);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.82);
  padding: 13px 14px;
}

.song-guidance p {
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
}

.workspace-grid {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr) minmax(290px, 0.42fr);
  gap: 14px;
  align-items: stretch;
}

.song-list {
  display: grid;
  gap: 8px;
  align-content: start;
}

.song-tab {
  width: 100%;
  min-height: 70px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.72);
  color: var(--ink);
  padding: 13px;
  text-align: left;
  transition: border-color 160ms ease, background 160ms ease;
}

.song-tab:hover {
  border-color: var(--line-strong);
  background: var(--surface);
}

.song-tab.is-active {
  border-color: var(--brass);
  background: #fbf2df;
}

.song-tab span,
.song-tab small {
  display: block;
}

.song-tab span {
  font-weight: 900;
}

.song-tab small {
  color: var(--muted);
  margin-top: 4px;
}

.pdf-panel,
.practice-card,
.reference-card,
.role-card,
.detail-card,
.role-sidebar {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.notes-panel {
  min-width: 0;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #f5edc9;
  box-shadow: var(--shadow);
}

.pdf-panel {
  display: flex;
  min-width: 0;
  flex-direction: column;
  overflow: hidden;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 82px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.pdf-frame {
  display: grid;
  min-height: 560px;
  background: #ebe6dc;
}

.pdf-frame iframe,
.pdf-frame object {
  width: 100%;
  height: 100%;
  min-height: 560px;
  border: 0;
  background: #fff;
}

.empty-pdf {
  display: grid;
  gap: 9px;
  place-content: center;
  padding: 34px;
  color: var(--muted);
  text-align: center;
}

.empty-pdf strong {
  color: var(--ink);
}

.empty-pdf p {
  margin: 0;
}

.staff-lines {
  display: block;
  width: min(100%, 360px);
  height: 82px;
  margin: 0 auto 8px;
  background: repeating-linear-gradient(180deg, transparent 0 13px, rgba(23, 23, 23, 0.26) 13px 15px, transparent 15px 18px);
  mask-image: linear-gradient(90deg, transparent, black 10%, black 90%, transparent);
}

.notebook-paper {
  min-height: 100%;
  padding: 24px 24px 24px 42px;
  border-radius: 8px;
  background:
    linear-gradient(90deg, transparent 0 24px, rgba(136, 61, 52, 0.42) 24px 26px, transparent 26px),
    repeating-linear-gradient(180deg, rgba(255, 251, 218, 0.98) 0 31px, rgba(67, 90, 104, 0.24) 31px 32px);
}

.notebook-paper .eyebrow {
  color: #7d3b2e;
}

.notebook-paper h3 {
  color: var(--ink);
}

.hand-note {
  margin: 18px 0 0;
  color: #263440;
  font-family: "Bradley Hand", "Segoe Print", "Comic Sans MS", "Apple SD Gothic Neo", cursive;
  font-size: 1.08rem;
  line-height: 1.65;
  white-space: pre-wrap;
}

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

.role-card {
  display: flex;
  min-height: 240px;
  flex-direction: column;
  padding: 20px;
  transition: border-color 160ms ease, transform 160ms ease;
}

.role-card:hover {
  transform: translateY(-2px);
  border-color: var(--brass);
}

.role-card h3 {
  margin: 0 0 10px;
}

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

.role-tag {
  align-self: start;
  margin-bottom: 14px;
  border: 1px solid #d9caa9;
  border-radius: 999px;
  background: #f8f0df;
  color: var(--brass);
  font-size: 0.78rem;
  font-weight: 900;
  padding: 5px 10px;
}

.role-focus {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 18px;
}

.role-focus span {
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  padding: 4px 9px;
}

.role-link {
  margin-top: auto;
  padding-top: 18px;
  color: var(--ink);
  font-size: 0.9rem;
}

.practice-grid,
.reference-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 14px;
}

.practice-card,
.reference-card {
  padding: 22px;
}

.practice-card.sunday,
.reference-card.sunday-ref {
  background: #f8fbf7;
}

.reference-card.friday {
  background: #fffaf0;
}

.practice-card h3,
.reference-card h3 {
  margin: 14px 0 16px;
  font-size: 1.35rem;
}

.practice-card p,
.reference-card p {
  margin: 0;
  color: var(--muted);
}

.service-times {
  display: grid;
  gap: 8px;
  margin: 0 0 12px;
}

.service-time-row {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.74);
  padding: 10px 11px;
}

.service-time-row strong {
  color: var(--ink);
  font-size: 0.93rem;
}

.service-time-row span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  padding: 4px 8px;
  white-space: nowrap;
}

.service-time-row span:last-child {
  border-color: var(--line-strong);
  background: #f8f0df;
  color: var(--brass);
}

.service-location {
  margin-bottom: 10px !important;
  font-size: 0.9rem;
  font-weight: 800;
}

.reference-card p + p {
  margin-top: 10px;
}

.ko-note {
  color: var(--ink-soft) !important;
  font-weight: 800;
}

.youtube-link,
.back-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  margin-top: 20px;
  border: 1px solid var(--ink);
  border-radius: 8px;
  background: var(--ink);
  color: #fffdf8;
  font-weight: 900;
  padding: 0 14px;
}

.youtube-link:hover,
.back-link:hover {
  background: #000;
}

.rotation-list {
  display: grid;
  gap: 10px;
}

.rotation-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.rotation-row strong {
  color: var(--ink);
}

.rotation-row span {
  color: var(--muted);
  font-weight: 800;
  text-align: right;
}

.role-page {
  padding-bottom: 56px;
}

.role-hero {
  padding: 42px 0 28px;
  border-bottom: 1px solid var(--line);
}

.role-hero .back-link {
  margin: 0 0 24px;
  background: transparent;
  color: var(--ink);
}

.role-hero h1 {
  max-width: 900px;
}

.role-hero .lede {
  color: var(--muted);
}

.role-hero .role-focus span {
  background: var(--surface);
}

.role-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  padding-top: 22px;
}

.role-sidebar {
  position: sticky;
  top: 96px;
  padding: 16px;
}

.role-sidebar h2 {
  margin: 0 0 12px;
  font-size: 1rem;
}

.role-sidebar nav {
  display: grid;
  gap: 6px;
}

.role-sidebar a {
  display: grid;
  gap: 2px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 10px;
}

.role-sidebar a:hover,
.role-sidebar a.is-active {
  border-color: var(--line);
  background: #fbf2df;
}

.role-sidebar span {
  font-weight: 900;
}

.role-sidebar small {
  color: var(--muted);
  font-weight: 700;
}

.role-content {
  display: grid;
  gap: 14px;
}

.detail-card {
  padding: 24px;
}

.detail-card h2 {
  margin: 14px 0 16px;
  font-size: clamp(1.45rem, 2vw, 2rem);
}

.detail-card ol,
.detail-card ul {
  display: grid;
  gap: 12px;
  margin: 0;
  padding-left: 22px;
  color: var(--ink-soft);
}

.reference-detail h2 {
  margin-bottom: 18px;
}

.reference-media-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(320px, 1.1fr);
  gap: 18px;
  align-items: start;
}

.reference-photo {
  margin: 0;
}

.reference-photo img {
  display: block;
  width: 100%;
  max-height: 540px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #171717;
}

.reference-photo figcaption {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.reference-table-wrap {
  overflow-x: auto;
}

.reference-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  font-size: 0.94rem;
}

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

.reference-table th {
  background: #f4eee3;
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 900;
}

.reference-table td:first-child {
  width: 72px;
  color: var(--brass);
  font-weight: 900;
}

.reference-table tr:last-child td {
  border-bottom: 0;
}

.checklist {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding-left: 0 !important;
  list-style: none;
}

.checklist li {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfaf6;
  font-weight: 800;
  padding: 12px;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(23, 23, 23, 0.34);
  backdrop-filter: blur(4px);
}

.admin-drawer {
  position: fixed;
  inset: 0 0 0 auto;
  z-index: 30;
  width: min(470px, 100%);
  overflow-y: auto;
  transform: translateX(102%);
  transition: transform 220ms ease;
  border-left: 1px solid var(--line);
  background: var(--surface);
  box-shadow: -28px 0 70px rgba(23, 23, 23, 0.18);
  padding: 22px;
}

.admin-drawer.is-open {
  transform: translateX(0);
}

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

.icon-button {
  width: 40px;
  padding: 0;
}

.admin-lock,
.admin-form {
  display: grid;
  gap: 12px;
}

.inline-form,
.button-row {
  display: flex;
  gap: 10px;
}

.inline-form input {
  flex: 1;
}

label,
legend {
  color: var(--ink-soft);
  font-size: 0.88rem;
  font-weight: 900;
}

fieldset {
  display: grid;
  gap: 12px;
  min-width: 0;
  margin: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 11px 12px;
}

input[type="file"]::file-selector-button {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-2);
  color: var(--ink);
  font-weight: 900;
  margin-right: 12px;
  padding: 8px 10px;
}

textarea {
  resize: vertical;
}

.secondary-button {
  border-color: var(--line-strong) !important;
  background: transparent !important;
  color: var(--ink) !important;
}

.secondary-button:hover {
  background: var(--surface-2) !important;
}

hr {
  width: 100%;
  height: 1px;
  border: 0;
  background: var(--line);
}

.form-message {
  min-height: 22px;
  margin: 0;
  color: var(--brass);
  font-size: 0.9rem;
  font-weight: 800;
}

@media (max-width: 1040px) {
  .workspace-grid {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .notes-panel {
    grid-column: 1 / -1;
  }

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

@media (max-width: 980px) {
  .role-layout {
    grid-template-columns: 1fr;
  }

  .role-sidebar {
    position: static;
  }

  .reference-media-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .workspace-grid,
  .practice-grid,
  .reference-grid {
    grid-template-columns: 1fr;
  }

  .song-guidance {
    grid-template-columns: 1fr;
  }

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

  .pdf-frame,
  .pdf-frame iframe,
  .pdf-frame object {
    min-height: 460px;
  }
}

@media (max-width: 680px) {
  .site-shell {
    width: min(100% - 22px, 1180px);
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .nav-links {
    justify-content: space-between;
    width: 100%;
  }

  .nav-links a {
    flex: 1;
    padding-inline: 6px;
    text-align: center;
  }

  .hero-band {
    min-height: 250px;
  }

  .practice-strip {
    grid-template-columns: 1fr;
  }

  .practice-strip-label {
    min-height: 38px;
  }

  .practice-strip-months {
    grid-template-columns: 1fr;
  }

  .practice-strip-card {
    grid-template-columns: auto auto;
  }

  .practice-strip-card div {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .service-time-row {
    grid-template-columns: 1fr;
  }

  .service-time-row span {
    width: fit-content;
  }

  h1 {
    font-size: clamp(2.1rem, 12vw, 3.35rem);
  }

  .section-heading,
  .panel-header,
  .inline-form,
  .button-row {
    align-items: stretch;
    flex-direction: column;
  }

  .song-list,
  .role-grid,
  .checklist {
    grid-template-columns: 1fr;
  }

  .pdf-frame,
  .pdf-frame iframe,
  .pdf-frame object {
    min-height: 390px;
  }

  .notebook-paper {
    padding-left: 38px;
  }

  .rotation-row {
    grid-template-columns: 1fr;
  }

  .rotation-row span {
    text-align: left;
  }
}
