*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { min-width: 320px; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--ui);
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--cds-selection); color: var(--ink); }

.page {
  width: min(100% - 96px, 1200px);
  min-height: 100vh;
  min-height: 100svh;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
}

.site-header {
  flex: none;
  display: flex;
  justify-content: center;
  padding-top: 20px;
}

.site-nav a:focus-visible { outline: 2px solid var(--cds-clay); outline-offset: 3px; }

main { flex: 1; min-width: 0; }

.home-view {
  display: grid;
  grid-template-columns: minmax(0, .84fr) minmax(0, 1.16fr);
  align-items: center;
  gap: clamp(32px, 4vw, 56px);
  padding-block: 28px;
}

.profile { min-width: 0; }

.introduction {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 80px;
  align-items: center;
  column-gap: 20px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--cds-text-link);
  font-size: .875rem;
  font-weight: 500;
  letter-spacing: normal;
  text-transform: none;
}

h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(2.75rem, 4.3vw, 3.875rem);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -.045em;
  text-wrap: balance;
  overflow-wrap: anywhere;
}

.avatar {
  display: block;
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 50%;
  border: 1px solid var(--line);
  box-shadow: none;
}

.bio {
  max-width: 410px;
  margin: 22px 0 0;
  color: var(--secondary);
  font-family: var(--serif);
  font-size: 1.375rem;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: -.012em;
  text-wrap: pretty;
}

.contacts { max-width: 100%; margin-top: 26px; flex-wrap: wrap; }

.contact {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 14px;
  border-radius: 8px;
  color: var(--secondary);
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1;
  text-decoration: none;
}

.contact svg {
  width: 17px;
  height: 17px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.contact:focus-visible { outline: 2px solid var(--cds-clay); outline-offset: 3px; }
/* Contact, navigation and article-link motion is shared in affordance.css. */

.projects { min-width: 0; }

.projects h2 {
  margin: 0 0 14px;
  font-family: var(--serif);
  font-size: 1.75rem;
  font-weight: 400;
  letter-spacing: -.025em;
}

.project-grid { display: grid; gap: 14px; }

.project-card {
  min-width: 0;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--tray-radius);
  background: var(--cds-surface-1);
  box-shadow: none;
}

.project-card h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.5rem;
  overflow-wrap: anywhere;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -.02em;
}

.project-meta { margin: 8px 0 0; color: var(--muted); font-size: .75rem; line-height: 1.5; }
.formula {
  margin: 12px 0 0;
  font-family: var(--serif);
  font-size: 1.1875rem;
  line-height: 1.35;
  letter-spacing: -.015em;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  overflow-wrap: normal;
  padding-block: 4px;
}
.formula math { white-space: nowrap; }
.project-interface { margin: 8px 0 0; color: var(--secondary); font-size: .75rem; line-height: 1.6; }
.project-interface code { font-family: var(--font-mono-fallbacks); font-size: .75rem; overflow-wrap: anywhere; }
.project-description { margin: 10px 0 0; color: var(--ink); font-size: .9375rem; line-height: 1.65; text-wrap: pretty; }
.project-tags { display: flex; flex-wrap: wrap; gap: 5px; margin: 12px 0 0; padding: 0; list-style: none; }
.project-tags li { padding: 3px 6px; border: 0; background: var(--cds-fill-ghost-hover); border-radius: var(--control-radius); color: var(--secondary); font-size: .75rem; line-height: 1.4; }

.footer {
  flex: none;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  flex-wrap: wrap;
  padding-block: 8px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .75rem;
  line-height: 1.6;
  letter-spacing: .015em;
}

@media (max-width: 900px) {
  main { flex: none; }
  .home-view { grid-template-columns: minmax(0, 1fr); gap: 36px; padding-block: 40px 32px; }
  .profile, .projects { width: min(100%, 620px); margin-inline: auto; }
  .bio { max-width: 480px; }
  .footer { margin-top: auto; }
}

@media (max-width: 640px) {
  .page { width: calc(100% - 48px); }
  .site-header { padding-top: 12px; }
  .introduction { grid-template-columns: 1fr; gap: 24px; }
  .avatar { grid-row: 1; width: 80px; height: 80px; }
  .eyebrow { margin-bottom: 12px; }
  h1 { font-size: clamp(3rem, 10vw, 4rem); }
  .bio { margin-top: 18px; font-size: 1.3125rem; }
  .contacts { margin-top: 22px; }
  .contact { gap: 7px; padding-inline: 11px; }
  .formula { font-size: 1.0625rem; }
  .footer { min-height: 48px; }
}
