:root {
  --ink: #331109;
  --red: #e7352d;
  --red-dark: #8f2419;
  --cream: #fff3cb;
  --gold: #ffc414;
  --orange: #ff7a1a;
  --panel: rgba(255, 248, 218, 0.9);
  --shadow: 0 22px 60px rgba(89, 31, 0, 0.22);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    linear-gradient(180deg, rgba(255, 196, 20, 0.08), rgba(255, 122, 26, 0.16)),
    url("assets/background.png") center / cover fixed;
}

button,
input,
textarea {
  font: inherit;
}

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

.site-shell {
  min-height: 100vh;
  overflow: hidden;
  padding: 20px clamp(16px, 4vw, 52px) 56px;
  position: relative;
}

.site-shell::before,
.site-shell::after {
  border-radius: 999px;
  content: "";
  pointer-events: none;
  position: fixed;
  z-index: -1;
}

.site-shell::before {
  background: rgba(231, 53, 45, 0.22);
  height: 420px;
  right: -140px;
  top: 110px;
  width: 420px;
}

.site-shell::after {
  background: rgba(255, 243, 203, 0.34);
  bottom: -120px;
  height: 340px;
  left: -120px;
  width: 340px;
}

.topbar {
  align-items: center;
  background: rgba(255, 243, 203, 0.72);
  border: 3px solid rgba(51, 17, 9, 0.12);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: flex;
  gap: 20px;
  justify-content: space-between;
  margin: 0 auto;
  max-width: 1180px;
  padding: 12px 14px;
  position: sticky;
  top: 16px;
  z-index: 5;
}

.brand {
  align-items: center;
  display: flex;
  font-weight: 900;
  gap: 10px;
  letter-spacing: 0;
}

.brand img {
  height: 42px;
  width: 42px;
}

.main-nav {
  display: flex;
  gap: 6px;
}

.main-nav a,
.root-button,
.secondary-action,
.primary-action,
.admin-panel button {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 900;
  padding: 11px 16px;
}

.main-nav a {
  background: rgba(255, 255, 255, 0.36);
}

.root-button,
.primary-action {
  background: var(--red);
  box-shadow: 0 6px 0 var(--red-dark);
  color: #fff8dc;
}

.secondary-action {
  background: var(--cream);
  box-shadow: inset 0 0 0 2px rgba(51, 17, 9, 0.16);
}

.hero {
  align-items: center;
  display: grid;
  gap: 42px;
  grid-template-columns: minmax(0, 1fr);
  margin: 70px auto 26px;
  max-width: 1180px;
  min-height: 420px;
}

.eyebrow {
  color: var(--red-dark);
  font-size: 0.88rem;
  font-weight: 900;
  margin: 0 0 10px;
  text-transform: uppercase;
}

.hero h1,
.section-heading h1,
.section-heading h2 {
  font-weight: 950;
  letter-spacing: 0;
  margin: 0;
}

.hero h1 {
  font-size: clamp(3.2rem, 8vw, 7.6rem);
  line-height: 0.92;
  max-width: 830px;
  text-shadow: 0 5px 0 rgba(255, 255, 255, 0.45);
}

.hero-copy > p:not(.eyebrow) {
  font-size: clamp(1rem, 2vw, 1.24rem);
  font-weight: 700;
  line-height: 1.7;
  max-width: 660px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.section-grid,
.studio-section,
.root-console {
  margin: 0 auto 32px;
  max-width: 1180px;
}

.section-grid,
.studio-section,
.root-console {
  background: var(--panel);
  border: 3px solid rgba(51, 17, 9, 0.14);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: clamp(18px, 4vw, 34px);
}

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

.section-heading h1,
.section-heading h2 {
  font-size: clamp(2rem, 5vw, 3.6rem);
}

.admin-panel {
  background: rgba(255, 255, 255, 0.46);
  border: 2px solid rgba(51, 17, 9, 0.12);
  border-radius: 8px;
  color: var(--ink);
  display: grid;
  gap: 14px;
  margin-bottom: 20px;
  padding: 18px;
}

.hidden {
  display: none !important;
}

.panel-title,
.form-actions,
.notice-actions {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

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

.section-admin-item {
  align-items: center;
  background: rgba(255, 255, 255, 0.48);
  border: 2px solid rgba(51, 17, 9, 0.12);
  border-radius: 8px;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 14px;
}

.section-admin-item div:first-child {
  display: grid;
  gap: 4px;
}

.section-admin-item span {
  color: var(--red-dark);
  font-weight: 800;
}

.section-admin-item a {
  overflow-wrap: anywhere;
}

.panel-title span {
  color: var(--red-dark);
  font-weight: 900;
}

.panel-title button,
.notice-actions button,
.notice-actions a,
#cancelEdit {
  background: rgba(51, 17, 9, 0.1);
  border: 0;
  border-radius: 8px;
  color: inherit;
  cursor: pointer;
  font: inherit;
  font-weight: 900;
  padding: 8px 10px;
}

.notice-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.admin-panel label {
  display: grid;
  font-weight: 900;
  gap: 8px;
}

.admin-panel input,
.admin-panel select,
.admin-panel textarea {
  background: #fff9df;
  border: 2px solid rgba(51, 17, 9, 0.2);
  border-radius: 8px;
  color: var(--ink);
  outline: 0;
  padding: 12px 14px;
  width: 100%;
}

.admin-panel textarea {
  resize: vertical;
}

.admin-dialog {
  background: transparent;
  border: 0;
  max-width: min(420px, calc(100vw - 32px));
  padding: 0;
}

.admin-dialog::backdrop {
  background: rgba(51, 17, 9, 0.55);
  backdrop-filter: blur(4px);
}

.admin-dialog form {
  background: var(--cream);
  border: 4px solid var(--ink);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 14px;
  padding: 24px;
  position: relative;
}

.admin-dialog h2,
.admin-dialog p,
.admin-dialog small {
  margin: 0;
}

.admin-dialog h2 {
  font-size: 2rem;
  font-weight: 950;
}

.admin-dialog p,
.admin-dialog small {
  font-weight: 800;
}

.admin-dialog input {
  background: #fff9df;
  border: 2px solid rgba(51, 17, 9, 0.2);
  border-radius: 8px;
  color: var(--ink);
  outline: 0;
  padding: 12px 14px;
  width: 100%;
}

.close-button {
  background: var(--ink);
  border: 0;
  border-radius: 50%;
  color: var(--cream);
  cursor: pointer;
  height: 34px;
  position: absolute;
  right: 12px;
  top: 12px;
  width: 34px;
}

.notice-list,
.studio-grid {
  display: grid;
  gap: 14px;
}

.notice-card,
.studio-grid article {
  background: rgba(255, 255, 255, 0.48);
  border: 2px solid rgba(51, 17, 9, 0.12);
  border-radius: 8px;
  padding: 18px;
}

.card-link {
  display: block;
}

.card-link .notice-card,
.card-link article {
  transition:
    box-shadow 160ms ease,
    transform 160ms ease;
}

.card-link:focus-visible {
  border-radius: 8px;
  outline: 4px solid rgba(231, 53, 45, 0.36);
  outline-offset: 4px;
}

.card-link:hover .notice-card,
.card-link:hover article {
  box-shadow: 0 12px 28px rgba(89, 31, 0, 0.16);
  transform: translateY(-2px);
}

.notice-card {
  display: grid;
  gap: 12px;
}

.notice-card header {
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.studio-grid article header {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 18px;
}

.notice-card h3,
.studio-grid h3 {
  font-size: 1.35rem;
  margin: 0;
}

.notice-card time,
.notice-card p,
.studio-grid p {
  font-weight: 700;
  line-height: 1.65;
  margin: 0;
}

.notice-card time {
  color: var(--red-dark);
  white-space: nowrap;
}

.media-list {
  display: grid;
  gap: 12px;
  margin-top: 8px;
}

.media-item {
  display: grid;
  gap: 8px;
  margin: 0;
}

.media-item img,
.media-item video {
  background: rgba(51, 17, 9, 0.08);
  border-radius: 8px;
  max-height: 520px;
  object-fit: contain;
  width: 100%;
}

.media-item audio {
  width: 100%;
}

.media-item figcaption,
.media-download,
.admin-panel small {
  color: var(--red-dark);
  font-size: 0.88rem;
  font-weight: 800;
}

.media-download {
  background: rgba(51, 17, 9, 0.08);
  border-radius: 8px;
  display: inline-block;
  padding: 10px 12px;
}

.studio-grid,
.settings-grid {
  grid-template-columns: repeat(3, 1fr);
}

.studio-grid article span {
  background: var(--red);
  border-radius: 999px;
  color: #fff8dc;
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 900;
  padding: 6px 10px;
}

.settings-grid {
  display: grid;
  gap: 14px;
}

.wide-field {
  grid-column: span 2;
}

.detail-section {
  margin: 70px auto 32px;
  max-width: 920px;
}

.detail-card {
  background: var(--panel);
  border: 3px solid rgba(51, 17, 9, 0.14);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 18px;
  padding: clamp(22px, 5vw, 44px);
}

.detail-card h1 {
  font-size: clamp(2.4rem, 6vw, 5rem);
  line-height: 1;
  margin: 0;
}

.detail-card p:not(.eyebrow) {
  font-size: clamp(1.05rem, 2vw, 1.28rem);
  font-weight: 750;
  line-height: 1.8;
  margin: 0;
  white-space: pre-wrap;
}

.detail-meta {
  color: var(--red-dark);
  font-weight: 900;
}

.detail-card .secondary-action {
  justify-self: start;
}

.legal-page {
  background: rgba(255, 248, 218, 0.94);
  border: 3px solid rgba(51, 17, 9, 0.14);
  border-radius: 8px;
  box-shadow: var(--shadow);
  line-height: 1.75;
  margin: 54px auto 0;
  max-width: 920px;
  padding: clamp(24px, 5vw, 52px);
}

.legal-page h1 {
  font-size: clamp(2.2rem, 5vw, 4.2rem);
  line-height: 1.05;
  margin: 0 0 20px;
}

.legal-page h2 {
  color: var(--red-dark);
  font-size: clamp(1.25rem, 2vw, 1.65rem);
  margin: 34px 0 10px;
}

.legal-page p,
.legal-page li,
.legal-body {
  font-size: 1.02rem;
  font-weight: 650;
}

.legal-body {
  line-height: 1.85;
  white-space: pre-wrap;
}

.legal-page ul {
  display: grid;
  gap: 5px;
  margin: 10px 0 0;
  padding-left: 24px;
}

@media (max-width: 820px) {
  .topbar,
  .section-heading,
  .notice-card header,
  .section-admin-item {
    align-items: stretch;
    flex-direction: column;
  }

  .main-nav {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  }

  .hero {
    grid-template-columns: 1fr;
    margin-top: 42px;
    min-height: auto;
  }

  .studio-grid,
  .settings-grid {
    grid-template-columns: 1fr;
  }

  .wide-field {
    grid-column: auto;
  }

}
