/* A small personal site. The room was assembled from spare punctuation. */
@font-face {
  font-family: 'IBM Plex Mono';
  src: url('assets/fonts/ibm-plex-mono-regular.ttf') format('truetype');
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: 'IBM Plex Mono';
  src: url('assets/fonts/ibm-plex-mono-medium.ttf') format('truetype');
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #f6f5ed;
  --ink: #22231f;
  --muted: #65685b;
  --link: var(--ink);
  --rule: #9ea091;
  --selection: var(--ink);
  --accent: #e8df52;
  --mono: 'IBM Plex Mono', 'Courier New', monospace;
}

:root[data-theme='dark'] {
  color-scheme: dark;
  --paper: #141711;
  --ink: #e9ecdf;
  --muted: #a8aca0;
  --rule: #717762;
}

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

html {
  background: var(--paper);
  scrollbar-gutter: stable;
  -webkit-text-size-adjust: 100%;
}

body.ascii-site {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.7;
  font-variant-ligatures: none;
  -webkit-font-smoothing: antialiased;
}

::selection {
  color: var(--paper);
  background: var(--selection);
}

a {
  color: var(--link);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

a:hover {
  text-decoration-style: dashed;
}

:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 5px;
}

button,
input,
textarea,
select {
  font: inherit;
}

button,
summary {
  cursor: pointer;
}

button {
  color: inherit;
}

p,
h1,
h2,
h3,
figure,
dl,
dd,
pre {
  margin: 0;
}

h1,
h2,
h3 {
  font-size: inherit;
  font-weight: 500;
  line-height: 1.4;
}

p + p {
  margin-top: 1em;
}

pre {
  font-family: var(--mono);
  font-variant-ligatures: none;
  tab-size: 4;
}

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

.skip-link {
  position: fixed;
  z-index: 10;
  top: 12px;
  left: 24px;
  padding: 10px 14px;
  color: var(--paper);
  background: var(--ink);
  transform: translateY(-200%);
}

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

.site-shell {
  width: min(1080px, calc(100% - 64px));
  margin-inline: auto;
}

.site-header {
  padding-top: 23px;
}

.site-header > .site-rule {
  width: 37%;
  margin-left: auto;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 24px;
  min-width: 0;
}

.site-nav a,
#theme-toggle,
.footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  min-width: 44px;
}

.site-id {
  flex-shrink: 0;
  color: var(--ink);
  font-weight: 500;
  text-decoration: none;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
  margin: 0 0 0 auto;
  padding: 0;
  list-style: none;
  font-size: 13px;
}

.nav-links a {
  color: var(--muted);
  white-space: nowrap;
  text-decoration: none;
}

.nav-links a:hover,
.nav-links a[aria-current='page'] {
  color: var(--ink);
  text-decoration: underline;
}

#theme-toggle {
  flex-shrink: 0;
  justify-content: center;
  min-width: 44px;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  white-space: nowrap;
}

#theme-toggle:hover {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 4px;
}

main {
  padding-top: 49px;
}

.page-kicker,
.terminal-path {
  color: var(--muted);
  font-size: 12px;
}

.page-kicker {
  margin-bottom: 27px;
}

.project-copy {
  min-width: 0;
}

.intro {
  max-width: 52ch;
  font-size: 16px;
  line-height: 1.75;
}

.subtle,
.note,
.site-note,
.ascii-caption {
  color: var(--muted);
}

.text-title {
  max-width: 23ch;
  margin-left: 32px;
  margin-bottom: 21px;
  padding-right: 1.3ch;
  font-size: clamp(34px, 5vw, 60px);
  font-weight: 400;
  line-height: 1.13;
  letter-spacing: -0.07em;
}

.room {
  --floor-drop: 0px;
  position: relative;
  margin-bottom: 49px;
  padding: 0 0 24px 42px;
}

.room::before {
  content: '[';
  position: absolute;
  top: 117px;
  left: -8px;
  color: var(--rule);
  font-size: 60px;
  line-height: 1;
}

.room-note {
  color: var(--muted);
  font-size: 11px;
}

.room-note--ceiling {
  width: fit-content;
  margin: 0 0 23px 42%;
}

.room-name {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 34px;
  font-size: clamp(60px, 9vw, 110px);
  font-weight: 400;
  line-height: 0.95;
  letter-spacing: -0.075em;
}

.first-name {
  display: block;
}

.last-name {
  margin: 0 12% -19px 0;
  font-size: 20px;
  letter-spacing: -0.055em;
}

.room-bio {
  max-width: 52ch;
  margin-left: 6ch;
  font-size: 16px;
  line-height: 1.75;
}

.room-basement {
  position: relative;
  height: 120px;
  margin-top: 23px;
  font-size: 15px;
  line-height: 1;
  user-select: none;
}

.room-wall {
  position: absolute;
  top: 13px;
  left: -3ch;
  color: var(--rule);
}

.room-object,
.room-floor {
  position: absolute;
  transform: translateY(var(--floor-drop));
}

.room-object {
  top: 3px;
  left: 21%;
}

.room-floor {
  top: 14px;
  left: 0;
  width: min(75%, 76ch);
  overflow: hidden;
  white-space: pre;
}

.room-stair {
  position: absolute;
  top: 35px;
  right: 4ch;
  color: var(--muted);
  line-height: 1.2;
  white-space: pre;
}

.room[data-floor='1'] {
  --floor-drop: 24px;
}

.room[data-floor='2'] {
  --floor-drop: 48px;
}

.room[data-floor='3'] {
  --floor-drop: 72px;
}

.room[data-floor='4'] .room-floor,
.room[data-floor='4'] .room-object {
  visibility: hidden;
}

.room-gap-note {
  width: fit-content;
  max-width: 100%;
  margin-left: auto;
  padding-right: 7ch;
  color: var(--muted);
  font-size: 11px;
}

.room-controls {
  display: grid;
  grid-template-columns: max-content 20ch;
  align-items: center;
  gap: 8px 20px;
  min-height: 44px;
  margin-top: 14px;
}

#lower-floor {
  width: 25ch;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid #22231f;
  border-radius: 0;
  color: #22231f;
  background: var(--accent);
  font-size: 12px;
}

#lower-floor[hidden] {
  display: none;
}

#lower-floor:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

#floor-status {
  min-height: 1.7em;
  white-space: nowrap;
  color: var(--muted);
  font-size: 11px;
}

.room-corner {
  position: absolute;
  top: 44px;
  left: -2px;
  color: var(--rule);
  line-height: 1;
}

.room-corner--bottom {
  top: auto;
  bottom: 112px;
}

.room-page {
  position: relative;
}

.room-page > .intro {
  margin-left: 38px;
}

.margin-note {
  max-width: 30ch;
  margin: 0 5ch 30px auto;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

.unmatched-bracket {
  position: absolute;
  top: 75px;
  right: 18px;
  color: var(--rule);
  font-size: 60px;
  line-height: 1;
}

.section-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 24px;
  margin-bottom: 9px;
}

.section-heading h2,
.plain-section h2 {
  color: var(--ink);
  font-size: 14px;
}

.section-heading .note {
  font-size: 11px;
}

.site-rule {
  height: 0;
  margin: 0;
  border: 0;
  border-top: 1px dashed var(--rule);
}

.section-heading + .site-rule {
  width: 14ch;
}

.project-list {
  margin: 0;
  padding: 14px 0 0;
  list-style: none;
}

.project-row {
  --branch-indent: 0ch;
  position: relative;
  display: grid;
  grid-template-columns: 3ch minmax(0, 1fr) 9ch;
  align-items: start;
  gap: 18px;
  margin-left: var(--branch-indent);
  padding-block: 24px;
}

.project-row::before {
  content: '';
  position: absolute;
  top: -3px;
  left: 0.45ch;
  height: 26px;
  border-left: 1px dotted var(--rule);
}

.project-row:nth-child(5n + 2) {
  --branch-indent: 4ch;
}

.project-row:nth-child(5n + 3) {
  --branch-indent: 1ch;
}

.project-row:nth-child(5n + 4) {
  --branch-indent: 7ch;
}

.project-row:nth-child(5n + 5) {
  --branch-indent: 3ch;
}

.project-number {
  padding-top: 2px;
  color: var(--muted);
  font-size: 14px;
  white-space: nowrap;
}

.project-copy h3 {
  margin-bottom: 7px;
  font-size: 16px;
}

.project-copy h3 a {
  color: var(--ink);
  text-decoration: none;
}

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

.project-copy p {
  max-width: 64ch;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.75;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 16px;
  margin: 11px 0 0;
  padding: 0;
  color: var(--muted);
  font-size: 11px;
  list-style: none;
}

.project-go {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  min-height: 44px;
  margin-top: -9px;
  font-size: 12px;
  white-space: nowrap;
  text-decoration: none;
}

.project-go:hover {
  text-decoration: underline;
}

.plain-section,
.with-heading {
  margin-top: 43px;
}

.plain-section {
  max-width: 88ch;
}

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

.plain-section p {
  max-width: 70ch;
}

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
  align-items: start;
  gap: 64px;
  margin-block: 35px 49px;
}

.about-grid > * {
  min-width: 0;
}

.about-grid p {
  max-width: 65ch;
}

.fact-list {
  margin: 0;
  font-size: 13px;
}

.fact-list > div,
.fact-list dl > div {
  margin-bottom: 20px;
}

.fact-list dt {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 11px;
}

.fact-list dd + dt {
  margin-top: 20px;
}

.skills-list {
  max-width: 88ch;
  font-size: 13px;
}

.skills-list > div {
  display: grid;
  grid-template-columns: 17ch minmax(0, 1fr);
  gap: 24px;
  padding-block: 10px;
}

.skills-list dt {
  color: var(--muted);
}

.site-note,
.ascii-caption {
  max-width: 72ch;
  font-size: 12px;
}

.site-note {
  margin-top: 26px;
}

.field-label {
  color: var(--muted);
  font-size: 11px;
}

.optional-notes {
  max-width: 78ch;
  margin-top: 25px;
  font-size: 13px;
}

.optional-notes summary {
  min-height: 44px;
  padding-block: 10px;
  color: var(--link);
}

.optional-notes[open] summary {
  margin-bottom: 8px;
}

.end-note {
  max-width: 36ch;
  margin: 61px 0 0 37%;
  color: var(--muted);
  font-size: 11px;
}

.end-note + .site-footer {
  margin-top: 23px;
}

.site-footer {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 7px 28px;
  margin-top: 57px;
  padding-block: 19px 29px;
  color: var(--muted);
  font-size: 11px;
}

.site-footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 41%;
  border-top: 1px dashed var(--rule);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-links a {
  color: var(--muted);
}

.ascii-prompt {
  width: min(520px, calc(100% - 48px));
  max-width: none;
  max-height: calc(100dvh - 48px);
  margin: auto;
  padding: clamp(22px, 5vw, 36px);
  overflow: auto;
  border: 1px solid var(--muted);
  border-radius: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.7;
}

.ascii-prompt::backdrop {
  background: rgb(23 28 24 / 65%);
}

.ascii-prompt form {
  margin: 0;
}

.ascii-prompt .page-kicker {
  margin-bottom: 16px;
}

.ascii-prompt h2 {
  margin-bottom: 13px;
  font-size: 20px;
}

.prompt-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 24px;
  margin-top: 22px;
}

.prompt-actions a,
.prompt-actions button {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: var(--link);
  background: transparent;
  font: inherit;
  font-size: 12px;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.prompt-actions button:hover {
  text-decoration-style: dashed;
}

@media (max-width: 759px) {
  .site-shell {
    width: calc(100% - 48px);
  }

  .site-nav {
    flex-wrap: wrap;
    gap: 0 20px;
  }

  .site-id {
    flex: 1;
  }

  .nav-links {
    order: 2;
    justify-content: space-between;
    width: 100%;
    gap: 0 12px;
    margin-top: 4px;
  }

  main {
    padding-top: 34px;
  }

  .room {
    margin-bottom: 36px;
    padding-left: 28px;
  }

  .room::before {
    top: 101px;
    left: -12px;
    font-size: 48px;
  }

  .room-name {
    margin-bottom: 31px;
  }

  .last-name {
    margin-right: 5%;
  }

  .room-bio {
    margin-left: 2ch;
    font-size: 15px;
  }

  .room-wall {
    left: -2ch;
  }

  .room-stair {
    right: 0;
  }

  .room-gap-note {
    padding-right: 0;
  }

  .text-title {
    margin-left: 16px;
  }

  .room-page > .intro {
    margin-left: 19px;
  }

  .margin-note {
    margin-right: 0;
  }

  .unmatched-bracket {
    top: 60px;
    right: 0;
  }

  .intro {
    font-size: 15px;
  }

  .about-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 30px;
    margin-block: 28px 36px;
  }

  .fact-list dl,
  dl.fact-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px 24px;
  }

  .fact-list > div,
  .fact-list dl > div {
    margin-bottom: 0;
  }

  .project-row {
    column-gap: 15px;
  }

  .project-row:nth-child(5n + 2) {
    --branch-indent: 2ch;
  }

  .project-row:nth-child(5n + 4) {
    --branch-indent: 3ch;
  }

  .project-row:nth-child(5n + 5) {
    --branch-indent: 1ch;
  }

  .plain-section,
  .with-heading {
    margin-top: 35px;
  }

  .site-footer {
    margin-top: 43px;
  }
}

@media (max-width: 479px) {
  body.ascii-site {
    font-size: 14px;
  }

  .site-header {
    padding-top: 14px;
  }

  .nav-links {
    gap: 0;
    font-size: 12px;
  }

  .page-kicker {
    margin-bottom: 23px;
  }

  .room {
    padding-left: 16px;
  }

  .room::before {
    top: 103px;
    left: -14px;
    font-size: 40px;
  }

  .room-note--ceiling {
    margin-left: 38%;
  }

  .room-name {
    gap: 12px;
    font-size: clamp(60px, 18vw, 78px);
  }

  .last-name {
    margin: 0 0 -19px;
    font-size: 18px;
  }

  .room-bio {
    margin-left: 0;
    font-size: 14px;
  }

  .room-basement {
    margin-top: 19px;
  }

  .room-wall {
    left: -1.6ch;
  }

  .room-floor {
    width: 78%;
  }

  .room-stair {
    font-size: 12px;
  }

  .room-corner {
    left: -6px;
  }

  .room-controls {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
  }

  .text-title {
    margin-left: 0;
    font-size: 34px;
  }

  .room-page > .intro {
    margin-left: 0;
  }

  .unmatched-bracket {
    top: 66px;
    font-size: 48px;
  }

  .project-row {
    grid-template-columns: 3ch minmax(0, 1fr);
    gap: 8px 12px;
    padding-block: 21px;
  }

  .project-copy h3 {
    font-size: 15px;
  }

  .project-go {
    grid-column: 2;
    justify-content: flex-start;
    justify-self: start;
    margin-top: 0;
  }

  .project-tags {
    gap: 4px 12px;
  }

  .skills-list > div {
    grid-template-columns: minmax(0, 1fr);
    gap: 3px;
    padding-block: 9px;
  }

  .fact-list dl,
  dl.fact-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .site-footer {
    display: block;
    padding-top: 20px;
  }

  .footer-links {
    margin-top: 5px;
    gap: 18px;
  }

  .end-note {
    margin-left: 3ch;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
  }
}

@media print {
  :root,
  :root[data-theme='dark'] {
    --paper: #fff;
    --ink: #000;
    --muted: #444;
    --link: #000;
    --rule: #aaa;
  }

  .site-shell {
    width: 100%;
  }

  #theme-toggle,
  .skip-link {
    display: none;
  }

  main {
    padding-top: 24px;
  }

  .project-row {
    break-inside: avoid;
  }
}
