/* ── Self-hosted Fraunces (variable, latin only) ── */

@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('fonts/fraunces-latin.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: 'Fraunces';
  font-style: italic;
  font-weight: 300 700;
  font-display: swap;
  src: url('fonts/fraunces-latin-italic.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;
}

:root {
  --paper: #f5efe2;
  --paper-edge: #ece4d2;
  --ink: #1c1814;
  --ink-soft: #6a5e4f;
  --rule: #d9d0bc;
  --accent: #b95738;
  --accent-soft: #d8a48b;
  --shadow: 0 1px 0 rgba(0, 0, 0, 0.04), 0 16px 40px -24px rgba(28, 24, 20, 0.18);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #14110d;
    --paper-edge: #1c1814;
    --ink: #efe6d3;
    --ink-soft: #948776;
    --rule: #2a2520;
    --accent: #e5957a;
    --accent-soft: #b06a4f;
    --shadow: 0 1px 0 rgba(255, 255, 255, 0.02), 0 16px 40px -24px rgba(0, 0, 0, 0.6);
  }
}

* { box-sizing: border-box; }

html {
  font-size: 17px;
  background: var(--paper-edge);
}

body {
  margin: 0;
  background:
    radial-gradient(ellipse at top, transparent 0%, var(--paper) 60%),
    var(--paper);
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Helvetica, sans-serif;
  font-feature-settings: "kern", "liga", "calt";
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}

main {
  max-width: 44rem;
  margin: 0 auto;
  padding: 4.5rem 1.6rem 4rem;
  position: relative;
  animation: rise 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  main { animation: none; }
}

/* ── Topbar (monogram + avatar) ─────────────── */

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

.mark {
  display: inline-block;
  font-family: 'Fraunces', ui-serif, Georgia, serif;
  font-variation-settings: "opsz" 144, "SOFT" 100, "wght" 700;
  font-size: 0.95rem;
  letter-spacing: 0.45em;
  color: var(--accent);
  text-decoration: none;
  padding-right: 0.4em;
}

.mark:hover { color: var(--accent-soft); }

.avatar {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  border: 2px solid var(--paper);
  box-shadow: 0 0 0 1px var(--rule), 0 6px 20px -10px rgba(28, 24, 20, 0.35);
  transition: transform 280ms cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 280ms;
}

.avatar:hover {
  transform: scale(1.04);
  box-shadow: 0 0 0 1px var(--accent-soft), 0 10px 30px -12px rgba(28, 24, 20, 0.4);
}

@media (max-width: 480px) {
  .avatar { width: 72px; height: 72px; }
}

/* ── Headline ───────────────────────────────── */

header {
  margin-bottom: 2.6rem;
  position: relative;
}

h1 {
  font-family: 'Fraunces', ui-serif, Georgia, serif;
  font-variation-settings: "opsz" 144, "SOFT" 100, "wght" 600;
  font-size: clamp(3.4rem, 11vw, 5.8rem);
  font-weight: 600;
  line-height: 0.95;
  letter-spacing: -0.025em;
  margin: 0 0 0.6rem;
  color: var(--ink);
}

h1 .last {
  font-style: italic;
  font-variation-settings: "opsz" 144, "SOFT" 50, "wght" 500;
  color: var(--accent);
  display: inline-block;
  padding-left: 0.05em;
}

.role {
  font-family: 'Fraunces', ui-serif, Georgia, serif;
  font-variation-settings: "opsz" 14, "SOFT" 100, "wght" 350;
  font-style: italic;
  font-size: 1.2rem;
  margin: 0;
  color: var(--ink-soft);
}

/* ── Bio ────────────────────────────────────── */

.bio {
  margin-bottom: 3rem;
  font-family: 'Fraunces', ui-serif, Georgia, serif;
  font-variation-settings: "opsz" 14, "SOFT" 80, "wght" 400;
  font-size: 1.08rem;
  line-height: 1.7;
  max-width: 36rem;
}

.bio .lead {
  font-size: 1.2rem;
  font-variation-settings: "opsz" 18, "SOFT" 80, "wght" 380;
  margin-bottom: 1.2rem;
}

.bio p:last-child { margin-bottom: 0; }

.bio a {
  color: var(--ink);
  text-decoration: none;
  background-image: linear-gradient(var(--accent), var(--accent));
  background-position: 0 100%;
  background-repeat: no-repeat;
  background-size: 100% 1px;
  transition: background-size 220ms cubic-bezier(0.4, 0, 0.2, 1), color 200ms;
  padding-bottom: 1px;
}

.bio a:hover {
  background-size: 100% 0.4em;
  color: var(--ink);
}

/* ── Link cards ─────────────────────────────── */

.links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 0.85rem;
  margin-bottom: 4rem;
}

.link-card {
  display: block;
  padding: 1rem 1.15rem;
  text-decoration: none;
  color: var(--ink);
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--paper);
  transition: border-color 200ms, transform 200ms, box-shadow 240ms;
  position: relative;
  overflow: hidden;
}

.link-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 280ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.link-card:hover {
  border-color: var(--accent-soft);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.link-card:hover::before { transform: scaleX(1); }

.link-card-label {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 0.35rem;
}

.link-card-target {
  display: block;
  font-family: 'Fraunces', ui-serif, Georgia, serif;
  font-variation-settings: "opsz" 14, "SOFT" 80, "wght" 500;
  font-size: 1rem;
  color: var(--ink);
}

.link-card--muted .link-card-target {
  color: var(--ink-soft);
  font-style: italic;
  font-variation-settings: "opsz" 14, "SOFT" 80, "wght" 400;
}

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

footer {
  font-family: 'Fraunces', ui-serif, Georgia, serif;
  font-variation-settings: "opsz" 9, "SOFT" 100, "wght" 350;
  font-size: 0.82rem;
  color: var(--ink-soft);
  text-align: center;
  border-top: 1px solid var(--rule);
  padding-top: 1.6rem;
  letter-spacing: 0.02em;
}

footer p { margin: 0; }

/* ── Selection ──────────────────────────────── */

::selection {
  background: var(--accent);
  color: var(--paper);
}
