:root {
  --ink: #000;
  --paper: #fff;
  --rule: 3px;
  color-scheme: light;
}

/*
 * Follow the device theme. The design is strictly two colours, so "dark mode"
 * is the exact 1-bit inversion: ink and paper trade places.
 */
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #fff;
    --paper: #000;
    color-scheme: dark;
  }
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  padding: 20px 16px;
  display: grid;
  place-items: center;
  background: var(--paper);
  color: var(--ink);
  font-family: "IBM Plex Mono", "Courier New", Courier, monospace;
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: none;
  font-smooth: never;
}

@media (min-width: 700px) and (min-height: 640px) {
  body { height: 100vh; height: 100svh; overflow: hidden; }
}

.shell {
  width: 100%;
  max-width: 34rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 18px;
}

/*
 * Portrait: 1-bit ink-on-paper artwork, never inverted. In dark mode the
 * var(--ink) border turns white and frames the original black-on-white image.
 */
.portrait {
  display: block;
  width: 128px;
  height: 128px;
  border: var(--rule) solid var(--ink);
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  background: var(--paper);
}

.name {
  margin: 0;
  font-size: clamp(2.75rem, 13vw, 5.5rem);
  font-weight: 700;
  line-height: 0.92;
  letter-spacing: -0.045em;
  text-transform: uppercase;
}

.role {
  margin: 0;
  font-size: clamp(0.75rem, 3.2vw, 0.9rem);
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  max-width: 100%;
}

/* Wide enough for the role to sit on one line beside the cursor. */
@media (min-width: 640px) {
  .role {
    letter-spacing: 0.22em;
    white-space: nowrap;
    overflow: hidden;
  }
}

.cursor {
  display: inline-block;
  width: 0.62em;
  height: 1.05em;
  vertical-align: -0.18em;
  background: var(--ink);
  animation: blink 1.06s steps(1, end) infinite;
}

@keyframes blink {
  0%, 50%   { visibility: visible; }
  50.01%, 100% { visibility: hidden; }
}

.dither {
  width: 100%;
  height: 8px;
  border-top: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  background-color: var(--paper);
  background-image:
    repeating-linear-gradient( 45deg, var(--ink) 0 25%, var(--paper) 25% 50%),
    repeating-linear-gradient(-45deg, var(--ink) 0 25%, var(--paper) 25% 50%);
  background-size: 4px 4px;
}

.contact {
  width: 100%;
  border: var(--rule) solid var(--ink);
  background: var(--paper);
}

.contact__head {
  margin: 0;
  padding: 6px 12px;
  border-bottom: var(--rule) solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.rows {
  margin: 0;
  padding: 12px;
  display: grid;
  gap: 8px;
}

.row {
  display: grid;
  grid-template-columns: 8ch 1fr;
  align-items: baseline;
  gap: 1ch;
}

.row dt {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.row dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 0.9rem;
}

a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

a:hover,
a:focus-visible,
a:active {
  background: var(--ink);
  color: var(--paper);
  text-decoration-color: var(--paper);
  outline: none;
}

a:focus-visible { box-shadow: 0 0 0 3px var(--ink); }

.foot {
  margin: 0;
  font-size: 10px;
  line-height: 1.4;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

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

/* Stack contact rows on phones so labels and values never fight for width. */
@media (max-width: 480px) {
  .row { grid-template-columns: 1fr; gap: 0; }
  .row dt { margin-top: 2px; }
  .row dd { padding-bottom: 6px; }
}

@media (max-width: 380px) {
  body { padding: 14px 12px; }
  .shell { gap: 14px; }
  .portrait { width: 96px; height: 96px; }
  .role { letter-spacing: 0.12em; }
}

@media (prefers-reduced-motion: reduce) {
  .cursor {
    animation: none;
    visibility: visible;
  }
}
