@import url("https://fonts.googleapis.com/css2?family=Averia+Serif+Libre:ital,wght@0,300;0,400;0,700;1,300;1,400;1,700&family=DM+Sans:ital,wght@0,400;0,500;0,600;1,400;1,500&display=swap");

:root {
  color-scheme: light;
  --background: #f8f7f3;
  --surface: #ffffff;
  --text: #22231f;
  --muted: #62645d;
  --line: #d8d7d0;
  --accent: #1d5d4a;
  --accent-soft: #e8f0ec;
  /*
   * Averia gives names and headings their distinctive voice. DM Sans carries
   * reading and interface text with a quieter, highly legible rhythm.
   */
  --font-display: "Averia Serif Libre", Georgia, "Times New Roman", serif;
  --font-body: "DM Sans", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --max-width: 760px;
}

/* Foundations */

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.6;
}

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

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

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover {
  text-decoration-thickness: 2px;
}

a:focus-visible {
  border-radius: 2px;
  outline: 3px solid #a7cabd;
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 10;
  padding: 0.5rem 0.75rem;
  background: var(--text);
  color: white;
  transform: translateY(-200%);
}

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

/* Home page */

.page {
  width: min(calc(100% - 2rem), var(--max-width));
  margin: 0 auto;
  padding: 5rem 0 3rem;
}

.intro {
  display: grid;
  grid-template-columns: 128px 1fr;
  column-gap: 2rem;
  row-gap: 1.25rem;
  align-items: start;
  padding-bottom: 3rem;
  border-bottom: 1px solid var(--line);
}

.portrait {
  grid-row: 1 / span 3;
  align-self: start;
  width: 128px !important;
  height: 128px !important;
  max-width: none;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  object-fit: cover;
}

.intro-copy,
.link-list {
  grid-column: 2;
}

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

h1 {
  margin-bottom: 0;
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 8vw, 3.7rem);
  font-weight: 700;
  line-height: 0.98;
  letter-spacing: -0.025em;
}

.intro-copy {
  max-width: 34rem;
  margin-bottom: 0.4rem;
  color: #3e403b;
  font-family: var(--font-body);
  font-size: 1.08rem;
  line-height: 1.65;
}

.link-list,
.tag-list {
  display: flex;
  flex-wrap: wrap;
  margin: 0;
  padding: 0;
  list-style: none;
}

.link-list {
  gap: 0.65rem;
  align-items: center;
}

.social-link {
  display: grid;
  width: 2rem;
  height: 2rem;
  place-items: center;
  color: var(--muted);
  text-decoration: none;
}

.social-link:hover {
  color: var(--text);
}

.social-icon {
  display: block;
  width: 1.1rem;
  height: 1.1rem;
  background: currentColor;
  -webkit-mask: var(--icon) center / contain no-repeat;
  mask: var(--icon) center / contain no-repeat;
}

/* Balance the differently shaped source marks at this small display size. */
.social-icon--email {
  transform: scale(1.08);
}

.social-icon--github,
.social-icon--bluesky {
  transform: scale(0.9);
}

.social-icon--linkedin {
  transform: scale(0.94);
}

main section {
  padding: 4.5rem 0 0;
  scroll-margin-top: 1.5rem;
}

h2 {
  margin-bottom: 1.5rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.about-copy {
  max-width: 42rem;
  font-family: var(--font-body);
  font-size: 1.15rem;
  line-height: 1.72;
}

.about-copy p:last-child {
  margin-bottom: 0;
}

.entry-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.entry {
  position: relative;
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr);
  gap: 1.5rem;
  padding: 1.5rem 0;
  border-top: 1px solid var(--line);
}

.entry:last-child {
  border-bottom: 1px solid var(--line);
}

.entry-period {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.015em;
  line-height: 1.45;
}

.entry-heading {
  display: flex;
  gap: 0.8rem;
  align-items: center;
  margin-bottom: 0.45rem;
}

.company-logo {
  width: 34px;
  height: 34px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
  object-fit: contain;
}

h3 {
  margin-bottom: 0;
  font-family: var(--font-body);
  font-size: 1.08rem;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.012em;
}

h3 a {
  color: var(--text);
  text-decoration-color: #aeb0a9;
}

.company {
  color: var(--muted);
}

.entry-description,
.project-description {
  margin-bottom: 0.65rem;
  color: #4d4f49;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
}

.tag-list {
  gap: 0.15rem 0.55rem;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 400;
  letter-spacing: 0.01em;
}

.tag-list li:not(:last-child)::after {
  margin-left: 0.55rem;
  color: #aaaba5;
  content: "·";
}

.project {
  position: relative;
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 1.25rem;
  padding: 1.5rem 0;
  border-top: 1px solid var(--line);
}

.entry-heading h3 a::before,
.project-heading h3 a::before {
  position: absolute;
  z-index: 1;
  inset: 0;
  content: "";
}

.project:last-child {
  border-bottom: 1px solid var(--line);
}

.project-image {
  width: 112px;
  height: 82px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  object-fit: cover;
}

.project-image--contain {
  padding: 0.55rem;
  object-fit: contain;
}

.project-heading {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  margin-bottom: 0.4rem;
}

.project-heading h3 {
  flex: 1 1 auto;
}

.project-secondary-links {
  display: flex;
  flex: 0 0 auto;
  margin: 0;
  padding: 0;
  list-style: none;
}

.project-secondary-link {
  position: relative;
  z-index: 2;
  display: grid;
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 4px;
  place-items: center;
  color: var(--muted);
  text-decoration: none;
}

.project-secondary-link:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.project-link-icon {
  display: block;
  width: 0.95rem;
  height: 0.95rem;
  background: currentColor;
  -webkit-mask: var(--icon) center / contain no-repeat;
  mask: var(--icon) center / contain no-repeat;
}

.external-mark {
  display: inline-block;
  width: 0.75em;
  height: 0.75em;
  margin-left: 0.2em;
  color: var(--muted);
  background: currentColor;
  -webkit-mask: url("./assets/icons/external-link.svg") center / contain no-repeat;
  mask: url("./assets/icons/external-link.svg") center / contain no-repeat;
  vertical-align: 0.08em;
  text-decoration: none;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 4.5rem;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 400;
  letter-spacing: 0.012em;
}

footer p {
  margin: 0;
}

.build-info {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: inherit;
  text-decoration: none;
}

.build-info:hover {
  color: var(--text);
}

.build-icon {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  flex: 0 0 1rem;
  background: currentColor;
  -webkit-mask: url("./assets/icons/git-commit.svg") center / contain no-repeat;
  mask: url("./assets/icons/git-commit.svg") center / contain no-repeat;
  vertical-align: -0.15em;
}

/* Project pages */

.project-page {
  width: min(calc(100% - 2rem), 960px);
  margin: 0 auto;
  padding: 3rem 0;
}

.project-nav {
  margin-bottom: 2.75rem;
  font-size: 0.9rem;
}

.project-nav a {
  color: var(--muted);
  text-decoration: none;
}

.project-nav a:hover {
  color: var(--text);
  text-decoration: underline;
}

.project-hero {
  margin-bottom: 3.75rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid var(--line);
}

.project-eyebrow {
  margin: 0 0 0.65rem;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.075em;
  text-transform: uppercase;
}

.project-hero h1 {
  margin: 0 0 1.1rem;
}

.project-summary {
  max-width: 44rem;
  margin: 0;
  color: #3e403b;
  font-family: var(--font-body);
  font-size: 1.2rem;
  line-height: 1.7;
}

.project-hero .tag-list {
  margin-top: 1.25rem;
}

.project-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
}

.project-action {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.42rem 0.68rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--text);
  font-size: 0.84rem;
  text-decoration: none;
}

.project-action:hover {
  border-color: #a7bdb5;
  background: var(--accent-soft);
  color: var(--accent);
}

.project-article > h2 {
  margin: 0 0 0.75rem;
  font-size: 1.65rem;
}

.project-article > h2:not(:first-of-type) {
  margin-top: 4.5rem;
  padding-top: 3.5rem;
  border-top: 1px solid var(--line);
}

.project-article > p,
.project-article > ul {
  max-width: 44rem;
  font-family: var(--font-body);
  font-size: 1.08rem;
  line-height: 1.72;
}

.project-article > h2 + p {
  margin-top: 0;
  margin-bottom: 1.35rem;
  color: var(--muted);
}

/* Project content patterns */

.project-feature {
  margin: 2rem 0 0;
}

.project-feature img {
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 1px 2px rgb(34 35 31 / 8%), 0 16px 40px rgb(34 35 31 / 6%);
}

.project-feature--hero {
  margin: -1rem 0 4.5rem;
}

.project-feature figcaption {
  max-width: 44rem;
  margin-top: 0.65rem;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.5;
}

.project-attribution {
  display: block;
  margin-top: 0.35rem;
}

.project-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin: 2.5rem 0 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.project-stat-grid > div {
  display: flex;
  min-height: 9rem;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.35rem;
  background: var(--surface);
}

.project-stat-grid strong {
  color: var(--accent);
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.55rem);
  line-height: 1;
}

.project-stat-grid span {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.project-capability-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}

.project-capability-grid article {
  min-height: 13rem;
  padding: 1.35rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.project-capability-grid h3 {
  margin-bottom: 0.65rem;
  font-family: var(--font-display);
  font-size: 1.25rem;
}

.project-capability-grid article > p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.62;
}

.project-capability-number {
  margin-bottom: 2.5rem;
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.project-feature--architecture img {
  padding: clamp(0.75rem, 3vw, 1.75rem);
  object-fit: contain;
}

.project-flow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin: 2.25rem 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.project-flow > div {
  min-height: 12rem;
  padding: 1.2rem;
  background: var(--surface);
}

.project-flow span {
  display: block;
  margin-bottom: 2.5rem;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.project-flow strong {
  display: block;
  margin-bottom: 0.55rem;
  font-family: var(--font-display);
  font-size: 1.08rem;
}

.project-flow p {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.55;
}

.project-demo-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(2rem, 7vw, 5rem);
  align-items: start;
  justify-items: center;
  margin: 3rem 0 0;
}

.project-phone-demo {
  width: min(100%, 18.5rem);
  margin: 0;
}

.project-phone {
  position: relative;
  width: 100%;
  padding: 0.55rem;
  border: 1px solid #555a56;
  border-radius: 3.1rem;
  background: linear-gradient(145deg, #3b3f3c 0%, #111412 26%, #303430 72%, #080a09 100%);
  box-shadow:
    0 2rem 4rem rgb(34 35 31 / 18%),
    0 0 0 1px rgb(255 255 255 / 10%) inset,
    0 0 0 4px #050706 inset;
}

.project-phone-screen {
  aspect-ratio: 390 / 844;
  overflow: hidden;
  border-radius: 2.6rem;
  background: #000;
  box-shadow: 0 0 0 1px rgb(255 255 255 / 7%);
}

.project-phone-screen video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-phone-button {
  position: absolute;
  z-index: 1;
  width: 0.2rem;
  border-radius: 3px;
  background: #343935;
}

.project-phone-button--mute {
  top: 5.4rem;
  left: -0.23rem;
  height: 1.75rem;
}

.project-phone-button--volume-up {
  top: 8.3rem;
  left: -0.23rem;
  height: 3.35rem;
}

.project-phone-button--volume-down {
  top: 12.4rem;
  left: -0.23rem;
  height: 3.35rem;
}

.project-phone-button--power {
  top: 9.3rem;
  right: -0.23rem;
  height: 4.85rem;
}

.project-phone-demo figcaption {
  display: grid;
  gap: 0.22rem;
  margin-top: 1rem;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.5;
  text-align: center;
}

.project-phone-demo figcaption strong {
  color: var(--text);
  font-family: var(--font-display);
  font-size: 1rem;
}

.project-figure-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
  align-items: start;
  margin-top: 2.25rem;
}

.project-figure-grid .project-feature {
  margin: 0;
}

.project-closing-link {
  margin: 2.25rem 0 0;
}

.artifact-embed {
  display: block;
  width: 100%;
  height: min(78vh, 760px);
  min-height: 32rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  box-shadow: 0 1px 2px rgb(34 35 31 / 8%), 0 12px 32px rgb(34 35 31 / 5%);
}

.project-video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #111;
  box-shadow: 0 1px 2px rgb(34 35 31 / 8%), 0 12px 32px rgb(34 35 31 / 5%);
}

.artifact-embed + p,
.project-video + p {
  margin-top: 0.7rem;
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 0.84rem;
  font-weight: 400;
  letter-spacing: 0.012em;
  line-height: 1.5;
}

::selection {
  background: #c8dfd6;
}

/* Responsive */

@media (max-width: 620px) {
  .page {
    padding-top: 2rem;
  }

  .intro {
    grid-template-columns: 88px 1fr;
    column-gap: 1.25rem;
    row-gap: 1rem;
  }

  .portrait {
    grid-row: auto;
    width: 88px !important;
    height: 88px !important;
  }

  h1 {
    font-size: clamp(2.15rem, 11vw, 3rem);
  }

  .intro-copy,
  .link-list {
    grid-column: 1 / -1;
  }

  .intro-copy {
    margin-top: 0.5rem;
    margin-bottom: 0;
  }

  .entry {
    grid-template-columns: 1fr;
    gap: 0.65rem;
  }

  .project {
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 1rem;
  }

  .project-image {
    width: 88px;
    height: 70px;
  }

  .project-page {
    padding-top: 2rem;
  }

  .project-nav {
    margin-bottom: 2rem;
  }

  .project-hero {
    margin-bottom: 3rem;
    padding-bottom: 2.5rem;
  }

  .project-article > h2:not(:first-of-type) {
    margin-top: 3.5rem;
    padding-top: 2.75rem;
  }

  .artifact-embed {
    height: 70vh;
    min-height: 26rem;
  }

  .project-feature--hero {
    margin-bottom: 3.5rem;
  }

  .project-stat-grid,
  .project-capability-grid,
  .project-figure-grid,
  .project-flow,
  .project-demo-grid {
    grid-template-columns: 1fr;
  }

  .project-stat-grid {
    gap: 1px;
  }

  .project-stat-grid > div,
  .project-capability-grid article,
  .project-flow > div {
    min-height: auto;
  }

  .project-stat-grid > div {
    gap: 0.75rem;
  }

  .project-capability-number {
    margin-bottom: 1.5rem;
  }

  .project-flow span {
    margin-bottom: 1.5rem;
  }

  .project-demo-grid {
    gap: 3rem;
  }

}

/* Keep project imagery prominent across contemporary phone viewports (393–430px). */
@media (max-width: 480px) {
  .project {
    grid-template-columns: 1fr;
  }

  .project-image {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
  }

}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
