@font-face {
  font-family: "DM Sans";
  src: url("fonts/dm-sans.ttf") format("truetype");
  font-style: normal;
  font-weight: 100 1000;
  font-display: swap;
}

:root {
  --paper: #f7f6ed;
  --ink: #243442;
  --muted: #4d5b61;
  --blue: #2e5689;
  --edge: #344758;
  --cream: #fffcf1;
  --mono: Consolas,"Liberation Mono",monospace;
  --shadow: 4px 5px 0 #344758;
  font-family: "DM Sans",Arial,sans-serif;
  color: var(--ink);
  background: var(--paper);
  color-scheme: light;
}

*,*::before,*::after {
  box-sizing: border-box;
}

body,h1,h2,h3,p,figure {
  margin: 0;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-image: radial-gradient(#646e5923 .8px,transparent .8px);
  background-size: 12px 12px;
}

main {
  flex: 1;
}

img,video {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
}

button,select,input {
  font: inherit;
}

button,select,summary {
  cursor: pointer;
}

[hidden] {
  display: none!important;
}

:focus-visible {
  outline: 3px solid #a43c13;
  outline-offset: 4px;
}

::selection {
  background: #ffd397;
  color: #243442;
}

.wrap {
  width: min(1080px,90%);
  margin-inline: auto;
}

.skip {
  position: absolute;
  z-index: 9;
  left: 1rem;
  top: 0;
  transform: translateY(-140%);
  padding: .7rem 1rem;
  background: white;
}

.skip:focus {
  transform: translateY(.4rem);
}

.masthead,footer {
  background: #f9f8f0;
}

.masthead {
  border-bottom: 2px solid var(--edge);
}

.header-row,.footer-row,nav,.brand {
  display: flex;
  align-items: center;
}

.header-row,.footer-row {
  justify-content: space-between;
  gap: 1rem;
}

.header-row {
  min-height: 75px;
}

.brand {
  gap: .65rem;
  font-weight: 720;
  letter-spacing: -.035em;
  text-decoration: none;
  font-size: 1.13rem;
}

.monogram {
  display: grid;
  place-items: center;
  background: var(--ink);
  color: #fff6df;
  width: 2.35rem;
  height: 2.15rem;
  box-shadow: 3px 3px #e89d64;
  letter-spacing: -.09em;
  padding-right: .1rem;
  font-size: 1.18rem;
}

nav {
  gap: .45rem;
  font-size: .95rem;
  font-weight: 640;
}

nav a {
  padding: .43rem .88rem;
  text-decoration: none;
  border: 1px solid transparent;
}

nav a[aria-current=page] {
  border-color: #81958c;
  background: #e3ecdf;
}

nav a:hover,.footer-row a:hover,.text-link:hover {
  color: var(--blue);
  text-decoration: underline;
  text-underline-offset: .25em;
}

.home-main {
  padding-block: clamp(2.4rem,5.8vw,5.5rem);
}

.player-grid {
  display: grid;
  grid-template-columns: minmax(0,.75fr) minmax(0,1.25fr);
  gap: clamp(1.5rem,3.3vw,2.8rem);
  align-items: start;
}

.profile-card,.activity-card,.experience-project {
  position: relative;
  border: 2px solid var(--edge);
  background: var(--cream);
  box-shadow: var(--shadow);
  min-width: 0;
}

.card-strip,.eyebrow,.meta,.kicker {
  font: 600 .83rem/1.4 var(--mono);
  letter-spacing: .065em;
  text-transform: uppercase;
}

.card-strip {
  background: #f5c795;
  border-bottom: 2px solid var(--edge);
  display: flex;
  gap: .75rem;
  align-items: center;
  padding: .65rem 1.1rem;
}

.pixel-dot {
  background: var(--ink);
  width: 8px;
  height: 8px;
  box-shadow: 2px 2px #fff2d9;
}

.strip-rule {
  flex: 1;
  height: 6px;
  border-block: 1px solid #b78156;
}

.portrait-mat {
  margin: 1.05rem 1.05rem 0;
  border: 1px solid var(--edge);
  background: #dbddd2;
  overflow: hidden;
}

.portrait-mat img {
  width: 100%;
  aspect-ratio: 1.48;
  object-fit: cover;
  object-position: 50% 42%;
}

.profile-info {
  padding: 1.2rem 1.25rem 1.5rem;
}

.profile-info h1 {
  font-size: clamp(2.65rem,4.25vw,4rem);
  line-height: .96;
  letter-spacing: -.065em;
  font-weight: 740;
  margin-bottom: .6rem;
}

.profile-info p {
  font-size: clamp(.98rem,1.4vw,1.12rem);
  line-height: 1.58;
}

.profile-info .year {
  color: var(--blue);
  font-weight: 650;
  margin-bottom: .65rem;
}

.activity-card {
  background: #e2eaf0;
}

.activity-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .8rem;
  background: #c7d9e6;
  padding: 1rem 1.3rem;
  border-bottom: 2px solid var(--edge);
}

.activity-header h2 {
  font-size: clamp(1.6rem,2.5vw,2.25rem);
  font-weight: 690;
  letter-spacing: -.05em;
  line-height: 1.05;
}

#motion {
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  background: #f5f7ee;
  border: 1px solid var(--edge);
  color: var(--ink);
  box-shadow: 2px 2px #72879b;
  font: bold 1rem var(--mono);
}

#motion:active {
  box-shadow: none;
}

.scene-frame {
  position: relative;
  margin: 1.15rem 1.15rem 0;
  border: 3px solid var(--ink);
  background: #d4e6d4;
}

.scene-heart {
  --heart-surface: #f8f4e7;
  position: absolute;
  inset-block-start: .55rem;
  inset-inline-end: .55rem;
  display: grid;
  grid-template-columns: 14px 13ch;
  align-items: center;
  gap: .28rem .4rem;
  padding: .3rem .42rem;
  border: 1px solid #2f3d42;
  background: var(--heart-surface);
  color: #65464b;
  font: 700 .72rem/1 var(--mono);
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.pixel-heart {
  --heart-shape: polygon(0 16.67%,14.29% 16.67%,14.29% 0,42.86% 0,42.86% 16.67%,57.14% 16.67%,57.14% 0,85.71% 0,85.71% 16.67%,100% 16.67%,100% 50%,85.71% 50%,85.71% 66.67%,71.43% 66.67%,71.43% 83.33%,57.14% 83.33%,57.14% 100%,42.86% 100%,42.86% 83.33%,28.57% 83.33%,28.57% 66.67%,14.29% 66.67%,14.29% 50%,0 50%);
  width: 14px;
  height: 12px;
  background: currentColor;
  clip-path: var(--heart-shape);
  font-size: 0;
}

.scene-heart.heart-fresh { color: #a52243; }
.heart-age {
  grid-column: 1 / -1;
  color: #65464b;
  font: 650 .68rem/1.1 "DM Sans",Arial,sans-serif;
}
.heart-fresh .pixel-heart { animation: heart-beat var(--beat-duration) ease-out infinite; }
.motion-stopped .heart-fresh .pixel-heart { animation: none; }

@keyframes heart-beat {
  0%, 100% { transform: scale(1); }
  24% { transform: scale(1.18); }
  55% { transform: scale(1); }
}

canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 144/80;
  image-rendering: pixelated;
}

.readout {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  padding: 1.1rem 1.3rem .9rem;
}

.status-lamp {
  width: .7rem;
  height: .7rem;
  margin-top: .5rem;
  flex-shrink: 0;
  background: #4e8566;
  border: 1px solid var(--edge);
  box-shadow: inset 1px 1px #a8d5a7;
}

.activity-label {
  font-size: clamp(1.25rem,2vw,1.7rem);
  font-weight: 670;
  letter-spacing: -.035em;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.activity-title { display: flex; align-items: center; gap: .45rem; }
.readout > div { min-width: 0; }
#game-icon { display: inline-flex; width: 30px; height: 30px; flex: 0 0 30px; }
#game-icon img { width: 100%; height: 100%; object-fit: contain; border-radius: 3px; }
#game-icon .pixel { image-rendering: pixelated; }
#game-icon[hidden] { display: none; }

.substatus,.music-line {
  font: .91rem/1.45 var(--mono);
  color: #354957;
}

.substatus {
  margin-top: .3rem;
  font-variant-numeric: tabular-nums;
}

.last-update {
  color: var(--muted);
  font-size: .78rem;
}

.last-sleep,
.music-line {
  margin: 0 1.3rem .9rem;
  border-top: 1px solid #a6b6bf;
  padding-top: .65rem;
}

.last-sleep h2 {
  font-size: .9rem;
  font-weight: 700;
}

.last-sleep p {
  font: .82rem/1.45 var(--mono);
  color: #354957;
}

.music-line {
  overflow-wrap: anywhere;
}

.console-base {
  display: flex;
  justify-content: flex-end;
  gap: 3px;
  padding: 0 1.2rem .7rem;
}

.console-base i {
  width: 3px;
  height: 9px;
  background: #92a5b5;
  transform: skew(-14deg);
}

#preview {
  margin-top: 2.2rem;
  border-top: 1px dashed #89938c;
  padding-top: 1rem;
  font-size: .93rem;
  color: var(--muted);
}

#preview summary {
  width: fit-content;
  font-weight: 630;
}

.preview-inputs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin: .85rem 0 .5rem;
}

.preview-inputs label {
  display: flex;
  align-items: center;
  gap: .45rem;
}

select {
  color: var(--ink);
  background: var(--cream);
  border: 1px solid var(--edge);
  padding: .4rem .55rem;
}

input[type=checkbox] {
  width: 1rem;
  height: 1rem;
  accent-color: var(--blue);
}

footer {
  border-top: 1px solid #9aa39e;
}

.footer-row {
  min-height: 67px;
  font: .87rem var(--mono);
}

.footer-row a {
  text-underline-offset: .22em;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: .5rem 1rem;
}

.experience,.case {
  padding-block: clamp(2.7rem,5.5vw,5rem);
}

.experience>h1,.case-head h1 {
  font-size: clamp(3.5rem,7vw,6.5rem);
  line-height: .95;
  letter-spacing: -.065em;
  margin: 0 0 2rem;
  font-weight: 710;
}

.experience-project {
  padding: clamp(1.15rem,3.6vw,3rem);
}

.portfolio-entry + .portfolio-entry,
.experience-project + .portfolio-entry {
  margin-top: 1.25rem;
}

.portfolio-entry .project-intro h2 {
  margin-top: 0;
}

.portfolio-entry .project-intro h2:last-child {
  margin-bottom: 0;
}

.eyebrow,.kicker,.meta {
  color: var(--blue);
}

.project-intro {
  max-width: 49rem;
}

.project-intro h2,.section-heading h2,.case-section h2 {
  font-size: clamp(1.65rem,3.65vw,3.3rem);
  line-height: 1.06;
  letter-spacing: -.055em;
  margin: .6rem 0 1rem;
  font-weight: 670;
}

.project-intro>p:not(.eyebrow,.entry-meta),.case-intro,.case-prose p,.gallery p {
  color: var(--muted);
  line-height: 1.6;
  font-size: 1.05rem;
}

.project-intro > p + p { margin-top: .7rem; }

.project-intro > .entry-meta {
  color: var(--blue);
  font: 650 .82rem/1.5 var(--mono);
}

.entry-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .65rem 1.1rem;
  margin-top: 1.2rem;
}

.planner-example {
  max-width: 40rem;
  margin-top: 1.4rem;
  border-top: 1px solid #acb4af;
  padding-top: .9rem;
}

.planner-example summary {
  color: var(--blue);
  font-weight: 650;
}

.planner-example p {
  margin-top: .65rem;
  line-height: 1.55;
  color: var(--muted);
}

.planner-example dl { margin-bottom: 0; }
.planner-example dl div {
  display: grid;
  grid-template-columns: minmax(8rem, 1fr) 1.3fr;
  gap: .55rem;
  padding-block: .35rem;
}
.planner-example dt { font: .88rem/1.5 var(--mono); }
.planner-example dd { margin: 0; }

.art-preview .gallery {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 1.5rem;
}

.art-preview figcaption h2 { font-size: 1.15rem; }

.art-preview-placeholder {
  aspect-ratio: 16 / 10;
  border: 1px dashed var(--edge);
  background: #f9f8f0;
}

.text-link {
  display: inline-block;
  font-weight: 640;
  text-underline-offset: .25em;
  color: var(--blue);
}

video {
  width: 100%;
  background: #1d2834;
  border: 1px solid var(--edge);
}

.experience-project figure {
  margin-top: 1.7rem;
}

.experience-project figcaption,.caption {
  margin-top: .65rem;
  color: var(--muted);
  font: .9rem/1.5 var(--mono);
}

.case {
  max-width: 1000px;
}

.case-head h1 {
  margin-block: 1.1rem;
}

.case-head h1 span {
  color: var(--blue);
}

.case-intro {
  max-width: 42rem;
}

.actions,.section-heading {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.1rem;
}

.actions {
  margin: 1.25rem 0 2.5rem;
}

.button {
  display: inline-block;
  padding: .65rem 1.1rem;
  border: 1px solid var(--edge);
  background: var(--cream);
  color: var(--ink);
  text-decoration: none;
  font-weight: 640;
}

.primary {
  background: var(--ink);
  color: white;
}

.section-heading h2 {
  font-size: clamp(1.65rem,3vw,2.4rem);
}

.rule {
  height: 1px;
  flex: 1;
  background: #a9b1ad;
}

.case-section {
  display: grid;
  grid-template-columns: 1fr 1.65fr;
  gap: 2rem;
  border-top: 1px solid #acb4af;
  padding-block: 2.25rem;
}

.case-section h2 {
  font-size: 1.7rem;
}

.case-prose p {
  margin-bottom: .85rem;
}

.case-prose h3,.gallery h3 {
  margin-bottom: .45rem;
}

.demo-section {
  margin-bottom: 2.4rem;
  scroll-margin-top: 1rem;
}

.gallery {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.3rem;
}

.gallery figcaption {
  padding-top: .8rem;
}

.shot-link {
  display: block;
  cursor: zoom-in;
  border: 1px solid var(--edge);
}

.return-link {
  margin-top: 2rem;
}

.lightbox {
  padding: .7rem;
  max-width: 96vw;
  border: 2px solid var(--edge);
  background: var(--cream);
}

.lightbox button {
  display: block;
  margin: 0 0 .5rem auto;
}

.lightbox img {
  max-height: 76vh;
}

.lightbox::backdrop {
  background: #182433dc;
}

@media(max-width:700px) {
  .wrap {
    width: min(91%,34rem);
  }
  .header-row {
    min-height: 64px;
  }
  .brand {
    font-size: 1rem;
  }
  nav {
    font-size: .9rem;
    gap: .15rem;
  }
  nav a {
    padding: .4rem .55rem;
  }
  .player-grid,.gallery,.case-section,.art-preview .gallery {
    grid-template-columns: 1fr;
  }
  .player-grid {
    gap: 1.4rem;
  }
  .home-main {
    padding-block: 1.6rem 2.5rem;
  }
  .portrait-mat img {
    aspect-ratio: 1.75;
    object-position: 50% 39%;
  }
  .profile-info {
    padding: 1rem 1.1rem 1.2rem;
  }
  .profile-info h1 {
    font-size: 2.8rem;
  }
  .activity-header {
    padding: .85rem 1rem;
  }
  .scene-frame {
    margin: .85rem .85rem 0;
  }
  .case-section {
    gap: .4rem;
  }
}

@media(max-width:450px) {
  .header-row {
    flex-wrap: wrap;
    gap: .55rem 1rem;
    padding-block: .7rem;
  }
  nav {
    flex-wrap: wrap;
  }
}

@media(prefers-reduced-motion:reduce) {
  .heart-fresh .pixel-heart {
    animation: none;
  }
}
