/* ============================================================
   marusczak.com Landing Page
   ============================================================ */

/* --- Reset --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
  color: #1a1a1a;
  background-color: #b0c4de;
  background-image:
    linear-gradient(rgba(0, 0, 0, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 0, 0, 0.05) 1px, transparent 1px);
  background-size: 32px 32px;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

a {
  color: #1a1a1a;
  text-decoration: none;
  transition: color 0.2s;
}

/* --- GitHub Icon --- */
#githubicon {
  position: absolute;
  top: 40px;
  right: 6vw;
  width: 60px;
  height: 60px;
  transition: 1.5s;
  z-index: 0;
  background-color: transparent;
  border-radius: 100px;
}

#githubicon:hover {
  transform: translateY(-5px);
  background-color: azure;
}

/* --- Layout --- */
.container {
  max-width: 56rem;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* --- Hero --- */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 60vh;
  padding-top: 1.5rem;
}

.hero-name {
  font-family: "Roboto Mono", monospace;
  font-size: clamp(2rem, 5vw, 2.8rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.cursor {
  display: inline-block;
  width: 3px;
  height: 0.85em;
  background-color: #1a1a1a;
  margin-left: 4px;
  vertical-align: baseline;
  position: relative;
  top: 0.05em;
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.hero-tagline {
  font-size: 1.1rem;
  color: #333;
  margin-top: 0.75rem;
  max-width: 32rem;
}

/* --- Hero fade-in --- */
.hero-name,
.hero-tagline {
  animation: heroFadeIn 0.8s ease both;
}

.hero-tagline {
  animation-delay: 0.15s;
}

@keyframes heroFadeIn {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- Cards Grid --- */
.projects {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  padding-bottom: 4rem;
}

/* --- Card --- */
.card {
  display: flex;
  flex-direction: column;
  position: relative;
  padding: 1.5rem 1.5rem 3rem;
  background-color: #faf0e6;
  border: 1px solid black;
  border-radius: 7px;
  text-decoration: none;
  color: inherit;
  transition: 500ms;
  border-left: 4px solid black;
}

.boxShadow {
  box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
}

.card:hover,
.card.visible:hover {
  background-color: lightgray;
  cursor: pointer;
  transform: translateY(-2px);
}

.card-blue {
  border-left-color: #5b8abf;
}

.card-amber {
  border-left-color: #d4956a;
}

.card-green {
  border-left-color: #6aad6a;
}

.card-purple {
  border-left-color: #9585bf;
}

.card h2 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.card p {
  font-size: 0.9rem;
  color: #444;
  line-height: 1.55;
}

.card-tag {
  position: absolute;
  bottom: 0.85rem;
  right: 1.1rem;
  font-family: "Roboto Mono", monospace;
  font-size: 0.7rem;
  color: #777;
  background: rgba(0, 0, 0, 0.05);
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
}

/* --- Reveal Animations --- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
  transition: 500ms;
}

.projects .reveal:nth-child(1) { transition-delay: 0s; }
.projects .reveal:nth-child(2) { transition-delay: 0.08s; }
.projects .reveal:nth-child(3) { transition-delay: 0.16s; }
.projects .reveal:nth-child(4) { transition-delay: 0.24s; }

.projects .reveal.visible:nth-child(1),
.projects .reveal.visible:nth-child(2),
.projects .reveal.visible:nth-child(3),
.projects .reveal.visible:nth-child(4) { transition-delay: 0s; }

/* --- Footer --- */
footer {
  padding: 1.5rem 0 3rem;
  color: #555;
  font-size: 0.78rem;
  font-family: "Roboto Mono", monospace;
  text-align: center;
}

footer a {
  color: #555;
}

footer a:hover {
  text-decoration: underline;
}

/* --- Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .hero-name,
  .hero-tagline {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .cursor {
    animation: none;
    opacity: 1;
  }

  .card {
    transition: none;
  }
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .hero {
    min-height: 50vh;
  }

  .hero-name {
    font-size: 1.8rem;
  }

  .hero-tagline {
    font-size: 1rem;
  }
}

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

  .card {
    padding: 1.25rem 1.25rem 2.75rem;
  }
}
