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

/* shadcn design tokens — dark */
:root {
  --background: hsl(0 0% 3.9%);
  --foreground: hsl(0 0% 98%);
  --muted: hsl(0 0% 9%);
  --muted-fg: hsl(0 0% 68%);
  --border: hsl(0 0% 14.9%);
  --input: hsl(0 0% 14.9%);
  --primary: hsl(0 0% 98%);
  --primary-fg: hsl(0 0% 9%);
  --accent: hsl(0 0% 14.9%);
  --accent-fg: hsl(0 0% 98%);
  --radius: 0.5rem;
  --accent-color: #818CF8;
}

/* shadcn design tokens — light */
[data-theme="light"] {
  --background: hsl(0 0% 100%);
  --foreground: hsl(0 0% 3.9%);
  --muted: hsl(0 0% 96.1%);
  --muted-fg: hsl(0 0% 42%);
  --border: hsl(0 0% 89.8%);
  --input: hsl(0 0% 89.8%);
  --primary: hsl(0 0% 9%);
  --primary-fg: hsl(0 0% 98%);
  --accent: hsl(0 0% 96.1%);
  --accent-fg: hsl(0 0% 9%);
  --accent-color: #4F46E5;
}

body {
  background: var(--background);
  color: var(--foreground);
  font-family: 'Inter', -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}

/* ── Layout ── */
.container {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Nav ── */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--background) 80%, transparent);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
}

nav .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-brand {
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.status-dot {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  flex-shrink: 0;
  cursor: pointer;
}

.status-dot::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  background: #22c55e;
  opacity: 0.25;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

  0%,
  100% {
    transform: scale(1);
    opacity: 0.25;
  }

  50% {
    transform: scale(1.6);
    opacity: 0;
  }
}

.status-tooltip {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--foreground);
  color: var(--background);
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  padding: 4px 8px;
  border-radius: 6px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
}

.status-dot:hover .status-tooltip {
  opacity: 1;
}

.status-dot.active .status-tooltip {
  opacity: 1;
}

.nav-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--foreground);
}

.nav-sub {
  font-size: 12px;
  color: var(--muted-fg);
  font-weight: 400;
}

.nav-links {
  display: flex;
  gap: 4px;
  list-style: none;
  align-items: center;
}

/* shadcn ghost button */
.nav-links a {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted-fg);
  text-decoration: none;
  height: 28px;
  padding: 0 12px;
  border-radius: calc(var(--radius) - 2px);
  transition: background 0.15s, color 0.15s;
  display: inline-flex;
  align-items: center;
}

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

/* ── Contact dropdown ── */
.nav-contact {
  position: relative;
  margin-left: 4px;
}

.nav-contact-trigger {
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted-fg);
  background: transparent;
  border: none;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  height: 28px;
  padding: 0 12px;
  border-radius: calc(var(--radius) - 2px);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: background 0.15s, color 0.15s;
}

.nav-contact-trigger:hover,
.nav-contact.open .nav-contact-trigger {
  background: var(--accent);
  color: var(--accent-fg);
}

.nav-contact-trigger .chevron {
  width: 13px;
  height: 13px;
  transition: transform 0.15s;
}

.nav-contact.open .nav-contact-trigger .chevron {
  transform: rotate(180deg);
}

.nav-contact-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 264px;
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  padding: 6px;
  display: none;
  flex-direction: column;
  gap: 2px;
  z-index: 50;
}

.nav-contact.open .nav-contact-menu {
  display: flex;
}

/* rows inside the dropdown (email, linkedin, cv) */
.nav-contact-menu a,
.nav-contact-menu .copy-email {
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--foreground);
  background: transparent;
  border: none;
  -webkit-appearance: none;
  appearance: none;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  height: auto;
  padding: 9px 10px;
  border-radius: calc(var(--radius) - 2px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  transition: background 0.15s;
}

.nav-contact-menu a:hover,
.nav-contact-menu .copy-email:hover {
  background: var(--accent);
}

.nav-contact-menu svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  color: var(--muted-fg);
}

/* copy-email affordance — icon swaps to a green check on copy */
.copy-email .check-icon {
  display: none;
}

.copy-email.copied .copy-icon {
  display: none;
}

.copy-email.copied .check-icon {
  display: block;
  color: #16a34a;
}

.copy-email.copied .copy-email-label {
  color: #16a34a;
}

/* primary button (Book a call) — nav uses the compact xs size */
.nav-links a.nav-cta {
  color: var(--primary-fg);
  background: var(--primary);
  border: 1px solid transparent;
  border-radius: var(--radius);
  height: 28px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
}

.nav-links a.nav-cta:hover {
  background: var(--primary);
  color: var(--primary-fg);
  opacity: 0.88;
}

/* ── Mobile burger menu ── */
.nav-burger {
  display: none;
  background: transparent;
  border: none;
  padding: 0;
  width: 28px;
  height: 28px;
  cursor: pointer;
  color: var(--foreground);
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.nav-burger svg {
  width: 24px;
  height: 24px;
  display: block;
}

.nav-burger .icon-close {
  display: none;
}

nav.menu-open .nav-burger .icon-open {
  display: none;
}

nav.menu-open .nav-burger .icon-close {
  display: block;
}

@media (max-width: 640px) {
  .nav-burger {
    display: inline-flex;
  }

  /* full-screen opaque menu — replaces page content instead of overlaying it */
  .nav-links {
    position: fixed;
    inset: 0;
    z-index: 1;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 88px 24px 32px;
    background: var(--background);
    overflow-y: auto;
    display: none;
  }

  nav.menu-open .nav-links {
    display: flex;
  }

  /* while open: drop the nav's backdrop-filter so it no longer becomes the
     containing block for the fixed overlay (otherwise inset:0 sizes to the
     nav bar, not the viewport), and make the top bar opaque */
  nav.menu-open {
    background: var(--background);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  /* keep the name + close button above the overlay */
  .nav-brand,
  .nav-burger {
    position: relative;
    z-index: 2;
  }

  .nav-links a {
    height: auto;
    padding: 10px 12px;
    font-size: 15px;
    color: var(--foreground);
    border-radius: var(--radius);
  }

  /* mobile: Contacts is a collapsible, nested accordion inside the menu */
  .nav-contact {
    margin: 6px 0 0;
  }

  .nav-contact-trigger {
    display: inline-flex;
    width: 100%;
    height: auto;
    padding: 10px 12px;
    font-size: 15px;
    color: var(--foreground);
    justify-content: space-between;
    gap: 8px;
    border-radius: var(--radius);
  }

  .nav-contact-trigger .chevron {
    width: 16px;
    height: 16px;
  }

  .nav-contact-menu {
    position: static;
    display: none;
    min-width: 0;
    margin-left: 12px;
    border: none;
    box-shadow: none;
    padding: 0;
    background: transparent;
  }

  .nav-contact.open .nav-contact-menu {
    display: flex;
  }

  .nav-contact-menu a,
  .nav-contact-menu .copy-email {
    padding: 12px;
    font-size: 15px;
    gap: 10px;
  }

  /* verified on-device: the copy button needs 6px 8px to line up with the links */
  .nav-contact-menu .copy-email {
    padding: 6px 8px;
  }

  /* mobile: copy icon always visible — no hover to reveal it */
  .nav-contact-menu .copy-email .copy-icon {
    opacity: 1;
  }

  /* keep the address on one line and never push the icon off-screen */
  .nav-contact-menu .copy-email .copy-email-label {
    flex: 0 1 auto;
    font-size: 15px;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .nav-links a.nav-cta {
    align-self: flex-start;
    margin-top: 10px;
    white-space: nowrap;
    padding: 0 14px;
  }
}

/* ── CV download gate modal ── */
.cv-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  padding: 1rem;
}

.cv-modal.open {
  opacity: 1;
  pointer-events: all;
}

.cv-modal-box {
  position: relative;
  width: 100%;
  max-width: 380px;
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.4);
  transform: translateY(8px);
  transition: transform 0.2s;
}

.cv-modal.open .cv-modal-box {
  transform: translateY(0);
}

.cv-modal-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: none;
  border: none;
  color: var(--muted-fg);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.25rem;
}

.cv-modal-close:hover {
  color: var(--foreground);
}

.cv-modal-box h2 {
  font-size: 1.1rem;
  margin-bottom: 0.35rem;
}

.cv-modal-sub {
  color: var(--muted-fg);
  font-size: 0.85rem;
  margin-bottom: 1.1rem;
}

#cv-modal-form,
#cv-modal-code-form {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

#cv-modal-form[hidden],
#cv-modal-code-form[hidden] {
  display: none;
}

#cv-modal-email,
#cv-modal-code {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--input);
  border-radius: var(--radius);
  background: var(--background);
  color: var(--foreground);
  font-size: 0.9rem;
}

#cv-modal-code {
  letter-spacing: 0.3em;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

#cv-modal-email:focus,
#cv-modal-code:focus {
  outline: none;
  border-color: var(--accent-color);
}

.cv-modal-code-actions {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
}

.cv-modal-link {
  background: none;
  border: none;
  padding: 0;
  color: var(--muted-fg);
  font-size: 0.8rem;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  font-family: inherit;
}

.cv-modal-link:hover {
  color: var(--foreground);
}

.cv-modal-link:disabled {
  opacity: 0.5;
  cursor: default;
  text-decoration: none;
}

.cv-modal-submit {
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius);
  border: 1px solid var(--foreground);
  background: var(--primary);
  color: var(--primary-fg);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.15s;
}

.cv-modal-submit:hover {
  opacity: 0.85;
}

.cv-modal-submit:disabled {
  opacity: 0.5;
  cursor: default;
}

.cv-modal-error,
.cv-modal-success {
  font-size: 0.85rem;
  margin-top: 0.75rem;
}

.cv-modal-error {
  color: #ef4444;
}

.cv-modal-success {
  color: var(--muted-fg);
}

.cv-modal-error a {
  color: inherit;
  text-decoration: underline;
}
