@import url("https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap");

:root {
  --bg-0: #071018;
  --bg-1: #0d1b26;
  --bg-2: #132735;
  --panel: rgba(255, 255, 255, 0.055);
  --panel-strong: rgba(255, 255, 255, 0.08);
  --border: rgba(255, 255, 255, 0.10);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #f3f8ff;
  --muted: rgba(226, 236, 248, 0.68);
  --accent: #00c6fb;
  --accent-2: #f7971e;
  --accent-soft: rgba(0, 198, 251, 0.14);
  --radius: 20px;
  --radius-sm: 14px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
  --font: "Plus Jakarta Sans", system-ui, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --focus: 0 0 0 3px rgba(0, 198, 251, 0.28);
}

* { box-sizing: border-box; }

html { color-scheme: dark; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--text);
  letter-spacing: -0.01em;
  background:
    radial-gradient(1100px 520px at 8% -10%, rgba(0, 198, 251, 0.18), transparent 55%),
    radial-gradient(900px 480px at 100% 0%, rgba(247, 151, 30, 0.14), transparent 50%),
    linear-gradient(160deg, var(--bg-0) 0%, var(--bg-1) 48%, var(--bg-2) 100%);
  overflow-x: hidden;
}

::selection {
  background: rgba(0, 198, 251, 0.28);
}

.site-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 20px 0 40px;
  position: relative;
  z-index: 1;
}

.site-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(7, 16, 24, 0.55);
  backdrop-filter: blur(16px) saturate(1.15);
  -webkit-backdrop-filter: blur(16px) saturate(1.15);
  box-shadow: var(--shadow);
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  filter: drop-shadow(0 8px 16px rgba(0, 198, 251, 0.22));
}

.brand-name {
  display: block;
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.brand-tag {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.topbar-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.meta-chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 650;
}

.dashboard-container {
  padding: 28px 26px 30px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  backdrop-filter: blur(18px) saturate(1.15);
  -webkit-backdrop-filter: blur(18px) saturate(1.15);
  box-shadow: var(--shadow);
}

.dashboard-hero {
  text-align: center;
  margin-bottom: 28px;
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}

.eyebrow {
  margin: 0 0 10px;
  color: rgba(125, 211, 252, 0.92);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.dashboard-hero h1,
.project-detail-copy h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 2.7rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.08;
  background: linear-gradient(135deg, #ffffff 10%, #b8f0ff 55%, #ffd7a8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.page-subtitle {
  color: var(--muted);
  font-size: 1rem;
  max-width: 720px;
  margin: 0.85rem auto 0;
  line-height: 1.7;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
}

.project-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 20px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.18);
  overflow: hidden;
  transition: transform 0.2s var(--ease), border-color 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s var(--ease);
}

.project-card::before {
  content: "";
  position: absolute;
  inset: auto auto -40% -20%;
  width: 180px;
  height: 180px;
  background: radial-gradient(circle, rgba(0, 198, 251, 0.28), transparent 68%);
  pointer-events: none;
}

.project-card:hover {
  transform: translateY(-4px);
  border-color: rgba(0, 198, 251, 0.35);
  background: rgba(255, 255, 255, 0.075);
  box-shadow: 0 18px 42px rgba(0, 198, 251, 0.12);
}

.project-copy {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  position: relative;
  z-index: 1;
}

.project-title {
  font-size: 1.12rem;
  font-weight: 750;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.project-subtitle {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.5;
}

.project-summary {
  margin: 0;
  color: rgba(243, 248, 255, 0.82);
  font-size: 0.92rem;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 0;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
  color: rgba(243, 248, 255, 0.88);
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.01em;
}

.status-pill-accent {
  background: linear-gradient(135deg, rgba(0, 198, 251, 0.22), rgba(247, 151, 30, 0.18));
  border-color: rgba(0, 198, 251, 0.28);
}

.project-card-footer {
  display: flex;
  justify-content: flex-start;
  margin-top: auto;
  padding-top: 4px;
}

.learn-more-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 7px 14px;
  border-radius: 999px;
  text-decoration: none;
  color: #071018;
  font-size: 0.82rem;
  font-weight: 750;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 8px 20px rgba(0, 198, 251, 0.18);
  transition: transform 0.16s var(--ease), box-shadow 0.16s var(--ease);
}

.learn-more-btn svg {
  width: 14px;
  height: 14px;
}

.learn-more-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(0, 198, 251, 0.28);
}

/* Card logos: frameless, per-project size via logoSize (sm/md/lg/xl) */
.project-card .project-logo {
  display: block;
  width: auto;
  max-width: 100%;
  height: 64px;
  padding: 0;
  margin: 0 0 14px;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  object-fit: contain;
  object-position: left center;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.22));
  transition: transform 0.2s var(--ease), filter 0.2s var(--ease);
  position: relative;
  z-index: 1;
}

.project-card .project-logo.logo-size-sm { height: 44px; }
.project-card .project-logo.logo-size-md { height: 64px; }
.project-card .project-logo.logo-size-lg { height: 88px; }
.project-card .project-logo.logo-size-xl { height: 112px; }

.project-card:hover .project-logo {
  transform: scale(1.04) translateY(-1px);
  filter: drop-shadow(0 10px 18px rgba(0, 198, 251, 0.28));
  box-shadow: none;
}

/* Detail-page logos: same frameless treatment */
.project-detail-header .project-logo,
.project-logo-detail {
  display: block;
  width: auto;
  max-width: min(280px, 100%);
  height: 96px;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  object-fit: contain;
  object-position: left center;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.22));
}

.project-logo-detail.logo-size-sm,
.project-detail-header .project-logo.logo-size-sm { height: 72px; }
.project-logo-detail.logo-size-md,
.project-detail-header .project-logo.logo-size-md { height: 96px; }
.project-logo-detail.logo-size-lg,
.project-detail-header .project-logo.logo-size-lg { height: 128px; }
.project-logo-detail.logo-size-xl,
.project-detail-header .project-logo.logo-size-xl { height: 160px; }

/* Inline content images can keep a light frame */
.logo-frame:not(.project-logo):not(.project-logo-detail) {
  object-fit: contain;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 8px;
  box-shadow: none;
}

.pagination-bar {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 26px;
}

.pagination-btn {
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  font-size: 0.84rem;
  transition: transform 0.16s var(--ease), background 0.16s var(--ease), border-color 0.16s var(--ease);
}

.pagination-btn:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--border-strong);
}

.pagination-btn.active {
  color: #071018;
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 8px 18px rgba(0, 198, 251, 0.2);
}

.site-footer {
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.84rem;
}

.site-footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
}

.site-footer-brand img {
  border-radius: 6px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #9adfff;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.84rem;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  transition: background 0.16s var(--ease), border-color 0.16s var(--ease);
}

.back-link svg {
  width: 16px;
  height: 16px;
}

.back-link:hover {
  background: rgba(0, 198, 251, 0.1);
  border-color: rgba(0, 198, 251, 0.3);
}

.project-detail-header {
  display: flex;
  gap: 22px;
  align-items: flex-start;
  flex-wrap: wrap;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.project-detail-copy {
  flex: 1 1 360px;
}

.project-detail-copy .page-subtitle {
  margin: 0.7rem 0 0;
  text-align: left;
  max-width: none;
}

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

.project-lead {
  color: rgba(243, 248, 255, 0.9);
  font-size: 1rem;
  line-height: 1.75;
  margin: 0;
  padding: 16px 18px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.18);
}

.section,
.content-panel {
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px 18px 16px;
  backdrop-filter: blur(10px);
}

.section-title {
  color: var(--text);
  margin: 0 0 12px;
  font-size: 1.02rem;
  font-weight: 750;
  letter-spacing: -0.02em;
}

.section-body,
.section-list {
  color: rgba(243, 248, 255, 0.88);
  line-height: 1.75;
  margin: 0;
}

.section-list {
  padding-left: 1.15rem;
}

.section-list li {
  margin-bottom: 8px;
}

.section-body a,
.rich-content a {
  color: #8be7ff;
}

.error-message {
  color: #ffd0d5;
  background: rgba(255, 107, 122, 0.12);
  border: 1px solid rgba(255, 107, 122, 0.28);
  border-radius: 14px;
  padding: 16px;
}

.error-message.is-loading {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border);
}

.inline-img,
.rich-content img.content-img {
  max-width: min(100%, 720px);
  height: auto;
  display: block;
  margin: 12px 0;
  border-radius: 14px;
}

.code-block {
  background: rgba(0, 0, 0, 0.34);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  overflow-x: auto;
  color: #e8f4ff;
  font-size: 0.88rem;
  line-height: 1.55;
}

.rich-content { word-break: break-word; }

.content-align-left { text-align: left; }
.content-align-center { text-align: center; }
.content-align-right { text-align: right; }
.content-align-justify { text-align: justify; }

.content-size-sm { font-size: 0.92rem; }
.content-size-md { font-size: 1rem; }
.content-size-lg { font-size: 1.08rem; }
.content-size-xl { font-size: 1.16rem; }
.content-size-full { width: 100%; max-width: none; }

.content-align-center img.content-img,
.content-align-center .inline-img,
.content-align-center .mermaid {
  margin-left: auto;
  margin-right: auto;
}

.content-align-right img.content-img,
.content-align-right .inline-img,
.content-align-right .mermaid {
  margin-left: auto;
  margin-right: 0;
}

.mermaid {
  background: rgba(8, 18, 28, 0.92);
  border: 1px solid rgba(0, 198, 251, 0.18);
  border-radius: 14px;
  padding: 18px;
  margin: 14px 0;
  overflow-x: auto;
  max-width: 100%;
  color: #e8f4ff;
}

.mermaid svg {
  max-width: 100%;
  height: auto;
}

.mermaid-error {
  color: #ffb4b4;
  margin: 0;
  background: transparent;
  border: none;
  padding: 0;
}

.content-quote {
  margin: 12px 0;
  padding: 12px 14px;
  border-left: 3px solid rgba(0, 198, 251, 0.7);
  background: rgba(0, 0, 0, 0.18);
  border-radius: 0 12px 12px 0;
}

.content-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 18px 0;
}

.inline-code {
  background: rgba(0, 0, 0, 0.28);
  border-radius: 6px;
  padding: 2px 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
}

.table-wrap {
  overflow-x: auto;
  margin: 14px 0;
}

.content-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 320px;
}

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

.content-table th {
  background: rgba(0, 0, 0, 0.24);
}

.content-table tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.03);
}

@media (max-width: 760px) {
  .site-shell {
    width: min(100% - 20px, 1180px);
    padding-top: 12px;
  }

  .site-topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .dashboard-container {
    padding: 18px 16px 22px;
  }

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

  .project-detail-header {
    gap: 14px;
  }
}
