@font-face {
  font-family: "Archivo Expanded";
  src: url("../fonts/archivo-display.woff2?v=1") format("woff2");
  font-weight: 600 900;
  font-stretch: 125%;
  font-display: swap;
}

@font-face {
  font-family: "Archivo";
  src: url("../fonts/archivo-body.woff2?v=1") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

:root {
  color-scheme: light;
  --page: #e6e4df;
  --panel: #f2f1ed;
  --ink: #121211;
  --ink-2: #44423d;
  --ink-3: #6b6861;
  --line: #d4d0c8;
  --accent: #ff5b14;
  --accent-deep: #c23d00;
  --tab: #3a3936;
  --good: #0f7a3d;
  --warn: #a35a00;
  --poor: #c0271a;
  --radius: 12px;
  --display: "Archivo Expanded", "Arial Black", system-ui, sans-serif;
  --body: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --wrap: 1180px;
}

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

html {
  overflow-x: clip;
  scroll-behavior: smooth;
  scroll-padding-top: 88px;

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

body {
  margin: 0;
  overflow-x: clip;
  background: var(--page);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--accent-deep);
}

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 50;
  padding: 8px 14px;
  background: var(--ink);
  color: var(--panel);
  border-radius: 6px;
}

.skip:focus {
  top: 12px;
}

.wrap {
  width: min(var(--wrap), 100% - 32px);
  margin-inline: auto;
}

/* Top bar */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  padding-block: 12px;
  background: color-mix(in srgb, var(--page) 92%, transparent);
}

.topbar .wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.handle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-right: 6px;
  font: 700 0.8125rem/1 var(--display);
  text-decoration: none;
}

.handle img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
}

.tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}

.tabs a {
  padding: 8px 12px;
  border-radius: 6px;
  background: var(--tab);
  color: #f2f1ed;
  font: 700 0.6875rem/1 var(--display);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
}

.tabs a[aria-current="true"] {
  background: var(--accent);
  color: var(--ink);
}

.tabs a:hover {
  color: #fff;
  background: #000;
}

.tabs a[aria-current="true"]:hover {
  color: var(--ink);
  background: #ff7a3f;
}

.hire {
  margin-left: auto;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--ink);
  font: 700 0.75rem/1 var(--display);
  text-decoration: none;
  white-space: nowrap;
}

.hire:hover {
  color: var(--ink);
  background: #ff7a3f;
}

/* Panels: one primitive, screwed to the page at each corner. */

.panel {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(24px, 4vw, 48px);
  background-image:
    radial-gradient(circle at 14px 14px, #c9c5bc 0 3.5px, transparent 4px),
    radial-gradient(circle at calc(100% - 14px) 14px, #c9c5bc 0 3.5px, transparent 4px),
    radial-gradient(circle at 14px calc(100% - 14px), #c9c5bc 0 3.5px, transparent 4px),
    radial-gradient(circle at calc(100% - 14px) calc(100% - 14px), #c9c5bc 0 3.5px, transparent 4px);
}

main {
  display: grid;
  gap: 20px;
  padding-bottom: 40px;
}

section[id] {
  scroll-margin-top: 88px;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

h2 {
  color: var(--ink);
  font-size: clamp(1.75rem, 3.6vw, 2.6rem);
}

h3 {
  font-size: 1.125rem;
  line-height: 1.2;
}

p {
  margin: 0;
  text-wrap: pretty;
}

/* Hero */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  align-items: center;
  gap: clamp(16px, 4vw, 56px);
  overflow: visible;
}

.hero-copy {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 14px;
  max-width: 34rem;
  color: var(--ink-2);
}

.hero h1 {
  margin-bottom: 10px;
  color: var(--ink);
  font-size: clamp(2.4rem, 5.6vw, 4.4rem);
  font-weight: 900;
}

.name {
  padding: 0 0.12em;
  background: var(--accent);
  color: var(--ink);
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.hero-lede {
  color: var(--ink);
  font-weight: 600;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border: 1.5px solid var(--ink);
  border-radius: 6px;
  background: var(--accent);
  color: var(--ink);
  font: 700 0.8125rem/1 var(--display);
  text-decoration: none;
}

.button:hover {
  color: var(--ink);
  background: #ff7a3f;
}

.button.quiet {
  background: transparent;
}

.button.quiet:hover {
  background: #fff;
}

/* Portrait: the disc and every overlay share the box's coordinate system.
   face.js reads the same numbers (DISC) for the WebGPU clip. */

.portrait {
  position: relative;
  width: min(100%, 540px);
  aspect-ratio: 1;
  justify-self: end;
}

.disc {
  position: absolute;
  left: 11%;
  top: 21%;
  width: 78%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--accent);
}

.portrait-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  mask:
    radial-gradient(ellipse 39% 39% at 50% 60%, #000 99.4%, transparent 100%),
    linear-gradient(#000 60%, transparent 60%);
  transition: opacity 0.18s ease-out;
}

.face-canvas {
  position: absolute;
  left: -90%;
  right: -30%;
  top: -35%;
  bottom: -30%;
  width: 220%;
  height: 165%;
  z-index: 3;
  pointer-events: none;
  opacity: 0;
}

.portrait.is-3d .face-canvas {
  opacity: 1;
}

.portrait.is-3d .portrait-img {
  opacity: 0;
}

.face-handle {
  position: absolute;
  left: 26%;
  top: 7%;
  width: 50%;
  height: 66%;
  z-index: 4;
  padding: 0;
  border: 0;
  border-radius: 46% 46% 42% 42%;
  background: transparent;
  cursor: grab;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.face-handle.is-dragging {
  cursor: grabbing;
}

.face-handle:focus-visible {
  outline: 2px dashed var(--ink);
  outline-offset: 4px;
}

.face-cls {
  position: absolute;
  left: 4%;
  bottom: 6%;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  background: var(--panel);
  color: var(--ink);
  font: 700 0.75rem/1 var(--display);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.face-cls b {
  font-weight: 800;
}

.face-cls [data-rating] {
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--good);
  color: #fff;
}

.face-cls [data-rating="Needs improvement"] {
  background: var(--warn);
}

.face-cls [data-rating="Poor"] {
  background: var(--poor);
}

.face-bubble {
  position: absolute;
  right: 0;
  top: 2%;
  z-index: 5;
  max-width: 15rem;
  padding: 10px 14px;
  border: 1.5px solid var(--ink);
  border-radius: 14px 14px 14px 4px;
  background: #fff;
  color: var(--ink);
  font: 700 0.875rem/1.3 var(--display);
  opacity: 0;
  translate: 0 6px;
  transition: opacity 0.16s ease-out, translate 0.16s ease-out;
  pointer-events: none;
}

.face-bubble.is-on {
  opacity: 1;
  translate: 0 0;
}

.face-hint {
  position: absolute;
  right: 2%;
  bottom: 6%;
  z-index: 5;
  color: var(--ink-3);
  font-size: 0.8125rem;
  transition: opacity 0.3s ease-out;
}

.portrait.was-pulled .face-hint {
  opacity: 0;
}

/* Credits strip */

.credits {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px 28px;
  padding: 6px clamp(24px, 4vw, 48px) 18px;
  color: var(--ink-3);
  font-size: 0.875rem;
}

.credits strong {
  margin-right: 6px;
  color: var(--ink);
  font: 800 0.9375rem/1.2 var(--display);
}

.credits-label {
  color: var(--ink-3);
  font: 700 0.6875rem/1 var(--display);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Section heads */

.section-head {
  display: grid;
  gap: 10px;
  max-width: 44rem;
  margin-bottom: clamp(24px, 3vw, 36px);
  color: var(--ink-2);
}

/* Services: four answers separated by rules, no nested cards. */

.services {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--line);
}

.service {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 28px 28px 30px 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink-2);
}

.service:nth-child(even) {
  padding: 28px 0 30px 28px;
  border-left: 1px solid var(--line);
}

.service h3 {
  color: var(--ink);
  font-size: 1.375rem;
}

.service ul {
  display: grid;
  gap: 6px;
  margin: 2px 0 0;
  padding: 0;
  list-style: none;
}

.service li {
  position: relative;
  padding-left: 18px;
}

.service li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.proof {
  color: var(--ink-3);
  font-size: 0.9375rem;
}

.proof strong {
  color: var(--ink);
  font-weight: 600;
}

/* Built */

.built {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0 32px;
  margin: 0;
}

.built div {
  display: grid;
  gap: 6px;
  align-content: start;
  padding: 18px 0 22px;
  border-top: 1px solid var(--line);
}

.built dt {
  font: 800 1rem/1.2 var(--display);
}

.built dd {
  margin: 0;
  color: var(--ink-2);
  font-size: 0.9688rem;
}

.built-note {
  margin-top: 18px;
  color: var(--ink-3);
  font-size: 0.9375rem;
}

/* Writing */

.articles {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.articles li {
  border-bottom: 1px solid var(--line);
}

.articles a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 16px;
  padding: 14px 0;
  text-decoration: none;
}

.articles .title {
  font-weight: 600;
  font-size: 1.0625rem;
}

.articles a:hover .title {
  text-decoration: underline;
}

.articles .topic {
  color: var(--ink-3);
  font: 700 0.6875rem/1 var(--display);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.more {
  display: inline-block;
  margin-top: 20px;
  font-weight: 600;
}

/* FAQ */

.faq {
  border-top: 1px solid var(--line);
}

.faq details {
  border-bottom: 1px solid var(--line);
}

.faq summary {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
  cursor: pointer;
  font: 700 1.0625rem/1.35 var(--display);
  list-style: none;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "+";
  flex: none;
  font-size: 1.25rem;
  line-height: 1;
}

.faq details[open] summary::after {
  content: "−";
}

.faq details p {
  max-width: 46rem;
  padding: 0 0 18px;
  color: var(--ink-2);
}

/* Contact */

.contact {
  display: grid;
  gap: 16px;
  justify-items: start;
}

.contact p {
  max-width: 40rem;
  color: var(--ink-2);
}

.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  padding: 8px 4px 40px;
  color: var(--ink-3);
  font-size: 0.875rem;
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .portrait {
    order: -1;
    justify-self: center;
    width: min(100%, 440px);
    margin-top: -8px;
  }

  .hero-copy {
    max-width: none;
  }

  .services {
    grid-template-columns: 1fr;
  }

  .service,
  .service:nth-child(even) {
    padding: 24px 0 26px;
    border-left: 0;
  }

  .built {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  body {
    font-size: 1rem;
  }

  .topbar .wrap {
    width: calc(100% - 16px);
  }

  .handle {
    display: none;
  }

  .tabs a {
    padding: 8px 9px;
    font-size: 0.625rem;
  }

  /* The page opens on About; drop its tab so the rest fit beside Hire me. */
  .tabs a[href="#about"] {
    display: none;
  }

  .hire {
    padding: 8px 12px;
    font-size: 0.6875rem;
  }

  .built {
    grid-template-columns: 1fr;
  }

  .articles a {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .credits {
    padding-inline: 4px;
  }

  .face-cls {
    font-size: 0.6875rem;
  }

  .face-hint {
    display: none;
  }
}
