:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #1b1a18;
  background: #f3eee5;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --ink: #1b1a18;
  --paper: #f3eee5;
  --card: #fffaf1;
  --muted: #6d685f;
  --line: #1b1a18;
  --accent: #ffca58;
  --mint: #9edbd0;
  --pink: #f3a3a4;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--paper); }
body { margin: 0; min-width: 320px; min-height: 100vh; background: radial-gradient(circle at 8% 4%, rgba(255, 216, 121, .45), transparent 28rem), radial-gradient(circle at 92% 20%, rgba(158, 219, 208, .35), transparent 26rem), linear-gradient(135deg, #faf6ef, #eee9de); }
body::before { position: fixed; inset: 0; z-index: -1; pointer-events: none; content: ""; opacity: .2; background-image: linear-gradient(rgba(27, 26, 24, .05) 1px, transparent 1px), linear-gradient(90deg, rgba(27, 26, 24, .05) 1px, transparent 1px); background-size: 28px 28px; }
button, input, select { font: inherit; }
button, a, input, select { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button, a, select { cursor: pointer; }
.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; }

.page-shell { width: min(1240px, calc(100% - 48px)); margin: 0 auto; padding: 22px 0 40px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-bottom: 18px; border-bottom: 2px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 950; letter-spacing: .1em; text-decoration: none; }
.brand span { padding: 5px 9px 4px; border: 2px solid var(--line); border-radius: 999px; background: var(--accent); font-size: 10px; letter-spacing: .15em; line-height: 1; }
.top-nav, footer nav { display: flex; align-items: center; gap: 18px; }
.top-nav a, footer a { color: var(--ink); font-size: 14px; font-weight: 850; text-decoration: none; }
.top-nav a:hover, footer a:hover { text-decoration: underline; text-underline-offset: 4px; }
.language-button, .button { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; gap: 8px; padding: 9px 16px; border: 2px solid var(--line); border-radius: 999px; font-weight: 900; text-decoration: none; transition: transform .16s ease, box-shadow .16s ease, background-color .16s ease; }
.language-button { color: var(--ink); background: var(--card); box-shadow: 3px 3px 0 var(--line); }
.language-button:hover, .button.secondary:hover { transform: translate(-2px, -2px); box-shadow: 5px 5px 0 var(--line); background: #fff1c3; }
.button { color: var(--ink); }
.button.primary { background: var(--accent); box-shadow: 4px 4px 0 var(--line); }
.button.primary:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--line); }
.button.secondary { background: var(--card); }
.button.dark { color: #fffaf1; background: var(--ink); box-shadow: 4px 4px 0 #6e665b; }
.button.dark:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 #6e665b; }
.button:active, .language-button:active { transform: translate(1px, 1px); box-shadow: 1px 1px 0 var(--line); }
button:disabled { opacity: .55; cursor: default; }
:where(button, a, input, select):focus-visible { outline: 3px solid #b26838; outline-offset: 3px; }

.hero { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(280px, .92fr); align-items: center; gap: clamp(34px, 6vw, 90px); padding: 74px 0 84px; }
.eyebrow, .section-kicker { margin: 0 0 20px; color: #8a5d1e; font-size: 11px; font-weight: 950; letter-spacing: .16em; text-transform: uppercase; }
.hero h1 { max-width: 720px; margin: 0 0 24px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(52px, 8vw, 104px); letter-spacing: -.07em; line-height: .9; text-wrap: balance; }
.hero-lede { max-width: 650px; margin: 0; color: var(--muted); font-size: clamp(16px, 1.7vw, 20px); line-height: 1.65; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 30px; }
.hero-art { position: relative; min-height: 340px; overflow: hidden; border: 3px solid var(--line); border-radius: 28px; background: var(--mint); box-shadow: 9px 10px 0 var(--line); isolation: isolate; }
.hero-art::before { position: absolute; width: 300px; height: 300px; right: -90px; bottom: -130px; border: 3px solid var(--line); border-radius: 50%; background: var(--accent); content: ""; }
.hero-art::after { position: absolute; inset: 0; background-image: linear-gradient(135deg, transparent 48%, rgba(27, 26, 24, .11) 49%, transparent 51%); background-size: 24px 24px; content: ""; opacity: .35; }
.hero-art-card { position: absolute; z-index: 1; display: grid; width: 148px; height: 190px; place-items: center; border: 3px solid var(--line); border-radius: 18px; background: var(--card); box-shadow: 7px 8px 0 var(--line); transform: rotate(-12deg); }
.hero-art-card span { font-size: 74px; filter: drop-shadow(4px 4px 0 #f3a3a4); }
.hero-art-card-a { top: 54px; left: 42px; }
.hero-art-card-b { top: 98px; left: 154px; background: #fff0b0; transform: rotate(9deg); }
.hero-art-card-c { top: 36px; right: 48px; background: #f4c9ca; transform: rotate(17deg); }
.hero-art p { position: absolute; right: 22px; bottom: 20px; z-index: 2; margin: 0; font-size: 10px; font-weight: 950; letter-spacing: .15em; }

.gallery-section { scroll-margin-top: 30px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 20px; padding-bottom: 15px; border-bottom: 2px solid var(--line); }
.section-kicker { margin-bottom: 8px; color: #8a5d1e; }
.section-head h2, .submit-banner h2, .modal-card h2, .detail-copy h2 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(34px, 4vw, 54px); letter-spacing: -.055em; line-height: .95; }
.section-tools { display: flex; align-items: center; gap: 10px; }
.search-box input, .section-tools select, .field input { min-height: 44px; border: 2px solid var(--line); border-radius: 12px; color: var(--ink); background: var(--card); font-size: 14px; }
.search-box input { width: min(240px, 34vw); padding: 9px 12px; }
.section-tools select { padding: 8px 32px 8px 12px; }
.tag-row { display: flex; flex-wrap: wrap; gap: 8px; min-height: 36px; margin-bottom: 18px; }
.tag { min-height: 34px; padding: 6px 11px; border: 1.5px solid #9e978b; border-radius: 999px; color: #625d55; background: rgba(255, 250, 241, .72); font-size: 12px; font-weight: 800; }
.tag:hover, .tag.active { border-color: var(--line); color: var(--ink); background: var(--accent); }
.gallery-status { min-height: 22px; margin-bottom: 12px; color: var(--muted); font-size: 13px; }
.gallery-status[data-state="error"] { color: #a33c32; }
.gallery-status[data-state="loading"] { color: #8a5d1e; }
.meme-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.meme-card { overflow: hidden; border: 2px solid var(--line); border-radius: 18px; background: var(--card); box-shadow: 5px 6px 0 var(--line); cursor: pointer; transition: transform .2s ease, box-shadow .2s ease; }
.meme-card:hover { transform: translate(-3px, -4px); box-shadow: 9px 10px 0 var(--line); }
.meme-card img { display: block; width: 100%; aspect-ratio: 1 / 1; object-fit: cover; background: #e9e1d5; }
.meme-card-body { padding: 13px 14px 15px; }
.meme-card h3 { overflow: hidden; margin: 0 0 7px; font-size: 16px; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.meme-card-meta { overflow: hidden; margin: 0; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.load-more { display: block; min-height: 46px; margin: 30px auto 0; padding: 8px 20px; border: 2px solid var(--line); border-radius: 999px; color: var(--ink); background: var(--card); box-shadow: 3px 3px 0 var(--line); font-weight: 900; }
.load-more:hover { transform: translate(-2px, -2px); box-shadow: 5px 5px 0 var(--line); background: var(--accent); }
.submit-banner { display: flex; align-items: center; justify-content: space-between; gap: 28px; margin-top: 100px; padding: 32px 34px; border: 3px solid var(--line); border-radius: 24px; background: var(--pink); box-shadow: 8px 9px 0 var(--line); }
.submit-banner .section-kicker { color: #6e393c; }
.submit-banner h2 { font-size: clamp(30px, 4vw, 48px); }
.submit-banner p:last-child { max-width: 580px; margin: 12px 0 0; color: #593b3c; line-height: 1.55; }
footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-top: 86px; padding-top: 20px; border-top: 2px solid var(--line); color: var(--muted); font-size: 13px; }
footer a { display: inline-flex; min-height: 40px; align-items: center; }

.modal { width: min(620px, calc(100% - 24px)); max-height: calc(100% - 24px); padding: 0; border: 0; border-radius: 24px; color: var(--ink); background: transparent; }
.modal::backdrop { background: rgba(27, 26, 24, .55); backdrop-filter: blur(4px); }
.modal-card, .detail-card { position: relative; margin: 0; padding: 30px; border: 3px solid var(--line); border-radius: 24px; background: var(--card); box-shadow: 8px 9px 0 var(--line); }
.modal-card h2 { font-size: 40px; }
.modal-intro { margin: 13px 0 20px; color: var(--muted); line-height: 1.5; }
.modal-close { position: absolute; top: 13px; right: 15px; display: grid; width: 35px; height: 35px; place-items: center; border: 2px solid var(--line); border-radius: 50%; color: var(--ink); background: var(--accent); font-size: 23px; line-height: 1; }
.upload-drop { display: grid; min-height: 142px; place-items: center; gap: 5px; margin-bottom: 16px; padding: 20px; border: 2px dashed #8d8579; border-radius: 16px; color: var(--muted); text-align: center; cursor: pointer; }
.upload-drop:hover, .upload-drop.dragging { border-color: var(--line); background: #fff0be; }
.upload-drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.upload-drop strong { color: var(--ink); }
.upload-drop small { font-size: 12px; }
.upload-icon { display: grid; width: 40px; height: 40px; place-items: center; border: 2px solid var(--line); border-radius: 50%; color: var(--ink); background: var(--accent); font-size: 25px; }
.file-preview { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; padding: 9px; border: 2px solid var(--line); border-radius: 12px; background: #f7e8c3; }
.file-preview img { width: 54px; height: 54px; border-radius: 8px; object-fit: cover; }
.file-preview div { min-width: 0; flex: 1; }
.file-preview strong, .file-preview small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-preview small { margin-top: 4px; color: var(--muted); }
.file-preview button { border: 0; color: var(--ink); background: transparent; font-size: 22px; }
.field { display: grid; gap: 7px; margin-top: 14px; color: var(--muted); font-size: 13px; font-weight: 800; }
.field input { width: 100%; padding: 10px 12px; }
.check-field { display: flex; align-items: start; gap: 9px; margin: 17px 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.check-field input { margin-top: 3px; accent-color: #8a5d1e; }
.form-status, .report-status { min-height: 22px; margin: 10px 0; color: var(--muted); font-size: 13px; }
.form-status[data-state="error"] { color: #a33c32; }
.form-status[data-state="success"] { color: #39705f; }
.form-status[data-state="loading"] { color: #8a5d1e; }
.submit-button { width: 100%; margin-top: 4px; }
.detail-card { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(240px, .95fr); gap: 25px; align-items: center; }
.detail-image-wrap { overflow: hidden; border: 2px solid var(--line); border-radius: 14px; background: #e9e1d5; }
.detail-image-wrap img { display: block; width: 100%; max-height: 520px; object-fit: contain; }
.detail-copy h2 { margin-top: 12px; font-size: 40px; }
.detail-copy > p:not(.section-kicker):not(.report-status) { color: var(--muted); line-height: 1.55; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }

@media (max-width: 1050px) { .meme-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 820px) { .page-shell { width: min(100% - 32px, 640px); } .hero { grid-template-columns: 1fr; padding: 58px 0 64px; } .hero-art { min-height: 270px; } .meme-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .submit-banner { align-items: start; flex-direction: column; } .detail-card { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .page-shell { width: min(100% - 24px, 430px); padding-top: 14px; } .topbar { align-items: flex-start; } .top-nav { gap: 10px; } .top-nav a { display: none; } .hero { gap: 34px; padding: 52px 0 56px; } .hero h1 { font-size: clamp(48px, 15vw, 72px); } .hero-art { min-height: 235px; border-radius: 22px; box-shadow: 6px 7px 0 var(--line); } .hero-art-card { width: 112px; height: 145px; } .hero-art-card span { font-size: 56px; } .hero-art-card-a { top: 38px; left: 20px; } .hero-art-card-b { top: 83px; left: 104px; } .hero-art-card-c { top: 30px; right: 18px; } .section-head { align-items: start; flex-direction: column; gap: 14px; } .section-tools { width: 100%; } .search-box { flex: 1; } .search-box input { width: 100%; } .section-tools select { max-width: 120px; } .meme-grid { grid-template-columns: 1fr 1fr; gap: 13px; } .meme-card { box-shadow: 3px 4px 0 var(--line); } .meme-card:hover { transform: none; box-shadow: 3px 4px 0 var(--line); } .meme-card-body { padding: 10px; } .meme-card h3 { font-size: 14px; } .meme-card-meta { font-size: 10px; } .submit-banner { margin-top: 70px; padding: 24px 22px; } .modal-card, .detail-card { padding: 23px 18px; } .modal-card h2, .detail-copy h2 { font-size: 34px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; scroll-behavior: auto !important; transition-duration: .01ms !important; } }
