:root {
  --desk: #2b3038;      /* the dark area around the sheet */
  --paper: #f3f0e8;
  --ink: #1b1a17;
  --faded: #6d685d;
  --rule: #cfc9ba;
  --tint: #e9e5d9;      /* hover and chip background */
  --mark: #c8401a;
  --serif: Charter, "Bitstream Charter", "Iowan Old Style", Georgia, serif;
  --mono: "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--desk);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.5;
}

a { color: inherit; text-decoration-color: var(--mark); text-underline-offset: 3px; }
a:hover { color: var(--mark); }

p { margin: 0; }

.sheet {
  background: var(--paper);
  max-width: 1120px;
  margin: 0 auto;
  padding: 52px 56px 40px;
  min-height: 100vh;
}
.sheet[hidden] { display: none; }

.kicker {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faded);
}

/* ── header ─────────────────────────────────────────── */

.topline { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 18px; }

.namerow { display: flex; align-items: center; gap: 26px; }

#portrait:empty { display: none; }
#portrait img {
  display: block;
  width: 132px;
  height: 150px;
  object-fit: cover;
  border: 1px solid var(--ink);
}

h1 {
  font-family: var(--sans);
  font-weight: 700;
  font-size: clamp(46px, 9vw, 104px);
  line-height: 0.9;
  letter-spacing: -0.045em;
  text-transform: uppercase;
  margin: 0;
}

nav {
  display: flex;
  flex-wrap: wrap;
  margin-top: 30px;
  border-top: 3px solid var(--ink);
  border-bottom: 1px solid var(--rule);
}
nav a {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 12px 18px;
  border-right: 1px solid var(--rule);
}
nav a:first-child { padding-left: 0; }
nav a:hover { background: var(--tint); }

.summary { font-size: 21px; line-height: 1.45; margin: 34px 0 46px; max-width: 900px; }

/* ── two columns ────────────────────────────────────── */

.columns { display: grid; grid-template-columns: 240px 1fr; gap: 0 44px; }

aside { border-right: 1px solid var(--rule); padding-right: 32px; }

h2 {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin: 0;
}

.block { margin-bottom: 38px; }
.block h2 { margin-bottom: 14px; }

.small { font-family: var(--sans); font-size: 14px; color: var(--faded); }

.edu { margin-bottom: 12px; }
.school { font-family: var(--sans); font-weight: 600; font-size: 16px; }

.chips { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.chips li {
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.3;
  padding: 8px 9px;
  border: 1px solid var(--rule);
  background: var(--tint);
}

.awards { list-style: none; margin: 0; padding: 0; }
.awards li { font-family: var(--sans); font-size: 14px; line-height: 1.35; padding: 8px 0 8px 12px; border-left: 3px solid var(--mark); margin-bottom: 8px; background: var(--tint); padding-right: 8px; }
.lang { font-family: var(--sans); font-weight: 600; font-size: 15px; padding: 7px 0; border-bottom: 1px solid var(--rule); }
.lang .small { display: block; font-weight: 400; font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; }

.contact-line { font-family: var(--mono); font-size: 13px; margin-bottom: 6px; word-break: break-all; }

/* ── timeline ───────────────────────────────────────── */

.timeline { margin-bottom: 46px; scroll-margin-top: 20px; }

.sec-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-bottom: 12px;
  border-bottom: 3px solid var(--ink);
}
.count { font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--faded); }

.item {
  display: grid;
  grid-template-columns: 116px 1fr auto;
  gap: 0 16px;
  border-bottom: 1px solid var(--rule);
  color: inherit;
  text-decoration: none;
}
.item.clickable:hover { background: var(--tint); color: inherit; }

.when {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faded);
  padding: 22px 0 0 2px;
}

/* the vertical line and the little ring on it */
.what { position: relative; border-left: 1px solid var(--faded); padding: 18px 0 20px 18px; }
.what::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 23px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 2px solid var(--ink);
  background: var(--paper);
}
.item.clickable:hover .what::before { background: var(--mark); border-color: var(--mark); }

.org {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.what h3 {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 21px;
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  margin: 0 0 6px;
}
.what p { color: #4a463e; max-width: 640px; }

.open {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mark);
  padding: 22px 6px 0 0;
  white-space: nowrap;
}

footer { margin-top: 20px; font-family: var(--mono); font-size: 12px; color: var(--faded); }

/* ── page for one entry ─────────────────────────────── */

.back {
  display: inline-block;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  margin-bottom: 44px;
}
.detail-title {
  font-size: clamp(34px, 6vw, 64px);
  line-height: 0.98;
  letter-spacing: -0.035em;
  margin: 12px 0 30px;
  padding-bottom: 26px;
  border-bottom: 3px solid var(--ink);
  max-width: 900px;
}
.detail-body { max-width: 680px; font-size: 18px; line-height: 1.55; }
.detail-body p { margin-bottom: 14px; }
.note { font-family: var(--mono); font-size: 13px; color: var(--faded); margin-bottom: 22px !important; }
.bullets { margin: 0 0 14px; padding-left: 20px; }
.bullets li { margin-bottom: 10px; }
.bullets li::marker { color: var(--mark); }
.parts { font-family: var(--mono); font-size: 13px; color: var(--faded); margin-top: 20px; }
.parts .label { color: var(--ink); }

.photos { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 34px; }
figure { margin: 0; }
/* odd number of photos: the first one gets the full width */
.photos figure:first-child:nth-last-child(odd) { grid-column: 1 / -1; }

figure img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--ink);
  background: #fff;
  cursor: zoom-in;
}
figcaption { font-family: var(--mono); font-size: 12px; color: var(--faded); margin-top: 6px; white-space: pre-wrap; }

.empty {
  aspect-ratio: 4 / 3;
  border: 1px dashed var(--faded);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--faded);
  text-align: center;
  padding: 12px;
}
.photos figure:first-child:nth-last-child(odd) .empty { aspect-ratio: 16 / 7; }
.empty code { color: var(--ink); word-break: break-all; }

/* ── big photo viewer ───────────────────────────────── */

#viewer {
  position: fixed;
  inset: 0;
  background: rgba(20, 19, 17, 0.93);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  cursor: zoom-out;
}
#viewer[hidden] { display: none; }
#viewer img { max-width: 100%; max-height: 86vh; background: #fff; }
#viewer p { color: #e9e5da; font-family: var(--mono); font-size: 13px; margin-top: 12px; text-align: center; }

/* ── phones ─────────────────────────────────────────── */

@media (max-width: 760px) {
  .sheet { padding: 28px 18px 30px; }
  .topline { flex-direction: column; gap: 4px; }
  .namerow { flex-direction: column; align-items: flex-start; gap: 16px; }
  .summary { font-size: 18px; margin: 24px 0 32px; }
  .columns { grid-template-columns: 1fr; }
  aside { order: 2; border-right: 0; padding-right: 0; border-top: 3px solid var(--ink); padding-top: 28px; }
  .item { grid-template-columns: 1fr; }
  .when { padding: 14px 0 0; }
  .what { border-left: 0; padding: 4px 0 6px; }
  .what::before { display: none; }
  .open { padding: 0 0 14px; }
  .photos { grid-template-columns: 1fr; }
}
