/* PRIMIA Open — brand: green #47C820, slate #5B5D62, Century Gothic / Cairo */
:root {
  --green: #47C820;
  --green-deep: #36a414;
  --slate: #5B5D62;
  --slate-deep: #4a4c50;
  --bg: #f2f3f1;
  --card: #ffffff;
  --ink: #2b2c2f;
  --muted: #6d7075;
  --line: #e2e4e1;
  --shot-bg: #eceeeb;
  --shadow: 0 1px 2px rgba(40, 42, 46, .06), 0 8px 24px rgba(40, 42, 46, .06);
  --shadow-hover: 0 2px 4px rgba(40, 42, 46, .08), 0 18px 40px rgba(40, 42, 46, .14);
  --font: "Century Gothic", "CenturyGothic", "URW Gothic", "Questrial", "Cairo", system-ui, sans-serif;
  --radius: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #2a2b2e;
    --card: #35373b;
    --ink: #f1f2f0;
    --muted: #a9acb1;
    --line: #45474c;
    --shot-bg: #2f3134;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.2);
    --shadow-hover: 0 2px 4px rgba(0,0,0,.35), 0 18px 40px rgba(0,0,0,.35);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: inherit; }
kbd {
  font-family: var(--font);
  font-size: 11px;
  border: 1px solid currentColor;
  border-radius: 5px;
  padding: 1px 6px;
  opacity: .55;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  background: var(--slate);
  color: #fff;
  padding: 28px 16px 96px;
}
.hero-inner { position: relative; z-index: 2; max-width: 1280px; margin: 0 auto; }
.brand-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.logo { height: 40px; width: auto; display: block; }
.clock { text-align: right; line-height: 1.2; }
.clock-time { display: block; font-size: 22px; letter-spacing: .04em; }
.clock-date { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; opacity: .75; }

.hero-text { margin: 56px 0 28px; max-width: 640px; }
.eyebrow {
  margin: 0 0 10px;
  color: var(--green);
  font-size: 13px;
  letter-spacing: .2em;
  text-transform: uppercase;
  font-weight: 700;
}
.hero h1 {
  margin: 0;
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 400;
  letter-spacing: .01em;
  line-height: 1.05;
}
.sub { margin: 14px 0 0; font-size: 17px; opacity: .82; }

.toolbar { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.search {
  display: flex; align-items: center; gap: 10px;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 999px;
  padding: 0 14px;
  height: 46px;
  flex: 1 1 280px;
  max-width: 420px;
  transition: background .2s, border-color .2s;
}
.search:focus-within { background: rgba(255,255,255,.16); border-color: var(--green); }
.search svg { width: 18px; height: 18px; fill: none; stroke: #fff; stroke-width: 2; opacity: .7; flex: none; }
.search input {
  flex: 1; min-width: 0;
  background: none; border: 0; outline: 0;
  color: #fff; font: inherit; font-size: 15px;
}
.search input::placeholder { color: rgba(255,255,255,.6); }
.search input::-webkit-search-cancel-button { filter: invert(1); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font: inherit; font-size: 13px; letter-spacing: .04em;
  color: #fff;
  background: var(--slate);
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 999px;
  padding: 8px 16px;
  cursor: pointer;
  transition: all .2s;
}
.chip:hover { border-color: #fff; }
.chip.is-active { background: var(--green); border-color: var(--green); }

.lattice {
  position: absolute; z-index: 1;
  right: -40px; top: 0;
  height: 100%; width: auto;
  max-width: 62%;
  pointer-events: none;
}
.lattice-g polyline { fill: none; stroke: var(--green); stroke-width: 1.3; opacity: .9; }
.lattice-w line { stroke: #fff; stroke-width: 1.6; opacity: .85; }

/* ---------- Grid ---------- */
.wrap {
  position: relative; z-index: 3;
  width: 100%;
  max-width: 1312px;
  margin: -64px auto 0;
  padding: 0 16px 48px;
  flex: 1;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 22px;
}

.card {
  display: flex; flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-decoration: none;
  overflow: hidden;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
  animation: rise .5s ease both;
}
.card:nth-child(2) { animation-delay: .04s } .card:nth-child(3) { animation-delay: .08s }
.card:nth-child(4) { animation-delay: .12s } .card:nth-child(5) { animation-delay: .16s }
.card:nth-child(6) { animation-delay: .2s }  .card:nth-child(n+7) { animation-delay: .24s }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.card:hover, .card:focus-visible {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: var(--accent);
  outline: none;
}
.card:focus-visible { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 40%, transparent), var(--shadow-hover); }

.preview { padding: 12px 12px 0; }
.chrome {
  display: flex; align-items: center; gap: 5px;
  height: 26px; padding: 0 10px;
  background: var(--shot-bg);
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 9px 9px 0 0;
}
.chrome span { width: 7px; height: 7px; border-radius: 50%; background: var(--line); }
.chrome em {
  margin-left: 8px; font-style: normal; font-size: 11px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.shot {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--shot-bg);
  border: 1px solid var(--line);
  border-top: 0;
}
.shot img {
  width: 100%; height: 100%; object-fit: cover; object-position: top center; display: block;
  transition: transform .6s ease;
}
.card:hover .shot img { transform: scale(1.04); }

.placeholder {
  position: absolute; inset: 0;
  display: flex; align-items: center; gap: 18px; padding: 0 22px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 16%, transparent), transparent 60%),
    var(--shot-bg);
}
.mono {
  flex: none;
  width: 64px; height: 64px; border-radius: 14px;
  display: grid; place-items: center;
  background: var(--accent); color: #fff;
  font-size: 24px; font-weight: 700; letter-spacing: .04em;
}
.ph-lines { flex: 1; display: grid; gap: 9px; }
.ph-lines i { display: block; height: 8px; border-radius: 4px; background: var(--line); }
.ph-lines i:nth-child(1) { width: 80%; } .ph-lines i:nth-child(2) { width: 60%; } .ph-lines i:nth-child(3) { width: 70%; }

.body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.title-row { display: flex; align-items: center; gap: 10px; }
.favicon { width: 22px; height: 22px; border-radius: 5px; flex: none; }
.title-row h2 { margin: 0; font-size: 18px; font-weight: 700; letter-spacing: .01em; flex: 1; min-width: 0; }
.hotkey { color: var(--muted); }
.body p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.meta { margin-top: auto; padding-top: 8px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tag {
  font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted);
}
.open {
  margin-left: auto;
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 13px; font-weight: 700; color: var(--accent);
}
.open svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; transition: transform .25s; }
.card:hover .open svg { transform: translate(2px, -2px); }

.empty, .no-results {
  background: var(--card); border: 1px dashed var(--line); border-radius: var(--radius);
  padding: 48px 24px; text-align: center; color: var(--muted);
}
.empty h2 { color: var(--ink); margin: 0 0 6px; font-weight: 400; }
.empty a { color: var(--green); }

.foot {
  max-width: 1312px; width: 100%; margin: 0 auto;
  padding: 18px 16px 28px;
  display: flex; justify-content: space-between; gap: 12px;
  font-size: 12px; color: var(--muted); letter-spacing: .06em;
}
.foot a { color: var(--muted); text-decoration: none; }
.foot a:hover { color: var(--green); }

.card.is-hidden { display: none; }

@media (max-width: 640px) {
  .hero { padding-bottom: 84px; }
  .logo { height: 30px; }
  .clock-time { font-size: 18px; }
  .hero-text { margin: 36px 0 22px; }
  .lattice { max-width: 90%; opacity: .45; }
  .grid { grid-template-columns: 1fr; gap: 16px; }
  .hotkey, .search kbd { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
