:root {
  --bg: #fbfbfa;
  --surface: #ffffff;
  --border: #e6e4df;
  --border-hover: #c9c5bc;
  --text: #1a1a18;
  --muted: #6b6862;
  --faint: #918d85;
  --accent: #b1552b;
  --tag-bg: #f2f0eb;
  --caret: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%236b6862' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --shadow: 0 1px 2px rgba(26, 26, 24, .04), 0 6px 20px rgba(26, 26, 24, .05);
  --shadow-hover: 0 2px 4px rgba(26, 26, 24, .06), 0 12px 32px rgba(26, 26, 24, .09);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161614;
    --surface: #1e1e1c;
    --border: #302f2c;
    --border-hover: #4a4844;
    --text: #ece9e3;
    --muted: #a6a29a;
    --faint: #7e7a73;
    --accent: #e2865a;
    --tag-bg: #2a2926;
    --caret: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23a6a29a' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    --shadow: none;
    --shadow-hover: 0 12px 32px rgba(0, 0, 0, .35);
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, "Hiragino Kaku Gothic ProN",
    "Noto Sans JP", "Segoe UI", sans-serif;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

main {
  max-width: 44rem;
  margin: 0 auto;
  padding: clamp(3rem, 10vw, 6rem) 1.25rem 4rem;
}

/* ---------- header ---------- */

.intro { margin-bottom: clamp(2rem, 6vw, 3rem); }

h1 {
  margin: 0;
  font-size: clamp(2.25rem, 8vw, 3rem);
  font-weight: 600;
  letter-spacing: -.03em;
  line-height: 1.1;
}

h1 .dot { color: var(--accent); }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: .75rem;
}

.lang-switch {
  flex: none;
  padding: .3125rem 1.75rem .3125rem .625rem;
  background: var(--surface) var(--caret) no-repeat right .55rem center;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
  font: inherit;
  font-size: .8125rem;
  line-height: 1.5;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color .15s ease, color .15s ease;
}

.lang-switch:hover { border-color: var(--border-hover); color: var(--text); }

.lang-switch:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Native dropdown lists are painted by the OS, not the page. */
.lang-switch option { color: var(--text); background: var(--surface); }

.lede {
  margin: 0;
  max-width: 34rem;
  color: var(--muted);
  font-size: 1.0625rem;
}

/* ---------- link cards ---------- */

.links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1rem;
}

.card {
  display: block;
  padding: 1.375rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  color: inherit;
  text-decoration: none;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.card:hover,
.card:focus-visible {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .25rem .75rem;
  margin-bottom: .5rem;
}

.card-title {
  font-size: 1.1875rem;
  font-weight: 600;
  letter-spacing: -.015em;
}

.card-host {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .8125rem;
  color: var(--accent);
}

/* Small qualifier next to the host, e.g. an app that needs a sign-in. */
.card-note {
  padding: .0625rem .5rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--faint);
  font-size: .75rem;
  line-height: 1.5;
}

.card-desc {
  display: block;
  color: var(--muted);
  font-size: .9375rem;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .375rem;
  margin-top: .875rem;
}

.tag {
  padding: .125rem .5rem;
  background: var(--tag-bg);
  border-radius: 999px;
  color: var(--faint);
  font-size: .75rem;
  line-height: 1.5;
}

/* ---------- footer ---------- */

footer {
  margin-top: clamp(2.5rem, 8vw, 4rem);
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  color: var(--faint);
  font-size: .8125rem;
}

footer p { margin: 0; }

.mark {
  letter-spacing: -.005em;
  font-weight: 500;
}

a { color: var(--accent); }

@media (prefers-reduced-motion: reduce) {
  .card { transition: none; }
  .card:hover, .card:focus-visible { transform: none; }
}
