:root {
  --text: #1a1a1a;
  --muted: #8a8a8a;
  --muted-2: #b5b5b5;
  --bg: #ffffff;
  --pill-bg: #f2f2f2;
  --pill-text: #4a4a4a;
  --max-width: 640px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 96px 32px 128px;
}

/* Header */
.profile {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 56px;
}
.avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  background: #e5e5e5;
  flex-shrink: 0;
}
.profile-text h1 {
  margin: 0 0 4px;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.subtitle {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 14px;
}

/* Sections */
section { margin-top: 48px; }
section h2 {
  margin: 0 0 24px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

.prose p {
  margin: 0 0 12px;
  color: var(--text);
}
.prose p:last-child { margin-bottom: 0; }

/* Timeline rows */
.row {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 32px;
  margin-bottom: 28px;
}
.row:last-child { margin-bottom: 0; }

.when {
  color: var(--muted-2);
  font-size: 14px;
  padding-top: 1px;
}

.what .title {
  font-weight: 600;
  color: var(--text);
  font-size: 15px;
  margin-bottom: 2px;
}
.what .meta {
  color: var(--muted);
  font-size: 14px;
}
.what ul {
  margin: 10px 0 0;
  padding-left: 18px;
  color: var(--text);
}
.what ul li {
  margin-bottom: 6px;
  font-size: 14px;
  line-height: 1.55;
}
.what ul li:last-child { margin-bottom: 0; }

/* Inline contact links */
.link {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 120ms ease;
}
.link:hover { border-bottom-color: var(--muted); }
.link[target="_blank"]::after {
  content: " ↗";
  color: var(--muted-2);
  font-size: 12px;
}

/* ---------- Featured Projects accordion ---------- */
.projects { margin-top: 56px; }

.project-container {
  border-top: 1px solid #ececec;
}
.project-container:last-of-type {
  border-bottom: 1px solid #ececec;
}

.project-toggle {
  width: 100%;
  background: transparent;
  border: 0;
  padding: 22px 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
  transition: padding-left 280ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.project-toggle:hover {
  padding-left: 12px;
}
.project-toggle h3 {
  flex: 0 0 60%;
  margin: 0 0 2px;
  padding-right: 16px;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.015em;
  transition: color 200ms ease;
}
.project-client {
  flex: 0 0 40%;
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  text-align: right;
  padding-right: 16px;
}
.project-toggle:hover h3 {
  color: #b85439;
}

.project-right {
  display: flex;
  align-items: center;
  gap: 18px;
}
.indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--pill-bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1;
  transition: transform 320ms cubic-bezier(0.2, 0.8, 0.2, 1),
              background 200ms ease;
}
.project-toggle:hover .indicator {
  background: #f5e0d9;
}
.project-toggle[aria-expanded="true"] .indicator {
  transform: rotate(45deg);
  background: #1a1a1a;
  color: #fff;
}
.project-toggle[aria-expanded="true"] h3 {
  color: #b85439;
}

/* Panel */
.panel-wrapper {
  max-height: 0;
  overflow: hidden;
  transition: max-height 460ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.panel-content {
  padding: 8px 4px 32px;
}

/* Case study */
.case-study { display: flex; flex-direction: column; gap: 24px; }

/* Big stat row */
.cs-metrics-subtle {
  display: flex;
  gap: 40px;
  flex-wrap: wrap;
  padding: 4px 0 8px;
}
.metric-pill {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.metric-pill .metric-num {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1;
}
.metric-pill .metric-lbl {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}

/* Body blocks */
.cs-body { display: flex; flex-direction: column; gap: 20px; }
.cs-block { display: flex; flex-direction: column; gap: 6px; }

.cs-section-title {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  text-transform: none;
  letter-spacing: 0;
}
.cs-text {
  margin: 0 0 14px;
  font-size: 14px;
  color: var(--text);
}

/* Stack tags row */
.stack-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tech-tag {
  display: inline-block;
  font-size: 11.5px;
  background: #fff;
  border: 1px solid #e6e6e6;
  border-radius: 999px;
  padding: 3px 9px;
  color: var(--text);
  transition: border-color 180ms ease, color 180ms ease;
}
.tech-tag:hover {
  border-color: #b85439;
  color: #b85439;
}

/* Mobile */
@media (max-width: 640px) {
  main { padding: 56px 24px 80px; }
  .row {
    grid-template-columns: 1fr;
    gap: 6px;
    margin-bottom: 28px;
  }
  .when {
    font-size: 12px;
  }
  .profile { gap: 16px; }
  .avatar { width: 60px; height: 60px; }

  .project-toggle { padding: 18px 2px; }
  .project-toggle h3 { font-size: 18px; }
  .project-toggle:hover { padding-left: 6px; }
  .project-right p { display: none; }
}
