/* ---------- Font: Inter, self-hosted (SIL OFL — see fonts/OFL-LICENSE.txt) ---------- */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/inter-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/inter-latin-ext-400-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---------- Tokens (from Figma) ---------- */
:root {
  --text-default: #1e1e1e;
  --text-secondary: #757575;
  --text-tertiary: #b3b3b3;
  --divider: #cccccc;
  --border: #d9d9d9;
  --card-border: #dddddd;
  --radius: 8px;
  --gap: 8px;

  /* outer padding of the grid; header/footer sit 12px further out
     so their text lines up with the grid edge (buttons have 12px padding) */
  --gutter: 16px;          /* mobile  */
}
@media (min-width: 640px)  { :root { --gutter: 32px; } }   /* tablet  */
@media (min-width: 1024px) { :root { --gutter: 52px; } }   /* desktop */

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: #fff;
  color: var(--text-default);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: normal;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
p { margin: 0; }

.icon {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

/* Shared page width: 1280 frame → 1176 grid */
.site-header,
.grid-wrap,
.site-footer {
  width: 100%;
  max-width: 1280px;
  margin-inline: auto;
}

/* ---------- Header ---------- */
.site-header {
  padding: calc(var(--gutter) * 0.77) calc(var(--gutter) - 12px) 0; /* 40px top on desktop */
  margin-bottom: 10px;
}
.breadcrumb { display: flex; align-items: center; gap: 2px; }
.crumb { display: inline-block; padding: 8px 12px; border-radius: var(--radius); white-space: nowrap; }
.crumb--home { color: var(--text-default); }
.crumb--current { color: var(--text-secondary); }
.crumb-divider { color: var(--divider); }

/* ---------- Grid ---------- */
.grid-wrap { padding-inline: var(--gutter); }

.grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;                       /* mobile: 1 per row */
  gap: var(--gap);
}
@media (min-width: 640px)  { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.tile {
  position: relative;
  aspect-ratio: 1 / 1;          /* always square */
  border-radius: var(--radius);
  overflow: hidden;
  background: #f6f6f6;
}
.tile > svg,
.tile img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;            /* fills the square, never stretches */
}

/* Text card — also square; type scales with the card so it never overflows */
.tile--info {
  container-type: inline-size;
  background: #fff;
  border: 1px solid var(--card-border);
}
.info {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  padding: 36px 40px;
  color: var(--text-secondary);
  line-height: 1.4;
}
@container (max-width: 360px) {
  .info { padding: 28px 28px; gap: 12px; font-size: clamp(14px, 4.4cqi, 16px); }
}
/* Below desktop (2 or 1 per row): drop the frame — text sits on the page,
   spans the full row, and gets breathing room before the footer */
@media (max-width: 1023.98px) {
  .tile--info {
    grid-column: 1 / -1;
    aspect-ratio: auto;
    border: 0;
    border-radius: 0;
    overflow: visible;
    background: none;
    container-type: normal;
  }
  .info {
    position: static;
    max-width: 34em;
    padding: 40px 0 64px;
    font-size: 16px;
  }
}

.button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text-secondary);
  line-height: normal;
  transition: border-color .15s, color .15s;
}
.button:hover, .button:focus-visible { border-color: var(--text-secondary); color: var(--text-default); }

/* ---------- Footer ---------- */
.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px calc(var(--gutter) - 12px) calc(var(--gutter) * 0.77);
}
.footer-links { display: flex; align-items: center; gap: 8px; }
.icon-button {
  display: inline-flex;
  padding: 8px 12px;
  border-radius: var(--radius);
  color: var(--text-tertiary);
  transition: color .15s;
}
.icon-button:hover, .icon-button:focus-visible { color: var(--text-default); }
.footer-meta {
  display: flex;
  gap: 10px;
  padding-inline: 12px;
  color: var(--text-tertiary);
  white-space: nowrap;
}

a:focus-visible { outline: 2px solid var(--text-default); outline-offset: 2px; }
