:root {
  --bg: #f6f2ea;
  --panel: #fffdf8;
  --ink: #1a241d;
  --muted: #5c6a61;
  --line: #d9d1c3;
  --accent: #bb4a1d;
  --accent-strong: #913714;
  --accent-soft: #ffe6d7;
  --teal: #0f7b70;
  --shadow: 0 20px 45px rgba(27, 35, 29, 0.14);
  --radius-xl: 26px;
  --radius-lg: 18px;
  --radius-md: 12px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Sora", "Segoe UI", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at 15% 10%, #fff5e8 0%, var(--bg) 42%, #efe9de 100%);
  line-height: 1.55;
  overflow-x: hidden;
}

body.viewer-open {
  overflow: hidden;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  line-height: 1.1;
}

p {
  margin: 0;
}

main {
  width: min(1120px, 92vw);
  margin: 0 auto 2.5rem;
}

.bg-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
}

.blob {
  position: absolute;
  border-radius: 999px;
  filter: blur(28px);
  opacity: 0.55;
}

.blob-a {
  width: 320px;
  height: 320px;
  top: -110px;
  left: -110px;
  background: #ffd5bd;
}

.blob-b {
  width: 260px;
  height: 260px;
  right: 10%;
  top: 9%;
  background: #bce8e1;
}

.blob-c {
  width: 420px;
  height: 420px;
  right: -140px;
  bottom: -120px;
  background: #f1dbcc;
}

.site-header {
  width: min(1120px, 92vw);
  margin: 1.2rem auto 1.5rem;
  padding: 0.9rem 1rem;
  border: 1px solid rgba(120, 100, 68, 0.2);
  border-radius: 999px;
  background: rgba(255, 252, 247, 0.86);
  backdrop-filter: blur(10px);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1rem;
  position: sticky;
  top: 0.6rem;
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  text-decoration: none;
}

.brand img {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  object-fit: cover;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
}

.brand-name {
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.25rem;
  font-weight: 800;
}

.brand-subtitle {
  color: var(--muted);
  font-size: 0.75rem;
}

.site-nav {
  display: flex;
  justify-content: center;
  gap: 1.1rem;
  flex-wrap: wrap;
}

.site-nav a {
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 600;
  color: #2e372f;
  transition: color 0.2s ease;
}

.site-nav a:hover {
  color: var(--accent);
}

.hero {
  margin-top: 2.4rem;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 2rem;
  align-items: center;
}

.hero-copy h1 {
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(2.1rem, 5vw, 3.7rem);
  margin-top: 0.35rem;
}

.hero-copy p {
  margin-top: 1rem;
  color: #3f4b43;
  max-width: 58ch;
}

.kicker {
  font-size: 0.78rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--accent);
}

.hero-cta {
  margin-top: 1.3rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.hero-photo {
  background: var(--panel);
  border: 1px solid #dbcab8;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.hero-photo img {
  height: clamp(290px, 52vh, 540px);
  width: 100%;
  object-fit: contain;
  background: #f1e7db;
}

.hero-photo figcaption {
  padding: 0.9rem 1rem;
  border-top: 1px solid #ece1d4;
  color: var(--muted);
  font-size: 0.86rem;
}

.panel {
  margin-top: 4.3rem;
  border: 1px solid #dbcdbf;
  border-radius: var(--radius-xl);
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: clamp(1.2rem, 3vw, 2.2rem);
}

section {
  margin-top: 4rem;
}

.section-head {
  margin-bottom: 1.25rem;
}

.section-head h2 {
  margin-top: 0.35rem;
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(1.5rem, 4vw, 2.3rem);
}

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

.about-grid article {
  border-radius: var(--radius-lg);
  border: 1px solid #e4d7ca;
  background: #fff9f1;
  padding: 1rem;
}

.about-grid h3 {
  margin-bottom: 0.5rem;
  font-size: 1rem;
}

.about-grid p {
  color: var(--muted);
  font-size: 0.92rem;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

.card {
  border-radius: var(--radius-lg);
  border: 1px solid #ddd1c2;
  background: rgba(255, 253, 248, 0.94);
  box-shadow: 0 10px 26px rgba(40, 30, 10, 0.11);
  overflow: hidden;
}

.card figure {
  margin: 0;
  aspect-ratio: 4 / 3;
  background: #efe5d9;
  display: grid;
  place-items: center;
}

.card img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #efe5d9;
  padding: 0.35rem;
}

.card-body {
  padding: 0.95rem;
  display: grid;
  gap: 0.55rem;
}

.card h3 {
  font-size: 1.08rem;
}

.card p {
  color: #425047;
  font-size: 0.9rem;
}

.card .meta {
  color: var(--muted);
  font-size: 0.78rem;
}

.badge {
  width: fit-content;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  border: 1px solid #f0cdb9;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
}

.achievements {
  margin: 0;
  padding-left: 1.15rem;
  color: #3f4d44;
  font-size: 0.88rem;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 0.9rem;
}

.gallery-tile {
  -webkit-appearance: none;
  appearance: none;
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  min-height: 0;
  aspect-ratio: 4 / 3;
  border: 1px solid #dacdbc;
  background: #f3e9dc;
  padding: 0;
  width: 100%;
  text-align: left;
  cursor: zoom-in;
}

.gallery-tile img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #f2e8db;
  transition: transform 0.28s ease;
}

.gallery-tile:hover img {
  transform: scale(1.025);
}

.gallery-tile:focus-visible {
  outline: 2px solid #b4471d;
  outline-offset: 2px;
}

.zoomable-image {
  cursor: zoom-in;
}

.gallery-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0.65rem;
  font-size: 0.82rem;
  color: white;
  background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.7) 100%);
}

.contact-panel {
  margin-bottom: 2.6rem;
}

.contact-grid {
  display: grid;
  gap: 0.85rem;
}

.contact-grid a {
  text-decoration: none;
  border: 1px solid #e2d6ca;
  background: #fff9f1;
  border-radius: 12px;
  padding: 0.85rem 0.95rem;
  font-weight: 600;
}

.contact-grid a:hover {
  border-color: #cca589;
}

.site-footer {
  text-align: center;
  color: var(--muted);
  font-size: 0.86rem;
  padding: 1rem 0 2.6rem;
}

.primary-button,
.secondary-button,
.ghost-button {
  border: 0;
  cursor: pointer;
  border-radius: 999px;
  font: inherit;
  padding: 0.62rem 1rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, opacity 0.2s ease, background 0.2s ease;
}

.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover {
  transform: translateY(-1px);
}

.primary-button {
  background: linear-gradient(110deg, var(--accent) 0%, #9f3713 100%);
  color: #fff;
  font-weight: 700;
}

.secondary-button {
  background: #fff5ec;
  color: #402a1e;
  border: 1px solid #e7c7ae;
}

.ghost-button {
  background: #fff;
  border: 1px solid #d4c5b6;
  color: #2d362f;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(20, 20, 20, 0.5);
  display: grid;
  place-items: center;
  padding: 1rem;
  z-index: 40;
}

.modal-card {
  position: relative;
  width: min(910px, 96vw);
  max-height: 92vh;
  overflow: auto;
  background: #fffdf8;
  border-radius: 20px;
  border: 1px solid #d7ccbe;
  box-shadow: 0 25px 55px rgba(0, 0, 0, 0.3);
  padding: 1.4rem;
}

.image-viewer {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(10, 10, 10, 0.82);
  display: grid;
  place-items: center;
  gap: 0.6rem;
  padding: 1.2rem;
}

.image-viewer-close {
  position: absolute;
  top: 0.8rem;
  right: 1rem;
  border: 0;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  font-size: 1.9rem;
  line-height: 1;
  cursor: pointer;
}

.image-viewer img {
  max-width: min(94vw, 1320px);
  max-height: 80vh;
  width: auto;
  height: auto;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.5);
  background: rgba(20, 20, 20, 0.55);
  object-fit: contain;
}

.image-viewer-caption {
  margin: 0;
  color: #f2f2f2;
  font-size: 0.9rem;
  text-align: center;
  max-width: min(92vw, 760px);
}

.close-button {
  position: absolute;
  right: 0.9rem;
  top: 0.7rem;
  border: 0;
  background: transparent;
  color: #6a5f53;
  font-size: 1.7rem;
  cursor: pointer;
  line-height: 1;
}

.auth-row {
  display: flex;
  gap: 0.6rem;
  margin-top: 0.4rem;
  align-items: center;
}

.auth-row input {
  flex: 1;
}

.muted {
  color: var(--muted);
  font-size: 0.85rem;
}

.form-message {
  margin-top: 0.55rem;
  min-height: 1.2rem;
  font-size: 0.85rem;
  color: #8a2d0d;
}

.form-message.is-success {
  color: #1f6f3f;
}

.form-message.is-error {
  color: #8a2d0d;
}

.security-note {
  margin-top: 0.7rem;
  border: 1px dashed #ccb9a9;
  border-radius: 10px;
  padding: 0.6rem 0.75rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.tabs {
  margin-top: 1rem;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.tab {
  border: 1px solid #d4c8ba;
  background: #fff;
  border-radius: 999px;
  padding: 0.42rem 0.85rem;
  font: inherit;
  cursor: pointer;
}

.tab.is-active {
  background: #fff2e8;
  border-color: #dfb08f;
  color: #7c3211;
}

.tab-panel {
  margin-top: 1rem;
}

.admin-form {
  border: 1px solid #e4d9cc;
  background: #fff9f1;
  border-radius: 14px;
  padding: 0.9rem;
  display: grid;
  gap: 0.45rem;
}

.admin-form label {
  font-size: 0.82rem;
  color: #4c5a50;
  font-weight: 600;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.checkbox-row input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  accent-color: #b4471d;
  flex: 0 0 auto;
}

.permission-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem 0.8rem;
  margin-bottom: 0.2rem;
}

.admin-form input,
.admin-form textarea {
  border: 1px solid #cfc2b5;
  border-radius: 10px;
  padding: 0.58rem 0.68rem;
  font: inherit;
  background: #fff;
}

.admin-form input:focus,
.admin-form textarea:focus {
  outline: 2px solid rgba(187, 74, 29, 0.25);
  border-color: #c77043;
}

.form-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.2rem;
}

.admin-list {
  margin-top: 0.8rem;
  display: grid;
  gap: 0.55rem;
}

.heat-intro {
  margin-top: 0.35rem;
  max-width: 74ch;
}

.heat-toolbar {
  margin-top: 0.85rem;
  border: 1px solid #e4d9cc;
  background: #fff9f1;
  border-radius: 14px;
  padding: 0.8rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.heat-filter-wrap {
  min-width: min(280px, 100%);
  display: grid;
  gap: 0.35rem;
}

.heat-filter-wrap label {
  font-size: 0.82rem;
  color: #4c5a50;
  font-weight: 600;
}

.heat-filter-wrap select {
  border: 1px solid #cfc2b5;
  border-radius: 10px;
  padding: 0.58rem 0.68rem;
  font: inherit;
  background: #fff;
}

.heat-filter-wrap select:focus {
  outline: 2px solid rgba(187, 74, 29, 0.25);
  border-color: #c77043;
}

.heat-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.heat-metrics {
  margin-top: 0.65rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
  gap: 0.5rem;
}

.heat-metric {
  border: 1px solid #dfd3c5;
  border-radius: 12px;
  background: #fff;
  padding: 0.6rem 0.65rem;
}

.heat-metric-label {
  margin-bottom: 0.25rem;
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.heat-metric-value {
  font-size: 1.08rem;
  font-weight: 700;
  color: #27342c;
}

.heat-forecast {
  margin-top: 0.65rem;
  border: 1px solid #dfd3c5;
  border-radius: 12px;
  background: #fff;
  padding: 0.75rem;
  display: grid;
  gap: 0.45rem;
}

.heat-forecast-line {
  color: #3a473f;
  font-size: 0.86rem;
}

.heat-status {
  width: fit-content;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
}

.heat-status.is-good {
  color: #1f6f3f;
  border-color: #9fd3b5;
  background: #ecfaf2;
}

.heat-status.is-warn {
  color: #8a5a0d;
  border-color: #e8c58f;
  background: #fff7e8;
}

.heat-status.is-late {
  color: #94301c;
  border-color: #e3a9a0;
  background: #fff2f0;
}

.heat-row {
  border: 1px solid #dfd3c5;
  border-radius: 10px;
  background: #fff;
  padding: 0.65rem 0.72rem;
  display: grid;
  gap: 0.4rem;
}

.heat-row-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.heat-row-title {
  font-size: 0.93rem;
  font-weight: 700;
}

.heat-row-meta {
  color: var(--muted);
  font-size: 0.8rem;
}

.heat-row-notes {
  color: #425047;
  font-size: 0.82rem;
  white-space: pre-wrap;
}

.upload-files-panel {
  margin-top: 1rem;
  border: 1px solid #e4d9cc;
  background: #fff9f1;
  border-radius: 14px;
  padding: 0.9rem;
}

.upload-files-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.upload-files-header h4 {
  font-size: 0.98rem;
}

.upload-files-grid {
  margin-top: 0.75rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.65rem;
}

.upload-file-card {
  border: 1px solid #dfd3c5;
  border-radius: 12px;
  background: #fff;
  padding: 0.5rem;
  display: grid;
  gap: 0.45rem;
}

.upload-file-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid #e8dccf;
  background: #f3e9dc;
}

.upload-file-meta {
  display: grid;
  gap: 0.18rem;
}

.upload-file-name {
  font-size: 0.8rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.upload-file-details {
  color: var(--muted);
  font-size: 0.75rem;
}

.admin-row {
  border: 1px solid #dfd3c5;
  border-radius: 10px;
  background: #fff;
  padding: 0.65rem 0.72rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
}

.admin-row h4 {
  font-size: 0.93rem;
  margin-bottom: 0.15rem;
}

.admin-row p {
  color: var(--muted);
  font-size: 0.8rem;
}

.row-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.small-button {
  border: 1px solid #d4c8ba;
  border-radius: 8px;
  background: #fff;
  padding: 0.36rem 0.6rem;
  font-size: 0.76rem;
  cursor: pointer;
}

.small-button.delete {
  border-color: #e3a9a0;
  color: #94301c;
  background: #fff2f0;
}

.admin-actions {
  margin-top: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.noscript {
  position: fixed;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  padding: 0.8rem;
  background: #fff2ee;
  border: 1px solid #e4b8ac;
  border-radius: 10px;
  color: #762515;
  font-size: 0.86rem;
}

.empty-state {
  border: 1px dashed #d7c7b5;
  border-radius: 14px;
  padding: 1rem;
  color: var(--muted);
  background: rgba(255, 251, 244, 0.9);
}

.hidden {
  display: none !important;
}

.reveal {
  animation: riseIn 0.7s ease both;
}

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

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

@media (max-width: 930px) {
  .site-header {
    grid-template-columns: 1fr;
    border-radius: 22px;
    padding: 0.8rem;
    position: static;
  }

  .site-nav {
    justify-content: flex-start;
    gap: 0.65rem;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 0.15rem;
  }

  .site-nav a {
    flex: 0 0 auto;
    padding: 0.35rem 0.55rem;
    border: 1px solid #e2d5c8;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.8);
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 1.2rem;
  }

  .hero-photo img {
    height: clamp(250px, 45vh, 440px);
  }

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

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

@media (max-width: 640px) {
  main {
    width: min(1120px, 94vw);
  }

  .site-header {
    gap: 0.65rem;
  }

  .brand {
    gap: 0.55rem;
  }

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

  .brand-subtitle {
    font-size: 0.68rem;
  }

  .site-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.45rem;
    overflow: visible;
    flex-wrap: wrap;
    padding-bottom: 0;
  }

  .site-nav a {
    text-align: center;
    padding: 0.4rem 0.5rem;
    font-size: 0.78rem;
  }

  #openAdminButton {
    width: 100%;
  }

  .hero {
    margin-top: 1.2rem;
  }

  .hero-copy h1 {
    font-size: clamp(1.72rem, 9vw, 2.2rem);
  }

  .hero-copy p {
    font-size: 0.93rem;
  }

  .hero-photo figcaption {
    font-size: 0.78rem;
  }

  section {
    margin-top: 2.3rem;
  }

  .panel {
    margin-top: 2.3rem;
    padding: 1rem;
  }

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

  .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
  }

  .gallery-caption {
    padding: 0.45rem;
    font-size: 0.74rem;
  }

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

  .tab {
    width: 100%;
    text-align: center;
    padding: 0.45rem 0.35rem;
    font-size: 0.8rem;
  }

  .form-actions > * {
    flex: 1 1 100%;
  }

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

  .row-actions {
    width: 100%;
  }

  .row-actions .small-button {
    flex: 1;
  }

  .heat-toolbar {
    align-items: stretch;
  }

  .heat-actions {
    width: 100%;
  }

  .heat-actions .small-button {
    flex: 1;
  }

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

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

  .modal {
    padding: 0.45rem;
  }

  .modal-card {
    max-height: 95vh;
    border-radius: 16px;
    padding: 1rem 0.8rem;
  }

  .image-viewer-close {
    top: 0.5rem;
    right: 0.5rem;
  }

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

@media (max-width: 420px) {
  .gallery-grid {
    grid-template-columns: 1fr;
  }
}
