/* linden — a small theme for a link-tree site.
   Single stylesheet, no build step, no external fonts. */

:root {
  color-scheme: light dark;

  --bg: #fbfaf8;
  --bg-tint: #f3f1ec;
  --fg: #1c1b19;
  --muted: #6b6862;
  --card: #ffffff;
  --border: #e3e0d9;
  --border-strong: #cfcbc1;
  --accent: #2f5d50;
  --shadow: 0 1px 2px rgb(28 27 25 / 6%), 0 4px 12px rgb(28 27 25 / 4%);

  --measure: 30rem;
  --radius: 0.75rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14161a;
    --bg-tint: #1a1d22;
    --fg: #e9e7e3;
    --muted: #9a978f;
    --card: #1d2026;
    --border: #2b2f36;
    --border-strong: #3a3f48;
    --accent: #7fc0ac;
    --shadow: none;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 400 clamp(1rem, 0.96rem + 0.2vw, 1.0625rem) / 1.6 ui-sans-serif, system-ui,
    -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.page {
  max-width: var(--measure);
  margin: 0 auto;
  padding: clamp(2.5rem, 9vw, 5rem) 1.25rem 3rem;
}

/* ── Identity block ─────────────────────────────────────────────────── */

.identity {
  margin-bottom: 2.25rem;
  text-align: center;
}

.identity--compact {
  text-align: left;
}

.identity__avatar,
.identity__monogram {
  display: block;
  width: 5.5rem;
  height: 5.5rem;
  margin: 0 auto 1.1rem;
  border-radius: 50%;
}

.identity__avatar {
  object-fit: cover;
  border: 1px solid var(--border);
}

.identity__monogram {
  display: grid;
  place-items: center;
  background: var(--bg-tint);
  border: 1px solid var(--border);
  color: var(--accent);
  font-size: 1.6rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  user-select: none;
}

.identity__name {
  margin: 0 0 0.35rem;
  font-size: clamp(1.75rem, 1.4rem + 1.6vw, 2.25rem);
  font-weight: 650;
  letter-spacing: -0.021em;
}

.identity__tagline {
  margin: 0;
  color: var(--muted);
  text-wrap: balance;
}

/* ── Prose ──────────────────────────────────────────────────────────── */

.prose a {
  color: var(--accent);
  text-underline-offset: 0.15em;
}

/* Banner marking a regional variant. Deliberately quiet — it's a wayfinding
   note, not a warning. */
.variant-note {
  padding: 0.7rem 1rem;
  background: var(--bg-tint);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--muted);
  font-size: 0.9375rem;
  text-align: left;
}

.variant-note a {
  color: var(--accent);
  text-underline-offset: 0.15em;
}

/* ── Link tree ──────────────────────────────────────────────────────── */

/* The body of a `Template: links` page. Its bullet list becomes the cards;
   anything else (a paragraph, the variant banner) renders in place. */

.link-tree > :first-child {
  margin-top: 0;
}

.link-tree > :last-child {
  margin-bottom: 0;
}

.link-tree ul {
  list-style: none;
  margin: 2rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.7rem;
}

.link-tree li > a {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.9rem 1.1rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  color: inherit;
  font-weight: 550;
  text-decoration: none;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.link-tree li > a:hover,
.link-tree li > a:focus-visible {
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.link-tree li > a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* The trailing note is the Markdown link's title, so it stays inside the
   anchor and the whole card remains one click target:
     - [GitHub](https://github.com/soapergem "code")
   attr() yields an empty string when the title is absent, which collapses the
   pseudo-element to nothing. */
.link-tree li > a::after {
  content: attr(title);
  margin-left: auto;
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 400;
  text-align: right;
}

/* Off-site links also get an arrow. Same pseudo-element, so it appends to the
   note when there is one and stands alone when there isn't. */
.link-tree li > a[href^="http"]::after {
  content: attr(title) " \2197";
}

/* ── Footer ─────────────────────────────────────────────────────────── */

.site-footer {
  margin-top: 3rem;
  color: var(--muted);
  font-size: 0.8125rem;
  text-align: center;
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  color: inherit;
}

/* ── Motion ─────────────────────────────────────────────────────────── */

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

  .link-tree li > a:hover,
  .link-tree li > a:focus-visible {
    transform: none;
  }
}
