@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/inter.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --paper: #f6f5f2;
  --ink: #14161a;
  --muted: #62666f;
  --rule: #ddd8cf;
  --accent: #1d3457;
  --measure: 1120px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #131518;
    --ink: #e8e6e1;
    --muted: #9aa0a8;
    --rule: #2b2f35;
    --accent: #9db9e8;
  }
  .masthead .portrait { filter: saturate(0.8) brightness(0.92); }
}

* { box-sizing: border-box; }

html {
  background: var(--paper);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0 auto;
  max-width: var(--measure);
  padding: 0 clamp(20px, 4vw, 48px) 64px;
  color: var(--ink);
  background: var(--paper);
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: clamp(16px, 1.05vw, 17px);
  line-height: 1.62;
  font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--accent);
  text-decoration: none;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
a:hover { text-decoration: underline; }

/* ---------------------------------------------------------------- masthead */

.masthead {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: clamp(24px, 4vw, 64px);
  padding: clamp(40px, 7vw, 88px) 0 clamp(24px, 3vw, 34px);
  border-bottom: 1px solid var(--ink);
}

.masthead .side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 18px;
}

.masthead h1 {
  margin: 0;
  font-size: clamp(2.5rem, 6.2vw, 4rem);
  font-weight: 620;
  line-height: 0.94;
  letter-spacing: -0.035em;
}

.masthead .role {
  margin: 0.7rem 0 0;
  font-size: clamp(1rem, 1.5vw, 1.15rem);
  color: var(--muted);
  letter-spacing: -0.005em;
}

.masthead .contact {
  margin: 0.55rem 0 0;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  color: var(--muted);
}
.masthead .contact span + span::before {
  content: "·";
  margin: 0 0.55em;
  color: var(--rule);
}

.masthead .portrait {
  width: 96px;
  height: 96px;
  object-fit: cover;
  object-position: 50% 20%;
  border-radius: 50%;
  filter: saturate(0.85);
}

.masthead nav {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 0.74rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 560;
}
.masthead nav a { color: var(--muted); }
.masthead nav a:hover { color: var(--accent); }

/* ---------------------------------------------------------------- layout */

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.9fr) minmax(0, 1fr);
  gap: clamp(36px, 6vw, 88px);
  padding-top: clamp(36px, 5vw, 64px);
}

.aside {
  align-self: start;
  position: sticky;
  top: 2rem;
  border-left: 1px solid var(--rule);
  padding-left: clamp(24px, 3vw, 40px);
}

section + section { margin-top: clamp(40px, 5vw, 60px); }

.lede {
  margin: 0;
  font-size: clamp(1.06rem, 1.5vw, 1.22rem);
  line-height: 1.55;
  letter-spacing: -0.006em;
  max-width: 62ch;
}

/* ---------------------------------------------------------------- labels */

.label {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 0 0 clamp(20px, 2.4vw, 30px);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  color: var(--accent);
  white-space: nowrap;
}
.label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--rule);
}

/* ---------------------------------------------------------------- entries */

.entry { margin-bottom: clamp(26px, 3vw, 38px); }
.entry:last-child { margin-bottom: 0; }

.entry__head {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  column-gap: 24px;
}

.entry__head h3 {
  margin: 0;
  font-size: 1.03rem;
  font-weight: 620;
  letter-spacing: -0.012em;
}

.entry__head h3 .org { font-weight: 400; color: var(--ink); }
.entry__head h3 .org::before { content: " · "; color: var(--muted); }

.entry__period {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
  letter-spacing: 0.01em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.entry__points {
  margin: 0.7rem 0 0;
  padding: 0;
  list-style: none;
  max-width: 66ch;
}
.entry__points li {
  position: relative;
  padding-left: 1.15em;
  margin: 0 0 0.35em;
}
.entry__points li::before {
  content: "–";
  position: absolute;
  left: 0;
  color: var(--muted);
}

.docs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 0.85rem;
}
.docs a {
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 3px 10px;
  font-size: 0.76rem;
  letter-spacing: 0.02em;
  color: var(--muted);
  background: transparent;
}
.docs a:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}

/* ---------------------------------------------------------------- aside */

.skill { margin-bottom: 1.15rem; }
.skill:last-child { margin-bottom: 0; }
.skill h3 {
  margin: 0 0 0.15rem;
  font-size: 0.82rem;
  font-weight: 620;
  letter-spacing: 0.01em;
}
.skill p {
  margin: 0;
  font-size: 0.86rem;
  color: var(--muted);
  line-height: 1.55;
}


.langs { margin: 0; padding: 0; list-style: none; }
.langs li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 0.42rem 0;
  border-bottom: 1px solid var(--rule);
  font-size: 0.86rem;
}
.langs li:last-child { border-bottom: 0; }
.langs .level { color: var(--muted); font-variant-numeric: tabular-nums; }

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

.footer {
  margin-top: clamp(56px, 7vw, 96px);
  padding-top: 20px;
  border-top: 1px solid var(--rule);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 0.78rem;
  color: var(--muted);
}

/* ---------------------------------------------------------------- mobile */

@media (max-width: 600px) {
  .masthead .contact { display: flex; flex-direction: column; gap: 2px; }
  .masthead .contact span + span::before { content: none; }
}

@media (max-width: 860px) {
  .masthead { grid-template-columns: 1fr auto; align-items: start; }
  .masthead .contact { grid-column: 1 / -1; }
  .masthead .side { gap: 12px; }
  .masthead .portrait { width: 64px; height: 64px; }
  .layout { grid-template-columns: 1fr; }
  .aside {
    position: static;
    border-left: 0;
    border-top: 1px solid var(--rule);
    padding-left: 0;
    padding-top: 32px;
  }
  .entry__head { grid-template-columns: 1fr; }
  .entry__period { margin-top: 2px; }
}

/* ---------------------------------------------------------------- print */

@media print {
  :root {
    color-scheme: light;
    --paper: #fff;
    --ink: #000;
    --muted: #333;
    --rule: #999;
    --accent: #000;
  }
  @page { size: A4; margin: 16mm; }
  html, body { background: #fff; }
  body { max-width: none; padding: 0; font-size: 10pt; }
  .masthead { padding: 0 0 12pt; border-bottom: 1px solid #000; }
  .masthead nav, .footer, .docs { display: none; }
  .layout { grid-template-columns: 1fr; gap: 24pt; }
  .aside { border: 0; padding: 0; position: static; }
  a { color: inherit; }
  section { break-inside: avoid; }
}
