@import 'var.css';

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #020617;
    --text: #f8f8f6;
    --muted: #9ca3af;
    --accent: #023ea8;
  }
}

/* 1. Use a more-intuitive box-sizing model */
*, *::before, *::after {
  box-sizing: border-box;
}

/* 2. Remove default margin */
*:not(dialog) {
  margin: 0;
}

/* 3. Enable keyword animations */
@media (prefers-reduced-motion: no-preference) {
  html {
    interpolate-size: allow-keywords;
  }
}

body {
  /* 4. Add accessible line-height */
  line-height: 1.5;
  /* 5. Improve text rendering */
  -webkit-font-smoothing: antialiased;
  
  /* Layout styles */
  font-family: 'Source Code Pro', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', monospace;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

/* 6. Improve media defaults */
img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
}

/* 7. Inherit fonts for form controls */
input, button, textarea, select {
  font: inherit;
}

/* 8. Avoid text overflows */
p, h1, h2, h3, h4, h5, h6 {
  overflow-wrap: break-word;
}

/* 9. Improve line wrapping */
p {
  text-wrap: pretty;
}
h1, h2, h3, h4, h5, h6 {
  text-wrap: balance;
}

/* 10. Create a root stacking context */
#root, #__next {
  isolation: isolate;
}

/* Page specific styles */
main {
  padding: 2.5rem 2rem;
}

h1 {
  font-size: clamp(3rem, 6vw, 4.5rem);
  margin-bottom: 0.5rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.subtitle {
  font-size: clamp(0.9rem, 2vw, 1.1rem);
  color: var(--muted);
  margin-bottom: 2rem;
  font-weight: 400;
}

.typing-subtitle {
  display: inline-block;
  overflow: hidden;
  white-space: nowrap;
  animation: typing-subtitle 1.85s steps(37, end) 2.2s forwards;
  max-width: 0;
  position: relative;
}

.typing-subtitle::after {
  content: '';
  position: absolute;
  right: 0;
  bottom: 0;
  width: 0.6em;
  height: 0.1em;
  background-color: var(--muted);
  animation: blink-caret-subtitle 0.4s step-end 5 2.2s, fade-out-subtitle 0.1s ease-out 4.05s forwards;
}

.typing-subtitle-2 {
  display: inline-block;
  overflow: hidden;
  white-space: nowrap;
  animation: typing-subtitle-2 1.2s steps(24, end) 4.25s forwards;
  max-width: 0;
  position: relative;
}

.typing-subtitle-2::after {
  content: '';
  position: absolute;
  right: 0;
  bottom: 0;
  width: 0.6em;
  height: 0.1em;
  background-color: var(--muted);
  animation: blink-caret-subtitle-2 0.4s step-end 3 4.20s, fade-out-subtitle-2 0.1s ease-out 5.20s forwards;
}

.typing-text {
  display: inline-block;
  overflow: hidden;
  white-space: nowrap;
  animation: typing 2s steps(11, end) forwards;
  position: relative;
}

.typing-text::after {
  content: '';
  position: absolute;
  right: 0;
  bottom: 0;
  width: 0.6em;
  height: 0.15em;
  background-color: var(--text);
  animation: blink-caret 0.4s step-end 5, fade-out 0.1s ease-out 2s forwards;
}

@keyframes typing {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

@keyframes blink-caret {
  from, to {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
}

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

@keyframes typing-subtitle {
  from {
    max-width: 0;
  }
  to {
    max-width: 100%;
  }
}

@keyframes blink-caret-subtitle {
  from, to {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
}

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

@keyframes typing-subtitle-2 {
  from {
    max-width: 0;
  }
  to {
    max-width: 100%;
  }
}

@keyframes blink-caret-subtitle-2 {
  from, to {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
}

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

.links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  width: auto;
  margin: 0 auto;
}

.links a {
  display: inline-block;
  text-decoration: none;
  color: var(--muted);
  font-weight: 500;
  padding: 0;
  transition: color 0.15s ease;
  position: relative;
}

.links a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -0.1em;
  width: 0;
  height: 0.1em;
  background-color: var(--accent);
  transition: width 0.3s ease;
}

.links a:hover {
  color: var(--accent);
}

.links a:hover::after {
  width: 100%;
}

footer {
  position: fixed;
  bottom: 1.2rem;
  font-size: 0.8rem;
  color: var(--muted);
}