:root {
  --ink: #0b0e12;
  --slate-0: #f6f7f9;
  --slate-1: #eceff3;
  --slate-2: #d5dbe2;
  --accent: #e4572e;
  --grid: rgba(11, 14, 18, 0.06);
}

* {
  box-sizing: border-box;
}

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

html {
  font-size: 16px;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink);
  background-color: var(--slate-0);
  background-image:
    linear-gradient(135deg, rgba(11, 14, 18, 0.08), rgba(11, 14, 18, 0) 45%),
    linear-gradient(0deg, rgba(11, 14, 18, 0.06), rgba(11, 14, 18, 0) 60%),
    repeating-linear-gradient(90deg, var(--grid) 0 1px, transparent 1px 26px),
    repeating-linear-gradient(0deg, var(--grid) 0 1px, transparent 1px 26px);
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  position: relative;
}

body::before,
body::after {
  content: "";
  position: fixed;
  pointer-events: none;
  border: 3px solid var(--ink);
  background: linear-gradient(135deg, var(--slate-1), var(--slate-2));
  opacity: 0.5;
  z-index: 0;
}

body::before {
  width: clamp(260px, 40vw, 520px);
  height: clamp(260px, 40vw, 520px);
  top: -18vh;
  right: -8vw;
  transform: rotate(6deg);
}

body::after {
  width: clamp(320px, 48vw, 620px);
  height: clamp(320px, 48vw, 620px);
  bottom: -22vh;
  left: -12vw;
  transform: rotate(-8deg);
}

header,
main,
footer {
  position: relative;
  z-index: 1;
}

header {
  width: min(1100px, 92vw);
  margin: 48px auto 0;
  padding-bottom: 12px;
  animation: rise-in 0.6s ease-out both;
}

header h1 {
  margin: 0;
  font-size: clamp(2.6rem, 6vw, 4.6rem);
  line-height: 1;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

header .tagline {
  margin: 12px 0 0;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

nav {
  width: min(1100px, 92vw);
  margin: 12px auto 0;
  animation: rise-in 0.6s ease-out 0.08s both;
}

nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

nav ul li {
  margin: 0;
}

nav ul li a {
  display: inline-block;
  padding: 12px 16px;
  border: 2px solid var(--ink);
  background: var(--slate-1);
  color: var(--ink);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  box-shadow: 4px 4px 0 var(--ink);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

nav ul li a:hover,
nav ul li a:focus-visible {
  background: var(--accent);
  color: var(--slate-0);
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--ink);
}

nav ul li a.active {
  background: var(--ink);
  color: var(--slate-0);
}

main {
  width: min(1100px, 92vw);
  margin: 24px auto 80px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

section {
  padding: clamp(20px, 3vw, 32px);
  background: #ffffff;
  border: 2px solid var(--ink);
  box-shadow: 8px 8px 0 var(--slate-2);
  animation: rise-in 0.6s ease-out both;
}

section:nth-of-type(1) {
  animation-delay: 0.12s;
}

section:nth-of-type(2) {
  animation-delay: 0.2s;
}

section:nth-of-type(3) {
  animation-delay: 0.28s;
}

section:nth-of-type(4) {
  animation-delay: 0.36s;
}


section h3 {
  margin: 0 0 16px;
  font-size: clamp(1.2rem, 2.4vw, 1.6rem);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-bottom: 3px solid var(--ink);
  display: inline-block;
  padding-bottom: 8px;
}

section h4 {
  margin: 24px 0 8px;
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-family: "IBM Plex Mono", monospace;
}

section p {
  margin: 0 0 14px;
}

section ul {
  margin: 0;
  padding-left: 20px;
  list-style: square;
}

section li {
  margin-bottom: 8px;
}

strong {
  font-weight: 700;
}

a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 3px;
  text-underline-offset: 4px;
  text-decoration-color: var(--accent);
  transition: color 0.2s ease, background 0.2s ease;
}

a:hover,
a:focus-visible {
  background: var(--accent);
  color: var(--slate-0);
}

footer {
  width: min(1100px, 92vw);
  margin: 0 auto 40px;
  text-align: left;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

footer .social-links {
  list-style: none;
  display: flex;
  gap: 12px;
  padding: 0;
  margin: 0 0 12px;
}

footer .social-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 2px solid var(--ink);
  background: var(--slate-1);
  color: var(--ink);
  text-decoration: none;
  box-shadow: 3px 3px 0 var(--ink);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

footer .social-links a:hover,
footer .social-links a:focus-visible {
  background: var(--accent);
  color: var(--slate-0);
  transform: translate(-2px, -2px);
  box-shadow: 5px 5px 0 var(--ink);
}

footer p {
  margin: 0;
  color: var(--ink);
}

.fade-out {
  animation: fade-out 0.4s ease forwards;
}

.error-message {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--accent);
  color: var(--slate-0);
  padding: 12px 20px;
  border: 2px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
  z-index: 1000;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade-out {
  to {
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media screen and (max-width: 900px) {
  header,
  nav,
  main,
  footer {
    width: min(92vw, 860px);
  }

  nav ul {
    gap: 10px;
  }

  nav ul li a {
    padding: 10px 12px;
  }
}

@media screen and (max-width: 600px) {
  header {
    margin-top: 36px;
  }

  header .tagline {
    letter-spacing: 0.12em;
  }

  main {
    gap: 18px;
    margin-bottom: 60px;
  }

  section {
    box-shadow: 6px 6px 0 var(--slate-2);
  }

  footer {
    margin-bottom: 28px;
  }
}
