/* Is AI Good? — brutalist gallery. Committed single look: orange + ink on paper,
   Space Mono masthead, Space Grotesk headings. Fonts are self-hosted (no CDN). */

@font-face {
  font-family: "Space Mono";
  src: url("fonts/SpaceMono-Bold.ttf") format("truetype");
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Space Grotesk";
  src: url("fonts/SpaceGrotesk.ttf") format("truetype");
  font-weight: 300 700; font-style: normal; font-display: swap;
}

:root {
  --orange: #FF6A00;
  --orange-ink: #D24E00;   /* deeper orange for small text on white */
  --ink: #0A0A0A;
  --paper: #F4F1EA;
  --surface: #ffffff;
  --text: #1c1a17;
  --muted: #4a463f;
  --mut2: #6a655d;
  --mono: "Space Mono", ui-monospace, Consolas, monospace;
  --display: "Space Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font: 16px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}
.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 20px; }
a { color: inherit; }

/* ---- Blinking cursor (slowed) ---- */
.cur {
  display: inline-block; width: .52em; height: .84em; background: currentColor;
  margin-left: .06em; transform: translateY(.05em);
}
@media (prefers-reduced-motion: no-preference) { .cur { animation: blink 2s step-end infinite; } }
@keyframes blink { 0%,50% { opacity: 1; } 50.01%,100% { opacity: 0; } }

/* ---- Masthead ---- */
.site-header { background: var(--orange); border-bottom: 8px solid var(--ink); padding: 44px 0 38px; }
.masthead {
  margin: 0; color: var(--ink); font-family: var(--mono); font-weight: 700;
  line-height: .9; letter-spacing: -.03em; font-size: clamp(52px, 11vw, 118px);
}
.masthead .l2 { display: block; }
.strap {
  margin: 20px 0 0; color: var(--ink); font-family: var(--mono); font-weight: 700;
  font-size: clamp(.72rem, 1.6vw, .95rem); letter-spacing: .05em; text-transform: uppercase;
}

/* ---- Controls ---- */
.controls { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 28px 0 4px; }
#search {
  flex: 1 1 240px; padding: 11px 15px; font-family: var(--mono); font-size: .9rem;
  border: 2px solid var(--ink); background: var(--surface); color: var(--text);
}
#search::placeholder { color: var(--mut2); }
#search:focus { outline: 2px solid var(--orange); outline-offset: 2px; }

.theme-filters { display: flex; flex-wrap: wrap; gap: 8px; width: 100%; }
.chip {
  border: 2px solid var(--ink); background: var(--surface); color: var(--ink);
  padding: 6px 12px; font-family: var(--sans); font-size: .82rem; font-weight: 600; cursor: pointer;
}
.chip:hover { background: var(--orange); }
.chip.active { background: var(--ink); color: #fff; }
.chip:focus-visible { outline: 2px solid var(--orange-ink); outline-offset: 2px; }

/* sensitive toggle */
.toggle {
  display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none;
  font-family: var(--mono); font-size: .72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .03em; color: var(--ink);
}
.toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle .track { width: 46px; height: 26px; border: 2px solid var(--ink); background: var(--surface); position: relative; flex: none; transition: background .15s; }
.toggle .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; background: var(--ink); transition: transform .15s; }
.toggle input:checked + .track { background: var(--orange); }
.toggle input:checked + .track::after { transform: translateX(20px); }
.toggle input:focus-visible + .track { outline: 2px solid var(--orange-ink); outline-offset: 2px; }

.count { color: var(--mut2); font-family: var(--mono); font-size: .74rem; margin: 18px 0 10px; }

/* ---- Grid ---- */
.grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 22px; padding-bottom: 52px;
}
.grid.hide-sensitive .card.sensitive { display: none; }

.card {
  background: var(--surface); border: 2px solid var(--ink); box-shadow: 6px 6px 0 var(--ink);
  display: flex; flex-direction: column;
  transition: transform .12s ease, box-shadow .12s ease;
}
@media (prefers-reduced-motion: no-preference) {
  .card:hover { transform: translate(-2px, -2px); box-shadow: 8px 8px 0 var(--ink); }
}

/* Media wells. YouTube = 16:9 iframe; images size naturally; social embeds
   (Instagram / TikTok / X) are rendered by each platform's own script. */
.card-media { border-bottom: 2px solid var(--ink); }
.card-media.youtube { background: #000; aspect-ratio: 16 / 9; }
.card-media.youtube iframe { width: 100%; height: 100%; border: 0; display: block; }
.card-media.image img { width: 100%; height: auto; display: block; }
.card-media.social {
  display: flex; justify-content: center; padding: 10px; background: var(--surface);
  min-height: 120px;
}
.card-media.social > * { max-width: 100%; }

/* Fallback "cover" for stories with no embeddable media — theme word on a hatched
   paper panel. Intentional-looking, brand-consistent, no external assets. */
.card-media.placeholder {
  aspect-ratio: 16 / 9; display: flex; align-items: center; justify-content: center;
  padding: 18px; overflow: hidden; background-color: var(--paper);
  background-image: repeating-linear-gradient(
    -45deg, transparent 0, transparent 11px,
    rgba(10, 10, 10, .06) 11px, rgba(10, 10, 10, .06) 13px);
}
.card-media.placeholder .ph-label {
  font-family: var(--mono); font-weight: 700; text-transform: uppercase;
  font-size: clamp(1rem, 4.6vw, 1.45rem); line-height: 1.12; letter-spacing: .01em;
  color: var(--ink); text-align: center; text-wrap: balance;
  background: var(--paper); box-shadow: 0 0 0 7px var(--paper);
}

.card-body { padding: 15px 16px 0; display: flex; flex-direction: column; gap: 9px; flex: 1; }

.card-tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.pill {
  font-size: .68rem; font-weight: 700; padding: 3px 8px;
  border: 1.5px solid var(--ink); background: var(--orange); color: var(--ink);
}
.pill.sensitive { background: var(--surface); color: var(--orange-ink); border-color: var(--orange-ink); }
.card .date { margin-left: auto; font-family: var(--mono); font-size: .7rem; color: var(--mut2); white-space: nowrap; }

.card h2 { margin: 0; font-family: var(--display); font-size: 1.1rem; line-height: 1.26; letter-spacing: -.01em; font-weight: 700; color: var(--ink); text-wrap: balance; }
.card .summary { margin: 0 0 15px; color: var(--muted); font-size: .9rem; line-height: 1.48; }

/* Instagram/TikTok clip cards: the embed IS the content, so the title + summary are hidden.
   .vh keeps them in the DOM (search, screen readers) while removing them from view. */
.vh { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0;
      overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.card.social-video .card-body { padding-top: 12px; gap: 12px; }

/* footer actions — share beside view source, split 50/50 */
.card-foot { margin-top: auto; border-top: 2px solid var(--ink); display: flex; }
.card-foot button,
.card-foot a {
  flex: 1; text-align: center; font-family: var(--mono); font-size: .74rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .03em; padding: 11px 8px;
  background: var(--surface); color: var(--ink); border: 0; cursor: pointer; text-decoration: none;
}
.card-foot .share { border-right: 2px solid var(--ink); }
.card-foot .share:hover, .card-foot .source:hover { background: var(--orange); }
.card-foot .source { color: var(--orange-ink); }
.card-foot .source:hover { color: var(--ink); }
.card-foot .share.copied { background: var(--ink); color: #fff; }
.card-foot button:focus-visible, .card-foot a:focus-visible { outline: 2px solid var(--orange-ink); outline-offset: -4px; }

.empty { text-align: center; color: var(--mut2); font-family: var(--mono); padding: 40px 0 60px; }

/* ---- Footer ---- */
.site-footer { border-top: 3px solid var(--ink); background: var(--surface); }
.site-footer p { color: var(--muted); font-size: .85rem; padding: 24px 0; max-width: 70ch; }

/* ---- Feedback (floating button + modal) ---- */
.fb-open {
  position: fixed; right: 18px; bottom: 18px; z-index: 50;
  font-family: var(--mono); font-weight: 700; font-size: .82rem; letter-spacing: .02em;
  padding: 11px 15px; color: var(--ink); background: var(--orange);
  border: 2.5px solid var(--ink); box-shadow: 4px 4px 0 var(--ink); cursor: pointer;
}
.fb-open:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--ink); }
.fb-open:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--ink); }
.fb-open:focus-visible { outline: 3px solid var(--orange-ink); outline-offset: 2px; }

.fb-panel { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center;
  justify-content: center; padding: 18px; background: rgba(10, 10, 10, .55); }
.fb-panel[hidden] { display: none; }
.fb-card {
  width: 100%; max-width: 460px; max-height: calc(100vh - 36px); overflow-y: auto;
  background: var(--paper); border: 3px solid var(--ink); box-shadow: 8px 8px 0 var(--ink);
  padding: 18px 18px 20px;
}
.fb-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.fb-head h2 { margin: 0; font-family: var(--display); font-size: 1.35rem; font-weight: 700; color: var(--ink); }
.fb-close { background: none; border: 0; font-size: 1.3rem; line-height: 1; cursor: pointer; color: var(--ink); padding: 4px; }
.fb-close:focus-visible { outline: 2px solid var(--orange-ink); outline-offset: 2px; }
.fb-intro { margin: 6px 0 14px; color: var(--muted); font-size: .88rem; line-height: 1.45; }

.fb-field { display: block; margin-bottom: 12px; }
.fb-field > span { display: block; font-family: var(--mono); font-size: .72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em; color: var(--ink); margin-bottom: 5px; }
.fb-field > span em { font-style: normal; text-transform: none; letter-spacing: 0; color: var(--mut2); font-weight: 400; }
.fb-field select, .fb-field textarea, .fb-field input {
  width: 100%; font-family: var(--sans); font-size: .92rem; color: var(--text);
  background: var(--surface); border: 2px solid var(--ink); padding: 9px 10px;
}
.fb-field textarea { resize: vertical; min-height: 88px; }
.fb-field select:focus, .fb-field textarea:focus, .fb-field input:focus {
  outline: 2px solid var(--orange-ink); outline-offset: -1px; }

.fb-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.fb-note { margin: 2px 0 10px; min-height: 1.1em; font-size: .84rem; font-weight: 700; }
.fb-note.err { color: var(--orange-ink); }
.fb-note.ok { color: #1a7f37; }

.fb-submit {
  width: 100%; font-family: var(--mono); font-weight: 700; font-size: .9rem; letter-spacing: .02em;
  padding: 12px; color: var(--paper); background: var(--ink);
  border: 2.5px solid var(--ink); box-shadow: 4px 4px 0 var(--orange); cursor: pointer;
}
.fb-submit:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--orange); }
.fb-submit:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--orange); }
.fb-submit:disabled { opacity: .55; cursor: default; transform: none; box-shadow: 4px 4px 0 var(--orange); }
.fb-submit:focus-visible { outline: 3px solid var(--orange-ink); outline-offset: 2px; }

@media (max-width: 480px) { .fb-open { right: 12px; bottom: 12px; } }
