﻿:root {
  --bg: #08111f;
  --bg-soft: rgba(8, 17, 31, 0.72);
  --panel: rgba(10, 22, 39, 0.72);
  --panel-strong: rgba(15, 28, 48, 0.9);
  --line: rgba(195, 232, 255, 0.16);
  --text: #eff6ff;
  --muted: #97abc0;
  --accent: #7df9d0;
  --accent-2: #ff8b6a;
  --shadow: 0 32px 80px rgba(0, 0, 0, 0.35);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --shell: min(1120px, calc(100vw - 32px));
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(125, 249, 208, 0.16), transparent 30%),
    radial-gradient(circle at right 10% top 20%, rgba(255, 139, 106, 0.18), transparent 25%),
    linear-gradient(135deg, #050b16, #08111f 46%, #0d1f35);
  font-family: "Space Grotesk", sans-serif;
}

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

button,
input,
textarea {
  font: inherit;
}

a {
  color: var(--text);
  text-decoration: none;
}

.site-body {
  position: relative;
  overflow-x: hidden;
}

.admin-pending .admin-shell {
  opacity: 0;
  pointer-events: none;
}

.shell {
  width: var(--shell);
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

.bg-orb {
  position: fixed;
  inset: auto;
  width: 28rem;
  height: 28rem;
  border-radius: 50%;
  filter: blur(60px);
  pointer-events: none;
  opacity: 0.5;
  z-index: 0;
}

.bg-orb-a {
  top: -8rem;
  left: -8rem;
  background: rgba(125, 249, 208, 0.2);
}

.bg-orb-b {
  bottom: -10rem;
  right: -6rem;
  background: rgba(255, 139, 106, 0.22);
}

.grid-noise {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.75), transparent 85%);
  pointer-events: none;
  z-index: 1;
}

.hero,
.admin-header {
  padding: 72px 0 28px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 0 8px;
}

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

.brand-avatar-link {
  display: inline-flex;
  align-items: center;
  line-height: 0;
}

.brand-avatar {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: block;
  object-fit: cover;
  object-position: 15% 10%;
  transform: scale(1.08);
  transform-origin: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 10px 24px rgba(6, 12, 30, 0.28);
}

.brand-name {
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(1.2rem, 1.8vw, 1.6rem);
  font-weight: 600;
  letter-spacing: -0.04em;
  color: var(--text);
}

.topbar-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(0.96rem, 1.3vw, 1.15rem);
  font-weight: 600;
  letter-spacing: -0.04em;
  transition: transform 180ms ease, opacity 180ms ease;
}

.topbar-action:hover,
.topbar-action:focus-visible {
  transform: translateY(-2px);
  opacity: 0.72;
  outline: none;
}

.hero-copy {
  display: grid;
  gap: 18px;
  margin: 18px 0 28px;
}

.hero h1,
.admin-header h1,
.section-head h2,
.modal-content h3 {
  margin: 0;
  font-family: "Cormorant Garamond", serif;
  font-weight: 600;
  line-height: 0.95;
  letter-spacing: -0.03em;
}

.hero h1,
.admin-header h1 {
  max-width: 10ch;
  font-size: clamp(3.2rem, 9vw, 7rem);
}

.admin-header {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.admin-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-header h1 {
  max-width: none;
  font-size: clamp(1.35rem, 2vw, 1.85rem);
  line-height: 1;
}

.hero-text,
.section-note,
.panel-note,
.link-name,
.admin-item-link-name,
.admin-item-link-url {
  color: var(--muted);
  line-height: 1.7;
}

.hero-text {
  max-width: 58rem;
  font-size: 1.04rem;
}

.panel-head,
.admin-item-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  padding: 28px 0 18px;
}

.section-head h2 {
  font-size: clamp(1.6rem, 3.2vw, 2.6rem);
}

.home-layout {
  position: relative;
}

.home-content {
  min-width: 0;
}

.side-rail {
  position: fixed;
  top: 118px;
  left: max(2px, calc((100vw - var(--shell)) / 2 - 246px));
  width: 200px;
  z-index: 3;
}

.side-panel {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(10, 24, 39, 0.9), rgba(7, 16, 29, 0.84));
  box-shadow: var(--shadow);
  overflow: hidden;
}

.side-panel-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 18px 16px;
  list-style: none;
  cursor: pointer;
  color: var(--text);
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.92rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.side-panel-toggle::-webkit-details-marker {
  display: none;
}

.side-panel-toggle-icon {
  width: 12px;
  height: 12px;
  border-right: 1.5px solid rgba(255, 255, 255, 0.72);
  border-bottom: 1.5px solid rgba(255, 255, 255, 0.72);
  transform: rotate(45deg);
  transition: transform 180ms ease;
}

.side-panel:not([open]) .side-panel-toggle-icon {
  transform: rotate(-45deg);
}

.side-panel-body {
  display: grid;
  gap: 14px;
  padding: 0 18px 18px;
}

.side-image-card {
  display: block;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.03);
}

.side-image-card img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  transition: transform 220ms ease, opacity 220ms ease;
}

.side-image-card:hover img,
.side-image-card:focus-visible img {
  transform: scale(1.04);
  opacity: 0.92;
}

.card-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 22px;
  padding-bottom: 80px;
}

.showcase-card {
  opacity: 0;
  transform: translateY(24px);
  animation: rise-in 0.8s ease forwards;
}

.showcase-card:nth-child(2n) {
  animation-delay: 0.08s;
}

.showcase-card:nth-child(3n) {
  animation-delay: 0.16s;
}

.card-hitarea {
  width: 100%;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, rgba(13, 25, 43, 0.92), rgba(8, 17, 31, 0.88));
  box-shadow: var(--shadow);
  text-align: left;
  color: inherit;
  cursor: pointer;
  transition: transform 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
}

.card-hitarea:hover,
.card-hitarea:focus-visible {
  transform: translateY(-4px);
  border-color: rgba(125, 249, 208, 0.38);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.42);
  outline: none;
}

.card-image-wrap {
  overflow: hidden;
  border-radius: calc(var(--radius-xl) - 8px);
  aspect-ratio: 1 / 1;
  background: rgba(255, 255, 255, 0.03);
}

.card-image {
  height: 100%;
  object-fit: cover;
  transition: transform 280ms ease;
}

.card-hitarea:hover .card-image,
.card-hitarea:focus-visible .card-image {
  transform: scale(1.03);
}

.card-copy {
  padding: 18px 4px 2px;
}

.card-title,
.admin-item-title {
  margin: 0;
  font-size: clamp(1.2rem, 1.6vw, 1.7rem);
  font-weight: 500;
}

.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  z-index: 10;
}

.modal.is-open {
  display: flex;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 7, 16, 0.72);
  backdrop-filter: blur(14px);
}

.modal-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(760px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, rgba(8, 17, 31, 0.98), rgba(14, 24, 43, 0.98));
  box-shadow: var(--shadow);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  cursor: pointer;
  z-index: 2;
}

.modal-media-wrap {
  flex: 0 0 auto;
  width: 100%;
  height: clamp(220px, 38vh, 360px);
  overflow: hidden;
}

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

.modal-content {
  flex: 0 0 auto;
  position: relative;
  padding: 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, rgba(17, 31, 54, 0.96), rgba(12, 23, 41, 0.98));
}

.modal-content h3 {
  font-size: clamp(1.8rem, 4vw, 3rem);
  margin-bottom: 10px;
}

.link-name {
  margin: 0;
  font-size: 0.84rem;
  white-space: nowrap;
}

.url-items {
  display: grid;
  gap: 10px;
}

.url-item-row,
.admin-item-link-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.url-item,
.admin-item-link-url {
  color: var(--accent);
  word-break: break-all;
  font-size: 0.84rem;
}

.url-item {
  padding: 6px 12px;
  border: 1px solid rgba(125, 249, 208, 0.16);
  border-radius: 999px;
  background: rgba(125, 249, 208, 0.08);
}

.url-item:hover,
.url-item:focus-visible,
.admin-item-link-url:hover,
.admin-item-link-url:focus-visible {
  opacity: 0.78;
  outline: none;
}

.admin-shell {
  padding-bottom: 64px;
}

.admin-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  align-items: start;
}

.admin-list-panel {
  grid-column: 1 / -1;
}

.admin-panel {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
  backdrop-filter: blur(22px);
  box-shadow: var(--shadow);
}

.admin-panel h2 {
  margin: 0 0 18px;
  font-size: 1.1rem;
}

.login-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 32px 0;
}

.login-panel {
  width: min(520px, 100%);
}

.login-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.login-head h1 {
  margin: 0;
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(1.35rem, 2.4vw, 1.9rem);
  font-weight: 600;
}

.admin-form,
.field {
  display: grid;
  gap: 10px;
}

.admin-form {
  gap: 16px;
}

.compact-head {
  align-items: center;
}

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

.field input,
.field textarea {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
}

.field textarea {
  min-height: 160px;
  resize: vertical;
}

.link-fields {
  display: grid;
  gap: 10px;
}

.link-field-row {
  display: grid;
  grid-template-columns: minmax(0, 160px) minmax(0, 1fr) auto;
  gap: 10px;
}

.link-name-input,
.link-url-input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
}

.primary-button,
.ghost-button,
.danger-button,
.ghost-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 180ms ease, opacity 180ms ease, border-color 180ms ease;
}

.primary-button {
  background: linear-gradient(135deg, var(--accent), #c8fff0);
  color: #041018;
  font-weight: 700;
}

.ghost-button,
.ghost-link {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
}

.danger-button {
  border-color: rgba(255, 139, 106, 0.26);
  background: rgba(255, 139, 106, 0.12);
  color: #ffd1c4;
}

.primary-button:hover,
.ghost-button:hover,
.danger-button:hover,
.ghost-link:hover,
.primary-button:focus-visible,
.ghost-button:focus-visible,
.danger-button:focus-visible,
.ghost-link:focus-visible {
  transform: translateY(-2px);
  outline: none;
}

.admin-list {
  display: grid;
  gap: 16px;
}

.admin-item {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 18px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.025);
}

.admin-item-copy {
  position: relative;
  min-height: 220px;
  padding: 4px 0 64px;
}

.admin-item-image {
  width: 220px;
  height: 220px;
  object-fit: cover;
  border-radius: 16px;
}

.admin-item-sort {
  position: absolute;
  top: 0;
  right: 0;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(125, 249, 208, 0.08);
  color: var(--accent);
  font-size: 0.78rem;
}

.admin-item-link-name {
  margin: 0;
  white-space: nowrap;
  font-size: 0.84rem;
}

.admin-item-link-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.admin-item-actions {
  position: absolute;
  right: 0;
  bottom: 0;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: rgba(9, 18, 33, 0.86);
  backdrop-filter: blur(16px);
}

.admin-item-link-url {
  display: inline-block;
  margin-top: 2px;
}

.empty-state {
  padding: 28px;
  border: 1px dashed rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-lg);
  text-align: center;
  color: var(--muted);
}

.scroll-top-button {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 52px;
  height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(125, 249, 208, 0.22);
  border-radius: 50%;
  background: rgba(9, 18, 33, 0.88);
  color: var(--accent);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(16px);
  cursor: pointer;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease, border-color 180ms ease;
  z-index: 20;
}

.scroll-top-button.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.scroll-top-button:hover,
.scroll-top-button:focus-visible {
  border-color: rgba(125, 249, 208, 0.5);
  outline: none;
}

@keyframes rise-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 900px) {
  .home-layout {
    display: grid;
    gap: 18px;
  }

  .side-rail {
    position: static;
    top: auto;
    left: auto;
    width: auto;
  }

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

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

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

  .hero h1 {
    max-width: none;
  }

  .admin-item {
    grid-template-columns: 1fr;
  }

  .admin-item-image {
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
  }
}

@media (max-width: 640px) {
  .hero,
  .admin-header {
    padding-top: 28px;
  }

  .card-hitarea {
    padding: 12px;
  }

  .side-panel-toggle,
  .side-panel-body {
    padding-left: 14px;
    padding-right: 14px;
  }

  .side-panel-body {
    grid-template-columns: 1fr;
    padding-bottom: 14px;
  }

  .topbar {
    align-items: center;
    flex-direction: row;
    justify-content: space-between;
    padding-top: 18px;
  }

  .modal-content,
  .admin-panel {
    padding: 18px;
  }

  .card-list {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .card-image-wrap {
    aspect-ratio: 1 / 1;
  }

  .section-head,
  .panel-head,
  .admin-item-actions {
    flex-direction: column;
    align-items: start;
  }

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

  .admin-header-actions,
  .login-head {
    width: 100%;
    align-items: stretch;
    flex-direction: column;
  }

  .link-field-row {
    grid-template-columns: 1fr;
  }

  .url-item-row,
  .admin-item-link-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .admin-item-copy {
    min-height: 0;
    padding-bottom: 0;
  }

  .admin-item-actions {
    position: static;
    width: 100%;
    margin-top: 16px;
    border-radius: 18px;
  }

  .topbar-action {
    width: auto;
  }

  .ghost-link,
  .ghost-button,
  .primary-button,
  .danger-button {
    width: 100%;
  }

  .scroll-top-button {
    right: 16px;
    bottom: 16px;
    width: 48px;
    height: 48px;
  }
}
