:root {
  color-scheme: dark;
  --bg: #000;
  --fg: #fff;
  --muted: #a3a3a3;
  --line: #333;
  --line-strong: #777;
  --press: #161616;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  /* Room for the pinned contact bar: 12 + 48 + 12, plus 16px breathing space */
  padding-bottom: calc(88px + env(safe-area-inset-bottom));
}

main, footer {
  max-width: 560px;
  margin: 0 auto;
  padding-left: max(20px, env(safe-area-inset-left));
  padding-right: max(20px, env(safe-area-inset-right));
}

main { padding-top: max(18px, env(safe-area-inset-top)); }

a { color: var(--fg); }

a:focus-visible {
  outline: 2px solid var(--fg);
  outline-offset: 3px;
}

h1 {
  margin: 4px 0 12px;
  font-size: clamp(18px, 5.4vw, 28px);
  line-height: 1.2;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: center;
}

h2 {
  margin: 0 0 8px;
  font-size: 13px;
  line-height: 1.3;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Pinned contact bar */
.contact-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  background: var(--bg);
  border-top: 1px solid var(--line);
  padding: 12px max(12px, env(safe-area-inset-right)) calc(12px + env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
}

.contact-bar-inner {
  display: flex;
  gap: 10px;
  max-width: 520px;
  margin: 0 auto;
}

.btn {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 8px;
  border: 1px solid var(--fg);
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
}

.btn-primary { flex-grow: 1.4; background: var(--fg); color: var(--bg); }
.btn-primary:hover { background: #ddd; }
.btn-primary:active { background: #bbb; }

.btn-secondary { background: transparent; color: var(--fg); }
.btn-secondary:hover { background: var(--press); }
.btn-secondary:active { background: #262626; }

.profile {
  margin: 0 0 18px;
  font-size: 15px;
  line-height: 1.45;
}

/* Project tiles */
.tiles {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.tile {
  display: block;
  min-height: 48px;
  padding: 9px 14px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  text-decoration: none;
  line-height: 1.35;
  transition: background-color .12s, border-color .12s;
}

.tile:hover { border-color: var(--line-strong); background: #0d0d0d; }
.tile:active { border-color: var(--line-strong); background: var(--press); }

.tile strong { display: block; font-size: 16px; }

.tile .desc { display: block; font-size: 14px; }

.tile .meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  column-gap: 12px;
  margin-top: 2px;
  font-size: 13px;
}

.tile .stack { color: var(--muted); }
.tile .cta { font-weight: 600; }

/* Below the fold */
.details { margin-top: 44px; }

.details h2 { margin-bottom: 16px; }

h3 { margin: 0; font-size: 16px; line-height: 1.35; }

.details p { margin: 0; font-size: 15px; }

.job + .job { margin-top: 22px; }

.job .when { margin: 2px 0 6px; color: var(--muted); font-size: 14px; }

/* Skills and tools panel */
.panel {
  margin-bottom: 20px;
  padding: 16px 18px;
  background: #1d2025;
  border: 1px solid #2b2f36;
  border-radius: 12px;
  color: #c9ccd1;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 13.5px;
  line-height: 1.7;
}

.details .panel-label { margin: 0; font-size: inherit; color: #8b9099; }

.panel ul { list-style: none; margin: 0; padding: 0; }

.panel ul + .panel-label { margin-top: 1.7em; }

.panel li { padding-left: 2ch; text-indent: -2ch; }

.panel li::before { content: "- "; }

dl { margin: 0; }

dt { font-weight: 600; }

dd { margin: 2px 0 16px; font-size: 15px; }

dd:last-child { margin-bottom: 0; }

/* Footer */
footer {
  margin-top: 56px;
  padding-top: 24px;
  padding-bottom: 24px;
  border-top: 1px solid #1f1f1f;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

footer p { margin: 0 0 4px; }

footer .links {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 8px;
}

footer .links a {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0 10px;
  color: var(--muted);
}

footer .links a:hover { color: var(--fg); }
