:root {
  color-scheme: dark;
  --accent: #8C9BFF;
  --background: #0C0C0D;
  --text: #E9E9E4;
  --muted: #8E8E88;
  --border: #26262A;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 14px;
  line-height: 1.6;
  font-weight: 400;
}

a { color: inherit; text-decoration: none; }
a:hover, a:focus-visible {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 6px;
  text-decoration-thickness: 1px;
}

.portfolio::selection, .portfolio ::selection {
  background: var(--accent);
  color: var(--background);
}

.container {
  max-width: 1440px;
  margin: 0 auto;
  box-sizing: border-box;
  padding: 0 clamp(20px, 4vw, 64px);
}

.header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px 32px;
  padding: 20px 0;
}

.muted { color: var(--muted); }
.languages { display: inline-flex; align-items: center; }
.language {
  font: inherit;
  min-height: 44px;
  box-sizing: border-box;
  padding: 12px 8px;
  color: var(--muted);
  text-underline-offset: 6px;
  text-decoration-thickness: 1px;
}
.language[aria-current="page"] { color: var(--text); text-decoration: underline; }
.language:hover, .language:focus-visible { color: var(--accent); }

.hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 64px;
  padding: clamp(56px, 9vw, 128px) 0 clamp(72px, 10vw, 144px);
}

.intro { flex: 1 1 440px; min-width: 0; }
.title {
  margin: 0;
  font-family: 'DM Serif Display', 'Didot', Georgia, serif;
  font-size: clamp(88px, 17vw, 260px);
  font-weight: 400;
  line-height: 0.9;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}

.role {
  margin: 48px 0 0;
  font-size: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.typewriter {
  --role-length: 11;
  display: inline-block;
  flex: 0 0 auto;
  overflow: hidden;
  white-space: nowrap;
  width: calc(var(--role-length) * 1ch);
  animation: type-role 1100ms steps(var(--role-length), end) 450ms backwards;
}

.cursor {
  display: inline-block;
  width: 0.6em;
  height: 1.15em;
  background: var(--accent);
  animation: blink 1.1s steps(1) infinite;
}

.art {
  margin: 0;
  flex: 0 1 auto;
  max-width: 100%;
  overflow: hidden;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  line-height: 1.1;
  color: var(--text);
  user-select: none;
}

.contact { scroll-margin-top: 16px; }
.contact-title {
  margin: 0;
  padding: 18px 0 40px;
  border-top: 1px solid var(--border);
  font-size: 14px;
  font-weight: 400;
}
.email {
  position: relative;
  margin: 0;
  font-size: clamp(22px, 3.6vw, 52px);
  font-weight: 300;
  line-height: 1.15;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}
.email-copy {
  display: inline-block;
  max-width: 100%;
  padding: 0;
  border: 0;
  border-radius: 2px;
  background: none;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-align: left;
  overflow-wrap: anywhere;
  cursor: pointer;
}
.email-copy:hover, .email-copy:focus-visible, .email-copy.is-copied { color: var(--accent); }
.email-copy:focus-visible { outline: 2px solid var(--accent); outline-offset: 6px; }
.copy-status {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  color: var(--accent);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.6;
  letter-spacing: 0;
  pointer-events: none;
}
.portfolio .clipboard-target {
  position: fixed;
  top: 0;
  left: -9999px;
  user-select: text;
  -webkit-user-select: text;
}
.confetti {
  position: fixed;
  inset: 0;
  z-index: 10;
  overflow: hidden;
  pointer-events: none;
}
.confetti-piece {
  position: absolute;
  width: 6px;
  height: 10px;
  animation: confetti-burst var(--duration) ease-out both;
}
@keyframes confetti-burst {
  0% { opacity: 1; transform: translate(-50%, -50%) rotate(0deg); }
  60% { opacity: 1; transform: translate(var(--spread), var(--lift)) rotate(var(--spin)); }
  100% { opacity: 0; transform: translate(var(--spread), var(--lift)) rotate(var(--spin)); }
}
.socials { display: flex; flex-wrap: wrap; gap: 4px 32px; margin-top: 40px; color: var(--muted); }

.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px 32px;
  margin-top: clamp(96px, 12vw, 176px);
  padding: 24px 0 32px;
  border-top: 1px solid var(--border);
  color: var(--muted);
}
.back-to-top { display: inline-block; padding: 12px 0; }

@keyframes blink { 50% { opacity: 0; } }
@keyframes type-role { from { width: 0; } to { width: calc(var(--role-length) * 1ch); } }
@keyframes enter { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }
@keyframes enter-art { from { opacity: 0; transform: translateY(24px) scale(0.96); } to { opacity: 1; transform: translateY(0) scale(1); } }
.enter { animation: enter 750ms cubic-bezier(0.22, 1, 0.36, 1) backwards; }
.enter-title { animation-delay: 80ms; }
.enter-role { animation-delay: 200ms; }
.enter-art { animation-name: enter-art; animation-duration: 1000ms; animation-delay: 140ms; }
.enter-contact { animation-delay: 300ms; }
.enter-footer { animation-delay: 400ms; }

@media (hover: none) and (pointer: coarse) {
  .portfolio, .portfolio * {
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cursor, .enter, .typewriter { animation: none; }
  .confetti { display: none; }
}
