:root {
  color-scheme: dark;
  --bg: #070b13;
  --panel: #101624;
  --ink: #e9eefc;
  --muted: #bac5dc;
  --line: #343e53;
  --amber: #ffc077;
  --blue: #b8ceff;
}
* { box-sizing: border-box; }
html { scroll-padding-top: 1rem; }
body {
  margin: 0;
  font-family: system-ui, sans-serif;
  line-height: 1.6;
  color: var(--ink);
  background: radial-gradient(ellipse 700px 420px at 15% 0%, #182c59, transparent),
    radial-gradient(ellipse 700px 410px at 95% 2%, #392319, transparent), var(--bg);
}
a { color: var(--blue); text-underline-offset: .2em; }
a:hover { color: #fff; }
a:focus-visible { outline: 2px solid var(--amber); outline-offset: 4px; }
.wrap { max-width: 800px; margin: auto; padding: clamp(16px, 5vw, 42px) 16px 24px; }
.card {
  border: 1px solid var(--line);
  border-radius: 26px;
  background: var(--panel);
  box-shadow: 0 18px 50px #0005;
}
header.card {
  background: radial-gradient(ellipse at top left, #202f55, transparent 70%),
    radial-gradient(ellipse at top right, #422921, transparent 65%), var(--panel);
  padding: clamp(16px, 4vw, 28px);
}
.languages { display: flex; justify-content: flex-end; gap: 6px; }
.languages a, .socials a, .sections a {
  display: inline-flex;
  align-items: center;
  gap: .35em;
  padding: .48rem .72rem;
  min-height: 44px;
  text-decoration: none;
}
.languages a, .socials a { border: 1px solid var(--line); border-radius: 12px; background: #070b135c; }
.languages a[aria-current] { color: var(--ink); border-color: #8294bb; background: #263454; }
.hero { display: flex; align-items: center; gap: clamp(13px, 4vw, 24px); margin: 14px 0 22px; }
.hero img {
  width: clamp(92px, 24vw, 144px);
  height: auto;
  flex: none;
  border-radius: 24px;
  border: 1px solid #fff4;
  box-shadow: 0 10px 30px #0006;
}
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(1.55rem, 6vw, 2.7rem); line-height: 1.1; letter-spacing: -.035em; }
.handle { display: inline-block; margin-top: .25rem; font-size: .9rem; }
.role { margin-top: .35rem; color: var(--muted); }
.actions { display: grid; gap: 10px; }
.link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1em;
  padding: .7rem .9rem;
  border: 1px solid var(--line);
  border-radius: 15px;
  color: var(--ink);
  background: linear-gradient(105deg, #1c2842, #1d1c29);
  text-decoration: none;
}
.link:hover { border-color: #8294bb; }
.link small { display: block; font-size: .85rem; color: var(--muted); }
.link.primary { border-color: #9e6f41; background: linear-gradient(105deg, #39291d, #262133); }
.link.primary strong { color: var(--amber); }
.socials, .sections { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: 14px; font-size: .9rem; }
.sections { gap: .15rem .75rem; border-top: 1px solid var(--line); padding-top: .3rem; }
.sections a { padding-inline: .12rem; text-decoration: underline; }
.section { margin-top: 16px; padding: clamp(16px, 4vw, 28px); }
.section p { margin-top: .55rem; color: var(--muted); }
h2 { font-size: clamp(1.25rem, 4vw, 1.55rem); line-height: 1.3; }
h3 { font-size: 1rem; line-height: 1.4; }
.projects, .books { list-style: none; padding: 0; margin: .85rem 0 0; display: grid; gap: 8px 12px; }
.projects li { padding: .8rem .9rem; border: 1px solid var(--line); border-radius: 14px; }
.projects p { font-size: .91rem; }
.books a { display: flex; justify-content: space-between; align-items: center; gap: .65rem; padding: .36rem .55rem; min-height: 44px; border-bottom: 1px solid var(--line); font-size: .94rem; }
footer { padding: 18px 0 0; text-align: center; font-size: .85rem; color: var(--muted); }
@media (min-width: 610px) {
  .projects, .books { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
