:root {
  --ink-900: #04101E;
  --ink:     #0B1B2E;
  --ink-700: #17283E;
  --ink-600: #22354D;
  --paper:   #FAFAF7;
  --paper-2: #F2F1EB;
  --paper-3: #E8E6DE;
  --line:    #E4E1D6;
  --line-2:  #CFCBBE;
  --line-dark:   rgba(255,255,255,0.10);
  --line-dark-2: rgba(255,255,255,0.22);
  --ink-dim:   #4B5A6E;
  --ink-faint: #8A94A3;
  --on-dark:     #F4F3EE;
  --on-dark-dim: #9BA9BC;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--paper);
  color: var(--ink);
  font-family: 'Geist', -apple-system, sans-serif;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01", "ss02", "cv11";
}
body { min-width: 320px; overflow-x: hidden; position: relative; }

.shell {
  position: relative; z-index: 1;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 72px;
}

.mono {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 500;
}

/* ====== NAV ====== */
nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}
.logo { display: flex; align-items: center; gap: 12px; }
.logo-mark {
  width: 40px; height: 40px;
  border-radius: 11px;
  background: var(--ink);
  display: grid; place-items: center;
  position: relative; overflow: hidden;
}
.logo-mark svg { width: 28px; height: 28px; display: block; }
.logo-text {
  font-family: 'Geist', sans-serif;
  font-weight: 600;
  font-size: 19px;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.logo-text span { font-weight: 400; color: var(--ink-dim); }

.btn-dark {
  background: var(--ink);
  color: var(--paper);
  border: 1px solid var(--ink);
  font-family: 'Geist', sans-serif;
  font-weight: 500;
  font-size: 14px;
  letter-spacing: -0.01em;
  padding: 12px 22px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.btn-dark:hover {
  background: var(--ink-900);
  transform: translateY(-1px);
  box-shadow: 0 14px 30px -14px rgba(11,27,46,0.5);
}
.btn-dark .arrow { width: 14px; height: 14px; transition: transform 0.2s ease; }
.btn-dark:hover .arrow { transform: translateX(3px); }

/* ====== HERO ====== */
.hero {
  padding: 130px 0 120px;
  text-align: center;
  position: relative;
}
.hero .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink-dim);
  margin-bottom: 36px;
  padding: 8px 16px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: var(--paper);
}
.hero .eyebrow .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--ink);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse { 0%,100%{opacity:1;} 50%{opacity:0.3;} }

h1.headline {
  font-family: 'Instrument Serif', serif;
  font-weight: 400;
  font-size: 92px;
  line-height: 1.02;
  letter-spacing: -0.035em;
  color: var(--ink);
  margin: 0 auto 28px;
  max-width: 1000px;
}
h1.headline em { font-style: italic; }

.subhead {
  font-size: 20px;
  line-height: 1.5;
  color: var(--ink-dim);
  max-width: 620px;
  margin: 0 auto 48px;
  font-weight: 400;
}

/* Search bar */
.search-wrap {
  max-width: 680px;
  margin: 0 auto;
  position: relative;
}
.search {
  display: flex;
  align-items: center;
  background: var(--paper);
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  padding: 8px 8px 8px 24px;
  box-shadow: 0 30px 60px -30px rgba(11,27,46,0.25);
  transition: box-shadow 0.2s;
}
.search:focus-within { box-shadow: 0 30px 60px -20px rgba(11,27,46,0.4); }
.search svg.mag { width: 20px; height: 20px; color: var(--ink-dim); flex-shrink: 0; }
.search input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-family: 'Geist', sans-serif;
  font-size: 17px;
  color: var(--ink);
  padding: 14px 16px;
}
.search input::placeholder { color: var(--ink-faint); }
.search button {
  background: var(--ink);
  color: var(--paper);
  border: none;
  font-family: 'Geist', sans-serif;
  font-weight: 500;
  font-size: 15px;
  padding: 14px 24px;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
}
.search button:hover { background: var(--ink-900); }
.search button .arrow { width: 14px; height: 14px; }

.search-hints {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
  flex-wrap: wrap;
}
.hint-chip {
  padding: 6px 14px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: var(--paper);
  font-size: 13px;
  color: var(--ink-dim);
  cursor: pointer;
  transition: all 0.15s;
}
.hint-chip:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.hint-chip .plus { color: var(--ink-faint); margin-right: 4px; }
.hint-chip:hover .plus { color: var(--on-dark-dim); }

/* ====== CATEGORIES ====== */
.categories {
  padding: 40px 0 120px;
}
.cat-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 40px;
}
.cat-head h2 {
  font-family: 'Instrument Serif', serif;
  font-weight: 400;
  font-size: 48px;
  line-height: 1;
  letter-spacing: -0.025em;
  color: var(--ink);
}
.cat-head h2 em { font-style: italic; }
.cat-head .meta { color: var(--ink-faint); font-size: 13px; }
.cat-head .meta b { color: var(--ink-dim); font-weight: 500; }

.cat-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
}
.cat-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 26px 22px 22px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  position: relative;
  overflow: hidden;
  min-height: 260px;
  display: flex;
  flex-direction: column;
}
.cat-card:hover, .cat-card.active {
  background: var(--ink);
  color: var(--on-dark);
  border-color: var(--ink);
  box-shadow: 0 30px 60px -20px rgba(11,27,46,0.35);
}
.cat-card:hover:not(.active) { transform: translateY(-4px); }
.cat-card:hover .cat-num, .cat-card.active .cat-num,
.cat-card:hover .cat-sub, .cat-card.active .cat-sub,
.cat-card:hover .cat-count, .cat-card.active .cat-count { color: var(--on-dark-dim); }
.cat-card:hover .cat-name, .cat-card.active .cat-name { color: var(--on-dark); }
.cat-card:hover .cat-foot, .cat-card.active .cat-foot { border-top-color: var(--line-dark-2); }
.cat-card:hover .cat-icon, .cat-card.active .cat-icon {
  background: var(--ink-700);
  border-color: var(--line-dark-2);
}
.cat-card:hover .cat-icon svg, .cat-card.active .cat-icon svg { color: var(--paper); }

.cat-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--ink-faint);
  letter-spacing: 0.08em;
  margin-bottom: 20px;
  transition: color 0.3s;
}
.cat-icon {
  width: 50px; height: 50px;
  border-radius: 12px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  display: grid; place-items: center;
  margin-bottom: 18px;
  transition: all 0.3s;
}
.cat-icon svg { width: 24px; height: 24px; color: var(--ink); transition: color 0.3s; }
.cat-name {
  font-family: 'Instrument Serif', serif;
  font-size: 26px;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: 8px;
  transition: color 0.3s;
}
.cat-sub {
  font-size: 13px;
  color: var(--ink-dim);
  line-height: 1.5;
  margin-bottom: 18px;
  transition: color 0.3s;
}
.cat-foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
  transition: border-color 0.3s;
}
.cat-count {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--ink-faint);
  letter-spacing: 0.08em;
  transition: color 0.3s;
}
.cat-arrow {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid var(--line-2);
  display: grid; place-items: center;
  transition: all 0.3s;
}
.cat-card:hover .cat-arrow, .cat-card.active .cat-arrow {
  background: var(--paper);
  border-color: var(--paper);
  transform: rotate(-45deg);
}
.cat-arrow svg { width: 11px; height: 11px; color: var(--ink); transition: color 0.3s; }

/* ====== PROMPT GALLERY ====== */
.gallery {
  padding: 40px 0 100px;
  display: none;
}
.gallery.open { display: block; animation: fade-in 0.4s ease; }
@keyframes fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.gallery-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}
.gallery-head h3 {
  font-family: 'Instrument Serif', serif;
  font-weight: 400;
  font-size: 44px;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.gallery-head h3 em { font-style: italic; }
.gallery-head .sub {
  color: var(--ink-dim);
  font-size: 14px;
  max-width: 380px;
  line-height: 1.55;
  text-align: right;
}

.gallery-grid {
  columns: 3;
  column-gap: 14px;
}

.prompt-card {
  break-inside: avoid;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  margin-bottom: 14px;
  position: relative;
  display: block;
}
.prompt-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(11,27,46,0);
  border-radius: 12px;
  transition: background 0.2s;
}
.prompt-card:hover::after { background: rgba(11,27,46,0.12); }

.prompt-img {
  width: 100%;
  display: block;
  position: relative;
  overflow: hidden;
}
/* Real image overlaid on top of the gradient placeholder */
.prompt-img-fill {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 0;
}

/* Gallery states */
.gallery-loading {
  padding: 60px 0;
  text-align: center;
  color: var(--ink-faint);
  font-size: 14px;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.no-results {
  padding: 48px 0;
  color: var(--ink-dim);
  font-size: 15px;
}

/* ====== HOW IT WORKS ====== */
.how {
  padding: 100px 0 120px;
  border-top: 1px solid var(--line);
}
.how-head {
  text-align: center;
  margin-bottom: 72px;
}
.how-head h2 {
  font-family: 'Instrument Serif', serif;
  font-weight: 400;
  font-size: 56px;
  line-height: 1;
  letter-spacing: -0.025em;
  color: var(--ink);
  margin-bottom: 14px;
}
.how-head h2 em { font-style: italic; }
.how-head p {
  color: var(--ink-dim);
  font-size: 17px;
  max-width: 580px;
  margin: 0 auto;
  line-height: 1.5;
}

.how-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  position: relative;
}
.how-grid::before {
  content: '';
  position: absolute;
  left: 8%; right: 8%;
  top: 44px;
  height: 1px;
  background: repeating-linear-gradient(to right, var(--line-2) 0, var(--line-2) 6px, transparent 6px, transparent 12px);
  z-index: 0;
}
.how-step {
  padding: 0 36px;
  position: relative; z-index: 1;
  text-align: center;
}
.how-step:first-child { padding-left: 0; }
.how-step:last-child { padding-right: 0; }
.how-num {
  width: 88px; height: 88px;
  border-radius: 50%;
  background: var(--paper);
  border: 1px solid var(--line-2);
  display: grid; place-items: center;
  font-family: 'Instrument Serif', serif;
  font-size: 40px;
  color: var(--ink);
  margin: 0 auto 28px;
  position: relative;
}
.how-num::before {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1px dashed var(--line);
}
.how-grid .how-step:nth-child(2) .how-num {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.how-title {
  font-family: 'Instrument Serif', serif;
  font-size: 28px;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
  color: var(--ink);
}
.how-desc {
  color: var(--ink-dim);
  font-size: 15px;
  line-height: 1.55;
  max-width: 300px;
  margin: 0 auto;
}
.how-desc b { color: var(--ink); font-weight: 500; }

/* ====== DONATION SECTION ====== */
.donate {
  padding: 80px 0 100px;
  border-top: 1px solid var(--line);
}
.donate-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
}
.donate-heading {
  font-family: 'Instrument Serif', serif;
  font-size: 48px;
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 1.05;
  color: var(--ink);
  margin-bottom: 16px;
}
.donate-heading em { font-style: italic; }
.donate-sub {
  color: var(--ink-dim);
  font-size: 16px;
  line-height: 1.55;
  max-width: 440px;
}
.donate-options { display: flex; gap: 48px; align-items: flex-start; }
.donate-card { display: flex; flex-direction: column; gap: 14px; align-items: center; }
.donate-card-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  text-align: center;
}
.khqr-img {
  width: 160px; height: 160px;
  border-radius: 12px;
  border: 1px solid var(--line);
  display: block;
  object-fit: contain;
  background: white;
}
.kofi-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: #FF5E5B; color: #fff;
  padding: 12px 22px; border-radius: 999px;
  font-family: 'Geist', sans-serif; font-weight: 500; font-size: 14px;
  text-decoration: none; transition: all 0.2s;
  border: none; cursor: pointer;
  white-space: nowrap;
}
.kofi-btn:hover {
  background: #e04e4b;
  transform: translateY(-1px);
  box-shadow: 0 8px 20px -8px rgba(255,94,91,0.5);
}
.kofi-btn svg { width: 18px; height: 18px; flex-shrink: 0; }

.supporters-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: #FF5E5B; color: #fff;
  padding: 12px 22px; border-radius: 999px;
  font-family: 'Geist', sans-serif; font-weight: 500; font-size: 14px;
  border: none; cursor: pointer;
  transition: all 0.2s; white-space: nowrap;
}
.supporters-btn:hover {
  background: #e04e4b;
  transform: translateY(-1px);
  box-shadow: 0 8px 20px -8px rgba(255,94,91,0.5);
}
.supporters-btn svg { width: 18px; height: 18px; flex-shrink: 0; }

/* KHQR modal */
.khqr-overlay {
  position: fixed; inset: 0;
  background: rgba(4,16,30,0.55);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 40px;
}
.khqr-overlay.open { display: flex; animation: fade-in 0.25s ease; }
.khqr-modal-card {
  background: var(--paper);
  border-radius: 22px;
  width: 100%;
  max-width: 380px;
  padding: 40px 32px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  position: relative;
  box-shadow: 0 40px 80px -20px rgba(0,0,0,0.4);
}
.khqr-modal-close {
  position: absolute;
  top: 16px; right: 16px;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--paper-2);
  border: 1px solid var(--line);
  cursor: pointer;
  display: grid; place-items: center;
}
.khqr-modal-close svg { width: 14px; height: 14px; color: var(--ink); }
.khqr-modal-close:hover { background: var(--ink); }
.khqr-modal-close:hover svg { color: var(--paper); }
.khqr-modal-desc {
  font-size: 14px;
  color: var(--ink-dim);
  line-height: 1.65;
  text-align: center;
}
.khqr-modal-img {
  width: 210px; height: 210px;
  border-radius: 14px;
  border: 1px solid var(--line);
  object-fit: contain;
  background: #fff;
  box-shadow: 0 8px 24px -8px rgba(11,27,46,0.15);
}
.khqr-download-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--paper-2);
  color: var(--ink);
  border: 1px solid var(--line-2);
  padding: 11px 22px;
  border-radius: 999px;
  font-family: 'Geist', sans-serif;
  font-weight: 500;
  font-size: 14px;
  text-decoration: none;
  transition: all 0.2s;
}
.khqr-download-btn:hover {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

/* ====== FOOTER ====== */
footer {
  background: var(--ink);
  color: var(--on-dark);
  padding: 48px 0 30px;
  position: relative;
  z-index: 1;
}
.foot-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--on-dark-dim);
  font-size: 13px;
}
.foot-links { display: flex; gap: 28px; }
.foot-links a {
  color: var(--on-dark-dim);
  text-decoration: none;
  transition: color 0.15s;
}
.foot-links a:hover { color: var(--paper); }
.foot-region { display: flex; align-items: center; gap: 8px; }
.foot-logo { display: flex; align-items: center; gap: 10px; }
.foot-logo .logo-mark {
  width: 26px; height: 26px;
  border-radius: 7px;
  background: var(--paper);
}
.foot-logo .logo-mark svg path,
.foot-logo .logo-mark svg circle { fill: var(--ink); }
.foot-logo span { font-size: 13px; color: var(--on-dark); }

/* Language pills (buttons) */
.lang-pill {
  background: transparent;
  border: 1px solid var(--line-dark-2);
  border-radius: 999px;
  padding: 5px 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--on-dark-dim);
  cursor: pointer;
  transition: all 0.15s;
}
.lang-pill.khmer {
  font-family: 'Noto Serif Khmer', serif;
  letter-spacing: 0;
  font-size: 12px;
}
.lang-pill.active {
  background: var(--paper);
  color: var(--ink);
  border-color: var(--paper);
}
.lang-pill:hover:not(.active) { color: var(--on-dark); border-color: rgba(255,255,255,0.35); }

/* ====== MODAL ====== */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(4,16,30,0.55);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 40px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--paper);
  border-radius: 22px;
  width: 100%;
  max-width: 960px;
  max-height: 90vh;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr 1fr;
  box-shadow: 0 40px 80px -20px rgba(0,0,0,0.4);
}
.modal-img {
  background: var(--paper-2);
  position: relative;
  min-height: 520px;
}
.modal-body {
  padding: 32px 32px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
}
.modal-close {
  position: absolute;
  top: 18px; right: 18px;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--paper);
  border: 1px solid var(--line);
  cursor: pointer;
  display: grid;
  place-items: center;
  z-index: 2;
}
.modal-close svg { width: 16px; height: 16px; color: var(--ink); }
.modal-close:hover { background: var(--ink); }
.modal-close:hover svg { color: var(--paper); }

.modal h3 {
  font-family: 'Instrument Serif', serif;
  font-size: 34px;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.modal-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.modal-tags .tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-dim);
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
}

.instruction {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 13.5px;
  color: var(--ink-dim);
  line-height: 1.5;
}
.instruction.warn { background: #FFF4D9; border-color: #F2D98C; color: #6B4F16; }
.instruction b { color: var(--ink); font-weight: 500; }
.instruction.warn b { color: #6B4F16; }
.instruction svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }

/* Variable fill-in fields */
#modal-variables { display: flex; flex-direction: column; gap: 10px; }
.var-field { display: flex; flex-direction: column; gap: 5px; }
.var-field label {
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-faint);
  font-family: 'JetBrains Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.var-field input {
  border: 1.5px solid var(--line-2);
  border-radius: 8px;
  padding: 10px 14px;
  font-family: 'Geist', sans-serif;
  font-size: 14px;
  color: var(--ink);
  background: var(--paper);
  transition: border-color 0.15s;
}
.var-field input:focus { outline: none; border-color: var(--ink); }

/* Aspect ratio selector */
.ar-selector { display: flex; flex-direction: column; gap: 8px; }
.ar-selector-label {
  font-size: 11px;
  color: var(--ink-faint);
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.ar-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.ar-pill {
  padding: 5px 12px;
  border: 1.5px solid var(--line-2);
  border-radius: 999px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.05em;
  color: var(--ink-dim);
  cursor: pointer;
  transition: all 0.15s;
  background: var(--paper);
}
.ar-pill:hover { border-color: var(--ink); color: var(--ink); }
.ar-pill.active { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* Prompt preview */
.prompt-text {
  background: var(--ink);
  color: var(--on-dark);
  padding: 20px 22px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.6;
  font-family: 'Geist', sans-serif;
  position: relative;
}
.prompt-text .dim { color: var(--on-dark-dim); }
.prompt-text .var-hl {
  color: var(--paper);
  border-bottom: 1px solid rgba(255,255,255,0.4);
  font-style: italic;
}
.prompt-text .var-empty {
  color: var(--on-dark-dim);
  border-bottom: 1px dashed rgba(255,255,255,0.3);
  font-style: italic;
}

.modal-actions { display: flex; gap: 10px; margin-top: auto; padding-top: 4px; }
.modal-actions button {
  flex: 1;
  padding: 14px;
  border-radius: 999px;
  font-family: 'Geist', sans-serif;
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
}
.modal-actions .secondary {
  background: transparent;
  color: var(--ink-dim);
  border: 1px solid var(--line-2);
}
.modal-actions .secondary:hover { background: var(--paper-2); color: var(--ink); }
.modal-actions .primary {
  background: var(--ink);
  color: var(--paper);
  border: 1px solid var(--ink);
}
.modal-actions .primary:hover { background: var(--ink-900); }
.modal-actions .primary.copied { background: #2d6a4f; border-color: #2d6a4f; }

/* Placeholder image patterns */
.ph-bg-1 { background: linear-gradient(135deg, #E8D9C4 0%, #C9A87C 100%); }
.ph-bg-2 { background: linear-gradient(135deg, #D9CDB7 0%, #8A7A5E 100%); }
.ph-bg-3 { background: linear-gradient(135deg, #F2E4D0 0%, #B89A76 100%); }
.ph-bg-4 { background: linear-gradient(135deg, #DDD5C4 0%, #7D8A77 100%); }
.ph-bg-5 { background: linear-gradient(135deg, #E0D5C8 0%, #A07856 100%); }
.ph-bg-6 { background: linear-gradient(135deg, #EADFC9 0%, #8B6F4E 100%); }
.ph-deco {
  position: absolute; inset: 0;
  background-image:
    radial-gradient(circle at 30% 30%, rgba(255,255,255,0.25), transparent 40%),
    radial-gradient(circle at 70% 70%, rgba(0,0,0,0.15), transparent 40%);
}

/* ====== RESPONSIVE — TABLET (768px – 1099px) ====== */
@media (max-width: 1099px) {
  .shell { padding: 0 40px; }
  h1.headline { font-size: 68px; }
  .hero { padding: 100px 0 88px; }
  .cat-head h2 { font-size: 40px; }
  .cat-grid { grid-template-columns: repeat(3, 1fr); }
  .gallery-grid { columns: 2; }
  .how-head h2 { font-size: 46px; }
  .donate-inner { gap: 48px; }
  .donate-heading { font-size: 40px; }
  .modal { max-width: 760px; }
}

/* ====== RESPONSIVE — MOBILE (< 768px) ====== */
@media (max-width: 767px) {
  .shell { padding: 0 20px; }

  /* ── Nav ── */
  nav { padding: 16px 0; }
  .btn-dark { padding: 10px 16px; font-size: 13px; gap: 7px; }
  .btn-dark .arrow { width: 12px; height: 12px; }

  /* ── Hero ── */
  .hero { padding: 52px 0 48px; }
  h1.headline { font-size: 42px; letter-spacing: -0.02em; line-height: 1.07; }
  .subhead { font-size: 16px; margin-bottom: 32px; max-width: 100%; }
  .search { padding: 6px 6px 6px 16px; }
  .search input { font-size: 15px; padding: 10px; }
  .search button { padding: 11px 16px; font-size: 14px; gap: 6px; }
  .search button > span { display: none; }

  /* ── Categories ── */
  .categories { padding: 32px 0 60px; }
  .cat-head { flex-direction: column; align-items: flex-start; gap: 8px; margin-bottom: 24px; }
  .cat-head h2 { font-size: 32px; }
  .cat-head .meta { display: none; }
  .cat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .cat-card { min-height: 190px; padding: 18px 16px 16px; }
  .cat-num { margin-bottom: 14px; }
  .cat-icon { width: 42px; height: 42px; border-radius: 10px; margin-bottom: 12px; }
  .cat-name { font-size: 22px; margin-bottom: 6px; }
  .cat-sub { font-size: 12px; margin-bottom: 12px; }

  /* ── Gallery ── */
  .gallery { padding: 24px 0 56px; }
  .gallery-head { flex-direction: column; align-items: flex-start; gap: 8px; margin-bottom: 20px; padding-bottom: 16px; }
  .gallery-head h3 { font-size: 28px; }
  .gallery-head .sub { text-align: left; max-width: 100%; font-size: 13px; }
  .gallery-grid { columns: 2; column-gap: 10px; }
  .prompt-card { margin-bottom: 10px; border-radius: 10px; }

  /* ── How it works ── */
  .how { padding: 56px 0 64px; }
  .how-head { margin-bottom: 40px; }
  .how-head h2 { font-size: 34px; }
  .how-head p { font-size: 15px; }
  .how-grid { grid-template-columns: 1fr; gap: 36px; }
  .how-grid::before { display: none; }
  .how-step,
  .how-step:first-child,
  .how-step:last-child { padding: 0; }
  .how-num { width: 72px; height: 72px; font-size: 32px; margin-bottom: 20px; }
  .how-title { font-size: 24px; }

  /* ── Donate ── */
  .donate { padding: 52px 0 60px; }
  .donate-inner { grid-template-columns: 1fr; gap: 36px; }
  .donate-heading { font-size: 34px; }
  .donate-sub { font-size: 15px; }
  .donate-options { justify-content: flex-start; }

  /* ── Footer ── */
  footer { padding: 36px 0 28px; }
  .foot-row { flex-direction: column; gap: 20px; text-align: center; }
  .foot-links { flex-wrap: wrap; justify-content: center; gap: 14px; }

  /* ── Prompt modal — bottom sheet ── */
  .modal-overlay { padding: 0; align-items: flex-end; }
  .modal {
    grid-template-columns: 1fr;
    border-radius: 22px 22px 0 0;
    max-height: 90vh;
  }
  .modal-img { min-height: 180px; }
  .modal-close { top: 12px; right: 12px; width: 32px; height: 32px; }
  .modal-close svg { width: 14px; height: 14px; }
  .modal-body {
    padding: 20px 20px 28px;
    overflow-y: auto;
    max-height: calc(90vh - 180px);
    gap: 12px;
  }
  .modal h3 { font-size: 24px; }
  .modal-actions { padding-top: 6px; }
  .modal-actions button { padding: 12px; font-size: 13px; }

  /* ── KHQR modal ── */
  .khqr-overlay { padding: 16px; }
  .khqr-modal-card { padding: 36px 20px 24px; gap: 18px; max-width: 100%; }
  .khqr-modal-img { width: 180px; height: 180px; }
  .khqr-modal-desc { font-size: 13px; }
}

/* ====== KHMER LANGUAGE ADJUSTMENTS ====== */
body.lang-kh .cat-name,
body.lang-kh .how-title,
body.lang-kh .donate-heading {
  font-family: 'Noto Serif Khmer', serif;
  letter-spacing: 0;
  line-height: 1.4;
}
body.lang-kh h1.headline,
body.lang-kh .cat-head h2,
body.lang-kh .how-head h2,
body.lang-kh .gallery-head h3 {
  font-family: 'Noto Serif Khmer', serif;
  letter-spacing: 0;
  line-height: 1.35;
  font-size: 72px;
}
body.lang-kh .subhead,
body.lang-kh .cat-sub,
body.lang-kh .how-desc,
body.lang-kh .donate-sub {
  font-family: 'Noto Serif Khmer', serif;
  line-height: 1.7;
}

@media (max-width: 767px) {
  body.lang-kh h1.headline,
  body.lang-kh .cat-head h2,
  body.lang-kh .how-head h2,
  body.lang-kh .gallery-head h3 {
    font-size: 30px;
    line-height: 1.45;
  }
}
