:root {
  --background: hsl(220 20% 6%);
  --foreground: hsl(40 10% 90%);
  --muted-foreground: hsl(220 5% 45%);
  --accent: hsl(220 10% 60%);
  --border: hsl(220 15% 18%);
  --radius: 0.5rem;
  --ease-out: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

body {
  min-height: 100vh;
  background: var(--background);
  color: var(--foreground);
  font-family: "Inter", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration: none;
}

.icon {
  width: 1.5rem;
  height: 1.5rem;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.label {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.75rem;
  color: var(--muted-foreground);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* Hero */

.hero {
  min-height: 50vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem 1.5rem 0;
}

.hero-inner {
  width: 100%;
  max-width: 32rem;
  animation: fade-up 0.7s var(--ease-out) both;
}

.hero .label {
  margin-bottom: 1rem;
}

.name {
  font-size: 1.875rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.025em;
  margin-bottom: 0.5rem;
}

/* Effet machine à écrire : chaque lettre apparaît toutes les 80 ms */
.name span[style] {
  display: inline-block;
  max-width: 0;
  overflow: hidden;
  vertical-align: bottom;
  animation: type 0s calc((var(--i) + 1) * 80ms) forwards;
}

.cursor {
  display: inline-block;
  width: 3px;
  height: 1.1em;
  margin-left: 0.25rem;
  background: var(--accent);
  vertical-align: middle;
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) 1.44s infinite;
}

.tagline {
  max-width: 24rem;
  margin-bottom: 2rem;
  font-size: 0.875rem;
  line-height: 1.625;
  color: var(--muted-foreground);
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.75rem;
  color: var(--muted-foreground);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all 0.3s;
}

.link .icon {
  width: 0.875rem;
  height: 0.875rem;
  transition: transform 0.15s;
}

.link:hover {
  color: var(--foreground);
  border-color: hsl(220 10% 60% / 0.5);
  background: hsl(220 10% 60% / 0.1);
  box-shadow: 0 0 12px hsl(220 10% 60% / 0.15);
}

.link:hover .icon {
  transform: scale(1.1);
}

/* Portfolio */

.portfolio {
  max-width: 35rem;
  margin: 0 auto;
  padding: 0 1.5rem 6rem;
}

.portfolio .label {
  margin-bottom: 1.5rem;
  animation: fade-in 0.5s 0.4s both;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 1.25rem;
  text-align: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.3s, background-color 0.3s, box-shadow 0.3s, translate 0.3s;
  animation: fade-up-small 0.4s calc(0.5s + var(--i) * 80ms) both;
}

.card .icon {
  color: var(--muted-foreground);
  transition: color 0.3s, transform 0.3s;
}

.card .ext {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 0.75rem;
  height: 0.75rem;
  color: transparent;
}

.card-title {
  font-size: 0.875rem;
  font-weight: 500;
}

.card-type {
  margin-top: -0.625rem;
  font-size: 11px;
  color: var(--muted-foreground);
}

.card:hover {
  border-color: hsl(220 10% 60% / 0.4);
  background: hsl(220 10% 60% / 0.05);
  box-shadow: 0 0 20px hsl(220 10% 60% / 0.1);
  translate: 0 -2px;
}

.card:hover .icon {
  color: var(--foreground);
  transform: scale(1.1);
}

.card:hover .ext {
  color: var(--muted-foreground);
  transform: none;
}

@media (min-width: 640px) {
  .name {
    font-size: 2.25rem;
  }

  .grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Animations */

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
}

@keyframes fade-up-small {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
}

@keyframes type {
  to {
    max-width: 1em;
  }
}

@keyframes pulse {
  50% {
    opacity: 0.5;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0s !important;
    animation-delay: 0s !important;
    transition: none !important;
  }

  .cursor {
    animation: none;
  }
}
