:root {
  --paper: #f7f8f4;
  --paper-strong: #ffffff;
  --ink: #151a18;
  --muted: #5b6761;
  --line: #dce2da;
  --teal: #0f8b7d;
  --blue: #3159b7;
  --coral: #c95738;
  --gold: #d79f22;
  --green: #4b8f45;
  --shadow: 0 18px 45px rgba(24, 33, 29, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(90deg, rgba(21, 26, 24, 0.035) 1px, transparent 1px),
    linear-gradient(180deg, rgba(21, 26, 24, 0.035) 1px, transparent 1px),
    var(--paper);
  background-size: 32px 32px;
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  letter-spacing: 0;
}

a {
  color: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px clamp(18px, 4vw, 56px);
  border-bottom: 1px solid rgba(21, 26, 24, 0.1);
  background: rgba(247, 248, 244, 0.9);
  backdrop-filter: blur(14px);
}

.brand,
.nav-links,
.site-footer div {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  font-weight: 800;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper-strong);
  font-size: 0.78rem;
}

.nav-links {
  gap: 18px;
  color: var(--muted);
  font-size: 0.92rem;
}

.nav-links a,
.header-action,
.text-link,
.site-footer a {
  text-decoration: none;
}

.nav-links a:hover,
.text-link:hover,
.site-footer a:hover {
  color: var(--teal);
}

.header-action {
  border: 1px solid var(--ink);
  padding: 8px 14px;
  font-weight: 700;
}

.hero {
  min-height: min(720px, calc(100vh - 118px));
  padding: clamp(40px, 6vw, 76px) 0 clamp(34px, 5vw, 58px);
  border-bottom: 1px solid var(--line);
}

.hero-shell,
.section,
.site-footer {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
}

.hero-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(360px, 0.78fr);
  gap: clamp(32px, 6vw, 86px);
  align-items: start;
  width: min(1180px, calc(100% - 40px));
}

.hero-copy {
  width: 100%;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--teal);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 20px;
  font-size: clamp(3.1rem, 6.4vw, 5.7rem);
  line-height: 0.95;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 16px;
  font-size: clamp(2rem, 4.2vw, 3.85rem);
  line-height: 0.98;
  letter-spacing: 0;
}

h3 {
  font-size: 1.22rem;
  line-height: 1.15;
  letter-spacing: 0;
}

.hero-lede {
  max-width: 700px;
  color: var(--muted);
  font-size: clamp(1.18rem, 1.75vw, 1.55rem);
}

.hero-actions,
.resume-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.button,
.small-button,
.send-button {
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 11px 18px;
}

.button.primary,
.send-button {
  background: var(--ink);
  color: var(--paper-strong);
}

.button.secondary:hover,
.small-button:hover {
  background: rgba(21, 26, 24, 0.06);
}

.hero-visual {
  justify-self: stretch;
  border: 1px solid var(--ink);
  background: var(--paper-strong);
  box-shadow: var(--shadow);
  max-width: 520px;
}

.profile-lockup {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  align-items: center;
  padding: 22px;
  border-bottom: 1px solid var(--ink);
}

.profile-lockup img {
  width: 88px;
  height: 88px;
  border: 1px solid var(--ink);
  object-fit: cover;
}

.profile-name {
  margin-bottom: 4px;
  font-weight: 900;
}

.profile-meta {
  margin-bottom: 0;
  color: var(--muted);
}

.focus-list {
  padding: 18px 22px 20px;
}

.focus-list p {
  margin-bottom: 12px;
  color: var(--muted);
}

.focus-list p:last-child {
  margin-bottom: 0;
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--ink);
}

.hero-metrics div {
  min-height: 128px;
  padding: 18px 20px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.hero-metrics div:nth-child(2n) {
  border-right: 0;
}

.hero-metrics div:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.hero-metrics strong {
  display: block;
  margin-bottom: 10px;
  font-size: clamp(1.85rem, 3.4vw, 2.65rem);
  line-height: 0.9;
}

.hero-metrics span,
.timeline p,
.project-card p,
.section p,
.resume-points,
.work-summary p,
.topcoder-stats p {
  color: var(--muted);
}

.section {
  padding: clamp(70px, 9vw, 118px) 0;
}

.band {
  width: 100%;
  max-width: none;
  padding-left: max(20px, calc((100vw - 1120px) / 2));
  padding-right: max(20px, calc((100vw - 1120px) / 2));
  background: rgba(255, 255, 255, 0.52);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.section-heading {
  max-width: 760px;
  margin-bottom: 34px;
}

.work-section {
  padding-top: clamp(62px, 8vw, 96px);
}

.work-intro {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(280px, 0.45fr);
  gap: clamp(26px, 5vw, 70px);
  align-items: end;
  margin-bottom: 36px;
}

.work-section .section-heading {
  max-width: 720px;
  margin-bottom: 0;
}

.work-summary {
  border-left: 6px solid var(--teal);
  background: rgba(255, 255, 255, 0.76);
  padding: 18px 22px 20px;
}

.work-summary span {
  display: block;
  margin-bottom: 10px;
}

.work-summary p {
  margin-bottom: 0;
}

.timeline {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--ink);
  border-left: 1px solid var(--ink);
}

.timeline article {
  min-height: 290px;
  padding: 22px;
  border-right: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  background: var(--paper-strong);
}

.timeline h3 {
  margin: 14px 0 12px;
}

.timeline span,
.card-topline,
.work-summary span,
.topcoder-stats span,
.chat-toolbar span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

@media (min-width: 941px) {
  .timeline {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .timeline article {
    min-height: 224px;
  }

  .timeline article:nth-child(1),
  .timeline article:nth-child(2) {
    grid-column: span 3;
    min-height: 252px;
    padding: 26px;
  }

  .timeline article:nth-child(3),
  .timeline article:nth-child(4) {
    grid-column: span 3;
  }

  .timeline article:nth-child(1) h3,
  .timeline article:nth-child(2) h3 {
    font-size: 1.42rem;
  }
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.project-card {
  min-height: 245px;
  padding: 20px;
  border: 1px solid var(--ink);
  background: var(--paper-strong);
  box-shadow: 8px 8px 0 var(--line);
}

.card-topline {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 34px;
}

.card-topline a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.accent-a {
  border-top: 6px solid var(--teal);
}

.accent-b {
  border-top: 6px solid var(--coral);
}

.accent-c {
  border-top: 6px solid var(--blue);
}

.accent-d {
  border-top: 6px solid var(--gold);
}

.accent-e {
  border-top: 6px solid var(--green);
}

.accent-f {
  border-top: 6px solid var(--ink);
}

.kaggle-section .section-heading {
  max-width: 860px;
}

.kaggle-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.kaggle-card {
  min-height: 360px;
  padding: 20px;
  border: 1px solid var(--ink);
  background: var(--paper-strong);
  box-shadow: 8px 8px 0 var(--line);
}

.kaggle-card .card-topline {
  margin-bottom: 28px;
}

.work-list {
  margin: 20px 0 0;
  padding-left: 20px;
  color: var(--muted);
}

.work-list li {
  margin-bottom: 8px;
}

.work-list li:last-child {
  margin-bottom: 0;
}

.topcoder-section {
  align-items: center;
}

.topcoder-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--ink);
  border-left: 1px solid var(--ink);
  background: var(--paper-strong);
  box-shadow: var(--shadow);
}

.topcoder-stats article {
  min-height: 178px;
  padding: 20px;
  border-right: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}

.topcoder-stats strong {
  display: block;
  margin: 10px 0 8px;
  font-size: clamp(1.7rem, 3.8vw, 2.5rem);
  line-height: 0.95;
}

.topcoder-stats p {
  margin-bottom: 0;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(320px, 0.75fr);
  gap: clamp(26px, 6vw, 76px);
  align-items: start;
}

.text-link {
  display: inline-block;
  margin-top: 12px;
  color: var(--ink);
  font-weight: 900;
  text-decoration: underline;
  text-underline-offset: 5px;
}

.code-panel {
  border: 1px solid var(--ink);
  background: #101513;
  color: #f8fff6;
  box-shadow: var(--shadow);
}

.code-row {
  display: grid;
  grid-template-columns: 58px 1fr;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.code-row:last-child {
  border-bottom: 0;
}

.code-row span,
.code-row code {
  padding: 18px;
}

.code-row span {
  color: #93d7cb;
  border-right: 1px solid rgba(255, 255, 255, 0.14);
}

.code-row code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.96rem;
}

.resume-points {
  border-left: 6px solid var(--coral);
  background: var(--paper-strong);
  padding: 22px 24px;
  box-shadow: var(--shadow);
}

.resume-points p:last-child {
  margin-bottom: 0;
}

.chat-section .section-heading {
  margin-bottom: 26px;
}

.chat-shell {
  border: 1px solid var(--ink);
  background: var(--paper-strong);
  box-shadow: var(--shadow);
}

.chat-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  border-bottom: 1px solid var(--ink);
}

.chat-toolbar strong,
.chat-toolbar span {
  display: block;
}

.small-button {
  min-height: 34px;
  padding: 6px 12px;
}

.quick-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}

.quick-prompts button {
  border: 1px solid var(--line);
  background: #f5f7f1;
  color: var(--ink);
  cursor: pointer;
  padding: 8px 11px;
  font: inherit;
  font-size: 0.9rem;
}

.quick-prompts button:hover {
  border-color: var(--teal);
}

.chat-log {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 280px;
  max-height: 460px;
  overflow-y: auto;
  padding: 18px;
}

.message {
  max-width: min(680px, 92%);
  padding: 13px 15px;
  border: 1px solid var(--line);
  background: #f8faf5;
}

.message.assistant {
  align-self: flex-start;
  border-left: 5px solid var(--teal);
}

.message.user {
  align-self: flex-end;
  border-right: 5px solid var(--blue);
  background: #eef3ff;
}

.message p {
  margin-bottom: 10px;
}

.message h3,
.message h4,
.message h5,
.message h6 {
  margin: 0 0 9px;
  font-size: 1rem;
  line-height: 1.25;
}

.message h3 {
  font-size: 1.08rem;
}

.message ul,
.message ol {
  margin: 0 0 12px;
  padding-left: 22px;
}

.message li {
  margin-bottom: 6px;
}

.message li:last-child {
  margin-bottom: 0;
}

.message blockquote {
  margin: 0 0 12px;
  padding: 2px 0 2px 14px;
  border-left: 4px solid var(--line);
  color: var(--muted);
}

.message pre {
  max-width: 100%;
  margin: 0 0 12px;
  overflow-x: auto;
  border: 1px solid rgba(21, 26, 24, 0.16);
  background: #101513;
  color: #f8fff6;
}

.message pre code {
  display: block;
  padding: 12px 14px;
  background: transparent;
  color: inherit;
  white-space: pre;
}

.message code {
  border: 1px solid rgba(21, 26, 24, 0.12);
  background: rgba(21, 26, 24, 0.06);
  padding: 1px 5px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.9em;
}

.message a {
  color: var(--blue);
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.message hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 12px 0;
}

.message > :last-child,
.message blockquote p:last-child {
  margin-bottom: 0;
}

.chat-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 14px 18px 18px;
  border-top: 1px solid var(--line);
}

.chat-form textarea {
  width: 100%;
  min-height: 52px;
  resize: vertical;
  border: 1px solid var(--line);
  padding: 12px;
  color: var(--ink);
  font: inherit;
}

.chat-form textarea:focus,
.quick-prompts button:focus,
.button:focus,
.small-button:focus,
.send-button:focus,
.nav-links a:focus,
.header-action:focus {
  outline: 3px solid rgba(15, 139, 125, 0.28);
  outline-offset: 2px;
}

.send-button {
  min-width: 86px;
  padding: 0 18px;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 28px 0 42px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.site-footer div {
  gap: 14px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 940px) {
  .site-header {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .nav-links {
    order: 3;
    width: 100%;
    overflow-x: auto;
    padding-bottom: 3px;
  }

  .hero-shell,
  .split,
  .work-intro {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .timeline,
  .project-grid,
  .kaggle-grid,
  .topcoder-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .site-header {
    padding: 12px 16px;
  }

  .header-action {
    display: none;
  }

  .hero {
    padding: 44px 0 32px;
  }

  .hero-shell,
  .section,
  .site-footer {
    width: min(100% - 32px, 1120px);
  }

  h1 {
    font-size: clamp(2.9rem, 16vw, 4.2rem);
  }

  .timeline,
  .project-grid,
  .kaggle-grid,
  .topcoder-stats {
    grid-template-columns: 1fr;
  }

  .profile-lockup {
    grid-template-columns: auto 1fr;
  }

  .profile-lockup img {
    width: 72px;
    height: 72px;
  }

  .focus-list {
    display: none;
  }

  .hero-metrics {
    grid-template-columns: 1fr;
  }

  .hero-metrics div,
  .hero-metrics div:nth-child(2n) {
    border-right: 0;
  }

  .hero-metrics div:nth-last-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .hero-metrics div:last-child {
    border-bottom: 0;
  }

  .chat-form {
    grid-template-columns: 1fr;
  }

  .send-button {
    min-height: 46px;
  }

  .site-footer {
    flex-direction: column;
  }
}
