:root {
  color-scheme: dark;
  --bg: #0c0c0d;
  --card: #111112;
  --text: #e9e7e2;
  --soft: #c9c6bd;
  --white: #ffffff;
  --muted: #9a988f;
  --line: #2a2926;
  --line-strong: #3a3833;
  --accent: #f2a541;
  --accent-hover: #ffc477;
  --ink: #1a1408;
  --ok: #7fd18b;
  --pixel: "Doto", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --body: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --c0: #1c1c1f;
  --c1: #4a3517;
  --c2: #7a5219;
  --c3: #b97a22;
  --c4: #f2a541;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 1.0625rem / 1.6 var(--body);
  overflow-wrap: break-word;
}

p { margin: 0; }
ul, dl, dd { margin: 0; padding: 0; }
ul { list-style: none; }

h1, h2, h3 {
  margin: 0;
  font-weight: 700;
  color: var(--white);
}
h1, h2 { font-family: var(--pixel); }
h1 { font-size: clamp(2.4rem, 11vw, 5.5rem); line-height: 0.95; letter-spacing: -0.01em; font-weight: 800; }
h2 { font-size: clamp(1.6rem, 4vw, 2rem); line-height: 1.1; font-weight: 800; }
h3 { font-size: 1.3rem; line-height: 1.3; }

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 3px;
  transition: color 150ms ease, text-decoration-color 150ms ease;
}
a:hover { color: var(--accent-hover); text-decoration-color: currentColor; }
a:focus-visible, .heat-scroll:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.muted { color: var(--muted); }

/* layout: one column, sections spaced evenly */
.site {
  display: flex;
  flex-direction: column;
  gap: clamp(3.5rem, 8vw, 6rem);
  max-width: 70rem;
  margin: 0 auto;
  padding: 1.5rem 1rem 2.5rem;
}
@media (min-width: 720px) {
  .site { padding: 2rem 1.5rem 3rem; }
}

/* top bar */
.topbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.25rem 1rem;
  font-family: var(--mono);
  font-size: 0.875rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--text);
  text-decoration: none;
}
.brand:hover { color: var(--white); }
.topnav { display: flex; flex-wrap: wrap; align-items: center; gap: 0 0.25rem; }
.topnav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 0.75rem;
  color: var(--muted);
  text-decoration: none;
}
.topnav a:hover { color: var(--text); }

/* hero */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.5rem;
  align-items: center;
}
.intro {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  min-width: 0;
}
.status-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 1rem;
  font-family: var(--mono);
  font-size: 0.875rem;
  color: var(--muted);
}
.status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 32px;
  padding: 0.25rem 0.75rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--text);
}
.dot {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
}
.role-line {
  font-family: var(--mono);
  font-size: 0.9375rem;
  color: var(--accent);
}
.lede {
  max-width: 34rem;
  font-size: clamp(1.05rem, 2.2vw, 1.25rem);
  line-height: 1.5;
}
.buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding-top: 0.5rem;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 1.25rem;
  border: 1px solid transparent;
  border-radius: 10px;
  text-decoration: none;
}
.btn-primary,
.btn-primary:hover { background: var(--accent); color: var(--ink); font-weight: 700; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-outline,
.btn-outline:hover { border-color: var(--line-strong); color: var(--text); }
.btn-outline:hover { border-color: var(--muted); }
.btn-quiet,
.btn-quiet:hover { padding: 0 0.875rem; color: var(--muted); }
.btn-quiet:hover { color: var(--text); }

/* braille point cloud (app.js). Height is reserved in em, so it cannot shift the layout. */
.cloud {
  display: block;
  width: 100%;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  font: 12px / 1 var(--mono);
  letter-spacing: 0;
  white-space: pre;
  color: var(--accent);
  opacity: 0.9;
  user-select: none;
}
/* phones: a short strip above the name */
#hero-cloud { height: 9em; font-size: 10px; touch-action: pan-y; cursor: grab; }
@media (min-width: 860px) {
  .hero { grid-template-columns: minmax(0, 1fr) minmax(0, 420px); gap: 3.5rem; }
  .intro { grid-column: 1; grid-row: 1; }
  #hero-cloud { grid-column: 2; grid-row: 1; height: 18em; font-size: 12px; }
}

/* section heads: "$ name" over a dotted rule */
.section { display: flex; flex-direction: column; gap: 1.25rem; min-width: 0; }
.sec-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.4rem 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px dotted var(--line-strong);
}
.prompt { color: var(--accent); margin-right: 0.45rem; }
.aside {
  font-family: var(--mono);
  font-size: 0.875rem;
  color: var(--muted);
}

/* proof strip */
.proof-list { display: grid; gap: 1rem; }
.proof {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1.25rem 1.4rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  min-width: 0;
}
.proof-value {
  font-family: var(--mono);
  font-size: 1.55rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--accent);
}
.proof-text { color: var(--text); }
.proof-note { font-size: 0.875rem; color: var(--muted); }
.proof-link { font-size: 0.875rem; }
.proof-link a { display: inline-flex; align-items: center; min-height: 44px; }
@media (min-width: 760px) {
  .proof-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* project cards */
.cards { display: grid; gap: 1rem; }
.cards > li { min-width: 0; }
@media (min-width: 860px) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  height: 100%;
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
}
.card-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem 1rem;
}
.card h3 { display: flex; gap: 0.5rem; }
.pill {
  display: inline-block;
  padding: 0.2rem 0.7rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--soft);
}
.what { color: var(--text); }
.my-role { font-size: 0.95rem; color: var(--muted); }
.my-role .k { color: var(--soft); }
.card-proof {
  font-family: var(--mono);
  font-size: 0.875rem;
  color: var(--accent);
  overflow-wrap: anywhere;
}
.card-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 1.25rem;
  margin-top: auto;
  padding-top: 0.25rem;
  font-size: 0.95rem;
}
.card-foot a { display: inline-flex; align-items: center; min-height: 44px; }
.card-foot .code { color: var(--muted); }
.also { margin-top: 1.25rem; font-size: 0.95rem; }
.also a { display: inline-flex; align-items: center; min-height: 44px; }

/* awards and experience rows */
.list { display: grid; gap: 1.4rem; }
.item { min-width: 0; }
.item-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.2rem 1rem;
}
.item-title {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  flex: 1 1 14rem;
  min-width: 0;
}
.marker {
  flex: none;
  display: inline-block;
  width: 1.1ch;
  color: var(--accent);
  font-family: var(--mono);
  font-weight: 700;
}
@media (prefers-reduced-motion: no-preference) {
  .marker { transition: transform 150ms ease; }
  .item:hover .marker { transform: translateX(2px); }
}
.name { font-weight: 700; color: var(--white); }
.event { font-weight: 700; color: var(--text); }
.item-body {
  margin: 0.25rem 0 0 1.7rem;
  color: var(--muted);
  font-size: 0.95rem;
}
.item-body.result { color: var(--soft); }
.item-body.result.hl { color: var(--accent); }
.item-body .source { font-size: 0.875rem; white-space: nowrap; }
.dates {
  color: var(--muted);
  font-size: 0.9rem;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.more-awards {
  display: grid;
  gap: 0.6rem;
  margin-top: 1.5rem;
  color: var(--muted);
  font-size: 0.95rem;
}
.awards-grid { display: grid; gap: 2rem; }
@media (min-width: 860px) {
  .awards-grid { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 3rem; align-items: start; }
}
@media (max-width: 520px) {
  .dates { padding-left: 1.7rem; }
}

/* experience and stack, side by side on desktop */
.duo { display: grid; gap: 3.5rem; min-width: 0; }
@media (min-width: 860px) {
  .duo { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.stack { display: flex; flex-direction: column; gap: 0.85rem; font-size: 0.95rem; }
.stack-row { display: flex; flex-wrap: wrap; gap: 0.2rem 0.75rem; }
.stack dt {
  flex: none;
  width: 7.5rem;
  padding-top: 0.15rem;
  font-family: var(--mono);
  font-size: 0.875rem;
  color: var(--muted);
}
.stack dd { flex: 1 1 13rem; color: var(--text); }

/* heatmaps (app.js fills #contributions and #leetcode) */
.heat-pair { display: grid; gap: 2.5rem; }
@media (min-width: 860px) {
  .heat-pair { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3rem; }
}
.heat-block { display: flex; flex-direction: column; gap: 0.75rem; min-width: 0; }
.caption {
  font-family: var(--mono);
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--muted);
}
#contributions, #leetcode { min-height: 10rem; }
.heat-scroll {
  max-width: 100%;
  overflow-x: auto;
  padding-bottom: 0.5rem;
}
.heat { display: flex; gap: 3px; width: max-content; }
.week { display: flex; flex-direction: column; gap: 3px; }
.cell { width: 10px; height: 10px; border-radius: 2px; background: var(--c0); }
.cell.none { background: transparent; }
.cell.l1 { background: var(--c1); }
.cell.l2 { background: var(--c2); }
.cell.l3 { background: var(--c3); }
.cell.l4 { background: var(--c4); }
@media (min-width: 640px) {
  .heat, .week { gap: 4px; }
  .cell { width: 12px; height: 12px; }
}
.stats {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem 1.4rem;
  margin-top: 0.5rem;
  color: var(--muted);
  font-size: 0.92rem;
}
.stats b { color: var(--white); font-weight: 700; margin-left: 0.25rem; }
.stats .link { margin-left: auto; color: var(--accent); }
.stats .split { margin-left: 0.4rem; color: var(--muted); font-size: 0.85em; }
@media (max-width: 520px) {
  .stats .link { margin-left: 0; }
}

/* off-hours */
.off-body { display: flex; flex-direction: column; gap: 0.75rem; }
.films {
  font-family: var(--mono);
  font-size: 0.875rem;
  color: var(--soft);
}
.quip-text { max-width: 46rem; color: var(--muted); }

/* footer */
.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.6rem 1rem;
  padding: 1.5rem 0 0;
  border-top: 1px dotted var(--line-strong);
  font-family: var(--mono);
  font-size: 0.875rem;
  color: var(--muted);
}

@media (prefers-reduced-motion: reduce) {
  a { transition: none; }
}
