:root {
  --ink: #221f1b;
  --muted: #6f675f;
  --soft: #90877d;
  --paper: #f7f3ea;
  --paper-deep: #eee5d6;
  --panel: #fffdf8;
  --line: #ded2bf;
  --accent: #246f68;
  --accent-dark: #164d48;
  --gold: #b98236;
  --rust: #9b4733;
  --tape: #252528;
  --shadow: 0 18px 42px rgba(50, 38, 26, 0.12);
  --shadow-soft: 0 10px 28px rgba(50, 38, 26, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background:
    linear-gradient(rgba(255, 255, 255, 0.42) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.32) 1px, transparent 1px),
    radial-gradient(circle at top left, rgba(185, 130, 54, 0.16), transparent 34rem),
    linear-gradient(180deg, var(--paper) 0%, #fbfaf5 52%, var(--paper-deep) 100%);
  background-size: 34px 34px, 34px 34px, auto, auto;
}

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

button,
input,
select {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px clamp(18px, 4vw, 56px);
  border-bottom: 1px solid rgba(222, 210, 191, 0.82);
  background: rgba(255, 253, 248, 0.88);
  backdrop-filter: blur(16px);
  box-shadow: 0 8px 26px rgba(50, 38, 26, 0.06);
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 1.02rem;
  font-weight: 800;
}

.logo::before {
  width: 18px;
  height: 18px;
  border: 3px solid var(--accent);
  border-radius: 50%;
  box-shadow: inset 0 0 0 4px var(--panel);
  content: "";
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  color: var(--muted);
  font-size: 0.94rem;
}

.site-nav a {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border-radius: 999px;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.site-nav a:hover {
  color: var(--accent-dark);
  background: rgba(36, 111, 104, 0.09);
  transform: translateY(-1px);
}

main,
.site-footer {
  width: min(1120px, calc(100% - 36px));
  margin: 0 auto;
}

.hero {
  min-height: 54vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 330px);
  align-items: center;
  gap: clamp(28px, 6vw, 76px);
  padding: clamp(58px, 8vw, 104px) 0;
}

.profile-hero {
  padding: clamp(42px, 7vw, 76px) 0 28px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--rust);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  max-width: 790px;
  margin-bottom: 18px;
  font-size: clamp(2.45rem, 6vw, 5rem);
  line-height: 0.98;
}

h2 {
  color: var(--ink);
}

.hero-copy {
  max-width: 660px;
  color: var(--muted);
  font-size: 1.12rem;
  line-height: 1.72;
}

.archive-summary {
  position: relative;
  min-height: 250px;
  padding: 28px;
  border: 1px solid rgba(222, 210, 191, 0.92);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(36, 111, 104, 0.1), rgba(185, 130, 54, 0.14)),
    var(--panel);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.archive-summary::before,
.archive-summary::after {
  position: absolute;
  top: 24px;
  width: 54px;
  height: 54px;
  border: 10px solid rgba(34, 31, 27, 0.12);
  border-radius: 50%;
  content: "";
}

.archive-summary::before {
  left: 24px;
}

.archive-summary::after {
  right: 24px;
}

.archive-summary span {
  color: var(--muted);
  font-size: 0.92rem;
}

.archive-summary strong {
  margin: 8px 0;
  color: var(--accent-dark);
  font-size: clamp(2.45rem, 6vw, 4.2rem);
  line-height: 1;
}

.archive-summary p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.5;
}

.section {
  padding: 48px 0;
  border-top: 1px solid rgba(222, 210, 191, 0.88);
}

.section-heading {
  margin-bottom: 24px;
}

.section-heading h2 {
  margin-bottom: 0;
  font-size: clamp(1.75rem, 4vw, 2.55rem);
}

.video-grid,
.photo-grid {
  display: grid;
  gap: 18px;
}

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

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

.video-card,
.photo-card,
.profile-form,
.upload-panel,
.profile-card,
.auth-card,
.empty-state,
.notice-list,
.user-row,
.member-card {
  border: 1px solid rgba(222, 210, 191, 0.92);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.95);
  box-shadow: var(--shadow-soft);
}

.video-card,
.photo-card {
  padding: 12px;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.video-card:hover,
.photo-card:hover,
.member-card:hover,
.user-row:hover {
  border-color: rgba(36, 111, 104, 0.35);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.video-frame {
  position: relative;
  aspect-ratio: 4 / 3;
  margin-bottom: 14px;
  border-radius: 6px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 0 2px, transparent 2px 10px),
    var(--tape);
}

.video-frame::before {
  position: absolute;
  inset: 9px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  pointer-events: none;
  content: "";
}

.video-frame video,
.video-frame iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  object-fit: contain;
}

.video-card h3,
.photo-card h3 {
  margin-bottom: 6px;
  font-size: 1rem;
}

.video-card p,
.notes p,
.photo-card p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.55;
}

.empty-state,
.notice-list {
  padding: 18px;
  color: var(--muted);
}

.empty-state {
  border-style: dashed;
  background:
    linear-gradient(135deg, rgba(36, 111, 104, 0.06), rgba(185, 130, 54, 0.07)),
    rgba(255, 253, 248, 0.9);
}

.empty-state p,
.notice-list p {
  margin: 0;
  line-height: 1.55;
}

.empty-state p + p,
.notice-list p + p {
  margin-top: 6px;
}

.notice-list {
  margin-bottom: 20px;
  color: var(--accent-dark);
  background: #f0f8f5;
  border-color: rgba(36, 111, 104, 0.22);
}

.error {
  color: #8a2f24;
  border-color: #e4b8ae;
  background: #fff6f3;
}

.photo-carousel {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding: 4px 2px 14px;
  scroll-snap-type: x mandatory;
  scrollbar-color: var(--accent) rgba(222, 210, 191, 0.7);
}

.photo-carousel .photo-card {
  flex: 0 0 min(270px, 78vw);
  scroll-snap-align: start;
}

.photo-placeholder,
.photo-card img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  margin-bottom: 14px;
  border-radius: 6px;
  object-fit: cover;
  background:
    linear-gradient(135deg, rgba(36, 111, 104, 0.14), rgba(185, 130, 54, 0.16)),
    #f3efe6;
}

.profile-card {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: clamp(18px, 4vw, 30px);
}

.profile-card h1 {
  margin-bottom: 10px;
  font-size: clamp(2.2rem, 5vw, 4rem);
}

.avatar-placeholder {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  background:
    radial-gradient(circle at 35% 32%, rgba(255, 255, 255, 0.34), transparent 34%),
    linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff;
  font-size: 2.4rem;
  font-weight: 800;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22), 0 12px 24px rgba(22, 77, 72, 0.18);
}

.profile-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
}

.profile-form,
.upload-panel {
  padding: clamp(18px, 4vw, 28px);
}

label {
  display: block;
  margin: 18px 0 8px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(36, 111, 104, 0.12);
}

textarea {
  min-height: 110px;
  resize: vertical;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  margin-top: 18px;
  padding: 0 18px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 10px 18px rgba(36, 111, 104, 0.18);
  transition: background 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.button:hover {
  background: var(--accent-dark);
  box-shadow: 0 12px 24px rgba(36, 111, 104, 0.24);
  transform: translateY(-1px);
}

.download-button {
  width: 100%;
  margin-top: 14px;
}

.photo-actions {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.photo-actions .button {
  width: 100%;
}

.danger-button {
  background: var(--rust);
  box-shadow: 0 10px 18px rgba(155, 71, 51, 0.16);
}

.danger-button:hover {
  background: #743224;
  box-shadow: 0 12px 24px rgba(155, 71, 51, 0.22);
}

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px 0;
}

.auth-card {
  width: min(430px, 100%);
  padding: clamp(24px, 5vw, 36px);
}

.auth-card h1 {
  margin-bottom: 18px;
  font-size: clamp(2.1rem, 5vw, 3.1rem);
}

.user-list,
.member-grid {
  display: grid;
  gap: 10px;
}

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

.user-row,
.member-card {
  display: grid;
  gap: 4px;
  padding: 14px;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.user-row {
  gap: 12px;
}

.user-row > a {
  display: grid;
  gap: 4px;
}

.inline-password-form {
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.inline-password-form label {
  margin-top: 0;
}

.inline-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.compact-button {
  margin-top: 0;
  white-space: nowrap;
}

.member-card {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 14px;
}

.member-card .avatar-placeholder {
  width: 54px;
  height: 54px;
  font-size: 1.35rem;
}

.user-row span,
.member-card span {
  color: var(--muted);
  font-size: 0.92rem;
}

.notes {
  max-width: 760px;
}

code {
  padding: 2px 6px;
  border-radius: 5px;
  color: var(--accent-dark);
  background: rgba(36, 111, 104, 0.09);
}

.site-footer {
  padding: 28px 0 36px;
  border-top: 1px solid rgba(222, 210, 191, 0.88);
  color: var(--muted);
}

.site-footer p {
  margin-bottom: 0;
}

@media (max-width: 980px) {
  .video-grid,
  .photo-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .site-header,
  .hero {
    align-items: flex-start;
    grid-template-columns: 1fr;
  }

  .site-header {
    flex-direction: column;
  }

  .site-nav {
    justify-content: flex-start;
  }

  .hero {
    min-height: auto;
  }

  .video-grid,
  .photo-grid,
  .profile-layout,
  .member-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  main,
  .site-footer {
    width: min(100% - 28px, 1120px);
  }

  .site-nav {
    width: 100%;
    gap: 6px;
  }

  .site-nav a {
    padding: 0 10px;
    font-size: 0.9rem;
  }

  h1 {
    font-size: 2.45rem;
  }

  .video-grid,
  .photo-grid,
  .profile-layout,
  .member-grid {
    grid-template-columns: 1fr;
  }

  .profile-card {
    align-items: flex-start;
    flex-direction: column;
  }

  .inline-controls {
    grid-template-columns: 1fr;
  }
}
