:root {
  --grey: #f5f5f7;
  --card: #fff;
  --field: #f5f5f7;
  --ink: #1d1d1f;
  --ink-2: #6e6e73;
  --line: #e8e8ed;
  --blue: #2347d9;
  --on-blue: #fff;
  --radius: 18px;
  --radius-sm: 10px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --grey: #000;
    --card: #1c1c1e;
    --field: #000;
    --ink: #f5f5f7;
    --ink-2: #a1a1a6;
    --line: #2c2c2e;
    --blue: #7b95ff;
    --on-blue: #0b0b0b;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--grey);
  color: var(--ink);
  font: 17px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 0.2em; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
}

/* Header and footer */

.site-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 28px 4px;
}
.name { color: var(--ink); font-weight: 600; }
.name:hover { text-decoration: none; }
nav { display: flex; gap: 22px; font-size: 15px; }
nav a { color: var(--ink-2); }
nav a:hover, nav a[aria-current] { color: var(--ink); text-decoration: none; }

.site-foot { padding: 40px 0 32px; font-size: 13px; color: var(--ink-2); }
.foot-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}
.home .site-foot { background: var(--card); padding-top: 0; }

/* Cards */

.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.card { background: var(--card); border-radius: var(--radius); padding: 28px 32px; min-width: 0; }
.span-3 { grid-column: span 3; }
.span-2 { grid-column: span 2; }
.label { font-size: 15px; font-weight: 500; color: var(--ink-2); margin: 0 0 14px; }
.fine { font-size: 13px; color: var(--ink-2); margin: 12px 0 0; }

.intro { padding: 40px; }
.intro h1 {
  font-size: clamp(26px, 3.4vw, 34px);
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: -0.02em;
  max-width: 26ch;
  margin: 0 0 16px;
  text-wrap: balance;
}
.intro p { margin: 0; max-width: 60ch; color: var(--ink-2); }

.projects ul { list-style: none; margin: 0; padding: 0; }
.projects li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 13px 0;
  border-top: 1px solid var(--line);
}
.projects li:last-child { border-bottom: 1px solid var(--line); }
.projects .what { min-width: 0; }
.projects .what span { display: block; font-size: 14px; color: var(--ink-2); }
.projects a { font-size: 15px; white-space: nowrap; }

/* Poll */

.poll-q { font-size: 19px; font-weight: 500; line-height: 1.35; margin: 0 0 16px; text-wrap: balance; }
.opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.opt, .bar {
  position: relative;
  overflow: hidden;
  background: var(--field);
  color: var(--ink);
  border: 0;
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  font: inherit;
  font-size: 15px;
}
.opt { cursor: pointer; }
.opt:hover { box-shadow: inset 0 0 0 1px var(--line); }
.opt:disabled { cursor: default; opacity: 0.6; }
.results { display: grid; gap: 8px; }
.bar { display: flex; justify-content: space-between; gap: 12px; }
.bar .fill { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--blue); opacity: 0.16; transition: width 0.6s ease; }
.bar .txt, .bar .pct { position: relative; }
.bar .pct { color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.bar.mine { font-weight: 600; }

/* Contact */

.band { background: var(--card); margin-top: 40px; padding: 56px 0 40px; }
.contact-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
.contact-copy { padding: 0 4px; }
.contact-copy h2 { font-size: 24px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.25; margin: 0 0 10px; }
.contact-copy p { margin: 0; color: var(--ink-2); font-size: 16px; }

form { display: grid; gap: 10px; }
#contact-form { grid-column: span 2; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
input, select, textarea {
  width: 100%;
  background: var(--field);
  color: var(--ink);
  border: 0;
  border-radius: var(--radius-sm);
  padding: 13px 14px;
  font: inherit;
  font-size: 16px;
}
textarea { resize: vertical; min-height: 120px; }
::placeholder { color: var(--ink-2); }
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; margin-top: 4px; font-size: 15px; }
.send {
  justify-self: start;
  background: var(--blue);
  color: var(--on-blue);
  border: 0;
  border-radius: 980px;
  padding: 11px 24px;
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
}
.send:disabled { opacity: 0.6; cursor: default; }
.status { font-size: 14px; color: var(--ink-2); min-height: 1.4em; margin: 0; }

/* Text pages and résumé */

.prose { max-width: 760px; margin: 0 auto; padding: 40px; }
.prose h1 { font-size: 30px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.2; margin: 0 0 16px; }
.prose h2 { font-size: 19px; font-weight: 600; margin: 32px 0 8px; }
.prose h3 { font-size: 17px; font-weight: 600; margin: 24px 0 4px; }
.prose p, .prose ul { margin: 0 0 12px; }
.prose ul { padding-left: 20px; }
.prose li { margin-bottom: 4px; }
.unlock { max-width: 360px; margin-top: 20px; }

@media (max-width: 760px) {
  .grid, .contact-grid { grid-template-columns: minmax(0, 1fr); }
  .span-3, .span-2, #contact-form { grid-column: auto; }
  .card, .intro, .prose { padding: 24px; }
  .pair { grid-template-columns: minmax(0, 1fr); }
  .band { padding: 40px 0 32px; }
}

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

@media print {
  body { background: #fff; }
  .site-head nav, .site-foot, .locked { display: none; }
  .card { padding: 0; }
}
