:root {
  color-scheme: dark;
  /* Darker, lower-chroma brown (washed / desaturated) */
  --bg: #1f1c1a;
  /* Warm off-white (subtle peachy / cream, not muddy beige) */
  --fg: #e9e5de;
  /* Warm gray-taupe for secondary lines */
  --muted: #9a948b;
}

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

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

body {
  margin: 0;
  min-height: 100dvh;
  min-height: 100svh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  display: grid;
  /* Center the column in the viewport; long pages grow and scroll normally */
  place-items: center;
  padding-top: max(clamp(1.25rem, 4vw, 3rem), env(safe-area-inset-top, 0px));
  padding-bottom: max(clamp(1.25rem, 4vw, 3rem), env(safe-area-inset-bottom, 0px));
  padding-left: max(clamp(1rem, 4vw, 1.75rem), env(safe-area-inset-left, 0px));
  padding-right: max(clamp(1rem, 4vw, 1.75rem), env(safe-area-inset-right, 0px));
  font-family: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.6;
  color: var(--fg);
  background: var(--bg);
  overflow-wrap: break-word;
  -webkit-tap-highlight-color: transparent;
}

main {
  width: min(100%, 30rem);
  min-width: 0;
}

/* Vertical “nudge” only on viewports that are wide *and* tall enough. Otherwise translateY pulls
   the profile block above the visible area on phones (incl. landscape) where you can’t scroll up. */
@media (min-width: 40.0625rem) and (min-height: 31.25rem) {
  main {
    transform: translateY(max(-12.5rem, -40vh));
  }
}

.blurb {
  width: 100%;
  min-width: 0;
  text-align: left;
  font-size: clamp(0.875rem, 0.85vw + 0.72rem, 0.9375rem);
  font-weight: 400;
  /* Slightly open so wrapped underlines don’t crowd the next line */
  line-height: 1.84;
  text-wrap: pretty;
}

.blurb > p,
.blurb a {
  font-size: inherit;
}

.profile-row {
  display: flex;
  align-items: center;
  gap: clamp(0.875rem, 2.5vw, 1.25rem);
  margin-bottom: clamp(1.15rem, 3.5vw, 1.75rem);
}

.avatar {
  display: block;
  width: 56px;
  height: 56px;
  margin: 0;
  flex-shrink: 0;
  border-radius: 50%;
  object-fit: cover;
  object-position: 30% 30%;
}

.identity {
  min-width: 0;
  line-height: 1.35;
}

.identity-name {
  margin: 0;
  font-size: inherit;
  font-weight: 500;
  color: var(--fg);
}

.identity-meta {
  margin: 0;
  font-size: inherit;
  font-weight: 400;
  color: var(--muted);
}

.identity-name + .identity-meta {
  margin-top: 2px;
}

.identity .identity-meta + .identity-meta {
  margin-top: 1px;
}

/* Only body paragraphs — not .identity meta lines */
.blurb > p {
  margin: 0 0 clamp(1rem, 3vw, 1.25rem);
  text-wrap: pretty;
}

.blurb > p:last-of-type {
  margin-bottom: 0;
}

.social {
  margin-top: clamp(1.15rem, 3vw, 1.5rem);
}

.social-list {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.4em;
  margin: 0;
  padding: 0;
  padding-inline-start: 0;
  list-style: none;
  line-height: inherit;
  text-wrap: pretty;
}

.social-list li {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* External links: dotted underline; social list also gets a diagonal arrow before the label */
.link-dotted {
  --dotted-thickness: 1.5px;
  /* Smaller offset = line sits tighter to glyphs, more clearance above the line below when text wraps */
  --dotted-offset: 0.06em;
  font-weight: 450;
  color: color-mix(in srgb, var(--fg) 72%, var(--muted) 28%);
  text-decoration: none;
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}

.link-dotted:not(:has(.link-dotted-text)) {
  text-decoration-line: underline;
  text-decoration-style: dotted;
  text-decoration-thickness: var(--dotted-thickness);
  text-underline-position: under;
  text-underline-offset: var(--dotted-offset);
  text-decoration-color: currentColor;
  text-decoration-skip-ink: none;
}

.link-dotted-text {
  text-decoration-line: underline;
  text-decoration-style: dotted;
  text-decoration-thickness: var(--dotted-thickness);
  text-underline-position: under;
  text-underline-offset: var(--dotted-offset);
  text-decoration-color: currentColor;
  text-decoration-skip-ink: none;
}

/* Same metrics as body links (inline paints like paragraph anchors; inline-flex did not) */
.social-list .link-dotted {
  display: inline;
  text-decoration-line: underline;
  text-decoration-style: dotted;
  text-decoration-thickness: var(--dotted-thickness);
  text-underline-position: under;
  text-underline-offset: var(--dotted-offset);
  text-decoration-color: currentColor;
  text-decoration-skip-ink: none;
}

.social-list .link-dotted .link-dotted-text {
  text-decoration: none;
}

.social-list .link-dotted::before {
  content: "";
  display: inline-block;
  width: 0.9em;
  height: 0.9em;
  margin-inline-end: 0.3em;
  vertical-align: -0.16em;
  margin-block: 0;
  margin-inline-start: 0;
  /* Softer than link text while still tracking hover color */
  background-color: color-mix(in srgb, currentColor 58%, var(--bg) 42%);
  mask-image: url("external-arrow.svg");
  mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
  -webkit-mask-image: url("external-arrow.svg");
  -webkit-mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
}

@media (hover: hover) and (pointer: fine) {
  .link-dotted:hover {
    color: #f3efe8;
  }
}

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

.link-dotted:focus-visible {
  outline: 2px solid var(--fg);
  outline-offset: 3px;
  border-radius: 2px;
}

/* Narrow screens: stack avatar above copy, tighter column + more side inset */
@media (max-width: 40rem) {
  body {
    padding-left: max(clamp(1.35rem, 6.5vw, 2.25rem), env(safe-area-inset-left, 0px));
    padding-right: max(clamp(1.35rem, 6.5vw, 2.25rem), env(safe-area-inset-right, 0px));
  }

  main {
    width: min(100%, 26rem);
  }

  /* At least ~16px body text on small screens (easier to read at arm’s length) */
  .blurb {
    font-size: clamp(1rem, 2vw + 0.82rem, 1.0625rem);
    line-height: 1.8;
  }

  .profile-row {
    flex-direction: column;
    align-items: center;
    gap: clamp(0.875rem, 4vw, 1.15rem);
    margin-bottom: clamp(1.1rem, 4vw, 1.4rem);
    text-align: center;
  }

  .identity {
    text-align: center;
  }

  .avatar {
    width: clamp(3.5rem, 22vw, 4.25rem);
    height: clamp(3.5rem, 22vw, 4.25rem);
  }

  .blurb > p {
    margin-bottom: clamp(1.1rem, 4vw, 1.35rem);
  }

  .link-dotted {
    padding-block: 0.1em;
  }
}
