:root {
  --bg: #041427;
  --bg-mid: #0a3056;
  --bg-soft: #1a6ea7;
  --panel: rgba(159, 214, 255, 0.14);
  --panel-strong: rgba(174, 225, 255, 0.23);
  --panel-soft: rgba(153, 206, 248, 0.1);
  --text: #ebf6ff;
  --muted: #b7d3ec;
  --line: rgba(195, 232, 255, 0.34);
  --brand: #58bcff;
  --brand-dark: #2e90d6;
  --ink: #f3fbff;
  --shadow: 0 24px 44px rgba(2, 12, 28, 0.44);
  --geo-a: rgba(169, 227, 255, 0.34);
  --geo-b: rgba(90, 174, 255, 0.24);
  --geo-line: rgba(181, 230, 255, 0.18);
}

* {
  box-sizing: border-box;
}

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

body {
  position: relative;
  overflow-x: hidden;
  font-family: "Exo 2", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 5% 8%, rgba(102, 198, 255, 0.22), transparent 26%),
    radial-gradient(circle at 84% 18%, rgba(47, 128, 237, 0.26), transparent 28%),
    linear-gradient(140deg, var(--bg) 0%, var(--bg-mid) 42%, #0d4270 100%);
  min-height: 100vh;
  line-height: 1.45;
}

body::before,
body::after {
  content: "";
  position: fixed;
  pointer-events: none;
  z-index: -2;
}

body::before {
  width: min(44vw, 520px);
  height: min(44vw, 520px);
  right: -12vw;
  top: -11vw;
  border: 1px solid rgba(198, 235, 255, 0.24);
  clip-path: polygon(24% 0%, 100% 0%, 100% 74%, 76% 100%, 0% 100%, 0% 26%);
  background:
    repeating-linear-gradient(
      135deg,
      rgba(180, 227, 255, 0.16) 0 2px,
      transparent 2px 20px
    ),
    linear-gradient(145deg, rgba(86, 174, 255, 0.18), rgba(7, 49, 86, 0.1));
}

body::after {
  width: min(36vw, 420px);
  height: min(36vw, 420px);
  left: -8vw;
  bottom: -12vw;
  border: 1px solid rgba(188, 234, 255, 0.2);
  clip-path: polygon(50% 0%, 95% 30%, 82% 100%, 18% 100%, 5% 30%);
  background: conic-gradient(
    from 220deg,
    rgba(102, 198, 255, 0.22),
    rgba(47, 127, 228, 0.08),
    rgba(149, 222, 255, 0.18)
  );
}

.background-mesh {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 14% 12%, rgba(133, 211, 255, 0.28), transparent 26%),
    radial-gradient(circle at 80% 22%, rgba(105, 153, 255, 0.2), transparent 30%),
    radial-gradient(circle at 44% 90%, rgba(83, 186, 255, 0.18), transparent 30%),
    repeating-linear-gradient(
      115deg,
      rgba(177, 226, 255, 0.06) 0 1px,
      transparent 1px 82px
    ),
    repeating-linear-gradient(
      28deg,
      rgba(95, 172, 242, 0.06) 0 1px,
      transparent 1px 66px
    );
  z-index: -1;
}

.background-mesh::before,
.background-mesh::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.background-mesh::before {
  width: 220px;
  height: 220px;
  left: 8%;
  top: 34%;
  border: 1px solid rgba(178, 227, 255, 0.26);
  clip-path: polygon(25% 0%, 75% 0%, 100% 44%, 76% 100%, 24% 100%, 0% 44%);
  background:
    linear-gradient(160deg, rgba(147, 214, 255, 0.15), rgba(27, 100, 158, 0.08)),
    repeating-linear-gradient(
      45deg,
      rgba(184, 232, 255, 0.1) 0 2px,
      transparent 2px 16px
    );
}

.background-mesh::after {
  width: 320px;
  height: 320px;
  right: 10%;
  bottom: 12%;
  transform: rotate(16deg);
  border: 1px solid rgba(174, 225, 255, 0.22);
  clip-path: polygon(0% 18%, 82% 0%, 100% 82%, 18% 100%);
  background: linear-gradient(145deg, rgba(82, 176, 255, 0.2), rgba(14, 54, 94, 0.06));
}

.section {
  width: min(1120px, calc(100% - 2.5rem));
  margin: 0 auto;
  padding: 2.35rem 0;
}

.top-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.2rem 0.15rem 0.55rem;
}

.top-nav-links {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.brand {
  margin: 0;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-family: "Tektur", sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
}

.hero {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  padding: 1.95rem clamp(1.05rem, 2.8vw, 2.1rem) 2.25rem;
  margin-top: 1rem;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--panel-soft);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  pointer-events: none;
  z-index: 0;
}

.hero::before {
  width: 300px;
  height: 300px;
  right: -96px;
  top: -120px;
  border: 1px solid rgba(188, 232, 255, 0.24);
  clip-path: polygon(22% 0%, 100% 0%, 100% 74%, 78% 100%, 0% 100%, 0% 26%);
  background: conic-gradient(
    from 205deg,
    rgba(94, 183, 255, 0.26),
    rgba(13, 54, 96, 0.08),
    rgba(164, 224, 255, 0.22)
  );
}

.hero::after {
  width: 260px;
  height: 260px;
  left: 54%;
  bottom: -142px;
  transform: rotate(36deg);
  border: 1px solid rgba(175, 226, 255, 0.22);
  background:
    linear-gradient(155deg, rgba(91, 179, 255, 0.2), rgba(9, 38, 70, 0.08)),
    repeating-linear-gradient(
      60deg,
      rgba(180, 228, 255, 0.1) 0 2px,
      transparent 2px 18px
    );
}

.hero > * {
  position: relative;
  z-index: 1;
}

.kicker {
  margin: 0;
  color: var(--brand);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
  font-family: "Tektur", sans-serif;
  font-weight: 800;
}

.hero-grid {
  margin-top: 2.8rem;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 2.4rem;
  align-items: start;
}

h1,
h2,
h3 {
  font-family: "Tektur", sans-serif;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

h1 {
  font-size: clamp(2.3rem, 5vw, 4.2rem);
  margin: 0.65rem 0 1rem;
  line-height: 1.03;
}

h1 span {
  display: block;
  color: #c9e6ff;
  font-size: 0.75em;
  margin-top: 0.35rem;
}

.hero-copy {
  max-width: 62ch;
  margin: 0;
  color: var(--muted);
  padding-right: 0.3rem;
}

.hero-actions {
  margin-top: 1.35rem;
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.hero-stats {
  display: grid;
  gap: 0.9rem;
}

.hero-stats article {
  padding: 1.28rem 1.18rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel-strong);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.hero-stats p {
  margin: 0;
  font-weight: 800;
  font-size: 2rem;
  color: var(--ink);
}

.hero-stats span {
  color: var(--muted);
}

.section-head {
  position: relative;
  margin-bottom: 1.35rem;
  padding-inline: 0.2rem;
}

.section-head::after {
  content: "";
  position: absolute;
  left: 0.2rem;
  bottom: -0.5rem;
  width: 140px;
  height: 6px;
  border-radius: 2px;
  transform: skewX(-35deg);
  background: linear-gradient(90deg, rgba(127, 208, 255, 0.78), rgba(127, 208, 255, 0));
}

h2 {
  margin: 0.45rem 0 0;
  font-size: clamp(1.5rem, 2.6vw, 2.4rem);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.2rem;
  align-items: start;
}

.gallery-grid.is-empty {
  display: block;
}

.work-card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow);
  display: block;
  width: 100%;
  aspect-ratio: var(--work-ratio, 16 / 9);
  margin: 0;
  transform: translateY(0);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.work-card::before {
  content: "";
  position: absolute;
  right: 10px;
  top: 10px;
  width: 32px;
  height: 32px;
  clip-path: polygon(100% 0%, 0% 0%, 100% 100%);
  background: linear-gradient(145deg, rgba(164, 223, 255, 0.46), rgba(87, 172, 245, 0.18));
  pointer-events: none;
}

.work-card::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 10px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(190, 233, 255, 0.6), transparent);
  pointer-events: none;
}

.work-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 30px 48px rgba(3, 17, 36, 0.54);
}

.work-card:hover .work-cover {
  transform: scale(1.04);
}

.work-open {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

.work-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: rgba(12, 51, 88, 0.6);
  transition: transform 0.35s ease;
}

.work-body {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  padding: 1rem 1rem 1.1rem;
  background: linear-gradient(
    180deg,
    rgba(5, 24, 45, 0) 0%,
    rgba(7, 28, 52, 0.68) 30%,
    rgba(7, 28, 52, 0.94) 100%
  );
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.34);
}

.work-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.25rem;
}

.work-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-family: "Tektur", sans-serif;
  color: #8ed4ff;
  font-weight: 700;
}

.work-delete {
  border: 0;
  border-bottom: 1px dashed rgba(174, 226, 255, 0.72);
  background: transparent;
  color: #d3ecff;
  cursor: pointer;
  padding: 0;
  font-size: 0.82rem;
}

.work-title {
  font-size: 1.1rem;
  margin: 0.35rem 0 0.24rem;
}

.work-description {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.work-stack {
  margin-top: 0.55rem;
  display: flex;
  gap: 0.35rem;
}

.work-stack img {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--line);
}

.work-stack .stack-more {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  border: 1px dashed var(--line);
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 0.75rem;
}

.upload-form {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1.3rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.upload-form::before {
  content: "";
  position: absolute;
  right: -62px;
  top: -66px;
  width: 180px;
  height: 180px;
  transform: rotate(42deg);
  border: 1px solid rgba(183, 230, 255, 0.26);
  background:
    linear-gradient(150deg, rgba(89, 184, 255, 0.22), rgba(12, 56, 98, 0.07)),
    repeating-linear-gradient(
      135deg,
      rgba(182, 231, 255, 0.09) 0 2px,
      transparent 2px 16px
    );
  pointer-events: none;
}

.upload-form > * {
  position: relative;
  z-index: 1;
}

.format-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
  margin-bottom: 1.15rem;
}

.format-switch label {
  position: relative;
}

.format-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.format-switch span {
  display: block;
  text-align: center;
  padding: 0.72rem 0.9rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel-soft);
  color: var(--muted);
  cursor: pointer;
  font-family: "Tektur", sans-serif;
  letter-spacing: 0.02em;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.format-switch input:checked + span {
  border-color: var(--brand);
  color: #eaf6ff;
  background: rgba(74, 174, 245, 0.34);
}

.input-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.95rem;
}

label {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  font-weight: 600;
  font-size: 0.88rem;
}

input[type="text"],
input[type="password"],
input[type="url"],
select,
textarea {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(4, 31, 59, 0.42);
  padding: 0.78rem 0.84rem;
  color: var(--text);
  font: inherit;
}

input[type="text"]:focus-visible,
input[type="password"]:focus-visible,
input[type="url"]:focus-visible,
select:focus-visible,
textarea:focus-visible,
input[type="file"]:focus-visible {
  outline: 2px solid rgba(124, 207, 255, 0.8);
  outline-offset: 1px;
}

input[type="text"]::placeholder,
input[type="password"]::placeholder,
input[type="url"]::placeholder,
textarea::placeholder {
  color: rgba(198, 223, 245, 0.84);
}

select {
  appearance: none;
}

input[type="file"] {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(4, 31, 59, 0.42);
  padding: 0.48rem 0.52rem;
  color: var(--text);
  font: inherit;
}

input[type="file"]::file-selector-button {
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel-soft);
  color: var(--ink);
  padding: 0.35rem 0.72rem;
  margin-right: 0.65rem;
  font-family: "Tektur", sans-serif;
  cursor: pointer;
}

input[type="color"] {
  width: 100%;
  min-height: 46px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(4, 31, 59, 0.42);
  padding: 0.22rem;
  cursor: pointer;
}

textarea {
  resize: vertical;
}

.drop-zone {
  position: relative;
  margin-top: 1.1rem;
  border: 1px dashed rgba(166, 219, 255, 0.62);
  border-radius: 14px;
  padding: 1.55rem;
  text-align: center;
  background: var(--panel-soft);
  cursor: pointer;
  outline: none;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.drop-zone::after {
  content: "";
  position: absolute;
  right: 12px;
  top: 12px;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(172, 225, 255, 0.36);
  transform: rotate(45deg);
}

.drop-zone.drag-over,
.drop-zone:focus-visible {
  border-color: var(--brand);
  background: rgba(98, 191, 255, 0.24);
}

.drop-zone p {
  margin: 0;
  font-weight: 700;
}

.drop-zone small {
  color: var(--muted);
}

.preview-list {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.65rem;
}

.preview-item {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
}

.preview-item img {
  width: 100%;
  height: 90px;
  object-fit: cover;
  display: block;
}

.preview-item span {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  font-size: 0.65rem;
  padding: 0.22rem 0.35rem;
  background: rgba(2, 16, 33, 0.7);
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.form-actions {
  margin-top: 1.2rem;
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.admin-auth-status {
  margin: 0.75rem 0 0;
  font-size: 0.86rem;
  color: var(--muted);
}

.admin-auth-status.is-error {
  color: #ffd3de;
}

.admin-auth-status.is-success {
  color: #bcf7d9;
}

.admin-auth-status.is-warning {
  color: #ffe7b3;
}

.primary-btn,
.ghost-btn,
.link-btn {
  border-radius: 999px;
  padding: 0.7rem 1.15rem;
  font-family: "Tektur", sans-serif;
  letter-spacing: 0.015em;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  transition: transform 0.18s ease, background 0.2s ease, border-color 0.2s ease;
}

.primary-btn {
  background: linear-gradient(135deg, #6ecfff, #2e90d6);
  color: #fff;
  border-color: rgba(168, 224, 255, 0.62);
  cursor: pointer;
}

.primary-btn:hover {
  background: linear-gradient(135deg, #4fbef8, #1f79c4);
  transform: translateY(-1px);
}

.primary-btn:disabled,
.ghost-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.ghost-btn {
  background: var(--panel-soft);
  border-color: var(--line);
  color: var(--ink);
  cursor: pointer;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

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

.link-btn {
  color: var(--ink);
  border-color: transparent;
}

.empty-state {
  border: 1px dashed rgba(165, 217, 255, 0.65);
  border-radius: 16px;
  padding: 1.4rem;
  text-align: center;
  background: var(--panel-soft);
  color: var(--muted);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.portfolio-tabs {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 1.1rem;
  flex-wrap: wrap;
}

.portfolio-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel-soft);
  color: var(--muted);
  font-family: "Tektur", sans-serif;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  padding: 0.6rem 1.05rem;
  cursor: pointer;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.portfolio-tab.active {
  color: var(--ink);
  border-color: var(--brand);
  background: rgba(74, 174, 245, 0.32);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.video-category-list {
  display: grid;
  gap: 1rem;
}

.video-category-block {
  border: 1px solid var(--category-line, var(--line));
  border-radius: 16px;
  background: linear-gradient(145deg, var(--category-bg, rgba(95, 172, 242, 0.15)), rgba(8, 35, 63, 0.2));
  padding: 0.95rem;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.video-category-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 0.75rem;
}

.video-category-head h3 {
  margin: 0;
  font-size: 1rem;
}

.video-category-head span {
  color: var(--muted);
  font-size: 0.85rem;
  font-family: "Tektur", sans-serif;
}

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

.video-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.video-open {
  border: 0;
  width: 100%;
  padding: 0;
  margin: 0;
  position: relative;
  background: transparent;
  cursor: pointer;
}

.video-preview {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
  background: rgba(11, 39, 67, 0.64);
}

.video-play {
  position: absolute;
  right: 12px;
  bottom: 10px;
  background: rgba(5, 19, 37, 0.72);
  border: 1px solid rgba(183, 231, 255, 0.48);
  color: var(--ink);
  font-family: "Tektur", sans-serif;
  border-radius: 999px;
  min-width: 56px;
  text-align: center;
  padding: 0.24rem 0.52rem;
  font-size: 0.78rem;
}

.video-lock {
  position: absolute;
  left: 10px;
  top: 10px;
  border-radius: 999px;
  background: rgba(190, 38, 84, 0.78);
  color: #fff;
  border: 1px solid rgba(255, 198, 213, 0.52);
  font-family: "Tektur", sans-serif;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.48rem;
}

.video-body {
  padding: 0.86rem 0.9rem 0.95rem;
}

.video-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.video-row-actions {
  margin-top: 0.7rem;
  justify-content: flex-end;
}

.video-category-badge,
.video-visibility-badge,
.video-tag {
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel-soft);
  padding: 0.18rem 0.58rem;
  font-size: 0.74rem;
  font-family: "Tektur", sans-serif;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
}

.video-visibility-badge.is-private {
  border-color: rgba(255, 198, 213, 0.6);
  background: rgba(172, 48, 84, 0.2);
}

.video-title {
  margin: 0.6rem 0 0.3rem;
  font-size: 1rem;
}

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

.video-delete {
  border: 0;
  border-bottom: 1px dashed rgba(174, 226, 255, 0.72);
  background: transparent;
  color: #d3ecff;
  cursor: pointer;
  padding: 0;
  font-size: 0.82rem;
}

.video-delete:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.admin-video-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

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

.category-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.8rem 0.85rem;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.category-swatch {
  display: inline-block;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.36);
  margin-bottom: 0.5rem;
}

.category-card h3 {
  margin: 0;
  font-size: 0.95rem;
}

.category-card p {
  margin: 0.3rem 0 0.7rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.visibility-switch {
  margin-top: 1.1rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
}

.visibility-switch label {
  position: relative;
}

.visibility-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.visibility-switch span {
  display: block;
  text-align: center;
  padding: 0.68rem 0.85rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel-soft);
  color: var(--muted);
  cursor: pointer;
  font-family: "Tektur", sans-serif;
}

.visibility-switch input:checked + span {
  border-color: var(--brand);
  color: #eaf6ff;
  background: rgba(74, 174, 245, 0.34);
}

.password-wrap {
  margin-top: 0.95rem;
}

.is-hidden {
  display: none !important;
}

.password-wrap.is-hidden {
  display: none;
}

.upload-preview-grid {
  margin-top: 0.95rem;
  display: grid;
  gap: 0.6rem;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.upload-file-item,
.upload-preview-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.62rem;
  background: rgba(8, 35, 62, 0.38);
  color: var(--muted);
  overflow-wrap: anywhere;
}

.upload-preview-item img {
  width: 100%;
  height: 100px;
  border-radius: 8px;
  object-fit: cover;
  display: block;
  margin-bottom: 0.35rem;
}

.upload-preview-item span {
  font-size: 0.8rem;
}

.upload-progress {
  margin-top: 0.9rem;
  display: grid;
  gap: 0.45rem;
}

.upload-progress-track {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(6, 30, 56, 0.58);
  overflow: hidden;
}

.upload-progress-bar {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #6ccfff, #2f90d7);
  transition: width 0.2s ease;
}

.upload-progress-text {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.upload-progress.is-error .upload-progress-bar {
  background: linear-gradient(90deg, #ff839d, #d14670);
}

.upload-progress.is-error .upload-progress-text {
  color: #ffd3de;
}

.video-viewer .viewer-content {
  background: rgba(5, 22, 40, 0.86);
}

.video-player-shell {
  padding: 0;
}

.video-player-shell video {
  width: 100%;
  max-height: 62vh;
  display: block;
  background: #02101f;
}

.video-viewer-row {
  margin-top: 0.95rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.viewer {
  position: relative;
  overflow: hidden;
  width: min(920px, calc(100% - 1.2rem));
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1rem;
  background: var(--panel-strong);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.viewer::before {
  content: "";
  position: absolute;
  left: -52px;
  top: -48px;
  width: 180px;
  height: 180px;
  border: 1px solid rgba(188, 233, 255, 0.24);
  clip-path: polygon(24% 0%, 100% 0%, 100% 76%, 76% 100%, 0% 100%, 0% 24%);
  background: linear-gradient(145deg, rgba(87, 178, 255, 0.2), rgba(8, 39, 71, 0.08));
  pointer-events: none;
}

.viewer > * {
  position: relative;
  z-index: 1;
}

.viewer::backdrop {
  background: rgba(4, 14, 28, 0.74);
  backdrop-filter: blur(4px);
}

.viewer-close {
  border: 1px solid var(--line);
  background: rgba(188, 229, 255, 0.26);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 1.1rem;
  color: var(--text);
  margin-left: auto;
  display: block;
  cursor: pointer;
}

.viewer-content {
  margin-top: 0.45rem;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(7, 32, 58, 0.64);
}

.viewer-content img {
  width: 100%;
  max-height: 62vh;
  object-fit: contain;
  display: block;
}

.viewer-meta h3 {
  margin: 1rem 0 0.25rem;
}

.viewer-meta p {
  margin: 0;
  color: var(--muted);
}

.viewer-controls {
  margin-top: 0.95rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.55rem;
}

.viewer-controls p {
  margin: 0;
  font-weight: 700;
  color: var(--ink);
}

.viewer-thumbs {
  margin-top: 0.85rem;
  display: flex;
  gap: 0.45rem;
  overflow-x: auto;
  padding-bottom: 0.2rem;
}

.viewer-thumbs button {
  border: 1px solid var(--line);
  background: var(--panel-soft);
  padding: 0;
  border-radius: 8px;
  width: 62px;
  height: 62px;
  overflow: hidden;
  cursor: pointer;
  flex-shrink: 0;
}

.viewer-thumbs button.active {
  border-color: var(--brand);
}

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

@media (max-width: 980px) {
  .background-mesh::before {
    width: 170px;
    height: 170px;
    left: 5%;
  }

  .background-mesh::after {
    width: 250px;
    height: 250px;
    right: 4%;
    bottom: 8%;
  }

  .hero::before {
    width: 220px;
    height: 220px;
    right: -72px;
  }

  .hero::after {
    width: 210px;
    height: 210px;
    left: 50%;
    bottom: -112px;
  }

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

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

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

  .video-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }
}

@media (max-width: 640px) {
  body::before,
  body::after,
  .background-mesh::after,
  .hero::after {
    display: none;
  }

  .section {
    width: min(1120px, calc(100% - 1.1rem));
    padding: 1.5rem 0;
  }

  .hero {
    padding: 1.45rem 0.9rem 1.7rem;
  }

  .upload-form {
    padding: 1rem;
  }

  .gallery-grid {
    grid-template-columns: 1fr;
    gap: 0.9rem;
  }

  .format-switch {
    grid-template-columns: 1fr;
  }

  .portfolio-tabs {
    flex-direction: column;
  }

  .portfolio-tab {
    width: 100%;
    justify-content: center;
  }

  .visibility-switch {
    grid-template-columns: 1fr;
  }

  .video-category-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .viewer {
    padding: 0.78rem;
  }
}
