:root {
  --bg: #f4f5fa;
  --bg-soft: #f7f8fc;
  --surface: rgba(255, 255, 255, 0.9);
  --surface-strong: #ffffff;
  --text: #1e2233;
  --muted: #5b6072;
  --line: rgba(60, 66, 110, 0.15);
  --card-border: rgba(60, 66, 110, 0.12);
  --shadow: 0 10px 30px rgba(35, 40, 90, 0.07);
  --shadow-hover: 0 16px 36px rgba(35, 40, 90, 0.12);
  --accent: #5a5cd6;
  --accent-dark: #3f41ab;
  --success: #2f8f6a;
  --radius-lg: 18px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --content-width: 1040px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(90, 92, 214, 0.07), transparent 26%),
    radial-gradient(circle at top right, rgba(120, 125, 220, 0.05), transparent 28%),
    linear-gradient(180deg, #ffffff 0%, var(--bg-soft) 30%, var(--bg) 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(40, 44, 80, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(40, 44, 80, 0.03) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.24), transparent 78%);
}

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

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

button,
input,
textarea {
  border: 0;
}

.page-shell {
  width: min(var(--content-width), calc(100% - 56px));
  margin: 0 auto;
  padding: 64px 0 56px;
}

.page-shell-admin {
  padding-top: 40px;
}

.page-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.page-header-home {
  align-items: center;
}

.page-header-admin {
  align-items: center;
}

.page-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  position: relative;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  margin-top: 2px;
}

.brand-mark-front,
.brand-mark-back {
  position: absolute;
  border-radius: 999px;
}

.brand-mark-front {
  top: 0;
  left: 0;
  width: 17px;
  height: 17px;
  background: linear-gradient(180deg, #6d6fe0, #5a5cd6);
}

.brand-mark-back {
  right: 0;
  bottom: 0;
  width: 17px;
  height: 17px;
  background: rgba(90, 92, 214, 0.32);
}

.header-copy h1,
.overview-panel h2,
.category-heading h2,
.section-heading-simple h2,
.view-heading h1,
.sidebar-brand-name,
.inline-heading h3,
.app-card h3,
.admin-project-copy h3 {
  margin: 0;
  font-family: "Fraunces", serif;
  font-weight: 400;
  color: var(--text);
}

.header-copy h1 {
  font-size: 1.08rem;
  line-height: 1.2;
}

.intro-copy,
.hero-copy,
.section-heading-simple p,
.empty-copy,
.admin-project-copy p,
.feedback-text {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.session-hint {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.intro-copy {
  margin-top: 6px;
  font-size: 0.95rem;
}

.ghost-button,
.primary-button,
.admin-project-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    background-color 180ms ease,
    color 180ms ease,
    border-color 180ms ease;
}

.ghost-button,
.admin-project-actions button {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.6);
  color: var(--text);
}

.primary-button {
  border: 1px solid transparent;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 12px 28px rgba(63, 65, 171, 0.22);
}

.ghost-button:hover,
.primary-button:hover,
.admin-project-actions button:hover {
  transform: translateY(-1px);
}

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

.button-disabled {
  opacity: 0.55;
  pointer-events: none;
}

.overview-panel,
.panel,
.app-card {
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.overview-panel {
  display: grid;
  grid-template-columns: 1.2fr 0.9fr;
  gap: 24px;
  padding: 30px;
  margin-top: 32px;
}

.eyebrow,
.app-type,
.project-chip,
.project-status {
  margin: 0 0 12px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.eyebrow {
  color: var(--accent-dark);
}

.overview-panel h2 {
  font-size: clamp(2rem, 3vw, 2.8rem);
  line-height: 1.04;
}

.hero-copy {
  margin-top: 14px;
  max-width: 40ch;
}

.stat-pills,
.stat-grid {
  display: grid;
  gap: 14px;
}

.stat-pills {
  align-self: stretch;
}

.stat-pill,
.stat-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.62);
  padding: 18px;
}

.stat-pill strong,
.stat-card strong {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
}

.stat-pill span,
.stat-card span,
.mini-list-item span {
  color: var(--muted);
  font-size: 0.92rem;
}

.category-list {
  margin-top: 48px;
}

.category-block + .category-block {
  margin-top: 58px;
}

.category-heading {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 26px;
}

.category-heading h2 {
  flex: 0 0 auto;
  font-size: 1.12rem;
  line-height: 1.2;
}

.category-divider {
  width: 100%;
  height: 1px;
  background: rgba(100, 106, 150, 0.4);
}

.app-grid {
  display: grid;
  gap: 18px;
}

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

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

.app-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: inherit;
  text-decoration: none;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    border-color 180ms ease;
}

.app-card:hover,
.app-card:focus-visible {
  transform: translateY(-3px);
  border-color: rgba(60, 66, 110, 0.24);
  box-shadow: var(--shadow-hover);
}

.app-card:focus-visible {
  outline: 2px solid rgba(90, 92, 214, 0.35);
  outline-offset: 3px;
}

.app-image-wrap {
  aspect-ratio: 1.32 / 1;
  overflow: hidden;
  background: #eceef6;
}

.app-image-wrap-empty {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 0.92rem;
}

.app-grid-4 .app-image-wrap {
  aspect-ratio: 1.12 / 1;
}

.app-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.app-card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 16px 16px 15px;
}

.app-type {
  color: var(--card-accent, var(--accent));
}

.app-card h3 {
  font-size: 1.02rem;
  line-height: 1.18;
}

.app-description {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.48;
}

.app-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 20px;
}

.app-domain {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #454b63;
  font-size: 0.85rem;
  line-height: 1.35;
}

.app-domain::before {
  content: "◎";
  color: #5b6072;
  font-size: 0.82rem;
}

.card-launch {
  color: var(--text);
  font-size: 1.1rem;
  line-height: 1;
}

.category-block-empty .empty-copy {
  font-size: 0.95rem;
}

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

.login-panel {
  width: min(420px, 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 34px 30px;
  text-align: center;
}

.login-panel .section-heading-simple {
  margin-bottom: 0;
}

.login-panel .stack-form {
  width: 100%;
  max-width: none;
}

.brand-mark-lg {
  width: 40px;
  height: 40px;
  margin-top: 0;
}

.brand-mark-lg .brand-mark-front,
.brand-mark-lg .brand-mark-back {
  width: 22px;
  height: 22px;
}

.login-back-link {
  color: var(--muted);
  font-size: 0.9rem;
  text-decoration: none;
}

.login-back-link:hover {
  color: var(--text);
}

.admin-shell {
  display: flex;
  align-items: stretch;
  min-height: 100vh;
}

.admin-sidebar {
  position: sticky;
  top: 0;
  align-self: flex-start;
  height: 100vh;
  flex: 0 0 240px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 26px 18px;
  background: var(--surface-strong);
  border-right: 1px solid var(--line);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 4px 8px 14px;
}

.sidebar-brand-name {
  font-size: 1.1rem;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 11px 12px;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition:
    background-color 160ms ease,
    color 160ms ease;
}

.sidebar-link:hover {
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  color: var(--text);
}

.sidebar-link.is-active {
  background: color-mix(in srgb, var(--accent) 13%, transparent);
  color: var(--accent-dark);
}

.sidebar-icon {
  width: 18px;
  font-style: normal;
  font-size: 1.05rem;
  line-height: 1;
  text-align: center;
}

.sidebar-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.sidebar-footer .session-hint {
  margin: 0 4px 2px;
  font-size: 0.82rem;
  word-break: break-word;
}

.ghost-button-block {
  width: 100%;
}

.admin-main {
  flex: 1;
  min-width: 0;
  padding: 44px clamp(20px, 4vw, 52px) 64px;
}

.admin-view {
  width: min(920px, 100%);
  margin: 0 auto;
}

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

.view-heading h1 {
  font-size: 1.7rem;
  line-height: 1.15;
}

.view-heading p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.view-heading-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

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

.top-projects-panel {
  margin-top: 18px;
}

.panel {
  padding: 24px;
}

.panel-form {
  min-width: 0;
}

.section-heading-simple {
  margin-bottom: 18px;
}

.section-heading-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.stack-form {
  display: grid;
  gap: 14px;
  max-width: 420px;
}

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

.field {
  display: grid;
  gap: 8px;
}

.field span {
  font-size: 0.9rem;
  font-weight: 600;
}

.field input,
.field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid rgba(60, 66, 110, 0.18);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
}

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

.field-wide {
  grid-column: 1 / -1;
}

.checkbox-field {
  display: flex;
  align-items: center;
  gap: 12px;
}

.checkbox-field input {
  width: 18px;
  height: 18px;
  padding: 0;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.form-preview span {
  display: block;
  margin-bottom: 8px;
  font-size: 0.9rem;
  font-weight: 600;
}

.image-preview {
  display: grid;
  place-items: center;
  min-height: 160px;
  border: 1px dashed rgba(60, 66, 110, 0.28);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.7);
  color: var(--muted);
  overflow: hidden;
}

.image-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.top-projects {
  margin-top: 22px;
}

.inline-heading {
  margin-bottom: 12px;
}

.mini-list {
  display: grid;
  gap: 10px;
}

.mini-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.62);
}

.mini-list-item strong {
  font-size: 0.95rem;
}

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

.admin-project-card {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr) auto;
  gap: 18px;
  align-items: stretch;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.62);
}

.admin-thumb {
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: #eceef6;
  min-height: 104px;
}

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

.admin-thumb-empty {
  color: var(--muted);
  font-size: 0.9rem;
}

.admin-project-copy {
  min-width: 0;
}

.admin-project-topline {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 6px;
}

.project-chip,
.project-status {
  display: inline-flex;
  align-items: center;
  margin: 0;
  padding: 5px 9px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  color: var(--accent-dark);
  letter-spacing: 0.08em;
}

.project-status-live {
  background: rgba(51, 105, 79, 0.11);
  color: var(--success);
}

.project-status-draft {
  background: rgba(90, 84, 78, 0.1);
  color: #5a544e;
}

.admin-project-copy h3 {
  font-size: 1.08rem;
  margin-bottom: 6px;
}

.admin-project-copy p {
  font-size: 0.92rem;
}

.admin-project-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.88rem;
}

.admin-project-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-content: start;
}

.admin-project-actions button {
  min-height: 38px;
  padding: 0 12px;
}

.admin-project-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
}

.button-danger {
  color: #8f3528;
}

.feedback-text {
  font-size: 0.92rem;
}

code {
  padding: 0.15rem 0.38rem;
  border-radius: 8px;
  background: rgba(60, 66, 110, 0.08);
  font-family: inherit;
}

@media (max-width: 980px) {
  .overview-panel,
  .admin-project-card {
    grid-template-columns: 1fr;
  }

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

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

@media (max-width: 860px) {
  .admin-shell {
    flex-direction: column;
  }

  .admin-sidebar {
    position: static;
    height: auto;
    flex: none;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 14px 18px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .sidebar-brand {
    padding: 0 8px 0 4px;
  }

  .sidebar-nav {
    flex-direction: row;
  }

  .sidebar-footer {
    margin: 0 0 0 auto;
    flex-direction: row;
    align-items: center;
    padding-top: 0;
    border-top: 0;
  }

  .sidebar-footer .session-hint {
    display: none;
  }

  .ghost-button-block {
    width: auto;
  }

  .admin-main {
    padding: 30px 20px 56px;
  }

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

@media (max-width: 760px) {
  .page-shell {
    width: min(var(--content-width), calc(100% - 28px));
    padding-top: 28px;
  }

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

  .page-actions {
    width: 100%;
    margin-left: 0;
  }

  .overview-panel,
  .panel {
    padding: 20px;
  }

  .project-form,
  .app-grid-3,
  .app-grid-4,
  .admin-project-actions {
    grid-template-columns: 1fr;
  }

  .category-heading {
    gap: 12px;
    margin-bottom: 18px;
  }
}
