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

:root {
  --bg: #F4F0E8;
  --ink: #1B1A17;
  --stroke-opacity: 0.22;
}

html {
  font-size: 19px;
}

@media (min-width: 640px) {
  html {
    font-size: 20px;
  }
}

body {
  background-color: var(--bg);
  color: var(--ink);
  font-family: 'Newsreader', serif;
  font-weight: 400;
  font-optical-sizing: auto;
  line-height: 1.55;
  letter-spacing: -0.005em;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.ghost-traces {
  display: block;
  width: 140px;
  height: 140px;
  margin: 0 auto 28px;
  pointer-events: none;
}

main {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 0 24px;
}

.logo {
  display: block;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.02em;
  color: var(--ink);
  margin-bottom: 2rem;
  text-align: center;
}

.thesis {
  padding-top: 12vh;
  padding-bottom: 8vh;
}

.thesis p {
  margin-bottom: 1.4em;
}

.contact {
  display: block;
  margin-top: 2.5rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  color: var(--ink);
  text-decoration: none;
  text-align: center;
  opacity: 0.55;
  transition: opacity 0.2s ease;
}

.contact:hover,
.contact:focus {
  opacity: 1;
}

/* Ghost traces styles */
.ghost-traces line,
.ghost-traces path,
.ghost-traces circle,
.ghost-traces rect,
.ghost-traces polyline,
.ghost-traces polygon,
.ghost-traces ellipse {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.5;
  stroke-linecap: square;
  stroke-linejoin: miter;
  vector-effect: non-scaling-stroke;
  opacity: var(--stroke-opacity);
}

.ghost-traces text {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  fill: var(--ink);
  opacity: var(--stroke-opacity);
}

.ghost-traces .marker {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
  opacity: var(--stroke-opacity);
}

/* Animation classes */
@keyframes draw {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes fadeOut {
  to {
    opacity: 0;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: var(--stroke-opacity);
  }
}

.ghost-traces .drawing {
  animation: draw var(--draw-duration, 6s) ease-out forwards;
}

.ghost-traces .fading {
  animation: fadeOut 2s ease-out forwards;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .ghost-traces .drawing,
  .ghost-traces .fading {
    animation: none;
  }
  
  .ghost-traces * {
    opacity: 0.04 !important;
  }
}
