/* ===== Variables ===== */
:root {
  --bg: #ffffff;
  --bg-secondary: #f8fafc;
  --text: #1e293b;
  --text-muted: #64748b;
  --accent: #89cff0;
  --accent-hover: #6bb8e8;
  --accent-muted: #e0f4fc;
  --border: #e2e8f0;
  --card-bg: #ffffff;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] {
  --bg: #0f172a;
  --bg-secondary: #1e293b;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --accent: #7dd3fc;
  --accent-hover: #38bdf8;
  --accent-muted: #0c4a6e;
  --border: #334155;
  --card-bg: #1e293b;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  --shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* ===== Navigation Bar ===== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 2px solid var(--border);
  padding: 0 1.5rem;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.navbar-inner {
  max-width: 48rem;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 3.5rem;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  padding: 0.5rem 0.75rem;
  text-decoration: none;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.9rem;
  border-radius: 0.5rem;
  transition: color 0.2s, background-color 0.2s;
}

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

.nav-links a.active {
  color: var(--accent);
  position: relative;
}

.nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0.75rem;
  right: 0.75rem;
  height: 2px;
  background: var(--accent);
  border-radius: 1px;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ===== Theme Toggle ===== */
.theme-toggle {
  position: relative;
  top: auto;
  right: auto;
}

#theme-btn {
  width: 2.75rem;
  height: 2.75rem;
  border: 2px solid var(--border);
  border-radius: 50%;
  background: var(--card-bg);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  transition: border-color 0.2s, transform 0.2s;
  box-shadow: var(--shadow);
}

#theme-btn:hover {
  border-color: var(--accent);
  transform: scale(1.05);
}

#theme-btn .icon-moon {
  display: none;
}

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

[data-theme="dark"] #theme-btn .icon-moon {
  display: inline;
}

/* ===== Layout ===== */
main {
  max-width: 42rem;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 3rem;
}

.page-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 1.5rem;
  letter-spacing: -0.02em;
}

/* ===== Hero ===== */
.hero {
  text-align: center;
  margin-bottom: 3.5rem;
}

.avatar-placeholder {
  width: 5rem;
  height: 5rem;
  margin: 0 auto 1.25rem;
  background: var(--accent-muted);
  border: 2px solid var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
}

.hero h1 {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 700;
  margin: 0 0 0.5rem;
  letter-spacing: -0.02em;
}

.hero .highlight {
  color: var(--accent);
  position: relative;
}

.tagline {
  font-size: 1rem;
  color: var(--text-muted);
  margin: 0 0 1rem;
  font-weight: 500;
}

.bio {
  color: var(--text-muted);
  font-size: 0.95rem;
  max-width: 32ch;
  margin: 0 auto;
}

/* ===== Sections ===== */
.section {
  margin-bottom: 2.5rem;
}

.section h2 {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin: 0 0 1rem;
}

/* ===== Link Grid ===== */
.link-grid {
  display: grid;
  gap: 0.75rem;
}

.link-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: var(--card-bg);
  border: 2px solid var(--border);
  border-radius: 0.75rem;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
  cursor: pointer;
  font: inherit;
  text-align: left;
  width: 100%;
}


.link-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.link-icon {
  width: 2.5rem;
  height: 2.5rem;
  min-width: 2.5rem;
  background: var(--accent-muted);
  color: var(--accent);
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.9rem;
  font-family: 'JetBrains Mono', monospace;
  overflow: hidden;
}

.link-icon img {
  width: 1.5rem;
  height: 1.5rem;
  object-fit: contain;
}

.link-label {
  font-weight: 600;
  flex: 1;
}

.link-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
}

@media (max-width: 480px) {
  .link-desc {
    display: none;
  }
}

/* ===== Project Cards ===== */
.project-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.project-card {
  padding: 1.25rem 1.5rem;
  background: var(--card-bg);
  border: 2px solid var(--border);
  border-radius: 0.75rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.project-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-hover);
}

.project-card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
}

.project-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0 0 0.75rem;
  line-height: 1.5;
}

.project-link {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
}

.project-link:hover {
  color: var(--accent-hover);
}

/* ===== Home Page ===== */
.home-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: 0.75rem;
}

.home-link-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.25rem;
  background: var(--card-bg);
  border: 2px solid var(--border);
  border-radius: 0.75rem;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.home-link-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.home-link-icon {
  font-size: 1.5rem;
}

.home-link-label {
  font-weight: 600;
  font-size: 1rem;
}

.home-link-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.section-more {
  margin: 1rem 0 0;
  font-size: 0.9rem;
}

.section-more a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.section-more a:hover {
  color: var(--accent-hover);
}

.home-connect {
  padding: 1.5rem 0;
  border-top: 1px solid var(--border);
}

.home-social {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.home-social-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.home-social-link:hover {
  color: var(--accent-hover);
}

.home-social-sep {
  color: var(--text-muted);
  font-weight: 300;
}

/* ===== Content Block ===== */
.content-block {
  margin-bottom: 2rem;
}

.content-block p {
  margin: 0 0 1rem;
  color: var(--text);
}

.content-block p:last-child {
  margin-bottom: 0;
}

/* ===== About Page ===== */
.about-intro {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  margin-bottom: 2rem;
}

@media (max-width: 640px) {
  .about-intro {
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
  }
}

.about-photo {
  flex-shrink: 0;
  position: relative;
}

.about-photo img {
  width: 10rem;
  height: 10rem;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid var(--accent);
  display: block;
}

.about-photo-placeholder {
  display: none;
  width: 10rem;
  height: 10rem;
  background: var(--accent-muted);
  border: 3px dashed var(--accent);
  border-radius: 50%;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 2rem;
}

.about-photo-placeholder small {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 500;
}

.about-content {
  flex: 1;
  min-width: 0;
}

.about-greeting {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--accent);
  margin: 0 0 1rem !important;
}

.about-content p {
  margin: 0 0 1rem;
  color: var(--text);
  line-height: 1.7;
}

.about-content p:last-child {
  margin-bottom: 0;
}

/* ===== Footer ===== */
footer {
  text-align: center;
  padding: 2rem 0;
  border-top: 1px solid var(--border);
}

footer p {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0;
}
