/* =========================
   Global UI system (token-driven)
========================= */

/* =========================
   Base reset
========================= */
*{ box-sizing: border-box; }

html, body{
  height: 100%;
}

body{
  margin: 0;
  font-family: var(--font-base);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

/* =========================
   Typography
========================= */
h1,h2,h3,h4,h5,h6{
  font-family: var(--font-base);
  letter-spacing: -0.01em;
  margin: 0;
}

p{
  margin: 0 0 1rem;
}

/* =========================
   Media
========================= */
img,
picture,
video,
canvas,
svg{
  display: block;
  max-width: 100%;
}

/* =========================
   Links
========================= */
a{
  color: inherit;
  text-decoration: none;
}

a:hover{
  text-decoration: underline;
  text-underline-offset: 2px;
}

.muted{ color: var(--muted); }
.dot{ opacity: 0.6; }

/* =========================
   Layout primitives
========================= */
.container{
  max-width: var(--container);
  margin: 0 auto;
  padding: 2rem 18px;
}

.section{
  margin: 0;
}

.section + .section{
  margin-top: 28px;
}

.section__head{
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.section__title{
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

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

.card{
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg);
  overflow: hidden;
}

.card__media{
  display: block;
  background: var(--surface);
}

.card__media img,
.card__media picture img{
  width: 100%;
  height: auto;
  aspect-ratio: 16/9;
  object-fit: cover;
}

.card__body{
  padding: 12px 12px 14px;
}

.card__title{
  margin: 8px 0;
  font-size: 16px;
  line-height: 1.2;
  letter-spacing: -0.01em;
  font-weight: 800;
}

.card__title a:hover{
  text-decoration: underline;
}

.card__desc{
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text);
  opacity: 0.78;
  max-width: 55ch;
}

/* =========================
   Meta UI
========================= */
.meta{
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

.pill{
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;

  background: var(--pill-bg);
  border: 1px solid var(--pill-border);
  color: var(--pill-text);

  font-weight: 800;
  font-size: 11px;
  letter-spacing: -0.01em;
  text-transform: none;

  box-shadow: inset 0 1px 0 rgba(255,255,255,0.55);
}

/* =========================
   Responsive
========================= */
@media (max-width: 980px){
  .grid{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px){
  .container{
    padding-top: 1.5rem;
    padding-bottom: 2rem;
  }

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

  .section + .section{
    margin-top: 22px;
  }
}