:root {
  --bg: #fffefb;
  --surface: #ffffff;
  --surface-soft: #ffffff;
  --ink: #172033;
  --muted: #5f6782;
  --line: #e3dcf2;
  --blue: #00bbf9;
  --blue-dark: #00a9e0;
  --green: #00f5d4;
  --purple: #9b5de5;
  --lavender: #f15bb5;
  --mint: #00f5d4;
  --sky: #00bbf9;
  --cream: #fee440;
  --apricot: #fee440;
  --blush: #f15bb5;
  --porcelain: #fffefb;
  --shadow: 0 18px 50px rgba(31, 55, 95, 0.12);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  font-family: Inter, Arial, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 18%, rgba(0, 245, 212, 0.18) 0, rgba(0, 245, 212, 0.11) 10%, rgba(0, 245, 212, 0.05) 20%, transparent 34%),
    radial-gradient(circle at 78% 14%, rgba(0, 187, 249, 0.2) 0, rgba(0, 187, 249, 0.12) 12%, rgba(0, 187, 249, 0.05) 24%, transparent 36%),
    radial-gradient(circle at 84% 64%, rgba(155, 93, 229, 0.18) 0, rgba(155, 93, 229, 0.11) 12%, rgba(155, 93, 229, 0.05) 22%, transparent 34%),
    radial-gradient(circle at 24% 72%, rgba(241, 91, 181, 0.16) 0, rgba(241, 91, 181, 0.1) 11%, rgba(241, 91, 181, 0.04) 22%, transparent 34%),
    linear-gradient(180deg, #fffefb 0%, #fffdf6 42%, #fffafd 100%);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

.ink-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -2;
  opacity: 0.9;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: -8%;
  pointer-events: none;
  z-index: -1;
}

body::before {
  background:
    radial-gradient(ellipse at 18% 24%, rgba(0, 187, 249, 0.16) 0, rgba(0, 187, 249, 0.1) 16%, rgba(0, 187, 249, 0.04) 28%, transparent 44%),
    radial-gradient(ellipse at 72% 22%, rgba(155, 93, 229, 0.18) 0, rgba(155, 93, 229, 0.11) 14%, rgba(155, 93, 229, 0.04) 28%, transparent 42%),
    radial-gradient(ellipse at 42% 82%, rgba(0, 245, 212, 0.15) 0, rgba(0, 245, 212, 0.09) 14%, rgba(0, 245, 212, 0.035) 28%, transparent 40%);
  filter: blur(44px) saturate(102%);
  opacity: 0.5;
}

body::after {
  background:
    radial-gradient(circle at 28% 18%, rgba(255, 255, 255, 0.42) 0, transparent 22%),
    radial-gradient(circle at 68% 52%, rgba(255, 255, 255, 0.28) 0, transparent 18%),
    radial-gradient(circle at 86% 28%, rgba(255, 255, 255, 0.2) 0, transparent 14%);
  filter: blur(24px);
  opacity: 0.44;
}

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

button,
a,
select {
  -webkit-tap-highlight-color: transparent;
}

.site-header {
  padding: 18px clamp(16px, 4vw, 48px) 20px;
}

.topbar {
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  color: white;
  background: linear-gradient(135deg, var(--blue), var(--purple));
  font-size: 13px;
  letter-spacing: 0;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.language-label {
  font-size: 14px;
  color: var(--muted);
}

.language-select {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  padding: 0 38px 0 12px;
  cursor: pointer;
}

.hero {
  max-width: 1180px;
  margin: 34px auto 0;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.95fr);
  align-items: center;
  gap: clamp(22px, 5vw, 64px);
}

.hero-copy {
  max-width: 640px;
}

.eyebrow {
  margin: 0 0 12px;
  color: #00c9b0;
  font-weight: 800;
  text-transform: uppercase;
  font-size: 13px;
}

h1,
h2,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  font-size: clamp(38px, 6vw, 68px);
  line-height: 1.02;
  letter-spacing: 0;
}

.hero-text {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 19px;
  line-height: 1.6;
}

.hero-panel {
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
  background: white;
}

.hero-panel img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

main {
  padding: 0 clamp(16px, 4vw, 48px) 48px;
}

.controls {
  max-width: 1180px;
  margin: 30px auto 22px;
  display: grid;
  grid-template-columns: minmax(240px, 320px) auto 1fr;
  gap: 14px;
  align-items: start;
}

.sort-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
}

.sort-label {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}

.sort-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.search-wrap {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.search-wrap span {
  color: #00a9e0;
  font-size: 22px;
}

.search-wrap input {
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  min-width: 0;
}

.category-filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-button {
  min-height: 48px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 16px;
  background: white;
  color: var(--ink);
  box-shadow: 0 8px 18px rgba(31, 55, 95, 0.06);
  cursor: pointer;
}

.sort-button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--muted);
  box-shadow: 0 6px 16px rgba(31, 55, 95, 0.06);
  cursor: pointer;
  font-weight: 700;
}

.filter-button[aria-pressed="true"] {
  color: var(--ink);
  background: var(--blue);
}

.sort-button[aria-pressed="true"] {
  color: #162035;
  background: rgba(0, 245, 212, 0.18);
  border-color: rgba(0, 245, 212, 0.45);
}

.gallery-section {
  max-width: 1180px;
  margin: 0 auto;
}

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

.section-heading h2 {
  margin: 0 0 4px;
  font-size: 28px;
}

.section-heading p {
  margin: 0;
  color: var(--muted);
}

.result-count {
  font-weight: 700;
  color: #00a9e0;
}

.prompt-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.prompt-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  border: 1px solid rgba(220, 231, 243, 0.9);
  border-radius: 8px;
  background: white;
  overflow: hidden;
  box-shadow: 0 12px 28px rgba(31, 55, 95, 0.08);
  cursor: pointer;
  text-align: left;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.prompt-card:hover,
.prompt-card:focus-visible {
  transform: translateY(-3px);
  border-color: rgba(37, 99, 235, 0.35);
  box-shadow: var(--shadow);
  outline: none;
}

.card-image-wrap {
  position: relative;
}

.card-image {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--sky);
}

.status-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border-radius: 999px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 800;
  backdrop-filter: blur(8px);
  box-shadow: 0 8px 18px rgba(23, 32, 51, 0.14);
}

.status-badge.hot {
  color: #6d3d15;
  background: rgba(254, 228, 64, 0.92);
}

.status-badge.new {
  color: #15507d;
  background: rgba(0, 187, 249, 0.9);
}

.card-body {
  padding: 14px;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag,
.difficulty-pill,
.youtube-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 8px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
}

.tag {
  color: #0d6680;
  background: rgba(0, 187, 249, 0.14);
}

.difficulty-pill {
  color: #6f4d10;
  background: rgba(254, 228, 64, 0.34);
}

.youtube-pill {
  color: #9a4f73;
  background: rgba(241, 91, 181, 0.15);
}

.prompt-card h3 {
  margin: 0 0 8px;
  font-size: 18px;
  line-height: 1.25;
}

.prompt-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.empty-state {
  margin: 28px 0;
  padding: 28px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  text-align: center;
  color: var(--muted);
  background: white;
}

.load-more-wrap {
  display: flex;
  justify-content: center;
  margin-top: 24px;
}

.load-more-button {
  min-width: 180px;
}

.footer-info {
  max-width: 1180px;
  margin: 52px auto 0;
  padding: 24px 0 10px;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.8fr);
  gap: 24px;
  border-top: 1px solid rgba(227, 220, 242, 0.9);
}

.footer-eyebrow {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  color: #00c9b0;
}

.footer-copy h2 {
  margin: 0 0 8px;
  font-size: 26px;
}

.footer-text {
  max-width: 560px;
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.footer-links {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.footer-links-title {
  margin: 0;
  font-size: 13px;
  font-weight: 800;
  color: #8d4ede;
  text-transform: uppercase;
}

.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.social-links a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
  color: #8149c8;
  text-decoration: none;
  font-weight: 700;
  box-shadow: 0 8px 18px rgba(155, 93, 229, 0.08);
}

.site-footer {
  padding: 0 16px 28px;
}

.site-footer p {
  max-width: 1180px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 14px;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(14, 23, 43, 0.62);
  z-index: 20;
}

.prompt-modal {
  position: relative;
  width: min(980px, 100%);
  max-height: min(92vh, 900px);
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(0, 1.1fr);
  overflow: auto;
  border-radius: 8px;
  background: white;
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.26);
}

.close-button {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
}

.icon-button {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 8px 20px rgba(31, 55, 95, 0.16);
  cursor: pointer;
}

.icon-button span {
  font-size: 28px;
  line-height: 1;
}

.modal-media {
  min-height: 100%;
  background: var(--sky);
  overflow: hidden;
  display: grid;
  place-items: center;
  padding: 18px;
}

.modal-media img {
  width: 100%;
  height: auto;
  max-height: min(78vh, 720px);
  min-height: 0;
  display: block;
  object-fit: contain;
}

.modal-content {
  padding: 28px;
  background: white;
  position: relative;
  z-index: 1;
}

.modal-title-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: start;
}

.modal-category {
  margin: 0 0 6px;
  color: #8d4ede;
  font-weight: 800;
  font-size: 13px;
}

.modal-content h2 {
  margin: 0;
  font-size: 28px;
  line-height: 1.15;
}

.modal-description {
  margin: 12px 0 18px;
  color: var(--muted);
  line-height: 1.55;
}

.fields-panel {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

.field-row label {
  display: block;
  margin-bottom: 6px;
  font-weight: 700;
  font-size: 14px;
}

.field-row input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  outline: none;
}

.field-row input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.prompt-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fffefd;
}

.prompt-box-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  background: rgba(0, 187, 249, 0.12);
}

.english-note {
  color: var(--muted);
  font-weight: 600;
  text-align: right;
}

#promptPreview {
  width: 100%;
  min-height: 170px;
  border: 0;
  resize: vertical;
  padding: 14px;
  color: var(--ink);
  background: transparent;
  line-height: 1.55;
  outline: none;
}

.modal-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  border-radius: 8px;
  padding: 0 18px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.primary-button {
  border: 0;
  color: #162035;
  background: linear-gradient(135deg, #00bbf9 0%, #9b5de5 100%);
  box-shadow: 0 10px 24px rgba(0, 187, 249, 0.24);
}

.primary-button:hover {
  background: linear-gradient(135deg, #00aee8 0%, #8d4ede 100%);
}

.secondary-button {
  border: 1px solid var(--line);
  color: #8149c8;
  background: rgba(255, 255, 252, 0.96);
  box-shadow: 0 8px 18px rgba(155, 93, 229, 0.1);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 30;
  padding: 12px 16px;
  border-radius: 8px;
  color: #433414;
  background: var(--cream);
  box-shadow: var(--shadow);
  font-weight: 800;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 920px) {
  .hero,
  .controls,
  .prompt-modal,
  .footer-info {
    grid-template-columns: 1fr;
  }

  .hero-panel img {
    max-height: 420px;
  }

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

  .modal-media img {
    max-height: 320px;
  }
}

@media (max-width: 640px) {
  .site-header {
    padding-top: 14px;
  }

  .topbar,
  .section-heading,
  .modal-title-row,
  .prompt-box-header,
  .footer-links,
  .sort-wrap {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-actions {
    width: 100%;
    justify-content: space-between;
  }

  .language-select {
    flex: 1;
  }

  h1 {
    font-size: 38px;
  }

  .hero-text {
    font-size: 17px;
  }

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

  .filter-button {
    flex: 1 1 auto;
  }

  .modal-content {
    padding: 22px 16px;
  }

  .modal-overlay {
    padding: 10px;
  }

  .prompt-modal {
    max-height: 95vh;
  }

  .modal-actions > * {
    width: 100%;
  }
}
