:root {
  --bg: #f7f4ec;
  --paper: #fffdf7;
  --ink: #15191f;
  --text: #2c333d;
  --muted: #6b7280;
  --line: #ddd4c4;
  --line-strong: #c7bba9;
  --blue: #2f5f9f;
  --blue-deep: #1d365c;
  --green: #1f7a5b;
  --brick: #9d4f3c;
  --yellow: #f2cc65;
  color: var(--ink);
  background: var(--bg);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  font-synthesis: none;
  line-height: 1.62;
  scroll-behavior: smooth;
}

* {
  box-sizing: border-box;
}

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

body {
  overflow-x: hidden;
  background:
    linear-gradient(90deg, rgba(21, 25, 31, 0.04) 1px, transparent 1px) 50% 0 / 82px 82px,
    var(--bg);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 253, 247, 0.94), rgba(247, 244, 236, 0.72));
}

::selection {
  background: rgba(242, 204, 101, 0.48);
}

a {
  color: inherit;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.2em;
}

button {
  border: 0;
  font: inherit;
  cursor: pointer;
}

img,
svg {
  display: block;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 200;
  padding: 8px 12px;
  background: var(--ink);
  color: white;
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.page-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 150;
  width: calc(var(--scroll-progress, 0) * 100%);
  height: 3px;
  background: var(--brick);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 18px;
  align-items: center;
  width: min(1080px, calc(100vw - 36px));
  margin: 0 auto;
  padding: 18px 0 14px;
  background: rgba(247, 244, 236, 0.86);
  backdrop-filter: blur(18px);
}

.mark {
  display: inline-grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  font-size: 0.82rem;
  font-weight: 720;
  text-decoration: none;
}

.site-header nav {
  justify-self: center;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 15px;
  align-items: center;
}

.site-header nav a,
.resume-link {
  color: var(--text);
  font-size: 0.94rem;
  font-weight: 530;
  text-decoration: none;
}

.site-header nav a:hover,
.resume-link:hover,
.text-link:hover,
.inline-links a:hover,
.contact-links a:hover {
  color: var(--brick);
}

.resume-link {
  justify-self: end;
  border-bottom: 1px solid currentColor;
}

main,
.site-footer {
  width: min(1080px, calc(100vw - 36px));
  margin: 0 auto;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 390px);
  gap: clamp(34px, 7vw, 86px);
  align-items: center;
  min-height: calc(100vh - 75px);
  padding: clamp(46px, 8vw, 92px) 0 74px;
}

.hero-copy,
.section-heading,
.text-stack,
.project-intro,
.mockdoctor-details,
.case-section,
.fit-section,
.contact-section {
  min-width: 0;
}

.eyebrow,
.system-label {
  margin: 0 0 12px;
  color: var(--brick);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.76rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 18px;
  font-size: clamp(4.25rem, 12vw, 9.2rem);
  font-weight: 680;
  letter-spacing: -0.055em;
  line-height: 0.86;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(2.1rem, 4.4vw, 4rem);
  font-weight: 650;
  letter-spacing: -0.035em;
  line-height: 1;
}

h3 {
  margin-bottom: 6px;
  font-size: clamp(1.15rem, 2vw, 1.45rem);
  font-weight: 650;
  line-height: 1.22;
}

.hero-copy p,
.text-stack p,
.project-intro p,
.contact-section p,
.article-preview p,
.work-rows p,
.case-list p,
.capability-grid p,
.check-list dd,
.hero-lede {
  color: var(--text);
  font-size: 1.04rem;
}

.hero-lede {
  max-width: 680px;
  margin-bottom: 14px;
  font-size: clamp(1.35rem, 2.4vw, 2.05rem);
  line-height: 1.28;
}

.hero-copy > p:not(.eyebrow):not(.hero-lede) {
  max-width: 630px;
}

.hero-links,
.inline-links,
.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin-top: 28px;
}

.hero-links a,
.inline-links a,
.contact-links a,
.text-link {
  color: var(--ink);
  font-weight: 620;
}

.hero-links a:first-child,
.contact-links a:first-child {
  text-decoration-color: var(--brick);
}

.proof-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 16px;
  max-width: 650px;
  margin: 30px 0 0;
  padding: 18px 0 0;
  border-top: 1px solid var(--line-strong);
  color: var(--muted);
  list-style: none;
}

.proof-strip li {
  position: relative;
  padding-left: 17px;
  font-size: 0.92rem;
}

.proof-strip li::before {
  content: "";
  position: absolute;
  top: 0.72em;
  left: 0;
  width: 7px;
  height: 7px;
  background: var(--brick);
}

.portrait {
  position: relative;
  margin: 0;
  padding-top: 36px;
}

.portrait::before {
  content: "";
  position: absolute;
  top: 0;
  right: 28px;
  width: 74%;
  height: 92%;
  border: 1px solid var(--ink);
  transform: rotate(2.2deg);
}

.portrait img {
  position: relative;
  width: 100%;
  height: clamp(460px, 68vh, 620px);
  border: 1px solid var(--ink);
  background: var(--paper);
  object-fit: cover;
  object-position: 34% center;
  filter: saturate(0.94) contrast(1.03);
}

.portrait figcaption {
  position: relative;
  display: grid;
  gap: 2px;
  width: calc(100% - 34px);
  margin: -34px auto 0;
  border: 1px solid var(--ink);
  padding: 12px 14px;
  background: var(--paper);
  box-shadow: 6px 6px 0 var(--yellow);
  color: var(--text);
  font-size: 0.9rem;
}

.portrait figcaption span:first-child {
  color: var(--ink);
  font-weight: 650;
}

.about-section,
.work-section,
.mockdoctor-section,
.systems-section,
.case-section,
.fit-section,
.notes-section,
.contact-section {
  padding: clamp(72px, 10vw, 118px) 0;
  border-top: 1px solid var(--line);
}

.about-section,
.mockdoctor-section {
  display: grid;
  grid-template-columns: minmax(0, 0.75fr) minmax(0, 1fr);
  gap: clamp(28px, 7vw, 78px);
}

.section-heading {
  display: grid;
  gap: 12px;
  align-self: start;
}

.text-stack {
  display: grid;
  gap: 18px;
  max-width: 670px;
}

.text-stack p,
.project-intro p,
.contact-section p {
  margin-bottom: 0;
}

.work-rows {
  display: grid;
  margin-top: 36px;
  border-top: 1px solid var(--line-strong);
}

.work-rows article {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 24px;
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
}

.work-rows article > span {
  color: var(--brick);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.78rem;
  font-weight: 700;
}

.work-rows p {
  max-width: 700px;
  margin-bottom: 0;
}

.case-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px 38px;
  margin-top: 36px;
}

.case-list article {
  border-top: 1px solid var(--line-strong);
  padding-top: 18px;
}

.case-list p {
  margin-bottom: 0;
}

.project-intro {
  align-self: start;
}

.project-intro p {
  max-width: 570px;
}

.mockdoctor-details {
  display: grid;
  gap: 18px;
}

.terminal {
  border: 1px solid var(--ink);
  background: #111820;
  color: #edf3f8;
  box-shadow: 10px 10px 0 #cfe0ec;
}

.terminal-title {
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  padding: 11px 14px;
  color: #b8c8d8;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.78rem;
}

.terminal pre {
  overflow-x: auto;
  margin: 0;
  padding: 18px;
}

.terminal code {
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: clamp(0.82rem, 1.8vw, 0.94rem);
}

.check-list {
  display: grid;
  gap: 0;
  margin: 0;
  border-top: 1px solid var(--line);
}

.check-list div {
  display: grid;
  grid-template-columns: minmax(160px, 0.38fr) minmax(0, 1fr);
  gap: 18px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.check-list dt {
  color: var(--ink);
  font-weight: 650;
}

.check-list dd {
  margin: 0;
}

.capability-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px 38px;
  margin-top: 34px;
}

.capability-grid article {
  border-top: 1px solid var(--line-strong);
  padding-top: 18px;
}

.capability-grid p {
  margin-bottom: 0;
}

.fit-section {
  max-width: 980px;
}

.fit-section h2 {
  max-width: 780px;
}

.fit-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 36px;
  margin-top: 34px;
}

.fit-columns div {
  border-top: 1px solid var(--line-strong);
  padding-top: 18px;
}

.fit-columns ul {
  display: grid;
  gap: 8px;
  margin: 12px 0 0;
  padding-left: 1.1rem;
  color: var(--text);
}

.note-list,
.article-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px;
  margin-top: 34px;
}

.article-preview {
  border-top: 1px solid var(--line-strong);
  padding-top: 18px;
}

.article-preview h3 a {
  text-decoration: none;
}

.article-preview h3 a:hover {
  color: var(--brick);
}

.article-preview p {
  max-width: 600px;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin-top: 16px;
  color: var(--muted);
  font-size: 0.82rem;
}

.article-meta span::before {
  content: "#";
  color: var(--brick);
}

.text-link {
  display: inline-flex;
  margin-top: 24px;
}

.contact-section {
  max-width: 780px;
}

.contact-section h2 {
  margin-bottom: 16px;
}

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

.guide {
  position: fixed;
  right: 20px;
  bottom: 18px;
  z-index: 120;
  display: grid;
  grid-template-columns: minmax(210px, 270px) 94px;
  gap: 10px;
  align-items: end;
  pointer-events: none;
}

.guide-bubble {
  order: 1;
  border: 1px solid var(--ink);
  padding: 12px;
  background: var(--paper);
  box-shadow: 6px 6px 0 rgba(21, 25, 31, 0.12);
  opacity: 0;
  transform: translateY(8px);
  transition:
    opacity 160ms ease,
    transform 160ms ease;
  pointer-events: auto;
}

.guide:hover .guide-bubble,
.guide[data-mode="tour"] .guide-bubble {
  opacity: 1;
  transform: translateY(0);
}

.guide-bubble p {
  margin-bottom: 10px;
  color: var(--text);
  font-size: 0.92rem;
  line-height: 1.42;
}

.guide-bubble button {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  font-size: 0.88rem;
  font-weight: 650;
}

.guide-avatar {
  order: 2;
  width: 94px;
  height: 116px;
  padding: 0;
  background: transparent;
  pointer-events: auto;
}

.guide-avatar svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.avatar-shadow {
  fill: rgba(21, 25, 31, 0.18);
}

.avatar-person {
  animation: avatar-rest 3.8s ease-in-out infinite;
  transform-origin: 95px 170px;
}

.avatar-head {
  animation: avatar-nod 4.5s ease-in-out infinite;
  transform-origin: 96px 112px;
}

.avatar-jacket {
  fill: #243f70;
}

.avatar-jacket-panel {
  fill: #315f9f;
}

.avatar-scarf,
.avatar-scarf-tail {
  fill: #e8e2d5;
}

.avatar-arm {
  fill: none;
  stroke: #213a68;
  stroke-linecap: round;
  stroke-width: 18;
  transform-origin: 138px 155px;
}

.avatar-arm-left {
  stroke: #2f5f9f;
}

.avatar-glove {
  fill: #d6d0c2;
}

.avatar-neck,
.avatar-face {
  fill: #b97962;
}

.avatar-beanie {
  fill: #1d2430;
}

.avatar-beanie-rib {
  fill: #273244;
}

.avatar-beard,
.avatar-moustache,
.avatar-eyes {
  fill: #15191f;
}

.avatar-beard {
  opacity: 0.78;
}

.avatar-glasses circle,
.avatar-glasses path {
  fill: none;
  stroke: #111820;
  stroke-linecap: round;
  stroke-width: 3.2;
}

.avatar-smile {
  fill: none;
  stroke: white;
  stroke-linecap: round;
  stroke-width: 3;
}

.avatar-eyes {
  animation: avatar-blink 4.7s infinite;
  transform-origin: 95px 70px;
}

.guide[data-mode="welcome"] .avatar-arm-right,
.guide[data-mode="tour"] .avatar-arm-right {
  animation: avatar-point 1.15s ease-in-out infinite;
}

.guide[data-mode="tour"] .avatar-person {
  animation: avatar-walk 0.68s ease-in-out infinite;
}

.guide[data-mode="resting"] .avatar-arm-left {
  animation: avatar-tap 4s ease-in-out infinite;
}

.article-page {
  width: min(820px, calc(100vw - 36px));
  margin: 0 auto;
  padding: 72px 0 96px;
}

.article-page header {
  margin-bottom: 38px;
}

.article-page h1 {
  font-size: clamp(2.7rem, 8vw, 5.6rem);
  line-height: 0.92;
}

.article-back {
  display: inline-flex;
  margin-bottom: 32px;
  color: var(--muted);
  font-weight: 600;
  text-decoration: none;
}

.article-back:hover {
  color: var(--brick);
}

.article-body {
  border-top: 1px solid var(--line-strong);
  padding-top: 22px;
}

.article-body h2 {
  margin-top: 34px;
  font-size: clamp(1.55rem, 2.6vw, 2.2rem);
}

.article-body p,
.article-body li {
  color: var(--text);
  font-size: 1.04rem;
}

.article-body pre {
  overflow-x: auto;
  border: 1px solid var(--ink);
  padding: 16px;
  background: #111820;
  color: white;
}

.article-body code {
  font-family: "SFMono-Regular", Consolas, monospace;
}

@keyframes avatar-rest {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-2px);
  }
}

@keyframes avatar-nod {
  0%,
  88%,
  100% {
    transform: rotate(0deg);
  }
  92% {
    transform: rotate(-2deg);
  }
  96% {
    transform: rotate(1.5deg);
  }
}

@keyframes avatar-point {
  0%,
  100% {
    transform: rotate(0deg) translateY(0);
  }
  50% {
    transform: rotate(-18deg) translateY(-4px);
  }
}

@keyframes avatar-walk {
  0%,
  100% {
    transform: translateY(0) rotate(0deg) scaleX(1);
  }
  50% {
    transform: translateY(-5px) rotate(-1.5deg) scaleX(1.015);
  }
}

@keyframes avatar-tap {
  0%,
  72%,
  100% {
    transform: translateY(0);
  }
  80% {
    transform: translateY(-3px);
  }
  88% {
    transform: translateY(0);
  }
}

@keyframes avatar-blink {
  0%,
  94%,
  100% {
    transform: scaleY(1);
  }
  96% {
    transform: scaleY(0.12);
  }
}

@media (max-width: 880px) {
  .site-header {
    grid-template-columns: auto 1fr;
  }

  .site-header nav {
    grid-column: 1 / -1;
    justify-self: start;
    order: 3;
  }

  .resume-link {
    justify-self: end;
  }

  .hero,
  .about-section,
  .mockdoctor-section {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: 0;
    padding-top: 44px;
  }

  .portrait {
    width: min(390px, 100%);
  }

  .check-list div {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .note-list,
  .article-grid,
  .case-list,
  .capability-grid,
  .fit-columns {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  main,
  .site-footer,
  .site-header {
    width: min(100vw - 28px, 1080px);
  }

  .site-header nav {
    gap: 4px 12px;
  }

  .site-header nav a,
  .resume-link {
    font-size: 0.88rem;
  }

  h1 {
    font-size: clamp(3.55rem, 19vw, 6rem);
  }

  .work-rows article {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .proof-strip {
    grid-template-columns: 1fr;
  }

  .portrait::before {
    right: 18px;
  }

  .site-footer {
    display: grid;
  }

  .guide {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
