:root {
  color-scheme: light;
  --page: #f3f6fb;
  --page-deep: #e9eef7;
  --panel: rgba(255, 255, 255, 0.78);
  --panel-border: rgba(15, 23, 42, 0.08);
  --card: rgba(255, 255, 255, 0.72);
  --card-hover: rgba(255, 255, 255, 0.96);
  --text: #101828;
  --muted: #64748b;
  --quiet: #94a3b8;
  --accent: #635bff;
  --accent-two: #14b8a6;
  --focus: rgba(99, 91, 255, 0.4);
  --panel-shadow: 0 28px 80px rgba(35, 49, 79, 0.15);
  --card-shadow: 0 10px 28px rgba(35, 49, 79, 0.07);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #080b14;
  --page-deep: #0c1120;
  --panel: rgba(15, 21, 36, 0.8);
  --panel-border: rgba(255, 255, 255, 0.085);
  --card: rgba(255, 255, 255, 0.045);
  --card-hover: rgba(255, 255, 255, 0.085);
  --text: #f8fafc;
  --muted: #a6b0c3;
  --quiet: #778197;
  --accent: #8b83ff;
  --accent-two: #2dd4bf;
  --focus: rgba(139, 131, 255, 0.55);
  --panel-shadow: 0 30px 90px rgba(0, 0, 0, 0.46);
  --card-shadow: 0 12px 32px rgba(0, 0, 0, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--page);
}

body {
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  background:
    radial-gradient(circle at 50% -20%, color-mix(in srgb, var(--accent) 15%, transparent), transparent 42rem),
    linear-gradient(145deg, var(--page), var(--page-deep));
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
}

.ambient {
  position: fixed;
  z-index: 0;
  width: 34rem;
  height: 34rem;
  border-radius: 50%;
  opacity: 0.42;
  filter: blur(100px);
  pointer-events: none;
}

.ambient-one {
  top: -13rem;
  left: -11rem;
  background: var(--accent);
}

.ambient-two {
  right: -14rem;
  bottom: -15rem;
  background: var(--accent-two);
}

.grid-overlay {
  position: fixed;
  inset: 0;
  z-index: 0;
  opacity: 0.23;
  background-image:
    linear-gradient(var(--panel-border) 1px, transparent 1px),
    linear-gradient(90deg, var(--panel-border) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, black, transparent 75%);
  pointer-events: none;
}

.page-shell {
  position: relative;
  z-index: 1;
  display: grid;
  min-height: 100vh;
  min-height: 100svh;
  place-items: center;
  padding: 42px 18px;
}

.profile-card {
  width: min(100%, 600px);
  padding: 32px;
  border: 1px solid var(--panel-border);
  border-radius: 32px;
  background: var(--panel);
  box-shadow: var(--panel-shadow);
  backdrop-filter: blur(24px) saturate(145%);
  -webkit-backdrop-filter: blur(24px) saturate(145%);
}

.profile-header {
  padding: 2px 4px 28px;
}

.identity-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 26px;
}

.avatar {
  position: relative;
  width: 76px;
  height: 76px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 24px;
  background: var(--card);
  box-shadow:
    0 18px 32px color-mix(in srgb, var(--accent) 28%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.avatar::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: inherit;
  box-shadow: inset 0 0 18px rgba(15, 23, 42, 0.08);
  pointer-events: none;
}

.avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.42);
  transform-origin: 50% 28%;
}

.theme-toggle {
  display: grid;
  width: 46px;
  height: 46px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--panel-border);
  border-radius: 15px;
  color: var(--muted);
  background: var(--card);
  box-shadow: var(--card-shadow);
  cursor: pointer;
  transition: color 180ms ease, background 180ms ease, transform 180ms ease;
}

.theme-toggle:hover {
  color: var(--text);
  background: var(--card-hover);
  transform: translateY(-2px);
}

.theme-toggle:focus-visible,
.link-card:focus-visible,
.profile-footer a:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.theme-toggle svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.moon-icon {
  display: none;
}

:root[data-theme="dark"] .sun-icon {
  display: none;
}

:root[data-theme="dark"] .moon-icon {
  display: block;
}

.eyebrow {
  display: flex;
  gap: 9px;
  align-items: center;
  margin-bottom: 11px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 720;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.eyebrow span {
  width: 24px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-two));
}

h1 {
  margin: 0;
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  font-size: clamp(2.1rem, 7vw, 3.2rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.035em;
}

.tagline {
  max-width: 450px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: clamp(0.98rem, 2.4vw, 1.08rem);
  line-height: 1.65;
}

.education {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 14px;
  color: var(--quiet);
}

.education svg {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.education p {
  min-width: 0;
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.link-list {
  display: grid;
  gap: 12px;
}

.link-card {
  --brand: var(--accent);
  position: relative;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 38px;
  gap: 15px;
  align-items: center;
  min-height: 82px;
  padding: 14px 15px;
  overflow: hidden;
  border: 1px solid var(--panel-border);
  border-radius: 20px;
  color: inherit;
  background: var(--card);
  box-shadow: var(--card-shadow);
  text-decoration: none;
  isolation: isolate;
  transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.link-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0;
  background: linear-gradient(105deg, color-mix(in srgb, var(--brand) 10%, transparent), transparent 52%);
  transition: opacity 180ms ease;
}

.link-card:hover {
  border-color: color-mix(in srgb, var(--brand) 30%, var(--panel-border));
  background: var(--card-hover);
  box-shadow: 0 16px 38px color-mix(in srgb, var(--brand) 11%, transparent);
  transform: translateY(-3px);
}

.link-card:hover::before {
  opacity: 1;
}

.link-card.linkedin { --brand: #0a66c2; }
.link-card.research { --brand: #7c3aed; }
.link-card.git { --brand: #14b8a6; }
.link-card.resume { --brand: #f59e0b; }

.icon-wrap {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--brand) 18%, var(--panel-border));
  border-radius: 16px;
  color: var(--brand);
  background: color-mix(in srgb, var(--brand) 10%, transparent);
  transition: color 180ms ease, background 180ms ease, transform 180ms ease;
}

.link-card:hover .icon-wrap {
  color: #fff;
  background: var(--brand);
  transform: scale(1.04) rotate(-2deg);
}

.icon-wrap svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.linkedin .icon-wrap svg {
  fill: currentColor;
  stroke: none;
}

.link-copy {
  min-width: 0;
}

.link-title,
.link-url {
  display: block;
}

.link-title {
  margin-bottom: 5px;
  font-size: 1rem;
  font-weight: 720;
  letter-spacing: -0.018em;
}

.link-url {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.8rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.open-icon {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 12px;
  color: var(--quiet);
  transition: color 180ms ease, background 180ms ease, transform 180ms ease;
}

.open-icon svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.link-card:hover .open-icon {
  color: var(--brand);
  background: color-mix(in srgb, var(--brand) 9%, transparent);
  transform: translate(2px, -2px);
}

.profile-footer {
  display: flex;
  gap: 9px;
  align-items: center;
  justify-content: center;
  margin-top: 24px;
  color: var(--quiet);
  font-size: 0.78rem;
}

.profile-footer a {
  border-radius: 4px;
  color: var(--muted);
  text-decoration: none;
  transition: color 160ms ease;
}

.profile-footer a:hover {
  color: var(--text);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #080b14;
    --page-deep: #0c1120;
    --panel: rgba(15, 21, 36, 0.8);
    --panel-border: rgba(255, 255, 255, 0.085);
    --card: rgba(255, 255, 255, 0.045);
    --card-hover: rgba(255, 255, 255, 0.085);
    --text: #f8fafc;
    --muted: #a6b0c3;
    --quiet: #778197;
    --accent: #8b83ff;
    --accent-two: #2dd4bf;
    --focus: rgba(139, 131, 255, 0.55);
    --panel-shadow: 0 30px 90px rgba(0, 0, 0, 0.46);
    --card-shadow: 0 12px 32px rgba(0, 0, 0, 0.14);
  }

  :root:not([data-theme="light"]) .sun-icon {
    display: none;
  }

  :root:not([data-theme="light"]) .moon-icon {
    display: block;
  }
}

@media (max-width: 620px) {
  .page-shell {
    place-items: start center;
    padding: 10px 12px 14px;
  }

  .profile-card {
    padding: 25px 18px 22px;
    border-radius: 26px;
  }

  .profile-header {
    padding: 0 3px 20px;
  }

  .identity-row {
    margin-bottom: 18px;
  }

  .profile-footer {
    margin-top: 18px;
  }
}

@media (max-width: 420px) {
  .avatar {
    width: 68px;
    height: 68px;
    border-radius: 21px;
  }

  .link-card {
    grid-template-columns: 47px minmax(0, 1fr) 32px;
    gap: 12px;
    min-height: 76px;
    padding: 12px;
    border-radius: 18px;
  }

  .icon-wrap {
    width: 47px;
    height: 47px;
    border-radius: 14px;
  }

  .open-icon {
    width: 32px;
    height: 32px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
