:root {
  --bg: #f7fbff;
  --bg-deep: #07112f;
  --surface: #ffffff;
  --surface-soft: #eef7ff;
  --glass: rgba(255, 255, 255, 0.78);
  --text: #0c1636;
  --muted: #60708f;
  --border: rgba(22, 54, 99, 0.12);
  --cyan: #12d8ff;
  --blue: #2563eb;
  --navy: #0a1d4d;
  --violet: #7c3aed;
  --gold: #f8c14a;
  --green: #18b981;
  --red: #ef4444;
  --shadow: 0 22px 60px rgba(10, 29, 77, 0.14);
  --shadow-soft: 0 12px 32px rgba(10, 29, 77, 0.1);
  --radius: 20px;
  --max: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: "Noto Sans Thai", "Segoe UI", Tahoma, sans-serif;
  line-height: 1.6;
}

body.modal-open {
  overflow: hidden;
}

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

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

button {
  cursor: pointer;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(7, 17, 47, 0.88);
  backdrop-filter: blur(18px);
}

.navbar {
  width: min(100% - 32px, var(--max));
  min-height: 76px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: #fff;
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--cyan), var(--violet));
  color: white;
  font-weight: 800;
  box-shadow: 0 10px 30px rgba(18, 216, 255, 0.28);
}

.brand strong,
.brand small {
  display: block;
  line-height: 1.15;
}

.brand small {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.78rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 18px;
  color: rgba(255, 255, 255, 0.84);
  font-weight: 600;
}

.nav-links a {
  position: relative;
  font-size: 0.95rem;
}

.nav-links a::after {
  position: absolute;
  left: 0;
  bottom: -8px;
  width: 0;
  height: 2px;
  content: "";
  background: var(--cyan);
  transition: width 0.22s ease;
}

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

.icon-btn {
  border: 0;
  background: transparent;
}

.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 14px;
}

.menu-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  margin: 5px auto;
  background: #fff;
  border-radius: 999px;
}

.section {
  padding: 84px 0;
}

.section-inner {
  width: min(100% - 32px, var(--max));
  margin: 0 auto;
}

.hero {
  position: relative;
  overflow: hidden;
  min-height: calc(100vh - 76px);
  display: flex;
  align-items: center;
  color: #fff;
  background:
    radial-gradient(circle at 80% 20%, rgba(124, 58, 237, 0.42), transparent 32%),
    radial-gradient(circle at 20% 18%, rgba(18, 216, 255, 0.3), transparent 34%),
    linear-gradient(135deg, #06102e 0%, #0b2a63 48%, #35156d 100%);
}

.hero-grid {
  position: absolute;
  inset: 0;
  opacity: 0.23;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, black, transparent 88%);
}

.orb {
  position: absolute;
  border-radius: 999px;
  filter: blur(4px);
  opacity: 0.75;
}

.orb-a {
  width: 260px;
  height: 260px;
  left: -80px;
  bottom: 80px;
  background: radial-gradient(circle, rgba(18, 216, 255, 0.35), transparent 65%);
}

.orb-b {
  width: 320px;
  height: 320px;
  right: -120px;
  top: 120px;
  background: radial-gradient(circle, rgba(248, 193, 74, 0.25), transparent 62%);
}

.hero-inner {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.75fr);
  align-items: center;
  gap: 52px;
}

.hero h1 {
  max-width: 820px;
  margin: 0;
  font-size: clamp(2.8rem, 7vw, 5.8rem);
  line-height: 1.02;
  letter-spacing: 0;
}

.hero p {
  max-width: 760px;
  margin: 24px 0 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: clamp(1.02rem, 2vw, 1.25rem);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 34px;
}

.btn {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 999px;
  padding: 11px 18px;
  font-weight: 700;
  line-height: 1.25;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    border-color 0.2s ease,
    background 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--cyan), var(--blue), var(--violet));
  color: #fff;
  box-shadow: 0 16px 30px rgba(37, 99, 235, 0.3);
}

.btn-secondary {
  background: linear-gradient(135deg, var(--gold), #ff8d4d);
  color: #2d1800;
  box-shadow: 0 14px 28px rgba(248, 193, 74, 0.24);
}

.btn-outline {
  border: 1px solid rgba(37, 99, 235, 0.28);
  background: rgba(255, 255, 255, 0.76);
  color: var(--navy);
}

.btn-outline.light {
  border-color: rgba(255, 255, 255, 0.32);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.btn-danger {
  background: #fee2e2;
  color: #991b1b;
}

.btn-small {
  min-height: 36px;
  padding: 8px 14px;
  font-size: 0.9rem;
}

.hero-image-panel {
  position: relative;
  isolation: isolate;
}

.hero-image-panel::before {
  position: absolute;
  inset: -26px;
  z-index: -1;
  content: "";
  border-radius: 36px;
  background:
    radial-gradient(circle at 24% 18%, rgba(18, 216, 255, 0.32), transparent 34%),
    radial-gradient(circle at 78% 74%, rgba(124, 58, 237, 0.36), transparent 42%);
  filter: blur(18px);
  opacity: 0.9;
}

.hero-image-frame {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  width: min(100%, 560px);
  min-height: 420px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.12);
  box-shadow:
    0 34px 95px rgba(0, 0, 0, 0.3),
    0 0 48px rgba(18, 216, 255, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(18px);
}

.hero-image-frame::before {
  position: absolute;
  inset: 0;
  z-index: 1;
  content: "";
  background:
    linear-gradient(135deg, rgba(18, 216, 255, 0.14), transparent 38%),
    linear-gradient(0deg, rgba(7, 17, 47, 0.34), transparent 48%),
    radial-gradient(circle at 78% 18%, rgba(248, 193, 74, 0.16), transparent 25%);
  pointer-events: none;
}

.hero-image-frame::after {
  position: absolute;
  inset: 14px;
  z-index: 2;
  content: "";
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 22px;
  box-shadow: inset 0 0 34px rgba(18, 216, 255, 0.14);
  pointer-events: none;
}

.hero-image-frame img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
  transform: scale(1.015);
}

.hero-light {
  position: absolute;
  z-index: 3;
  border-radius: 999px;
  filter: blur(16px);
  pointer-events: none;
}

.light-a {
  width: 150px;
  height: 150px;
  left: -40px;
  bottom: 12%;
  background: rgba(18, 216, 255, 0.42);
}

.light-b {
  width: 180px;
  height: 180px;
  right: -62px;
  top: 8%;
  background: rgba(124, 58, 237, 0.44);
}

.image-badge {
  position: absolute;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 9px 16px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  box-shadow:
    0 14px 34px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.26);
  backdrop-filter: blur(14px);
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  animation: float 5s ease-in-out infinite;
}

.badge-ai {
  top: 9%;
  left: 9%;
}

.badge-game {
  top: 14%;
  right: 8%;
  animation-delay: -1.2s;
}

.badge-coding {
  right: 7%;
  bottom: 18%;
  animation-delay: -2.1s;
}

.badge-media {
  left: 8%;
  bottom: 10%;
  animation-delay: -3s;
}

.section-heading {
  max-width: 720px;
  margin-bottom: 28px;
}

.section-heading.split {
  max-width: none;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
}

.section-heading.compact {
  margin-bottom: 16px;
}

.section-heading h2 {
  margin: 0 0 8px;
  font-size: clamp(1.75rem, 4vw, 2.55rem);
  line-height: 1.18;
}

.section-heading p {
  margin: 0;
  color: var(--muted);
}

.text-link {
  color: var(--blue);
  font-weight: 800;
}

.result-count {
  padding: 8px 14px;
  border-radius: 999px;
  background: #e8f4ff;
  color: var(--navy);
  font-weight: 800;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
}

.stat-card,
.media-card,
.about-card,
.manual-item,
.admin-panel,
.admin-row-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.stat-card {
  padding: 22px;
}

.stat-card .stat-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  margin-bottom: 16px;
  border-radius: 14px;
  background: linear-gradient(135deg, #e4f7ff, #f1eaff);
  font-weight: 800;
}

.stat-card strong {
  display: block;
  font-size: 2rem;
  line-height: 1.1;
}

.stat-card span {
  color: var(--muted);
  font-weight: 600;
}

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

.media-card {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  transition:
    transform 0.24s ease,
    box-shadow 0.24s ease;
}

.media-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow);
}

.cover {
  position: relative;
  min-height: 188px;
  padding: 18px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  color: #fff;
  background: linear-gradient(135deg, #1d4ed8, #7c3aed);
}

.cover::before {
  position: absolute;
  inset: 0;
  content: "";
  background:
    linear-gradient(rgba(255, 255, 255, 0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.12) 1px, transparent 1px);
  background-size: 26px 26px;
  opacity: 0.55;
}

.cover::after {
  position: absolute;
  right: -24px;
  top: -24px;
  width: 132px;
  height: 132px;
  border-radius: 999px;
  content: "";
  background: rgba(255, 255, 255, 0.18);
}

.cover img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cover.has-image::before,
.cover.has-image::after {
  display: none;
}

.cover-text {
  position: relative;
  z-index: 1;
}

.cover-text small,
.cover-text strong {
  display: block;
}

.cover-text small {
  color: rgba(255, 255, 255, 0.78);
  font-weight: 700;
}

.cover-text strong {
  max-width: 260px;
  font-size: 1.35rem;
  line-height: 1.18;
}

.theme-cyber {
  background: linear-gradient(135deg, #0f766e, #0ea5e9, #312e81);
}

.theme-mouse {
  background: linear-gradient(135deg, #f59e0b, #ef4444, #7c3aed);
}

.theme-english {
  background: linear-gradient(135deg, #4f46e5, #ec4899, #f59e0b);
}

.theme-scratch {
  background: linear-gradient(135deg, #2563eb, #9333ea, #111827);
}

.card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 20px;
}

.badge-row,
.meta-row,
.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #e8f4ff;
  color: #174ea6;
  font-size: 0.8rem;
  font-weight: 800;
}

.badge.best {
  background: #fff4cc;
  color: #815400;
}

.badge.cyber {
  background: #dcfce7;
  color: #166534;
}

.badge.new {
  background: #fce7f3;
  color: #9d174d;
}

.badge.draft {
  background: #f3e8ff;
  color: #6b21a8;
}

.card-body h3 {
  margin: 14px 0 8px;
  font-size: 1.15rem;
  line-height: 1.3;
}

.card-body p {
  margin: 0 0 14px;
  color: var(--muted);
}

.meta-row {
  margin-top: auto;
}

.meta-row span {
  border-radius: 999px;
  padding: 5px 10px;
  background: #f3f7fb;
  color: #40516d;
  font-size: 0.82rem;
  font-weight: 700;
}

.card-actions {
  margin-top: 18px;
}

.filters {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr auto;
  gap: 12px;
  margin-bottom: 24px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--glass);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(18px);
}

.filters label,
.admin-form label,
.login-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
  color: var(--text);
  padding: 11px 13px;
  outline: none;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

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

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(37, 99, 235, 0.6);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.empty-state {
  margin-top: 22px;
  padding: 44px 24px;
  border: 1px dashed rgba(37, 99, 235, 0.28);
  border-radius: var(--radius);
  background: #f8fbff;
  text-align: center;
}

.empty-state h3 {
  margin: 10px 0 6px;
}

.empty-state p {
  margin: 0;
  color: var(--muted);
}

.empty-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  margin: 0 auto;
  border-radius: 20px;
  background: linear-gradient(135deg, #e4f7ff, #f1eaff);
  color: var(--blue);
  font-size: 1.9rem;
  font-weight: 800;
}

.gallery-section {
  background: linear-gradient(180deg, #f7fbff, #edf6ff);
}

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

.gallery-item {
  min-height: 240px;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.gallery-item .cover {
  min-height: 172px;
}

.gallery-item strong {
  display: block;
  padding: 14px 16px 16px;
  line-height: 1.3;
}

.manual-layout {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 36px;
  align-items: start;
}

.manual-list {
  display: grid;
  gap: 12px;
}

.manual-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px;
}

.manual-item strong {
  display: block;
}

.manual-item span {
  color: var(--muted);
  font-size: 0.9rem;
}

.about-section {
  background:
    radial-gradient(circle at 85% 15%, rgba(18, 216, 255, 0.14), transparent 30%),
    linear-gradient(135deg, #081536, #14245a);
}

.about-card {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 30px;
  padding: 30px;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(18px);
}

.about-card .section-heading p,
.profile-idea {
  color: rgba(255, 255, 255, 0.74);
}

.profile-avatar {
  width: 160px;
  height: 160px;
  display: grid;
  place-items: center;
  border-radius: 38px;
  background: linear-gradient(135deg, var(--gold), var(--cyan), var(--violet));
  color: #07112f;
  font-size: 1.45rem;
  font-weight: 800;
  box-shadow: 0 22px 48px rgba(18, 216, 255, 0.22);
}

.profile-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0 16px;
}

.profile-meta span {
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.86);
  font-weight: 700;
}

.profile-idea {
  margin: 0;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 28px max(16px, calc((100vw - var(--max)) / 2));
  background: #06102e;
  color: rgba(255, 255, 255, 0.78);
}

.site-footer a {
  color: var(--cyan);
  font-weight: 800;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(3, 8, 23, 0.68);
  backdrop-filter: blur(10px);
}

#detailModal {
  z-index: 110;
}

#adminModal {
  z-index: 100;
}

.modal-card {
  position: relative;
  width: min(100%, 1000px);
  max-height: min(90vh, 920px);
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 26px;
  background: var(--surface);
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.34);
  animation: modalIn 0.22s ease;
}

.detail-card {
  width: min(100%, 1040px);
}

.admin-card {
  width: min(100%, 1180px);
}

.modal-close {
  position: sticky;
  top: 14px;
  left: calc(100% - 58px);
  z-index: 3;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 14px;
  background: #eef3fb;
  color: var(--text);
  font-size: 1.7rem;
  line-height: 1;
}

.detail-layout {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 26px;
  padding: 8px 28px 30px;
}

.detail-layout .cover {
  min-height: 330px;
  border-radius: 22px;
}

.detail-content h2 {
  margin: 0 0 12px;
  font-size: clamp(1.7rem, 4vw, 2.35rem);
  line-height: 1.18;
}

.detail-content p {
  color: var(--muted);
}

.detail-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 20px 0;
}

.detail-list div {
  padding: 12px;
  border-radius: 16px;
  background: #f5f8fc;
}

.detail-list span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.detail-list strong {
  display: block;
  margin-top: 2px;
}

.detail-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 18px 0;
}

.detail-gallery .cover {
  min-height: 110px;
  border-radius: 16px;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 120;
  max-width: min(360px, calc(100% - 40px));
  padding: 14px 18px;
  border-radius: 16px;
  background: #081536;
  color: #fff;
  box-shadow: var(--shadow);
  font-weight: 700;
}

.admin-shell {
  padding: 8px 28px 30px;
}

.admin-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.admin-head h2,
.admin-panel h3 {
  margin: 0;
}

.admin-head p {
  margin: 4px 0 0;
  color: var(--muted);
}

.login-form {
  display: grid;
  gap: 14px;
  padding: 8px 28px 32px;
}

.login-note {
  margin: 0;
  padding: 12px;
  border-radius: 16px;
  background: #fff7df;
  color: #6f4a00;
}

.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.tab-btn {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  padding: 10px 16px;
  color: var(--muted);
  font-weight: 800;
}

.tab-btn.active {
  background: linear-gradient(135deg, var(--blue), var(--violet));
  color: #fff;
}

.admin-panel {
  padding: 20px;
}

.admin-panel.hidden {
  display: none;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.admin-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.admin-form .full {
  grid-column: 1 / -1;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
}

.checkbox-row input {
  width: 18px;
  height: 18px;
}

.form-actions,
.data-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

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

.admin-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

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

.admin-table th {
  color: var(--muted);
  font-size: 0.86rem;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-card-list {
  display: none;
  gap: 12px;
}

.admin-row-card {
  padding: 14px;
}

.admin-row-card p {
  margin: 4px 0 12px;
  color: var(--muted);
}

.hidden {
  display: none !important;
}

.fade-in {
  animation: fadeUp 0.55s ease both;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 980px) {
  .hero-inner,
  .manual-layout,
  .detail-layout {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
    padding-top: 90px;
  }

  .stats-grid,
  .gallery-strip {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .filters .search-box,
  .filters .btn {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .navbar {
    min-height: 68px;
  }

  .menu-toggle {
    display: block;
  }

  .nav-links {
    position: absolute;
    top: 68px;
    left: 16px;
    right: 16px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 20px;
    background: rgba(7, 17, 47, 0.96);
    box-shadow: var(--shadow);
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a,
  .nav-links button {
    width: 100%;
    justify-content: center;
  }

  .section {
    padding: 58px 0;
  }

  .hero-actions,
  .site-footer,
  .section-heading.split,
  .admin-head {
    align-items: stretch;
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }

  .about-card,
  .admin-stats,
  .admin-form {
    grid-template-columns: 1fr;
  }

  .hero-image-frame {
    width: 100%;
    min-height: 0;
    max-height: 390px;
    border-radius: 24px;
  }

  .stats-grid,
  .media-grid,
  .gallery-strip,
  .filters,
  .detail-list,
  .detail-gallery {
    grid-template-columns: 1fr;
  }

  .about-card {
    display: grid;
  }

  .profile-avatar {
    width: 132px;
    height: 132px;
  }

  .modal-overlay {
    padding: 10px;
  }

  .modal-card {
    max-height: 94vh;
    border-radius: 20px;
  }

  .detail-layout,
  .admin-shell,
  .login-form {
    padding-left: 18px;
    padding-right: 18px;
  }

  .admin-table-wrap {
    display: none;
  }

  .admin-card-list {
    display: grid;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation: none !important;
    transition: none !important;
  }
}
