:root {
  --bg: #f6f6f6;
  --surface: #f9f9f9;
  --ink: #191919;
  --muted: #767676;
  --line: #d7d7d7;
  --accent: #111;
  --radius: 10px;
  --measure: 72ch;
  --hairline: 0.5px;
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI",
    Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Monaco,
    "Roboto Mono", monospace;
  --block-pad-y: 0.85rem;
  --block-pad-x: 0.95rem;
  --article-pad-y: 1.35rem;
  --article-pad-x: 1.45rem;
}

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

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

:where(h1, h2, h3, p, ul, ol, blockquote) {
  margin: 0;
}

:where(a) {
  color: inherit;
  text-underline-offset: 0.16em;
}

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

.site {
  width: min(100%, 66rem);
  margin-inline: auto;
  padding: clamp(1.2rem, 3.4vw, 2.6rem) 1.2rem 2.4rem;
}

.cv {
  width: min(100%, 44rem);
  margin-inline: auto;
  padding: 0;
  display: grid;
  gap: 0;
}

.cv > * {
  border: var(--hairline) solid var(--line);
}

.cv > * + * {
  border-top: 0;
}

.profile-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: var(--block-pad-y) var(--block-pad-x);
}

.profile-main {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  min-width: 0;
}

.avatar {
  width: 4rem;
  height: 4rem;
  border-radius: 999px;
  object-fit: cover;
  border: 1px solid #d6d6d6;
}

.profile-head h1 {
  font-size: 1.36rem;
  letter-spacing: -0.01em;
  line-height: 1.08;
}

.subtle {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.35;
}

.profile-links a {
  color: inherit;
  text-decoration: none;
}

.profile-links a:hover,
.profile-links a:focus-visible {
  text-decoration: underline;
}

.profile-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: var(--hairline) solid var(--line);
  padding: 0.38rem 0.62rem;
  font-size: 0.78rem;
  font-family: var(--font-mono);
  text-decoration: none;
  color: #333;
  line-height: 1;
  white-space: nowrap;
  background: #f8f8f8;
  cursor: pointer;
}

.profile-cta:hover,
.profile-cta:focus-visible {
  background: #efefef;
  color: #111;
}

.hello-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 20, 20, 0.42);
  display: grid;
  place-items: center;
  z-index: 1000;
  padding: 1rem;
}

.hello-modal-backdrop[hidden] {
  display: none;
}

.hello-modal {
  width: min(100%, 34rem);
  border: var(--hairline) solid var(--line);
  background: #f8f8f8;
}

.hello-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: var(--hairline) solid var(--line);
  padding: 0.8rem 0.95rem;
}

.hello-modal-head h2 {
  font-size: 1rem;
  letter-spacing: -0.01em;
}

.hello-modal-close {
  border: var(--hairline) solid var(--line);
  background: #f3f3f3;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 0.3rem 0.5rem;
  cursor: pointer;
}

.hello-modal-body {
  padding: 0.8rem 0.95rem;
}

.hello-label {
  display: block;
  margin-bottom: 0.45rem;
  font-size: 0.8rem;
  font-family: var(--font-mono);
  color: #4e4e4e;
}

.hello-textarea {
  width: 100%;
  border: var(--hairline) solid var(--line);
  background: #fafafa;
  color: #1f1f1f;
  font: inherit;
  padding: 0.55rem 0.6rem;
  resize: vertical;
  min-height: 7.5rem;
}

.hello-action {
  border: var(--hairline) solid var(--line);
  background: #f3f3f3;
  color: #2a2a2a;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 0.36rem 0.58rem;
  cursor: pointer;
}

.hello-action[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}

.hello-honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

[data-hello-status] {
  padding: 0 0.95rem 0.8rem;
}

[data-hello-status]:empty {
  display: none;
}

.section {
  margin-top: 0;
  padding: var(--block-pad-y) var(--block-pad-x);
}

.section h2,
.section-title {
  margin-bottom: 0.7rem;
  font-size: 0.78rem;
  letter-spacing: 0.045em;
  color: #4a4a4a;
  text-transform: uppercase;
  font-weight: 600;
}

.blurb {
  max-width: 60ch;
  font-size: 0.97rem;
  color: #2f2f2f;
  line-height: 1.52;
}

.timeline {
  display: grid;
  gap: 0;
}

.timeline-item {
  display: grid;
  grid-template-columns: 7.2rem minmax(0, 1fr);
  gap: 0.95rem;
  align-items: start;
  padding: var(--block-pad-y) var(--block-pad-x);
  background: transparent;
  border: var(--hairline) solid var(--line);
  border-radius: 0;
  transition: border-color 140ms ease;
}

.timeline-item + .timeline-item {
  border-top: 0;
}

.timeline-item > div {
  min-width: 0;
}

.year {
  color: var(--muted);
  font-size: 0.82rem;
  font-family: var(--font-mono);
  margin-top: 0.1rem;
}

.entry-title {
  font-size: 1.02rem;
  text-decoration: none;
  letter-spacing: -0.01em;
  line-height: 1.32;
}

.entry-title:hover,
.entry-title:focus-visible {
  color: var(--accent);
}

.sub {
  margin-top: 0.26rem;
  color: #565656;
  font-size: 0.93rem;
  line-height: 1.5;
  max-width: 60ch;
}

.meta {
  margin-top: 0.3rem;
  color: #666;
  font-size: 0.82rem;
  font-family: var(--font-mono);
}

.project-media {
  margin-top: 0.6rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.52rem;
  max-width: 31rem;
}

.project-media img {
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: var(--hairline) solid var(--line);
  border-radius: 0;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
}

.project-card {
  border: var(--hairline) solid var(--line);
  padding: var(--block-pad-y) var(--block-pad-x);
  display: grid;
  gap: 0.55rem;
  text-decoration: none;
  color: inherit;
}

.project-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border: var(--hairline) solid var(--line);
}

.project-card .year {
  margin-top: 0.1rem;
}

.project-card .entry-title {
  display: inline-block;
  font-size: 1.02rem;
  line-height: 1.32;
  letter-spacing: -0.01em;
}

.article-page {
  width: min(100%, 44rem);
  margin-inline: auto;
  padding: 0;
  display: grid;
  gap: 0;
}

.article-page > * {
  border: var(--hairline) solid var(--line);
}

.article-page > * + * {
  border-top: 0;
}

.eyebrow {
  color: var(--muted);
  font-size: 0.78rem;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.article-head .eyebrow a {
  text-decoration: none;
  color: #555;
}

.article-head .eyebrow a:hover,
.article-head .eyebrow a:focus-visible {
  text-decoration: underline;
}

.article-head h1 {
  margin-top: 0.32rem;
  font-size: clamp(1.8rem, 4.8vw, 2.6rem);
  line-height: 1.08;
  letter-spacing: -0.022em;
}

.article-head {
  padding: var(--article-pad-y) var(--article-pad-x);
}

.article-head .meta {
  margin-top: 0.5rem;
}

.article-content {
  margin-top: 0;
  font-family: var(--font-sans);
  color: #2f353d;
  padding: var(--article-pad-y) var(--article-pad-x);
  overflow-x: hidden;
}

.article-content > * + * {
  margin-top: 1.1em;
}

.article-content p {
  margin-bottom: 0;
  font-size: 1.03rem;
  line-height: 1.72;
  max-width: var(--measure);
}

.article-content h1,
.article-content h2,
.article-content h3 {
  font-family: var(--font-sans);
  color: #111827;
  letter-spacing: -0.016em;
  line-height: 1.25;
  margin: 1.55em 0 0.55em;
}

.article-content h1 {
  font-size: 1.75rem;
}

.article-content h2 {
  font-size: 1.34rem;
}

.article-content h3 {
  font-size: 1.14rem;
}

.article-content ul,
.article-content ol {
  margin: 0 0 0 1.45rem;
  padding: 0;
  max-width: calc(var(--measure) - 2ch);
}

.article-content li {
  margin: 0.48rem 0;
  padding-left: 0.18rem;
}

.article-content blockquote {
  margin: 0;
  padding: 0 0 0 1rem;
  border-left: 3px solid #d1d5db;
  color: #4b5563;
  font-size: 1.04rem;
  font-style: italic;
}

.article-content pre {
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  overflow: auto;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
}

.article-content code {
  font-size: 0.88em;
  font-family: var(--font-mono);
  color: #1f2937;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  padding: 0.08em 0.3em;
}

.article-content pre code {
  font-size: 0.9rem;
  line-height: 1.65;
  color: #e5e7eb;
  background: transparent;
  border: 0;
  border-left: 0;
  border-radius: 0;
  padding: 1.75rem 1.1rem 1.05rem;
  display: block;
  white-space: pre;
}

.code-block {
  position: relative;
  margin: 1.15rem 0 1.25rem;
  max-width: 100%;
  overflow-x: auto;
}

.code-block pre {
  background: #0b1220;
  border: 1px solid #1f2937;
  border-radius: 10px;
  max-width: 100%;
}

.code-lang {
  position: absolute;
  top: 0.58rem;
  left: 0.7rem;
  color: #9ca3af;
  font-size: 0.66rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-family: var(--font-mono);
}

.code-copy {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  border: 1px solid #374151;
  background: #111827;
  color: #d1d5db;
  font-size: 0.7rem;
  line-height: 1;
  padding: 0.32rem 0.45rem;
  border-radius: 6px;
  font-family: var(--font-mono);
  cursor: pointer;
}

.code-copy:hover,
.code-copy:focus-visible {
  background: #1f2937;
  color: #f3f4f6;
}

.article-content img {
  width: min(100%, var(--measure));
  margin: 0;
  border: var(--hairline) solid #d7dbe0;
  border-radius: 0;
}

.article-content video {
  width: min(100%, var(--measure));
  display: block;
  margin: 0;
  border: var(--hairline) solid #d7dbe0;
  background: #0b1220;
}

.article-content a {
  color: #111827;
  text-decoration-color: #d1d5db;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

.article-content a:hover,
.article-content a:focus-visible {
  text-decoration-color: #9ca3af;
}

.article-content strong {
  color: #111827;
  font-weight: 600;
}

.article-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  border: var(--hairline) solid var(--line);
}

.article-content th,
.article-content td {
  text-align: left;
  padding: 0.55rem 0.65rem;
  border: var(--hairline) solid var(--line);
  vertical-align: top;
}

.article-content th {
  font-weight: 600;
  color: #111827;
  background: transparent;
}

@media (max-width: 40rem) {
  .site {
    padding: 1.1rem 1rem 2rem;
  }

  .cv {
    width: min(100%, 38rem);
  }

  .timeline-item {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .profile-head {
    gap: 0.85rem;
  }

  .profile-main {
    gap: 0.8rem;
  }

  .project-media {
    max-width: 100%;
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }

  .article-head,
  .article-content {
    padding: 1.1rem 1.15rem;
  }

  .code-block {
    margin: 1rem 0 1.1rem;
  }

  .article-content pre code {
    padding: 1.7rem 0.85rem 0.9rem;
  }
}
