:root {
  color-scheme: dark;
  --bg: #050505;
  --fg: #f5f5f0;
  --muted: #a8a8a0;
  --line: #3a3a35;
  --accent: #d7ff3f;
  --max-width: 1120px;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--fg);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    var(--bg);
  background-size: 64px 64px;
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.45;
}

.shell {
  width: min(100% - 32px, var(--max-width));
  min-height: 100vh;
  margin: 0 auto;
  padding: 32px 0;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 30px;
}

.masthead {
  padding-top: min(9vh, 96px);
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(3.1rem, 14vw, 10rem);
  line-height: 0.84;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 span {
  display: block;
  width: fit-content;
  max-width: 100%;
  overflow-wrap: normal;
}

.intro {
  max-width: 820px;
  padding-top: 4px;
  display: grid;
  gap: 1.2em;
}

.intro p {
  color: var(--fg);
  font-size: clamp(1.2rem, 2.4vw, 2rem);
  font-weight: 700;
  line-height: 1.14;
}

.projects {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  align-self: end;
  border: 1px solid var(--line);
  background: var(--line);
}

.projects article {
  min-width: 0;
  min-height: 220px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 28px;
  background: rgba(5, 5, 5, 0.94);
}

.projects h2 {
  font-size: 1rem;
  line-height: 1;
  font-weight: 900;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.projects p {
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.contact {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: baseline;
  padding-top: 4px;
  color: var(--muted);
  font-size: 0.95rem;
}

.contact a {
  color: var(--fg);
  text-decoration: none;
  overflow-wrap: anywhere;
}

@media (max-width: 900px) {
  .projects {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .projects article {
    min-height: 190px;
  }
}

@media (max-width: 560px) {
  .shell {
    width: min(100% - 24px, var(--max-width));
    padding: 22px 0;
    gap: 24px;
  }

  .masthead {
    padding-top: 28px;
  }

  h1 {
    font-size: clamp(2.75rem, 14.5vw, 5.8rem);
  }

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

  .projects article {
    min-height: 152px;
    padding: 18px;
  }
}
