:root {
  color-scheme: dark;
  --background: #101210;
  --ink: #e9ebdf;
  --muted: #9caa98;
  --accent: #c4de9d;
  --line: #30382e;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-family: "Inter", system-ui, sans-serif;
  color: var(--ink);
  background: var(--background);
}

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

body, h1, h2, p, ul {
  margin: 0;
}

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

.page {
  --gutter: clamp(1.5rem, 6vw, 6rem);
  width: min(100%, 100rem);
  min-height: 100svh;
  margin-inline: auto;
  padding: clamp(1.5rem, 5vh, 3.75rem) var(--gutter) 0;
  display: flex;
  flex-direction: column;
}

.masthead {
  position: relative;
  z-index: 1;
  padding-block: 0.6rem 1.15rem;
  border-bottom: 1px solid var(--line);
}

.masthead p,
.projects h2,
.contact-link {
  font: 400 0.875rem/1.5 var(--mono);
  letter-spacing: 0.035em;
  color: var(--muted);
}

.masthead p {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.aperture {
  width: 0.875rem;
  height: 0.875rem;
  display: inline-grid;
  place-items: center;
  flex: none;
  border: 1px solid #728762;
  border-radius: 50%;
}

.aperture::after {
  content: "";
  width: 4px;
  height: 4px;
  background: var(--accent);
  border-radius: 50%;
}

main {
  display: flex;
  flex: 1;
  flex-direction: column;
}

.hero {
  flex: 1;
  position: relative;
  isolation: isolate;
  display: grid;
  align-items: center;
  min-height: clamp(29rem, 63vh, 45rem);
}

.identity {
  justify-self: start;
  position: relative;
  padding-bottom: 1.25rem;
}

.wordmark {
  --unit: clamp(5.5rem, 10.1vw, 10.5rem);
  --stroke: calc(0.148 * var(--unit));
  display: flex;
  align-items: start;
  gap: calc(0.102 * var(--unit));
  height: calc(1.285 * var(--unit));
  width: max-content;
  color: var(--ink);
}

.wordmark span {
  position: relative;
  display: block;
}

.wordmark-three {
  width: calc(0.84 * var(--unit));
  height: var(--unit);
}

.wordmark-three::before,
.wordmark-three::after {
  content: "";
  position: absolute;
}

.wordmark-three[data-variant="original"]::before,
.wordmark-three[data-variant="original"]::after {
  left: 0;
  border: var(--stroke) solid currentColor;
  border-left: 0;
  border-radius: 0 46% 46% 0 / 0 64% 64% 0;
}

.wordmark-three[data-variant="original"]::before {
  top: 0;
  width: 93%;
  height: 56%;
}

.wordmark-three[data-variant="original"]::after {
  bottom: 0;
  width: 100%;
  height: calc(44% + var(--stroke));
}

.wordmark-three[data-variant="angular"]::before {
  inset: 0;
  background: currentColor;
  /* The diagonal overlaps the top of the lower bowl. */
  clip-path: polygon(
    0 0, 91% 0, 91% 14.8%, 53% 44%, 53% 55%,
    28% 55%, 28% 44%, 66% 14.8%, 0 14.8%
  );
}

.wordmark-three[data-variant="angular"]::after {
  inset: 44% 0 0;
  border: var(--stroke) solid currentColor;
  border-left: 0;
  border-radius: 0 47% 47% 0 / 0 50% 50% 0;
  clip-path: polygon(28% 0, 100% 0, 100% 100%, 0 100%, 0 70%, 28% 70%);
}

.wordmark-p,
.wordmark-o {
  top: calc(0.28 * var(--unit));
  width: calc(0.757 * var(--unit));
  height: calc(0.72 * var(--unit));
  border: var(--stroke) solid currentColor;
  border-radius: 47%;
}

.wordmark-p {
  border-left: 0;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

.wordmark-p::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: var(--stroke);
  height: calc(0.857 * var(--unit));
  background: currentColor;
}

.wordmark-i {
  top: calc(0.28 * var(--unit));
  width: var(--stroke);
  height: calc(0.72 * var(--unit));
  background: currentColor;
}

.wordmark-i::before {
  content: "";
  position: absolute;
  bottom: calc(100% + var(--unit) * 0.074);
  width: var(--stroke);
  height: var(--stroke);
  border-radius: 50%;
  background: currentColor;
}

.tagline {
  margin-block-start: clamp(0.45rem, 1.7vw, 1.55rem);
  font-size: clamp(1.55rem, 2.45vw, 2.35rem);
  font-weight: 400;
  letter-spacing: -0.052em;
  line-height: 1.2;
  color: #c2c8bc;
}

.tagline em {
  color: var(--accent);
  font-style: normal;
}

.field {
  position: absolute;
  z-index: -1;
  top: 50%;
  right: -1%;
  width: min(66%, 54rem);
  aspect-ratio: 38 / 29;
  transform: translateY(-50%);
  pointer-events: none;
  background: radial-gradient(ellipse at 58% 51%, #1c2718 0%, #161c15 32%, transparent 69%);
}

.field canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.projects {
  display: grid;
  grid-template-columns: 25% 1fr;
  border-block: 1px solid var(--line);
}

.projects h2 {
  padding-block: 1.6rem;
}

.projects ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 0;
  list-style: none;
}

.projects li {
  border-inline-start: 1px solid var(--line);
}

.projects a {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-height: 100%;
  padding: 1.35rem clamp(1rem, 2.6vw, 2.6rem);
  color: var(--ink);
  text-decoration: none;
  transition: color 150ms ease, background-color 150ms ease;
}

.project-name {
  width: fit-content;
  font-size: clamp(1.125rem, 1.65vw, 1.5rem);
  line-height: 1.3;
  letter-spacing: -0.04em;
}

.project-host {
  font: 400 0.8125rem/1.5 var(--mono);
  color: var(--muted);
  overflow-wrap: anywhere;
}

.projects a:hover,
.projects a:focus-visible {
  color: var(--accent);
  background: #1a2118;
}

.projects a:hover .project-name,
.projects a:focus-visible .project-name {
  text-decoration: underline;
  text-underline-offset: 0.25em;
  text-decoration-thickness: 1px;
}

.projects a:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: -1px;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-height: clamp(2.5rem, 7vh, 5rem);
}

.contact-link {
  padding-block: 0.125rem;
  text-decoration: none;
}

.contact-link:hover,
.contact-link:focus-visible {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.25em;
}

.contact-link:focus-visible {
  outline: 1px solid currentColor;
  outline-offset: 2px;
}

@media (max-width: 46rem) {
  .site-footer {
    min-height: 2rem;
  }

  .hero {
    min-height: clamp(26rem, 60svh, 35rem);
    align-items: start;
    padding-top: clamp(2.25rem, 8svh, 5rem);
  }

  .identity {
    padding-bottom: 0;
  }

  .wordmark {
    --unit: min(clamp(4.5rem, 19.5vw, 7rem), 27vw);
  }

  .field {
    top: auto;
    right: calc(-1 * var(--gutter));
    bottom: 0;
    width: min(100vw, 31rem);
    transform: none;
  }

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

  .projects h2 {
    padding-block: 1rem 0.55rem;
  }

  .projects li:first-child {
    border-inline-start: 0;
  }

  .projects li:first-child a {
    padding-inline-start: 0;
  }

  .projects a {
    padding-block: 0.55rem 1.2rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .projects a {
    transition: none;
  }
}

@media (forced-colors: active) {
  .wordmark {
    forced-color-adjust: none;
    color: CanvasText;
  }
}
