/* Carl Hobden — personal site */
@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@400;500;600;700&display=swap');

:root {
  --bg: #f7f5f1;
  --panel: #ffffff;
  --text: #1c1a17;
  --muted: #6f7480;
  --logo-block: #343a40;
  --border-subtle: #e3ddd3;
  --shadow-soft: 0 16px 40px rgba(0, 0, 0, 0.04);
  --duck-orange: #ff6300;
  --duck-orange-dark: #e05500;
  --duck-yellow: #fbc700;
  --duck-ink: #1c1a17;
  --font-display: "Fredoka", system-ui, -apple-system, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  opacity: 0;
  animation: fade-in 0.6s ease-out forwards;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
}

/* Page transitions */
body.is-transitioning {
  opacity: 0;
  transition: opacity 0.25s ease;
}

.admin-page {
  background: #f2f4f8;
}

.admin-container {
  width: 100%;
  max-width: 900px;
  margin: 2rem auto;
  padding: 1.25rem 1.5rem;
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: 0.85rem;
  box-shadow: var(--shadow-soft);
  text-align: left;
}

.admin-login-card {
  max-width: 320px;
  width: 90%;
  text-align: center;
  margin-top: 3rem;
}

.admin-login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.admin-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.admin-logo {
  height: 60px;
  width: auto;
}

.admin-login-card .admin-logo {
  width: 80px;
  max-width: 120px;
  height: auto;
}

.admin-hero-text {
  text-align: center;
}

.admin-hero-text h1 {
  margin: 0;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 1.1rem;
}

.admin-hero-text p {
  margin: 0.2rem 0 0;
  color: var(--muted);
}

.admin-header {
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
}

.admin-actions {
  display: flex;
  gap: 0.6rem;
}

.admin-editor {
  margin-bottom: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
  text-align: left;
  background: #f8f9fb;
  border-radius: 0.75rem;
  padding-bottom: 1rem;
  padding-left: 1rem;
  padding-right: 1rem;
}

.admin-tip {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.upload-card {
  border: 1px dashed var(--border-subtle);
  border-radius: 0.75rem;
  padding: 1rem;
  margin-bottom: 1rem;
  text-align: left;
}

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

.media-card {
  border: 1px solid var(--border-subtle);
  border-radius: 0.65rem;
  padding: 0.4rem;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-width: 240px;
}

.media-thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  max-height: 140px;
  overflow: hidden;
  border-radius: 0.5rem;
  background: #f2f4f8;
  display: flex;
  align-items: center;
  justify-content: center;
}

.media-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-alt {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.media-actions {
  display: flex;
  gap: 0.3rem;
  align-items: center;
}

.media-actions .toolbar-btn {
  flex: 1;
  text-align: center;
  border: none;
  border-radius: 0.4rem;
  background: #2f3238;
  color: #fff;
  padding: 0.35rem 0.7rem;
  font-size: 0.8rem;
  cursor: pointer;
  letter-spacing: 0.02em;
}

.media-actions .toolbar-btn:hover {
  opacity: 0.9;
}

.media-actions .button-secondary.danger {
  padding: 0.32rem 0.65rem;
  font-size: 0.78rem;
}
.editor-panels {
  display: flex;
  justify-content: center;
}

.editor-preview {
  border: 1px solid var(--border-subtle);
  border-radius: 0.65rem;
  padding: 1rem;
  background: #fff;
  min-height: 260px;
}

/* Layout */

.container {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.button-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.55rem 1.1rem;
  border: none;
  border-radius: 999px;
  text-decoration: none;
  color: #f5f5f7;
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 600;
  background: var(--duck-ink);
  transition: background 0.2s ease, transform 0.2s ease;
}

.button-secondary--small {
  padding: 0.35rem 0.75rem;
  font-size: 0.7rem;
  letter-spacing: 0.14em;
}
 
.button-secondary:hover {
  background: #4c5157;
  transform: translateY(-1px);
}
.button-secondary.danger {
  background: #9b1c1c;
}
.button-secondary.danger:hover {
  background: #7c1414;
}

.project-admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 220px));
  justify-content: center;
  gap: 0.7rem;
}

.project-admin-card {
  border: 1px solid var(--border-subtle);
  border-radius: 0.75rem;
  padding: 0.6rem;
  background: #fff;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  width: 100%;
  max-width: 220px;
}

.project-admin-thumb {
  width: 100%;
  aspect-ratio: 4 / 3;
  max-height: 140px;
  border-radius: 0.65rem;
  overflow: hidden;
  background: #f2f4f8;
  display: flex;
  align-items: center;
  justify-content: center;
}

.project-admin-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

.project-admin-body h3 {
  margin: 0;
  letter-spacing: 0.05em;
}

.project-admin-summary {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.project-actions {
  display: flex;
  gap: 0.35rem;
  align-items: center;
}

.project-edit-form {
  display: none;
  border-top: 1px solid var(--border-subtle);
  padding-top: 0.6rem;
}

.project-edit-form.open {
  display: block;
}

/* Header */

.site-header {
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(245, 245, 247, 0.9);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0;
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  text-decoration: none;
  flex-shrink: 0;
}

.brand-mark-icon {
  height: 34px;
  width: auto;
  display: block;
}

.brand-mark-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
  text-transform: lowercase;
}

/* Navigation */

.nav {
  display: flex;
  gap: 1.75rem;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  justify-content: center;
  align-items: center;
  transition: max-height 0.25s ease, opacity 0.2s ease;
}

.nav a {
  text-decoration: none;
  color: var(--muted);
  font-weight: 600;
  position: relative;
  padding: 0.35rem 0.4rem 0.2rem;
  transition: color 0.2s ease, transform 0.2s ease;
  animation: nav-stagger 0.5s ease backwards;
}

.nav a::before { display: none; }
.nav a::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -0.25rem;
  width: 0%;
  height: 2px;
  background: var(--duck-orange);
  transform: translateX(-50%);
  transition: width 0.25s ease;
}

.nav a:hover {
  color: var(--duck-orange-dark);
  transform: translateY(-1px);
}

.nav a:hover::after {
  width: 100%;
}

.nav a.active {
  color: var(--duck-orange-dark);
}

.nav a.active::after {
  width: 100%;
}

.nav-toggle {
  display: none;
  background: var(--duck-ink);
  border: none;
  border-radius: 0.55rem;
  padding: 0.5rem;
  cursor: pointer;
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  gap: 5px;
  flex-direction: column;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: #fff;
  border-radius: 999px;
}

.nav a:nth-child(1) { animation-delay: 0.05s; }
.nav a:nth-child(2) { animation-delay: 0.1s; }
.nav a:nth-child(3) { animation-delay: 0.15s; }
.nav a:nth-child(4) { animation-delay: 0.2s; }
.nav a:nth-child(5) { animation-delay: 0.25s; }

@keyframes nav-stagger {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Home hero */

.home-hero {
  min-height: calc(100vh - 120px);
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.hero-inner {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 4rem 0;
}

.hero-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 620px;
}

.hero-logo {
  max-width: 150px;
  width: 45%;
  height: auto;
  filter: drop-shadow(0 18px 45px rgba(0, 0, 0, 0.08));
  transform-origin: 50% 50%;
  opacity: 1;
  transform: translateY(0) scale(1);
  animation: logo-land 2.5s cubic-bezier(0.25, 0.9, 0.3, 1) forwards, logo-float 6s ease-in-out infinite 2.7s;
  animation-fill-mode: forwards, none;
  margin-bottom: 1rem;
}

.hero-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.2rem, 6vw, 3.4rem);
  text-transform: lowercase;
  margin: 0 0 0.75rem;
}

.hero-tagline {
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.65;
  margin: 0 0 1.75rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}

.home-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 30%, rgba(23, 24, 29, 0.08), transparent 35%), radial-gradient(circle at 70% 60%, rgba(23, 24, 29, 0.06), transparent 35%);
  animation: hero-glow 10s ease-in-out infinite alternate;
}

/* Grumpy Duck homepage spotlight */

.eyebrow {
  margin: 0 0 0.2rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--duck-orange-dark);
}

.duck-spotlight {
  padding: 2.5rem 0 3.5rem;
}

.duck-spotlight-inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  background: var(--panel);
  border: 1px solid var(--border-subtle);
  border-radius: 1rem;
  box-shadow: var(--shadow-soft);
  padding: 1.75rem;
  flex-wrap: wrap;
}

.duck-spotlight-icon {
  height: 90px;
  width: auto;
  flex-shrink: 0;
}

.duck-spotlight h2 {
  margin: 0 0 0.4rem;
  text-transform: lowercase;
  font-size: 1.6rem;
}

.duck-spotlight p {
  margin: 0 0 0.9rem;
  color: var(--muted);
}

/* Home photos CTA */
.home-photos {
  padding: 2rem 0 3rem;
  text-align: center;
}

.home-photos h2 {
  font-size: 2rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin: 0.2rem 0 0.4rem;
}

.home-photos__intro {
  margin: 0 auto 1.2rem;
  max-width: 600px;
  color: var(--muted);
  font-size: 0.95rem;
  letter-spacing: 0.08em;
}

.home-photos__actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.6rem;
}

@keyframes logo-land {
  0% { opacity: 0; transform: translateY(12px) scale(0.2); }
  60% { opacity: 1; transform: translateY(-3px) scale(1.08); }
  80% { opacity: 1; transform: translateY(2px) scale(1.02); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes logo-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@keyframes hero-glow {
  0% { transform: translate3d(0,0,0); }
  100% { transform: translate3d(2%, -2%, 0); }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Page sections */

.page-section {
  padding: 3rem 0 3.5rem;
  position: relative;
}

.page-section .narrow {
  max-width: 720px;
}

.page-section h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 2.1rem;
  margin-bottom: 0.75rem;
}

.page-section h2 {
  font-family: var(--font-display);
  font-weight: 600;
}

.page-section:not(:first-of-type)::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.08), transparent);
}

.page-section img {
  max-width: 100%;
  height: auto;
}

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

.project-card {
  background: var(--panel);
  border: 1px solid var(--border-subtle);
  border-radius: 0.85rem;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  transform: translateY(14px);
  opacity: 0;
  transition: transform 0.5s ease, opacity 0.5s ease, box-shadow 0.3s ease;
}

.project-card.in-view {
  transform: translateY(0);
  opacity: 1;
}

.project-card:hover {
  box-shadow: 0 14px 32px rgba(0,0,0,0.12);
}

.project-thumb {
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #f2f4f8;
}

.project-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.project-content {
  padding: 1rem 1.1rem 1.2rem;
}

.project-content h2 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  letter-spacing: 0.05em;
}

.project-content p {
  margin: 0;
  color: var(--muted);
}

.project-cta {
  margin-top: 0.6rem;
}

.project-cta .button-secondary {
  width: 100%;
  justify-content: center;
}

.project-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 999;
  padding: 1rem;
}

.project-modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.project-modal {
  background: #fff;
  border-radius: 0.9rem;
  max-width: 720px;
  width: 95vw;
  box-shadow: 0 22px 48px rgba(0,0,0,0.22);
  position: relative;
  overflow: hidden;
}

.project-modal-close {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  border: none;
  background: #2f3238;
  color: #fff;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
}

.project-modal-body {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 1rem;
  padding: 1.4rem 1.4rem 1.6rem;
  max-height: 80vh;
  overflow: auto;
}

.project-modal-thumb {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #f2f4f8;
  border-radius: 0.75rem;
  overflow: hidden;
}

.project-modal-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.project-modal-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--muted);
  font-size: 0.9rem;
}

.project-modal-content h2 {
  margin: 0 0 0.35rem;
  font-size: 1.2rem;
  letter-spacing: 0.05em;
}

.project-modal-content p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

@media (max-width: 720px) {
  .project-modal-body {
    grid-template-columns: 1fr;
    max-height: 70vh;
  }

  .project-modal {
    width: 100%;
    max-width: 100%;
    margin: 0 0.5rem;
    border-radius: 0.75rem;
  }
}

.lead {
  font-size: 1.02rem;
  color: var(--muted);
  margin-bottom: 1.75rem;
}

/* Cards */

.card {
  background: var(--panel);
  border-radius: 0.85rem;
  padding: 1.4rem 1.5rem;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-soft);
  margin-bottom: 1.5rem;
}

.card h2 {
  margin-top: 0;
  margin-bottom: 0.6rem;
  font-size: 0.9rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.card h3 {
  margin: 0 0 0.2rem;
  font-size: 1.05rem;
}

.card .job-meta {
  margin: 0 0 0.75rem;
  color: var(--duck-orange-dark);
  font-size: 0.85rem;
  font-weight: 600;
}

.card ul {
  margin-bottom: 0;
}

.card-link a {
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
  border-bottom: 1px solid var(--text);
}

.card-link a:hover {
  opacity: 0.7;
}

.card-link a.button-secondary,
.card-link a.button-primary {
  color: #f5f5f7;
  border-bottom: none;
}

/* Grumpy Duck page */

.duck-hero {
  text-align: center;
  margin-bottom: 2rem;
}

.duck-hero-icon {
  height: 110px;
  width: auto;
  margin-bottom: 1rem;
  filter: drop-shadow(0 12px 28px rgba(0, 0, 0, 0.1));
}

.duck-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.2rem;
  margin-bottom: 2.5rem;
}

.duck-card {
  background: var(--panel);
  border: 1px solid var(--border-subtle);
  border-radius: 0.85rem;
  box-shadow: var(--shadow-soft);
  padding: 1.2rem 1.1rem 1.4rem;
  text-align: center;
}

.duck-card img {
  max-width: 140px;
  width: 100%;
  height: auto;
  margin: 0 auto 0.75rem;
  display: block;
}

.duck-card p {
  color: var(--muted);
  font-size: 0.92rem;
  margin: 0;
}

.duck-hardware {
  border-top: 1px solid var(--border-subtle);
  padding-top: 1.5rem;
}

/* Lists */

ul {
  padding-left: 1.2rem;
}

ul li {
  margin-bottom: 0.4rem;
}

/* Contact form */

.contact-form-card {
  margin-top: 0.75rem;
}

form {
  margin-top: 1rem;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

label {
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

input[type="text"],
input[type="email"],
textarea {
  border-radius: 0.5rem;
  border: 1px solid var(--border-subtle);
  padding: 0.6rem 0.7rem;
  font-family: inherit;
  font-size: 0.95rem;
  background: #fbfbfd;
}

input:focus,
textarea:focus {
  outline: 2px solid #b5bbc6;
  outline-offset: 1px;
}

.file-input {
  display: none;
}

.hp-field {
  position: absolute;
  left: -9999px;
  top: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.button-primary {
  border: none;
  border-radius: 999px;
  padding: 0.65rem 1.5rem;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  background: var(--duck-orange);
  color: #ffffff;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.3s ease;
}

.button-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(255, 99, 0, 0.25);
  background: var(--duck-orange-dark);
}

.form-note {
  margin-top: 0.75rem;
  font-size: 0.8rem;
  color: var(--muted);
}
.form-alert {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 0.5rem;
  border: 1px solid var(--border-subtle);
  background: #f7f8fb;
  font-size: 0.9rem;
}
.form-alert.success {
  border-color: #6bb187;
  color: #245a37;
  background: #eff9f3;
}
.form-alert.error {
  border-color: #d88484;
  color: #6c1f1f;
  background: #fdf2f2;
}

textarea {
  font-family: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  border-radius: 0.5rem;
  border: 1px solid var(--border-subtle);
  padding: 0.8rem 0.9rem;
  font-size: 0.92rem;
  min-height: 240px;
  background: #fbfbfd;
}

textarea:focus {
  outline: 2px solid #b5bbc6;
  outline-offset: 1px;
}

.hidden-textarea {
  display: none;
}

.rich-editor {
  border: 1px solid var(--border-subtle);
  border-radius: 0.65rem;
  padding: 0.85rem;
  min-height: 360px;
  background: #fbfbfd;
  max-width: 820px;
  width: 100%;
  margin: 0 auto;
}

.rich-editor:focus {
  outline: 2px solid #b5bbc6;
  outline-offset: 1px;
}

.rich-editor img,
.editor-preview img,
.page-section img {
  max-width: 100%;
  height: auto;
}

.rich-editor img.img-size-small,
.editor-preview img.img-size-small,
.page-section img.img-size-small {
  width: 25%;
  height: auto;
  max-width: 25%;
}
.rich-editor img.img-size-medium,
.editor-preview img.img-size-medium,
.page-section img.img-size-medium {
  width: 50%;
  height: auto;
  max-width: 50%;
}
.rich-editor img.img-size-large,
.editor-preview img.img-size-large,
.page-section img.img-size-large {
  width: 75%;
  height: auto;
  max-width: 75%;
}
.rich-editor img.fit-width,
.editor-preview img.fit-width,
.page-section img.fit-width {
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
}

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

.editor-toolbar {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.editor-toolbar .toolbar-btn {
  border: none;
  border-radius: 0.4rem;
  background: #2f3238;
  color: #fff;
  padding: 0.35rem 0.7rem;
  font-size: 0.8rem;
  cursor: pointer;
  letter-spacing: 0.02em;
}

.editor-toolbar .toolbar-btn:hover {
  opacity: 0.9;
}

.editor-actions {
  margin-top: 0.6rem;
}

/* Gallery page */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.gallery-card {
  margin: 0;
  border: 1px solid var(--border-subtle);
  border-radius: 0.75rem;
  overflow: hidden;
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.gallery-card img {
  width: 100%;
  display: block;
}

.gallery-card figcaption {
  padding: 0.65rem 0.85rem;
  font-size: 0.9rem;
  color: var(--muted);
}

/* CCTV */

.cctv-page .page-section {
  padding-top: 2.6rem;
  padding-bottom: 3.1rem;
}

.cctv-intro h1 {
  margin: 0.2rem 0 0.4rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.cctv-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: #1f2024;
  color: #ffffff;
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.cctv-note {
  margin-top: 0.55rem;
  display: inline-block;
  padding: 0.65rem 0.75rem;
  border-radius: 0.65rem;
  background: #eef1f6;
  color: var(--muted);
  font-size: 0.9rem;
}

.cctv-grid {
  margin-top: 1.6rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.cctv-card {
  border: 1px solid var(--border-subtle);
  border-radius: 0.9rem;
  background: var(--panel);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.cctv-card-inner {
  border: none;
  padding: 0;
  width: 100%;
  background: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  text-align: left;
}

.cctv-card-inner:focus-visible {
  outline: 2px solid #2f3238;
  outline-offset: 4px;
}

.cctv-feed {
  position: relative;
  aspect-ratio: 16 / 10;
  background: radial-gradient(circle at 30% 30%, rgba(0, 0, 0, 0.08), transparent 50%), #0f1013;
  overflow: hidden;
}

.cctv-feed img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease, opacity 0.35s ease;
}

.cctv-card-inner:hover .cctv-feed img {
  transform: scale(1.02);
  opacity: 0.94;
}

.cctv-live-pill {
  position: absolute;
  top: 0.65rem;
  left: 0.65rem;
  background: rgba(255, 255, 255, 0.9);
  color: #121316;
  border-radius: 999px;
  padding: 0.25rem 0.6rem;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.12);
}

.cctv-meta {
  padding: 0.9rem 1rem 1rem;
}

.cctv-meta h3 {
  margin: 0 0 0.25rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 0.92rem;
}

.cctv-meta p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.cctv-full {
  margin-top: 1.8rem;
  border: 1px solid var(--border-subtle);
  border-radius: 0.95rem;
  padding: 1rem;
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}

.cctv-full-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.cctv-full-frame {
  margin-top: 1rem;
  border-radius: 0.8rem;
  overflow: hidden;
  background: #0f1013;
  border: 1px solid var(--border-subtle);
  cursor: pointer;
}

.cctv-full-frame img {
  width: 100%;
  height: auto;
  display: block;
}

.cctv-full-open .cctv-grid {
  display: none;
}

@media (min-width: 900px) {
  .admin-container {
    max-width: 1100px;
  }
  .editor-panels {
    grid-template-columns: 1fr 1fr;
  }
  .admin-header {
    justify-content: flex-end;
  }
}

.photos-page {
  padding: 2.4rem 0 3rem;
}

.photos-hero {
  text-align: center;
  margin-bottom: 1.5rem;
}

.photos-hero__actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.photos-hero__actions .button-secondary {
  min-width: 160px;
  justify-content: center;
  padding: 0.75rem 1.35rem;
  border: 1px solid rgba(0, 0, 0, 0.14);
  box-shadow: 0 16px 28px rgba(0, 0, 0, 0.18);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.photos-hero__actions .button-secondary:hover,
.photos-hero__actions .button-secondary:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 20px 32px rgba(0, 0, 0, 0.2);
}

.photos-hero__actions .button-secondary--ghost {
  background: #6b707a;
  border-color: rgba(0, 0, 0, 0.15);
  color: #f5f5f7;
  box-shadow: 0 16px 28px rgba(0, 0, 0, 0.18);
}

.photos-hero__actions .button-secondary--active {
  border-color: rgba(0, 0, 0, 0.35);
  box-shadow: 0 20px 32px rgba(0, 0, 0, 0.22);
}

.photos-hero h1 {
  margin: 0.2rem 0 0.35rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
}

.photos-secret-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  letter-spacing: 0.06em;
}

@media (max-width: 640px) {
  .photos-hero__actions {
    flex-direction: column;
  }
  .photos-hero__actions .button-secondary {
    width: 100%;
  }
}

.photos-search {
  margin-bottom: 1.8rem;
  background: var(--panel);
  border: 1px solid var(--border-subtle);
  border-radius: 1rem;
  padding: 1.2rem 1.5rem;
  box-shadow: var(--shadow-soft);
}

.photos-upload {
  margin-bottom: 2rem;
  background: var(--panel);
  border: 1px solid var(--border-subtle);
  border-radius: 1rem;
  padding: 1.6rem 1.5rem;
  box-shadow: var(--shadow-soft);
}

.upload-form {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
}

.upload-form label {
  display: block;
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.upload-form input[type="password"],
.upload-form input[type="file"] {
  width: 100%;
  border: 1px solid var(--border-subtle);
  border-radius: 0.6rem;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  background: #fff;
  color: var(--text);
}

.upload-form input[type="file"] {
  padding: 0.6rem;
}

.upload-messages {
  border: 1px solid var(--border-subtle);
  border-radius: 0.8rem;
  padding: 1rem 1.2rem;
  margin-bottom: 1.2rem;
}

.upload-messages ul {
  margin: 0.35rem 0 0;
  padding-left: 1.2rem;
}

.upload-messages--error {
  background: #fff5f5;
  border-color: #f0b4b4;
}

.upload-messages--success {
  background: #f4fff8;
  border-color: #a8e7c1;
}

.photos-page[data-search-mode="all"] .photos-search {
  display: none;
}

.photos-page[data-search-mode="person"] .search-area--tags,
.photos-page[data-search-mode="tag"] .search-area--people {
  display: none;
}

.photos-page[data-search-mode="person"] .search-area--people,
.photos-page[data-search-mode="tag"] .search-area--tags {
  border-color: rgba(23, 24, 29, 0.18);
  box-shadow: 0 18px 32px rgba(0, 0, 0, 0.08);
}

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

.search-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
}

.search-area-card {
  width: 100%;
  max-width: 520px;
  background: #fff;
  border-radius: 1rem;
  border: 1px solid var(--border-subtle);
  padding: 1.55rem 1.4rem;
  box-shadow: var(--shadow-soft);
}

.search-area-card .search-block {
  margin-bottom: 0.35rem;
}

.photos-search__hint {
  margin: 0.8rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  text-align: center;
}

.search-block label {
  display: block;
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.photos-search input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-subtle);
  border-radius: 0.6rem;
  background: #fff;
  font-size: 1rem;
  color: var(--text);
}

.photos-search input:focus {
  outline: 2px solid #2f3238;
  outline-offset: 2px;
}

.search-helper {
  display: flex;
  justify-content: center;
  width: 100%;
  margin-top: 0.45rem;
}

.search-helper button {
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.35rem 0.9rem;
}

.search-suggestions {
  margin-top: 0.6rem;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.45rem;
}

.search-suggestions button {
  border: 1px solid rgba(0, 0, 0, 0.14);
  border-radius: 0.85rem;
  background: #6b707a;
  color: #f5f5f7;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.65rem 1rem;
  cursor: pointer;
  width: 100%;
  max-width: 360px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transition: transform 0.2s ease, background 0.2s ease;
}

.search-suggestions button:hover,
.search-suggestions button:focus-visible {
  background: #4c5157;
  transform: translateY(-1px);
}

.search-suggestions__tip {
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  color: var(--muted);
  text-transform: uppercase;
}

.people-hint,
.tag-hint {
  margin: 0.5rem 0 0.25rem;
  color: var(--muted);
  font-size: 0.85rem;
}


.photos-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 0.6rem;
}

.action-buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.results-count {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0;
}

@media (max-width: 640px) {
  .photos-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .action-buttons {
    flex-direction: column;
    width: 100%;
  }
  .action-buttons .button-secondary {
    width: 100%;
    justify-content: center;
  }
  .results-count {
    text-align: center;
  }
}

.button-secondary.button-secondary--ghost {
  background: #6b707a;
  color: #f5f5f7;
  border-color: rgba(0, 0, 0, 0.15);
}

.button-secondary.button-secondary--ghost:hover {
  background: #4c5157;
}

.photo-grid {
  margin-top: 1.3rem;
  display: grid;
  gap: 0.9rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.photo-card {
  border: 1px solid var(--border-subtle);
  border-radius: 0.85rem;
  background: #fff;
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.photo-card__trigger {
  width: 100%;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
}

.photo-card__trigger img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.photo-card__meta {
  padding: 0.6rem 0.9rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.photo-card__meta span {
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.photo-card__meta p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text);
  line-height: 1.4;
}

.photo-grid__empty {
  margin: 2rem 0;
  padding: 1.2rem;
  border: 1px solid var(--border-subtle);
  border-radius: 0.65rem;
  background: #fafafb;
  color: var(--muted);
  text-align: center;
}

.photos-resume {
  position: fixed;
  right: calc(1rem + env(safe-area-inset-right));
  bottom: calc(1rem + env(safe-area-inset-bottom));
  z-index: 50;
  display: flex;
}

.photo-card--resume {
  border-color: #2f3238;
  box-shadow: 0 0 0 3px rgba(47, 50, 56, 0.24), var(--shadow-soft);
  animation: resumePulse 1.8s ease-out 1;
}

@keyframes resumePulse {
  0% {
    box-shadow: 0 0 0 0 rgba(47, 50, 56, 0.35), var(--shadow-soft);
  }
  70% {
    box-shadow: 0 0 0 12px rgba(47, 50, 56, 0), var(--shadow-soft);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(47, 50, 56, 0), var(--shadow-soft);
  }
}

.photos-results__placeholder {
  margin-top: 0.4rem;
  text-align: center;
  color: var(--muted);
  letter-spacing: 0.1em;
  font-size: 0.95rem;
}

@media (max-width: 640px) {
  .photos-resume {
    right: 50%;
    transform: translateX(50%);
  }
  .photos-resume .button-secondary {
    min-width: 160px;
  }
}

.gallery-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.98);
  z-index: 10001;
  backdrop-filter: blur(8px);
  padding: 1rem;
}

.gallery-overlay:not([hidden]) {
  display: flex;
}

body.overlay-open {
  overflow: hidden;
}

body.overlay-open .site-footer {
  visibility: hidden;
}

.photo-meta-editor {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.92);
  z-index: 10002;
  padding: 1rem;
}

.photo-meta-editor:not([hidden]) {
  display: flex;
}

body.meta-editor-open {
  overflow: hidden;
}

.photo-meta-editor__panel {
  width: min(900px, 100%);
  max-height: 92vh;
  background: var(--panel);
  border-radius: 1.1rem;
  padding: 1.6rem;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
  overflow-y: auto;
}

.photo-meta-editor__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  cursor: pointer;
}

.photo-meta-editor__preview {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.photo-meta-editor__image {
  width: 120px;
  height: 120px;
  border-radius: 0.9rem;
  object-fit: cover;
  background: #f2f4f8;
}

.photo-meta-editor__details {
  flex: 1;
}

.photo-meta-editor__caption {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.photo-meta-editor__date {
  margin: 0.2rem 0 0;
  font-size: 0.75rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--muted);
}

.photo-meta-editor__form {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.meta-password-row {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.meta-password-row input {
  flex: 1;
  min-width: 160px;
}

.meta-password-row input.meta-password--approved {
  text-align: center;
  font-weight: 600;
  letter-spacing: 0.08em;
  background: var(--panel);
  color: var(--muted);
}

.photo-meta-editor__actions {
  display: flex;
  justify-content: center;
  margin-top: 0.4rem;
}

.photo-meta-editor__actions button {
  width: 100%;
  max-width: 240px;
}

.photo-meta-editor__trigger {
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.gallery-overlay__panel {
  position: relative;
  width: min(920px, 100%);
  max-height: calc(100vh - 2rem);
  border-radius: 1rem;
  background: var(--panel);
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  box-shadow: var(--shadow-soft);
  overflow-y: auto;
}

.gallery-overlay__close {
  align-self: flex-end;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

.gallery-overlay__image {
  width: 100%;
  height: auto;
  border-radius: 0.8rem;
  background: #f2f4f8;
  max-height: 60vh;
  object-fit: contain;
}

.gallery-overlay__date {
  margin: 0;
  font-size: 0.75rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--muted);
}

.gallery-overlay__caption {
  margin: 0;
  font-size: 1rem;
  color: var(--text);
}

.gallery-overlay__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.gallery-overlay__meta {
  margin-top: 0.9rem;
}

.gallery-overlay__meta-form {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.gallery-overlay__meta-form label {
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.gallery-overlay__meta-form input {
  width: 100%;
  border: 1px solid var(--border-subtle);
  border-radius: 0.55rem;
  padding: 0.7rem 0.85rem;
  font-size: 0.95rem;
  background: #fff;
  color: var(--text);
}

.gallery-overlay__meta-form button {
  width: 100%;
  justify-content: center;
  align-self: stretch;
}

.gallery-overlay__meta-message {
  margin: 0;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-align: center;
  min-height: 1rem;
}

.gallery-overlay__meta-message[data-state="success"] {
  color: #0c9755;
}

.gallery-overlay__meta-message[data-state="error"] {
  color: #a82121;
}

.gallery-overlay__meta-suggestions {
  margin-top: 0.3rem;
  min-height: 2rem;
}

.gallery-overlay__meta-hint {
  margin: 0.3rem 0 0;
  font-size: 0.8rem;
  color: var(--muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: center;
}

.gallery-overlay__tags span {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(0, 0, 0, 0.03);
}

.gallery-overlay__tag-separator {
  border: none;
  background: none;
}

.gallery-overlay__nav {
  display: flex;
  gap: 0.6rem;
}

.gallery-overlay__nav button {
  flex: 1;
  border: none;
  border-radius: 0.7rem;
  padding: 0.65rem 0;
  background: #17181d;
  color: #fff;
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
}

@media (min-width: 768px) {
  .photos-search-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Footer */

.site-footer {
  border-top: 1px solid var(--border-subtle);
  padding: 1.2rem 0 1.6rem;
  font-size: 0.78rem;
  color: var(--muted);
  background: rgba(245, 245, 247, 0.9);
  margin-top: 1rem;
}

.site-footer .container {
  text-align: center;
}

/* Small screens */

@media (max-width: 640px) {
  .header-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .nav {
    position: relative;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    max-height: 0;
    overflow: hidden;
    gap: 0.5rem;
    opacity: 0;
  }

  body.nav-open .nav {
    max-height: 260px;
    opacity: 1;
  }

  .nav-toggle {
    display: inline-flex;
    align-self: flex-end;
  }

  .nav a {
    width: 100%;
    padding: 0.45rem 0.2rem;
  }

  .hero-logo {
    max-width: 260px;
  }
}
