@font-face {
  font-family: "Kdam Thmor Pro";
  src: url("/assets/fonts/kdam-thmor-pro-400.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Kantumruy Pro";
  src: url("/assets/fonts/kantumruy-pro-variable.ttf") format("truetype");
  font-style: normal;
  font-weight: 100 700;
  font-display: swap;
}

@font-face {
  font-family: "Noto Sans Khmer";
  src: url("/assets/fonts/noto-sans-khmer-variable.ttf") format("truetype");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --black: #050505;
  --panel: #111111;
  --panel-strong: #181818;
  --white: #f8f8f8;
  --muted: #d6c8cf;
  --pink: #ec99b9;
  --pink-hot: #ff4fa8;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  overflow-x: hidden;
}

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  padding-bottom: clamp(110px, 18vw, 190px);
  overflow-x: hidden;
  background:
    linear-gradient(90deg, rgba(236, 153, 185, 0.018) 1px, transparent 1px),
    linear-gradient(180deg, rgba(236, 153, 185, 0.018) 1px, transparent 1px),
    var(--black);
  background-size: 34px 34px, 34px 34px, auto;
  color: var(--white);
  font-family: "Kantumruy Pro", "Noto Sans Khmer", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 300;
  line-height: 1.75;
}

a {
  color: inherit;
}

.site-header,
main,
.site-footer {
  width: min(1160px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(236, 153, 185, 0.08);
  margin-bottom: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  color: var(--white);
  text-decoration: none;
}

.brand img {
  width: 168px;
  height: auto;
  object-fit: contain;
}

.brand span {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.brand strong,
h1,
.hero h1,
.article-hero-section h1 {
  letter-spacing: 0;
  font-family: "Kdam Thmor Pro", "Noto Sans Khmer", sans-serif;
  font-weight: 400;
}

h2,
h3,
h4,
.post-card h3,
.repo-card h3,
.technical-panel h3,
nav a,
.hero-actions a,
.repo-link,
.text-link {
  letter-spacing: 0;
  font-family: "Kantumruy Pro", "Noto Sans Khmer", "Outfit", sans-serif;
  font-weight: 600;
}

.brand strong {
  font-size: 1rem;
  line-height: 1;
}

.brand small {
  color: var(--pink);
  font-family: "Kantumruy Pro", "Noto Sans Khmer", sans-serif;
  font-size: 1.05rem;
  font-weight: 300;
}

nav {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

@media (min-width: 769px) {
  nav {
    flex-wrap: nowrap;
  }
}

nav a,
.hero-actions a,
.repo-link,
.text-link {
  border: 1px solid rgba(236, 153, 185, 0.25);
  border-radius: 8px;
  padding: 8px 14px;
  background: var(--black);
  color: var(--white);
  text-decoration: none;
  font-weight: 600;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

nav a:hover,
.hero-actions a:hover,
.repo-link:hover,
.text-link:hover {
  background: var(--pink);
  color: var(--black);
  border-color: var(--pink);
  box-shadow: 0 0 12px rgba(236, 153, 185, 0.35);
}

main {
  padding: 18px 0 52px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(330px, 1.08fr);
  gap: 28px;
  align-items: center;
  min-height: 480px;
  border: 1px solid rgba(236, 153, 185, 0.18);
  border-radius: 8px;
  padding: 38px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(236, 153, 185, 0.04) 0 23%, transparent 23% 100%),
    var(--panel);
}

.eyebrow {
  display: inline-flex;
  margin: 0 0 14px;
  border: 1px solid rgba(236, 153, 185, 0.25);
  border-radius: 8px;
  padding: 5px 10px;
  background: var(--black);
  color: var(--pink);
  font-family: "Kantumruy Pro", "Noto Sans Khmer", "Outfit", sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 600px;
  margin-bottom: 18px;
  color: var(--white);
  font-size: clamp(2.25rem, 4.5vw, 3.4rem);
  line-height: 1.05;
  text-wrap: balance;
}

.intro-copy,
.post-summary {
  max-width: 660px;
  margin-bottom: 14px;
  border-left: 4px solid var(--pink);
  border-top: 1px solid rgba(236, 153, 185, 0.08);
  border-right: 1px solid rgba(236, 153, 185, 0.08);
  border-bottom: 1px solid rgba(236, 153, 185, 0.08);
  border-radius: 0 8px 8px 0;
  padding: 14px 16px;
  background: rgba(0, 0, 0, 0.4);
  color: var(--muted);
  font-size: 1.08rem;
  font-weight: 300;
}

.byline {
  color: var(--pink);
  font-weight: 600;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.hero-art {
  display: grid;
  align-items: center;
}

.hero-logo {
  width: min(100%, 520px);
  height: auto;
  transform: rotate(-1deg);
}

.section {
  padding: 52px 0 0;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: baseline;
  margin-bottom: 18px;
}

h2 {
  margin-bottom: 0;
  font-size: 2rem;
}

.section-heading p,
.post-card-date,
.repo-meta,
.repo-description,
.site-footer {
  color: var(--muted);
}

.post-grid,
.repo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 310px), 1fr));
  gap: 18px;
}

.featured-posts,
.featured-articles {
  margin-bottom: 18px;
}

.post-card,
.repo-card {
  display: grid;
  gap: 14px;
  align-content: start;
  min-height: 230px;
  border: 1px solid rgba(236, 153, 185, 0.12);
  border-radius: 8px;
  padding: 18px;
  background: var(--panel);
  transition: border-color 200ms ease, box-shadow 200ms ease, transform 200ms ease;
}

.post-card:hover,
.repo-card:hover {
  border-color: rgba(236, 153, 185, 0.45);
  box-shadow: 0 4px 20px rgba(236, 153, 185, 0.06);
  transform: translateY(-2px);
}

.post-card.featured,
.repo-card.featured {
  background: #180d13;
  border-color: rgba(236, 153, 185, 0.25);
}

.post-card.featured:hover,
.repo-card.featured:hover {
  border-color: var(--pink);
  box-shadow: 0 4px 20px rgba(236, 153, 185, 0.12);
}

.post-card h3,
.repo-card h3 {
  margin-bottom: 0;
  overflow-wrap: anywhere;
  font-size: 1.05rem;
  line-height: 1.25;
}

.post-card h3 a {
  text-decoration: none;
}

.post-card p,
.repo-card p {
  margin-bottom: 0;
}

.tag-list,
.repo-topics {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag-list span,
.repo-topics span {
  border: 1px solid var(--pink);
  border-radius: 999px;
  padding: 3px 8px;
  background: var(--black);
  color: var(--pink);
  font-size: 0.8rem;
  font-weight: 600;
}

.text-link {
  justify-self: start;
}

.repo-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.repo-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.article-content .repo-link,
.repo-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  background: var(--pink);
  color: var(--black) !important;
  border: 1px solid var(--pink);
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.article-content .repo-link:hover,
.repo-link:hover {
  background: var(--black);
  color: var(--white) !important;
  border-color: var(--pink);
  box-shadow: 0 0 12px rgba(236, 153, 185, 0.25);
}

.article-content .repo-link-secondary,
.repo-link-secondary {
  background: var(--black);
  color: var(--pink) !important;
  border: 1px solid rgba(236, 153, 185, 0.25);
}

.article-content .repo-link-secondary:hover,
.repo-link-secondary:hover {
  background: var(--pink);
  color: var(--black) !important;
  border-color: var(--pink);
}

.repo-badge {
  display: inline-flex;
  width: fit-content;
  border: 1px solid rgba(236, 153, 185, 0.25);
  border-radius: 8px;
  padding: 3px 8px;
  background: var(--pink);
  color: var(--black);
  font-family: "Kantumruy Pro", "Noto Sans Khmer", "Outfit", sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.empty {
  grid-column: 1 / -1;
  border: 1px dashed rgba(236, 153, 185, 0.35);
  border-radius: 8px;
  padding: 28px;
  background: rgba(0, 0, 0, 0.5);
  color: var(--muted);
  text-align: center;
  font-weight: 600;
}

.architecture-copy,
.post-content {
  max-width: 760px;
  color: var(--muted);
  font-size: 1.05rem;
}

.post {
  max-width: 860px;
}

.post-header {
  padding: 42px 0 28px;
}

.post-meta {
  color: var(--pink);
  font-weight: 600;
}

.post-content h2,
.post-content h3 {
  margin-top: 2rem;
  color: var(--white);
}

.post-content a {
  color: var(--pink);
  font-weight: 600;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 28px 0 24px;
  border-top: 2px solid var(--pink);
  font-size: 0.9rem;
  font-weight: 300;
}

.page-signoff {
  position: absolute;
  right: -20px;
  bottom: 0;
  width: clamp(150px, 28vw, 300px);
  max-width: 72vw;
  height: auto;
  pointer-events: none;
}

/* Article pages */

.article-page {
  position: relative;
}

.hero.article-hero-section {
  grid-template-columns: minmax(0, 1fr) minmax(220px, 420px);
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: center;
  min-height: 0;
}

.article-hero-section .hero-copy {
  min-width: 0;
  max-width: 680px;
}

.article-hero-art {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  width: 100%;
  overflow: hidden;
}

.article-hero-art figure {
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(100%, 420px);
  height: min(54vh, 420px);
  margin: 0;
  overflow: hidden;
}

.article-hero-image {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
  border-radius: 18px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
}

.article-hero-art figcaption {
  margin-top: 0.75rem;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
  text-align: center;
}

.article-tag-list {
  margin-top: 1rem;
}

.edit-article-link {
  font-size: 0.92rem;
  opacity: 0.82;
}

.article-content-section {
  padding-top: 42px;
}

.article-content {
  max-width: 760px; /* Reading layout by default */
  margin: 0 auto;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.8;
}

.article-content.doc-layout {
  max-width: 1100px; /* Documentation layout for grids, reports, tables */
}

.article-content > * + * {
  margin-top: 1.25rem;
}

.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4 {
  color: var(--white);
  line-height: 1.15;
}

.article-content h1 {
  font-size: clamp(2rem, 4vw, 3rem);
}

.article-content h2 {
  margin-top: 2.4rem;
  font-size: clamp(1.65rem, 3vw, 2.1rem);
  border-bottom: 1px solid rgba(236, 153, 185, 0.12);
  padding-bottom: 6px;
}

.article-content h3 {
  margin-top: 2rem;
  font-size: clamp(1.2rem, 2vw, 1.55rem);
}

.article-content a {
  color: var(--pink);
  font-weight: 600;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.22em;
}

.article-content img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid rgba(236, 153, 185, 0.15);
}

.article-content figure {
  margin: 2rem 0;
}

.article-content figcaption {
  margin-top: 0.75rem;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.article-content blockquote {
  margin: 2rem 0;
  border-left: 4px solid var(--pink);
  border-top: 1px solid rgba(236, 153, 185, 0.08);
  border-right: 1px solid rgba(236, 153, 185, 0.08);
  border-bottom: 1px solid rgba(236, 153, 185, 0.08);
  border-radius: 0 8px 8px 0;
  padding: 1.25rem 1.5rem;
  background: rgba(0, 0, 0, 0.35);
  color: var(--muted);
  font-style: italic;
}

.article-content code {
  color: var(--white);
  font-size: 0.88em;
  background: rgba(236, 153, 185, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(236, 153, 185, 0.1);
  font-family: Consolas, Monaco, "Andale Mono", "Ubuntu Mono", monospace;
}

.article-content pre {
  overflow-x: auto;
  padding: 1.2rem;
  border-radius: 8px;
  background: var(--panel-strong);
  border: 1px solid rgba(236, 153, 185, 0.1);
}

.article-content pre code {
  background: transparent;
  padding: 0;
  border: 0;
  border-radius: 0;
  font-size: 0.9em;
}

/* Reusable technical classes to replace inline styles */
.technical-panel-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin: 24px 0;
}

@media (max-width: 768px) {
  .technical-panel-grid {
    grid-template-columns: 1fr;
  }
}

.technical-panel {
  border: 1px solid rgba(236, 153, 185, 0.15);
  border-radius: 8px;
  padding: 22px;
  background: var(--panel);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: border-color 200ms ease, box-shadow 200ms ease;
}

.technical-panel:hover {
  border-color: rgba(236, 153, 185, 0.35);
  box-shadow: 0 4px 15px rgba(236, 153, 185, 0.05);
}

.technical-panel h3 {
  margin-top: 0 !important;
  margin-bottom: 12px !important;
  font-size: 1.15rem;
  color: var(--white);
}

.technical-panel p {
  font-size: 0.94rem;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 16px;
}

.info-callout {
  margin-bottom: 34px;
  font-size: 0.95rem;
  color: var(--muted);
  background: var(--panel-strong);
  padding: 16px 20px;
  border-radius: 8px;
  border: 1px solid rgba(236, 153, 185, 0.15);
}

.info-callout strong {
  color: var(--white);
}

.two-column-list {
  padding-left: 20px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 24px;
  margin-bottom: 24px;
}

@media (max-width: 768px) {
  .two-column-list {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

.two-column-list li {
  color: var(--muted);
  font-size: 0.98rem;
}

.two-column-list li strong {
  color: var(--white);
}

.metadata-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 28px;
  font-size: 0.95rem;
  background: var(--panel);
  border: 1px solid rgba(236, 153, 185, 0.15);
  border-radius: 8px;
  overflow: hidden;
}

.metadata-table td {
  padding: 12px;
  border: 1px solid rgba(236, 153, 185, 0.1);
  color: var(--muted);
}

.metadata-table tr td:first-child {
  font-weight: bold;
  color: var(--white);
  width: 30%;
  background: rgba(236, 153, 185, 0.02);
}

.action-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 40px;
}

/* Environment statistics grids */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  text-align: center;
  margin: 16px 0 24px;
}

@media (max-width: 580px) {
  .metrics-grid {
    grid-template-columns: 1fr;
  }
}

.metrics-panel {
  background: var(--panel-strong);
  padding: 16px;
  border-radius: 6px;
  border: 1px solid rgba(236, 153, 185, 0.12);
}

.metrics-panel .metric-number {
  display: block;
  font-family: "Kdam Thmor Pro", sans-serif;
  font-size: 2rem;
  font-weight: bold;
  color: var(--white);
  line-height: 1.1;
}

.metrics-panel .metric-label {
  font-size: 0.88rem;
  color: var(--muted);
  font-weight: 500;
  margin-top: 4px;
  display: block;
}

/* Responsive */

@media (max-width: 1000px) {
  h1 {
    font-size: 2.7rem;
  }

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

  .hero-logo {
    width: min(100%, 420px);
  }

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

  .article-hero-art {
    justify-content: flex-start;
  }

  .article-hero-art figure {
    width: min(100%, 520px);
    height: auto;
    max-height: none;
  }

  .article-hero-image {
    width: 100%;
    height: auto;
    max-height: none;
  }
}

@media (max-width: 720px) {
  .site-header,
  main,
  .site-footer {
    width: min(100% - 24px, 1160px);
  }

  .site-header,
  .section-heading,
  .site-footer {
    align-items: stretch;
  }

  .site-header {
    flex-direction: column;
  }

  .brand {
    align-self: flex-start;
  }

  .brand img {
    width: 138px;
  }

  nav,
  .site-footer {
    justify-content: flex-start;
  }

  nav a,
  .hero-actions a {
    text-align: center;
  }

  .hero {
    padding: 22px;
  }

  h1 {
    font-size: 2.1rem;
  }

  .intro-copy {
    font-size: 1rem;
  }

  .section-heading {
    flex-direction: column;
  }

  .article-content {
    font-size: 1rem;
  }

  .article-hero-art figure {
    width: 100%;
  }
}

@media (max-width: 460px) {
  h1 {
    font-size: 1.75rem;
  }

  .repo-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .repo-links {
    justify-content: stretch;
  }

  .repo-link {
    flex: 1 1 auto;
  }
}
.article-edit-footer {
  margin-top: 3rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(236, 153, 185, 0.35);
  font-size: 0.9rem;
}

.article-edit-footer a {
  color: var(--pink);
  font-weight: 600;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.22em;
}
.article-card {
  overflow: hidden;
}

.article-card-image-link {
  display: block;
  margin: -18px -18px 0;
  border-bottom: 2px solid var(--pink);
  background: var(--black);
  text-decoration: none;
}

.article-card-image {
  display: block;
  width: 100%;
  height: 190px;
  object-fit: cover;
  object-position: center;
  background:
    linear-gradient(135deg, rgba(236, 153, 185, 0.12) 0 28%, transparent 28% 100%),
    var(--panel-strong);
}

/* media query for mobile/tablet */
@media (max-width: 720px) {
  .article-card-image {
    height: 180px;
  }
}
/* 404 page */

.not-found-page {
  display: grid;
  gap: 28px;
}

.not-found-header {
  border: 3px solid var(--pink);
  border-radius: 8px;
  padding: 28px;
  background:
    linear-gradient(135deg, rgba(236, 153, 185, 0.2) 0 23%, transparent 23% 100%),
    var(--panel);
}

.not-found-frame-wrap {
  overflow: hidden;
  border: 3px solid var(--pink);
  border-radius: 8px;
  background: var(--panel);
}

.not-found-frame {
  display: block;
  width: 100%;
  height: min(78vh, 900px);
  min-height: 560px;
  border: 0;
  background: var(--black);
}

@media (max-width: 720px) {
  .not-found-header {
    padding: 22px;
  }

  .not-found-frame {
    height: 76vh;
    min-height: 460px;
  }
}
.tabs {
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 10px;
  margin: 1em 0;
}

.tab-button {
  padding: 8px 12px;
  margin-right: 6px;
  cursor: pointer;
  border: none;
  background: #eee;
  border-radius: 6px;
  font-size: 14px;
}

.tab-button.active {
  background: #222;
  color: white;
}

.tab-content {
  display: none;
  margin-top: 12px;
}

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