:root {
  color-scheme: light;
  --surface-canvas: #f8f7f3;
  --ink: #1a2d30;
  --ink-muted: #687170;
  --hairline: rgb(26 45 48 / 18%);
  --surface-card: transparent;
  --surface-card-hover: #f2f0ea;
  --corner-color: #1d1b19;
  --logo-width: clamp(13rem, 24vw, 21rem);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--surface-canvas);
  color: var(--ink);
  font-family: Inter, "Helvetica Neue", Arial, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

.page {
  display: grid;
  min-height: 100vh;
  min-height: 100svh;
  padding: clamp(0.8rem, 1.8vw, 1.5rem);
  place-items: center;
}

.constellation {
  position: relative;
  width: min(100%, 62rem);
  height: min(44rem, calc(100svh - 2rem));
  min-height: 40rem;
}

.hero {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.logo {
  display: block;
  width: var(--logo-width);
  height: auto;
}

.projects {
  display: grid;
  grid-template-columns: repeat(2, minmax(16rem, 18.5rem));
  grid-template-rows: repeat(2, auto);
  align-content: space-between;
  justify-content: space-between;
  width: 100%;
  height: 100%;
  column-gap: 0;
  row-gap: 0;
}

.project {
  position: relative;
  display: flex;
  flex-direction: column;
  align-self: stretch;
  width: 100%;
  height: auto;
  padding: clamp(0.9rem, 1.4vw, 1.2rem);
  color: inherit;
  text-decoration: none;
  background: var(--surface-card);
  border: 0;
  border-radius: 0;
  transition:
    background-color 180ms ease,
    transform 180ms ease;
}

.project:nth-child(1) {
  order: 4;
}

.project:nth-child(2) {
  order: 3;
}

.project:nth-child(3) {
  order: 2;
}

.project:nth-child(4) {
  order: 1;
}

.project:hover,
.project:focus-visible {
  background: var(--surface-card-hover);
  transform: translateY(-1px);
}

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

.project__corners {
  --corner-arm: 24px;
  --corner-weight: 3px;
  position: absolute;
  inset: -4px;
  z-index: 2;
  pointer-events: none;
  color: var(--corner-color);
  background:
    linear-gradient(currentColor, currentColor) left top / var(--corner-arm) var(--corner-weight) no-repeat,
    linear-gradient(currentColor, currentColor) left top / var(--corner-weight) var(--corner-arm) no-repeat,
    linear-gradient(currentColor, currentColor) right top / var(--corner-arm) var(--corner-weight) no-repeat,
    linear-gradient(currentColor, currentColor) right top / var(--corner-weight) var(--corner-arm) no-repeat,
    linear-gradient(currentColor, currentColor) left bottom / var(--corner-arm) var(--corner-weight) no-repeat,
    linear-gradient(currentColor, currentColor) left bottom / var(--corner-weight) var(--corner-arm) no-repeat,
    linear-gradient(currentColor, currentColor) right bottom / var(--corner-arm) var(--corner-weight) no-repeat,
    linear-gradient(currentColor, currentColor) right bottom / var(--corner-weight) var(--corner-arm) no-repeat;
}

.project__link-icon {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 1.15rem;
  height: 1.15rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.48;
  transition: opacity 180ms ease, transform 180ms ease;
}

.project:hover .project__link-icon,
.project:focus-visible .project__link-icon {
  opacity: 1;
  transform: translate(1px, -1px);
}

.project h2 {
  max-width: calc(100% - 2.5rem);
  margin: 0 0 clamp(1.05rem, 1.8vw, 1.45rem);
  font-size: clamp(1.2rem, 1.7vw, 1.5rem);
  font-weight: 450;
  letter-spacing: -0.035em;
  line-height: 1.05;
}

.project p {
  max-width: 33rem;
  margin: 0;
  color: #394847;
  font-size: clamp(0.82rem, 1vw, 0.94rem);
  font-weight: 400;
  line-height: 1.42;
}

.project .project__meaning {
  margin-top: 0.65rem;
}

@media (max-width: 48rem) {
  .page {
    display: block;
    padding: 1rem;
  }

  .constellation {
    width: 100%;
    height: auto;
    min-height: 0;
  }

  .hero {
    position: static;
    display: grid;
    min-height: 50svh;
    place-items: center;
    transform: none;
  }

  .projects {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: none;
    width: min(100%, 32rem);
    height: auto;
    margin: 0 auto;
    column-gap: 0;
    row-gap: 1.5rem;
  }

  .project:nth-child(1) {
    order: 4;
  }

  .project:nth-child(2) {
    order: 3;
  }

  .project:nth-child(3) {
    order: 1;
  }

  .project:nth-child(4) {
    order: 2;
  }

  .project {
    height: auto;
    min-height: 15rem;
    padding: 1.25rem;
  }

  .project h2 {
    margin-bottom: 1.35rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .project,
  .project:hover,
  .project:focus-visible {
    transition: none;
  }
}
