/* Geist Mono imported in head via Google Fonts with display=swap */

:root {
  --bg: #f8f7f4;
  --text: #171717;
  --text-muted: #404040;
  --text-subtle: #737373;
  --border: rgba(0, 0, 0, 0.08);
  --link: #171717;
  --content-width: 68ch;
  --bg-columns: 48;
  --bg-row-height: 1.25rem;

  --bg-symbol: rgba(0, 0, 0, 0.045);
  --bg-symbol-active: rgba(10, 10, 10, 0.95);
  --bg-symbol-glow: 0 0 5px rgba(0, 0, 0, 0.6), 0 0 12px rgba(0, 0, 0, 0.35);

  --banner-bg: #ffffff;
  --banner-filter: none;
  --card-bg: rgba(255, 255, 255, 0.5);
  --card-hover-bg: #171717;
  --card-hover-text: #ffffff;
}

[data-theme="dark"] {
  --bg: #0d0e11;
  --text: #ededed;
  --text-muted: #cccccc;
  --text-subtle: #8e8e93;
  --border: rgba(255, 255, 255, 0.12);
  --link: #ffffff;

  --bg-symbol: rgba(255, 255, 255, 0.06);
  --bg-symbol-active: #ffffff;
  --bg-symbol-glow: 0 0 8px rgba(255, 255, 255, 0.85), 0 0 18px rgba(255, 255, 255, 0.5);

  --banner-bg: #18191e;
  --banner-filter: invert(0.92) hue-rotate(180deg);
  --card-bg: rgba(255, 255, 255, 0.06);
  --card-hover-bg: #ffffff;
  --card-hover-text: #0d0e11;
}

::selection {
  color: var(--bg);
  background: var(--text);
}

::-moz-selection {
  color: var(--bg);
  background: var(--text);
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light dark;
}

body {
  margin: 0;
  position: relative;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family:
    "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
  font-size: 15px;
  line-height: 1.6;
  letter-spacing: -0.015em;
  /* Instant fast mode transition */
  transition: background-color 0.05s linear, color 0.05s linear;
}

/* Fixed Dark Mode Toggle at Top Right */
.theme-toggle-btn {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 100;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--card-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--text);
  cursor: pointer;
  outline: none;
  transition: background-color 0.05s linear, color 0.05s linear, border-color 0.05s linear, transform 0.1s ease;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

.theme-toggle-btn:hover {
  transform: scale(1.08);
  border-color: var(--text);
}

.theme-toggle-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.1s ease;
}

/* Icon visibility based on theme */
.sun-icon {
  display: none;
}

.moon-icon {
  display: block;
}

[data-theme="dark"] .sun-icon {
  display: block;
}

[data-theme="dark"] .moon-icon {
  display: none;
}

.theme-toggle-btn .tooltip {
  position: absolute;
  top: 100%;
  right: 0;
  transform: translateY(6px);
  padding: 0.25rem 0.55rem;
  border-radius: 6px;
  background: var(--text);
  color: var(--bg);
  font-size: 0.72rem;
  font-weight: 500;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.1s ease, transform 0.1s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.theme-toggle-btn:hover .tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateY(10px);
}

/* Background Glowing Symbols Grid */
.background-symbols {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: grid;
  grid-template-columns: repeat(var(--bg-columns), 1fr);
  grid-auto-rows: var(--bg-row-height);
  align-content: stretch;
  padding: 0.5rem;
  overflow: hidden;
  user-select: none;
  pointer-events: none;
  contain: strict;
}

.background-symbols span {
  display: block;
  color: var(--bg-symbol);
  font-size: 0.62rem;
  line-height: var(--bg-row-height);
  text-align: center;
  transition: color 0.15s ease, text-shadow 0.15s ease, transform 0.2s ease;
}

.background-symbols span.is-active {
  color: var(--bg-symbol-active);
  text-shadow: var(--bg-symbol-glow);
  transform: scale(1.4);
  transition-duration: 0s;
}

/* Main Layout Container */
.page {
  position: relative;
  z-index: 1;
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 2.5rem 1.5rem 5rem;
}

/* Profile Header & LinkedIn/X Banner */
.profile-header {
  margin-bottom: 2.8rem;
}

.profile-banner-container {
  width: 100%;
  height: 140px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--banner-bg);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
  transition: background-color 0.05s linear, border-color 0.05s linear;
}

.profile-banner {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  filter: var(--banner-filter);
  transition: filter 0.05s linear;
}

.profile-info-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 0 0.8rem;
  margin-top: -38px;
  margin-bottom: 1.2rem;
}

.profile-avatar-wrapper {
  position: relative;
  z-index: 2;
}

.profile-avatar {
  width: 76px;
  height: 76px;
  border-radius: 20px;
  object-fit: cover;
  border: 3px solid var(--bg);
  background: var(--banner-bg);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
  display: block;
  transition: border-color 0.05s linear;
}

.profile-meta {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.profile-title-row {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.profile-name {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  font-size: 1.22rem;
  font-weight: 600;
  letter-spacing: -0.04em;
  color: var(--text);
}

.verified-badge {
  width: 19px;
  height: 19px;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
  transition: transform 0.15s ease, filter 0.15s ease;
  filter: drop-shadow(0 1px 3px rgba(245, 158, 11, 0.35));
}

.profile-name:hover .verified-badge {
  transform: scale(1.15) rotate(6deg);
  filter: drop-shadow(0 0 7px rgba(251, 191, 36, 0.65));
}

.hero__location {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-subtle);
  letter-spacing: -0.02em;
}

.profile-role {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Social Links Bar & Tooltips */
.social-links {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.social-icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--text);
  text-decoration: none;
  transition: background-color 0.05s linear, color 0.05s linear, border-color 0.05s linear, transform 0.1s ease;
}

.social-icon:hover {
  background: var(--card-hover-bg);
  color: var(--card-hover-text);
  border-color: var(--card-hover-bg);
  transform: translateY(-1px);
}

.social-icon svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.social-icon .tooltip {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-6px);
  padding: 0.25rem 0.55rem;
  border-radius: 6px;
  background: var(--text);
  color: var(--bg);
  font-size: 0.72rem;
  font-weight: 500;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.1s ease, transform 0.1s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 10;
}

.social-icon .tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 4px;
  border-style: solid;
  border-color: var(--text) transparent transparent transparent;
}

.social-icon:hover .tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(-10px);
}

/* Content Sections */
.section {
  margin-bottom: 2.8rem;
}

.section h2 {
  margin: 0 0 0.8rem;
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.035em;
  text-transform: lowercase;
}

.section p {
  margin: 0 0 0.8rem;
  font-size: 0.92rem;
  line-height: 1.62;
  color: var(--text-muted);
}

.about-section p.about-text {
  color: var(--text-muted);
  font-weight: 400;
  font-size: 0.92rem;
  line-height: 1.68;
}

.section p:last-child {
  margin-bottom: 0;
}

/* Stack and project items */
.stack {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.stack-item {
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--text-muted);
}

.stack-item strong {
  color: var(--text);
  font-weight: 600;
}

/* Project Cards / List */
.project-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.project-card {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.project-title {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.93rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  width: fit-content;
  transition: color 0.1s ease;
}

.project-title:hover {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.project-title svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  stroke-width: 2;
  transition: transform 0.15s ease;
}

.project-title:hover svg {
  transform: translate(2px, -2px);
}

.project-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
}

/* General Links */
a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-color: var(--border);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.1s ease, color 0.1s ease;
}

a:hover {
  color: var(--text);
  text-decoration-color: var(--text);
}

/* Responsiveness */
@media (max-width: 580px) {
  .page {
    padding: 1.5rem 1rem 3.5rem;
  }

  .theme-toggle-btn {
    top: 1rem;
    right: 1rem;
    width: 34px;
    height: 34px;
  }

  .profile-banner-container {
    height: 110px;
    border-radius: 12px;
  }

  .profile-avatar {
    width: 66px;
    height: 66px;
    border-radius: 16px;
  }

  .profile-info-row {
    margin-top: -33px;
  }

  .profile-name {
    font-size: 1.1rem;
  }

  .section h2 {
    font-size: 0.96rem;
  }

  .section p,
  .about-section p.about-text,
  .stack-item,
  .project-desc {
    font-size: 0.85rem;
  }
}