:root {
  --bg: #ffffff; /* #f5f3f3 */
  --bg-elevated: #ffffff; /* #f5f3f3 */
  --ink: #000000; /* #3d3510 */
  --muted: #000000;  /* #3d3510 */
  --line: #000000;  /* #3d3510 */
  --line-soft: #000000;  /* #3d3510 */
  --surface: #ffffff; /* #faf4e8 */
  --nav-h: 3.5rem;
  --content: 52rem;
  --font: "IBM Plex Sans", sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  background: var(--bg);
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

button {
  font: inherit;
  cursor: pointer;
  border: 0;
  background: none;
  color: inherit;
}

.site-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: min(100% - 2rem, var(--content));
  margin-inline: auto;
}

/* Nav */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--line);
}

.nav {
  min-height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0;
}

.brand {
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.brand:hover {
  text-decoration: none;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.15rem 0.85rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 400;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--ink);
  text-decoration: none;
}

.nav-links a[aria-current="page"] {
  text-decoration: underline;
  text-underline-offset: 0.25em;
}

.nav-toggle {
  display: none;
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid var(--line);
  align-items: center;
  justify-content: center;
}

.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  display: block;
  width: 1rem;
  height: 1px;
  background: var(--ink);
  position: relative;
}

.nav-toggle span::before,
.nav-toggle span::after {
  content: "";
  position: absolute;
  left: 0;
}

.nav-toggle span::before {
  top: -4px;
}

.nav-toggle span::after {
  top: 4px;
}

/* Hero */
.hero {
  padding: 4.5rem 0 3.5rem;
}

.hero-brand {
  margin: 0 0 1rem;
  font-weight: 600;
  font-size: clamp(2.5rem, 8vw, 4rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.hero-brand em {
  font-style: normal;
  font-weight: 400;
}

.hero-lead {
  margin: 0 0 1.75rem;
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 28rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.55rem 0.9rem;
  border: 1px solid var(--line);
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}

.btn:hover {
  text-decoration: none;
}

.btn-primary {
  background: var(--ink);
  color: var(--bg-elevated);
  border-color: var(--ink);
}

.btn-primary:hover {
  background: var(--bg-elevated);
  color: var(--ink);
}

.btn-ghost:hover {
  background: var(--ink);
  color: var(--bg-elevated);
}

/* Page intro */
.page-intro {
  padding: 3rem 0 1.5rem;
  border-bottom: 1px solid var(--line);
}

.page-intro h1 {
  margin: 0 0 0.65rem;
  font-weight: 600;
  font-size: clamp(1.85rem, 5vw, 2.5rem);
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.page-intro p {
  margin: 0;
  max-width: 34rem;
  color: var(--muted);
}

/* Project list */
.project-list.container {
  list-style: none;
  margin-block: 0;
  margin-inline: auto;
  padding: 0 0 4rem;
}

.project-item {
  border-bottom: 1px solid var(--line-soft);
}

.project-link {
  display: grid;
  grid-template-columns: minmax(7rem, 12rem) 1fr;
  gap: 1.25rem;
  align-items: center;
  padding: 1.25rem 0;
}

.project-link:hover {
  text-decoration: none;
}

.project-link:hover .project-meta h2 {
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.project-link:focus-visible {
  outline: 1px solid var(--ink);
  outline-offset: 4px;
}

.project-thumb {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  background: var(--surface);
}

.project-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /*filter: grayscale(1);*/
}

.project-meta h2 {
  margin: 0 0 0.3rem;
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.project-meta p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.project-meta .date {
  display: inline-block;
  margin-top: 0.55rem;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Category strip */
.category-strip {
  padding: 2.5rem 0 4rem;
}

.category-strip h2 {
  margin: 0 0 0;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--line);
  font-size: 1.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.category-row {
  display: grid;
  grid-template-columns: 1fr;
}

.category-link {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--line-soft);
}

.category-link:hover {
  text-decoration: none;
}

.category-link:hover strong {
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.category-link strong {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.category-link span {
  color: var(--muted);
  font-size: 0.9rem;
}

/* Article / blog */
.article-shell {
  width: min(100% - 2rem, 70rem);
  margin-inline: auto;
  display: grid;
  grid-template-columns: 13.5rem minmax(0, 1fr);
  gap: 2.5rem;
  align-items: start;
  padding: 2.5rem 0 4rem;
}

.article-outline {
  position: sticky;
  top: calc(var(--nav-h) + 1rem);
  padding: 0.85rem 0;
  border-right: 1px solid var(--line-soft);
  padding-right: 1.25rem;
}

.article-outline-label {
  margin: 0 0 0.75rem;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.outline-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.35rem;
}

.outline-item a {
  display: block;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.35;
  text-decoration: none;
}

.outline-item a:hover,
.outline-item a.is-active {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.outline-item--3 {
  padding-left: 0.85rem;
}

.outline-item--3 a {
  font-size: 0.82rem;
}

.article {
  min-width: 0;
  max-width: 44rem;
}

.article-back {
  display: inline-block;
  margin-bottom: 1.5rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.article-header {
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 1.5rem;
}

.article-header h1 {
  margin: 0 0 0.65rem;
  font-weight: 600;
  font-size: clamp(1.75rem, 4.5vw, 2.4rem);
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.article-meta .tag {
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.75rem;
}

.article-links {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 1.25rem;
}

.article-links li {
  min-width: 0;
  max-width: 100%;
}

.article-links a,
.article-inline-link a,
.article-body a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 0.18em;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.article-link-note {
  margin-left: 0.4rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.article-inline-link {
  margin: 0 0 1.15rem;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.article-html {
  margin: 0 0 1.25rem;
  overflow: visible;
}

.article-html > *:first-child {
  margin-top: 0;
}

.article-html > *:last-child {
  margin-bottom: 0;
}

.article-embed {
  margin: 1rem 0 1rem;
  overflow: visible;
}

.article-embed--khan iframe {
  display: block;
  width: 100%;
  /*max-width: 200px;*/
  aspect-ratio: 1;
  /*min-height: 200px;*/
  border: 1px solid var(--line-soft);
  background: var(--surface);
}

.article-html iframe {
  max-width: 100%;
}

.article-hero {
  margin: 0 0 1.75rem;
  border: 1px solid var(--line-soft);
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: var(--surface);
}

.article-hero img,
.article-figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /*filter: grayscale(1);*/
}

.article-body p {
  margin: 0 0 1.15rem;
}

.article-section {
  margin: 0 0 2.25rem;
  padding-top: 0.35rem;
}

.article-section > h2 {
  margin: 0 0 1rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid var(--line-soft);
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.article-subsection {
  margin: 1.5rem 0 0;
}

.article-subsection > h3 {
  margin: 0 0 0.75rem;
  font-size: 1.02rem;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.article-figure {
  margin: 1.25rem 0 1.5rem;
  border: 1px solid var(--line-soft);
  background: var(--surface);
  overflow: hidden;
}

.article-figure img {
  display: block;
  aspect-ratio: 16 / 10;
}

.article-figure--video .article-video {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #1a1212;
}

.article-figure--video video,
.article-figure--video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #1a1212;
}

.article-figure--demo .article-demo {
  position: relative;
  width: 100%;
  height: var(--demo-height, 600px);
  max-width: 100%;
  background: #111;
  overflow: hidden;
}

.article-figure--demo iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #111;
}

.article-demo--script {
  overflow: auto;
}

.article-demo-error {
  margin: 0;
  padding: 1rem;
  color: var(--ink);
  background: var(--surface);
}

.article-figure figcaption {
  margin: 0;
  padding: 0.65rem 0.85rem;
  border-top: 1px solid var(--line-soft);
  color: var(--muted);
  font-size: 0.85rem;
}

.not-found {
  padding: 4rem 0;
  text-align: center;
}

.not-found a {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

@media (max-width: 900px) {
  .article-shell {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .article-outline {
    position: static;
    border-right: 0;
    border-bottom: 1px solid var(--line-soft);
    padding-right: 0;
    padding-bottom: 1rem;
  }

  .outline-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 1rem;
  }

  .outline-item--3 {
    padding-left: 0;
  }
}

/* Awards */
.award-list,
.resume-section {
  list-style: none;
  margin: 0;
  padding: 0 0 4rem;
}

body[data-page="awards"] .page-intro {
  text-align: center;
}

body[data-page="awards"] .page-intro p {
  margin-inline: auto;
}

body[data-page="awards"] .award-list {
  width: min(100% - 2rem, 36rem);
  margin-inline: auto;
  padding-bottom: 4rem;
}

.award-item,
.resume-item {
  display: grid;
  grid-template-columns: 6.5rem 1fr;
  gap: 1.25rem;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--line-soft);
}

.resume-item:has(.year[aria-hidden="true"]) {
  grid-template-columns: 1.25rem 1fr;
  gap: 0.65rem;
  border-bottom: 0;
  padding: 0.45rem 0;
}

.resume-item--no-date {
  grid-template-columns: 1fr;
}

.project-bullets {
  list-style: disc;
  margin: 0.35rem 0 0;
  padding-left: 1.25rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.project-bullets li {
  padding: 0.15rem 0;
}

.project-bullets li::marker {
  color: var(--ink);
}

.award-item .year,
.resume-item .year {
  font-size: 0.85rem;
  color: var(--muted);
}

.award-item h2,
.resume-item h2 {
  margin: 0rem 0 0;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.award-item p,
.resume-item p {
  margin: 0 0 0.75rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.resume-block {
  padding: 0 0 0;
}

.resume-block > :not(h2) {
  width: calc(100% - 2.5rem);
  margin-inline: auto;
}

.resume-block + .resume-block {
  border-top: 1px solid var(--line);
  margin-top: 0rem;
}

.resume-block h2 {
  margin: 0;
  padding: 0.7rem 0 0.7rem;
  font-size: 1.25rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--line-soft);
}

.resume-block h3 {
  margin: 0;
  padding: 0.25rem 0 0.7rem;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--line-soft);
}

.resume-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 1.5rem 0 0;
}

.resume-note {
  margin: 0.85rem 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.skill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0rem 1.25rem;
  list-style: none;
  margin: 0;
  padding: 0rem 0 0.25rem;
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 4rem;
}

.skill-list li {
  font-size: 0.95rem;
}

/* Footer */
.site-footer {
  margin-top: auto;
  padding: 1.25rem 0 1.75rem;
  border-top: 1px solid var(--line);
  background: var(--bg-elevated);
  color: var(--muted);
  font-size: 0.8rem;
}

.site-footer .container {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.site-footer a:hover {
  color: var(--ink);
}

@media (max-width: 720px) {
  .nav-toggle {
    display: inline-flex;
  }

  .nav-links {
    position: absolute;
    top: calc(100% + 1px);
    right: 1rem;
    left: 1rem;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.5rem 0;
    background: var(--bg-elevated);
    border: 1px solid var(--line);
  }

  .nav-links.is-open {
    display: flex;
  }

  .nav-links a {
    padding: 0.7rem 1rem;
  }

  .project-link,
  .award-item,
  .resume-item {
    grid-template-columns: 1fr;
    gap: 0.65rem;
  }

  .project-thumb {
    max-width: 14rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
