:root {
  --radius: 16px;
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #eef1f5;
  --surface: #ffffff;
  --text: #14181f;
  --muted: #5a6572;
  --surface-border: rgba(15, 20, 25, 0.08);
  --shadow: 0 12px 40px rgba(15, 20, 25, 0.08);
  --glow-a: rgba(17, 133, 254, 0.14);
  --glow-b: rgba(10, 102, 194, 0.1);
  --linkedin: #0a66c2;
  --linkedin-hover: #004182;
  --bluesky: #1185fe;
  --bluesky-hover: #0c6fd4;
  --link-fg: #fff;
  --focus-ring: #14181f;
  --toggle-bg: rgba(15, 20, 25, 0.06);
  --toggle-bg-hover: rgba(15, 20, 25, 0.1);
  --toggle-fg: #14181f;
  --avatar-ring: rgba(15, 20, 25, 0.12);
  --email: #334155;
  --email-hover: #1e293b;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f1419;
  --surface: #1a222c;
  --text: #e8eaed;
  --muted: #9aa5b1;
  --surface-border: rgba(255, 255, 255, 0.06);
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  --glow-a: rgba(17, 133, 254, 0.12);
  --glow-b: rgba(10, 102, 194, 0.08);
  --linkedin: #0a66c2;
  --linkedin-hover: #378fe9;
  --bluesky: #1185fe;
  --bluesky-hover: #47a3ff;
  --link-fg: #fff;
  --focus-ring: #e8eaed;
  --toggle-bg: rgba(255, 255, 255, 0.08);
  --toggle-bg-hover: rgba(255, 255, 255, 0.12);
  --toggle-fg: #e8eaed;
  --avatar-ring: rgba(255, 255, 255, 0.14);
  --email: #64748b;
  --email-hover: #94a3b8;
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family:
    system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    "Helvetica Neue",
    Arial,
    sans-serif;
  font-size: 1.0625rem;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 120% 80% at 50% -20%, var(--glow-a), transparent),
    radial-gradient(ellipse 80% 50% at 100% 100%, var(--glow-b), transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1.25rem, 4vw, 2.5rem);
}

main {
  width: 100%;
  max-width: 28rem;
}

.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: clamp(1.75rem, 5vw, 2.5rem);
  box-shadow: var(--shadow);
  border: 1px solid var(--surface-border);
}

.profile-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.profile-header-text {
  min-width: 0;
  flex: 1;
}

.profile-avatar {
  width: clamp(3.25rem, 11vw, 4.5rem);
  height: clamp(3.25rem, 11vw, 4.5rem);
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid var(--avatar-ring);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

html[data-theme="dark"] .profile-avatar {
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}

.profile-header h1 {
  margin: 0 0 0.35rem;
  font-size: clamp(1.5rem, 4.5vw, 1.75rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.location-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.95rem;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s ease;
  border-radius: 6px;
  margin: 0 -0.2rem;
  padding: 0.15rem 0.2rem;
}

.location-link:hover {
  color: var(--text);
}

.location-link:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.location-icon {
  width: 1.125rem;
  height: 1.125rem;
  flex-shrink: 0;
  opacity: 0.9;
}

.lead {
  margin: 0 0 1.75rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.links {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

@media (min-width: 480px) {
  .links {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .links a {
    flex: 1 1 calc(50% - 0.4375rem);
    min-width: 10rem;
  }
}

.links a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  padding: 1rem 1.25rem;
  border-radius: 12px;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  color: var(--link-fg);
  transition:
    transform 0.15s ease,
    background 0.15s ease,
    box-shadow 0.15s ease;
  min-height: 3.25rem;
  -webkit-tap-highlight-color: transparent;
}

.links a:active {
  transform: scale(0.98);
}

.links a:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 3px;
}

.links a.linkedin {
  background: var(--linkedin);
  box-shadow: 0 4px 14px rgba(10, 102, 194, 0.35);
}

.links a.linkedin:hover {
  background: var(--linkedin-hover);
  box-shadow: 0 6px 20px rgba(10, 102, 194, 0.4);
}

.links a.bluesky {
  background: var(--bluesky);
  box-shadow: 0 4px 14px rgba(17, 133, 254, 0.35);
}

.links a.bluesky:hover {
  background: var(--bluesky-hover);
  box-shadow: 0 6px 20px rgba(17, 133, 254, 0.4);
}

.links a.instagram {
  background: linear-gradient(
    135deg,
    #f58529 0%,
    #dd2a7b 45%,
    #8134af 75%,
    #515bd4 100%
  );
  box-shadow: 0 4px 14px rgba(221, 42, 123, 0.35);
}

.links a.instagram:hover {
  filter: brightness(1.08);
  box-shadow: 0 6px 22px rgba(221, 42, 123, 0.45);
}

.links a.email {
  background: var(--email);
  box-shadow: 0 4px 14px rgba(51, 65, 85, 0.3);
}

.links a.email:hover {
  background: var(--email-hover);
  box-shadow: 0 6px 20px rgba(51, 65, 85, 0.38);
}

html[data-theme="dark"] .links a.email {
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

html[data-theme="dark"] .links a.email:hover {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
}

.links a svg {
  flex-shrink: 0;
  width: 1.35rem;
  height: 1.35rem;
}

.theme-toggle {
  position: fixed;
  top: clamp(0.75rem, 3vw, 1.25rem);
  right: clamp(0.75rem, 3vw, 1.25rem);
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 1px solid var(--surface-border);
  border-radius: 12px;
  background: var(--toggle-bg);
  color: var(--toggle-fg);
  cursor: pointer;
  transition:
    background 0.15s ease,
    transform 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.theme-toggle:hover {
  background: var(--toggle-bg-hover);
}

.theme-toggle:active {
  transform: scale(0.96);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 3px;
}

.theme-toggle svg {
  width: 1.35rem;
  height: 1.35rem;
}

.theme-toggle .icon-sun,
.theme-toggle .icon-moon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

html[data-theme="light"] .theme-toggle .icon-sun {
  display: none;
}

html[data-theme="light"] .theme-toggle .icon-moon {
  display: block;
}

html[data-theme="dark"] .theme-toggle .icon-sun {
  display: block;
}

html[data-theme="dark"] .theme-toggle .icon-moon {
  display: none;
}
