:root {
  --mist: #dfe3df;
  --mist-2: #c9cfc9;
  --ink: #1b1f1b;
  --muted: #5d665d;
  --green: #3fb51f;
  --green-dark: #2a8a12;
  --radius: 14px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background: var(--mist);
  line-height: 1.5;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2 { font-weight: 700; letter-spacing: -0.02em; margin: 0 0 0.4em; }
h2 { font-size: clamp(32px, 5vw, 56px); }
section { padding: 90px 6vw; position: relative; }
.sub { color: var(--muted); margin: -8px 0 30px; font-size: 18px; }

.top {
  position: fixed; inset: 0 0 auto 0; z-index: 30;
  display: flex; align-items: center; gap: 24px;
  padding: 12px 4vw;
  background: rgba(223, 227, 223, 0.7);
  backdrop-filter: blur(10px);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 22px; text-decoration: none; }
.brand img { width: 36px; height: 36px; border-radius: 50%; }
.top nav { display: flex; gap: 20px; margin-left: auto; }
.top nav a { text-decoration: none; color: var(--muted); }
.top nav a:hover { color: var(--ink); }

.btn {
  display: inline-block; cursor: pointer;
  font: 700 17px Arial, Helvetica, sans-serif;
  padding: 13px 26px; border-radius: 999px; border: 2px solid var(--ink);
  background: var(--ink); color: #fff; text-decoration: none;
  transition: transform .12s ease, background .12s ease;
}
.btn:hover { transform: translateY(-2px); background: var(--green-dark); border-color: var(--green-dark); }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.ghost:hover { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn.small { padding: 8px 18px; font-size: 15px; }

/* hero */
.hero {
  min-height: 100vh; padding: 0; overflow: hidden;
  display: grid; place-items: center;
  background: radial-gradient(ellipse at 50% 70%, #eef1ee 0%, var(--mist) 45%, #b9c1b9 100%);
}
.hero-inner { position: relative; text-align: center; padding: 80px 20px 50px; }
.hero-fog {
  width: min(170px, 34vw); margin: 0 auto -6px;
  filter: blur(0.6px) saturate(0.95);
  animation: sway 5s ease-in-out infinite;
  transform-origin: 50% 100%;
}
@keyframes sway { 0%, 100% { transform: rotate(-1.5deg); } 50% { transform: rotate(1.5deg); } }
.hero h1 {
  font-size: clamp(90px, 15vw, 190px); line-height: 1.05; margin: 0; padding-bottom: .05em;
  color: var(--ink); filter: blur(1.2px); position: relative;
}
.tag { font-size: clamp(18px, 2.4vw, 26px); margin: 10px 0 28px; color: #333a33; }
.hero-fog, .hero h1, .tag { position: relative; z-index: 1; }
.ca, .links { position: relative; z-index: 4; }
.ca {
  display: inline-flex; align-items: center; gap: 12px; max-width: 92vw;
  background: rgba(255,255,255,.7); border: 2px solid var(--ink); border-radius: 999px;
  padding: 8px 8px 8px 18px; margin-bottom: 22px;
}
.ca-label { font-weight: 700; }
.ca code { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ca button { border: 0; border-radius: 999px; padding: 8px 16px; background: var(--ink); color: #fff; font-weight: 700; cursor: pointer; }
.links { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
#fogcanvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; pointer-events: none; }
.hint { position: absolute; bottom: 18px; width: 100%; text-align: center; z-index: 3; color: var(--muted); font-size: 14px; margin: 0; }

/* what */
.cols { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 6vw; align-items: center; }
.what p { font-size: 19px; max-width: 620px; }
.what .big { font-size: 28px; font-weight: 700; line-height: 1.3; }
.clip { margin: 0; }
.clip video { width: 100%; border-radius: var(--radius); filter: blur(.4px); }
.clip figcaption { color: var(--muted); font-size: 14px; margin-top: 8px; }
.facts { list-style: none; padding: 0; margin: 50px 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.facts li { background: #fff6; border: 2px solid var(--ink); border-radius: var(--radius); padding: 14px 16px; font-size: 18px; }
.facts b { display: block; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }

/* galleries */
.sightings { background: var(--mist-2); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.card { cursor: pointer; background: #fff; border-radius: var(--radius); overflow: hidden; border: 2px solid var(--ink); transition: transform .15s ease; }
.card:hover { transform: rotate(-1deg) scale(1.02); }
.card img { aspect-ratio: 1; object-fit: cover; width: 100%; }
.card .meta { padding: 10px 12px; font-size: 14px; }
.card .meta b { display: block; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.memes-grid .card img { aspect-ratio: auto; }

/* maker */
.maker-ui { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 4vw; align-items: start; }
#mk-canvas { width: 100%; height: auto; border-radius: var(--radius); border: 2px solid var(--ink); background: #fff; }
.mk-controls { display: flex; flex-direction: column; gap: 18px; }
.mk-controls label { display: flex; flex-direction: column; gap: 6px; font-weight: 700; }
.mk-controls textarea, .mk-controls select {
  font: 18px Arial, Helvetica, sans-serif; padding: 12px; border-radius: 10px; border: 2px solid var(--ink); background: #fff;
}
.mk-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 6px; max-height: 300px; overflow: auto; }
.mk-thumbs img { cursor: pointer; border-radius: 8px; border: 3px solid transparent; aspect-ratio: 1; object-fit: cover; }
.mk-thumbs img.on { border-color: var(--green); }
.mk-row { display: flex; gap: 12px; flex-wrap: wrap; }

/* how */
.how ol { counter-reset: s; list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.how li { counter-increment: s; background: #fff6; border: 2px solid var(--ink); border-radius: var(--radius); padding: 22px; font-size: 18px; }
.how li::before { content: counter(s); display: block; font-size: 44px; font-weight: 700; color: var(--green-dark); line-height: 1; margin-bottom: 8px; }
.how b { display: block; }

footer { padding: 60px 6vw 80px; text-align: center; color: var(--muted); }
footer img { width: 80px; border-radius: 50%; margin: 0 auto 16px; filter: blur(.5px); }
footer p { max-width: 640px; margin: 8px auto; }

.lightbox {
  position: fixed; inset: 0; z-index: 50; background: rgba(20,24,20,.85);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 20px;
}
.lightbox[hidden] { display: none; }
.lightbox img { max-height: 76vh; max-width: 92vw; border-radius: var(--radius); }
.lightbox p { color: #fff; margin: 0; text-align: center; }
.lightbox .btn.ghost { color: #fff; border-color: #fff; }

@media (max-width: 820px) {
  .top nav { display: none; }
  .cols, .maker-ui { grid-template-columns: 1fr; }
  section { padding: 70px 5vw; }
}
