:root {
  color-scheme: light;
  --background: #f5f5f5;
  --surface: #ffffff;
  --text: #171717;
  --muted: #929292;
  --line: #dcdcdc;
}

* { box-sizing: border-box; }

html,
body {
  min-width: 320px;
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: Pretendard, "Apple SD Gothic Neo", "Noto Sans KR", "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

main {
  width: min(calc(100% - 48px), 1180px);
  margin: 0 auto;
  padding: 48px 0;
}

h1 {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.link-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.link-grid > a {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  transition: border-color 140ms ease, transform 140ms ease;
}

.link-grid > a:hover {
  border-color: var(--text);
  transform: translateY(-2px);
}

.link-grid > a:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 3px;
}

.preview {
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: #ececec;
}

.preview img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: top center;
}

.meta {
  min-width: 0;
  min-height: 72px;
  padding: 13px 15px;
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.number {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 10px;
}

.text {
  min-width: 0;
  display: block;
}

.name,
.url {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.name {
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.025em;
}

.url {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
}

.arrow {
  color: var(--muted);
  font-size: 16px;
}

.link-grid > a:hover .arrow { color: var(--text); }

@media (max-width: 900px) {
  .link-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
  main {
    width: min(calc(100% - 24px), 440px);
    padding: 16px 0;
  }

  .link-grid {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .link-grid > a:hover { transform: none; }

  .preview { display: none; }

  .meta {
    min-height: 64px;
    padding: 0 15px;
  }

  .name { font-size: 15px; }
  .url { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .link-grid > a { transition: none; }
}
