/* ===== Variables ===== */
:root {
  --bg:           #0d1117;
  --surface:      #161b22;
  --text:         #e6edf3;
  --text-muted:   #8b949e;
  --accent:       #00b4d8;
  --border:       #30363d;
  --font-sans:    'Inter', system-ui, -apple-system, sans-serif;
  --font-mono:    'JetBrains Mono', 'Courier New', monospace;
  --max-width:    680px;
  --dot:          rgba(255, 255, 255, 0.045);
  --glow:         rgba(0, 180, 216, 0.07);
}

[data-theme="light"] {
  --bg:           #ffffff;
  --surface:      #f6f8fa;
  --text:         #1a1a2e;
  --text-muted:   #57606a;
  --accent:       #0284c7;
  --border:       #d0d7de;
  --dot:          rgba(0, 0, 0, 0.05);
  --glow:         rgba(2, 132, 199, 0.04);
}

/* ===== Reset ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 75% 40% at 50% 0%, var(--glow) 0%, transparent 100%),
    radial-gradient(var(--dot) 1px, transparent 1px);
  background-size: auto, 20px 20px;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.7;
  padding: 2rem 1.25rem;
  transition: background 0.2s, color 0.2s;
}

/* ===== Layout ===== */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
}

/* ===== Corner brackets ===== */
body::before,
body::after {
  content: '';
  position: fixed;
  width: 18px;
  height: 18px;
  pointer-events: none;
  z-index: 50;
  opacity: 0.22;
  border-color: var(--accent);
  border-style: solid;
}

body::before {
  top: 1.25rem;
  left: 1.25rem;
  border-width: 1.5px 0 0 1.5px;
}

body::after {
  bottom: 1.25rem;
  right: 1.25rem;
  border-width: 0 1.5px 1.5px 0;
}

/* ===== Theme toggle ===== */
#theme-toggle {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0.4rem 0.6rem;
  transition: border-color 0.2s;
  z-index: 100;
}

#theme-toggle:hover {
  border-color: var(--accent);
}

/* ===== Hero ===== */
.hero {
  padding: 4rem 0 3rem;
}

.hero-inner {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

.avatar {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s;
}

.avatar:hover {
  border-color: var(--accent);
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* placeholder silhouette when no image */
.avatar::after {
  content: '';
  display: block;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--border);
  box-shadow: 0 18px 0 12px var(--border);
}

.avatar img ~ * { display: none; }

.hero h1 {
  font-size: 2.25rem;
  font-weight: 600;
  letter-spacing: -0.5px;
  margin-bottom: 0.3rem;
}

.alias {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 0.95rem;
  margin-bottom: 0.4rem;
  text-shadow: 0 0 18px rgba(0, 180, 216, 0.4);
}

[data-theme="light"] .alias {
  text-shadow: none;
}

.alias::after {
  content: '_';
  animation: blink 1.2s step-end infinite;
  margin-left: 1px;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

.tagline {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ===== Sections ===== */
section {
  padding: 2.25rem 0;
  border-top: 1px solid var(--border);
}

h2 {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

h2::before {
  content: '// ';
  color: var(--accent);
  font-family: var(--font-mono);
  opacity: 0.6;
  text-transform: none;
  letter-spacing: 0;
}

p {
  margin-bottom: 0.75rem;
}

p:last-child {
  margin-bottom: 0;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ===== Timeline (education) ===== */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.entry {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
}

.year {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  min-width: 105px;
  padding-top: 0.15rem;
}

.entry strong {
  display: block;
  font-size: 0.95rem;
}

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

/* ===== List (achievements) ===== */
ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

ul li {
  display: flex;
  gap: 0.75rem;
  font-size: 0.95rem;
}

ul li::before {
  content: '\2014';
  color: var(--accent);
  flex-shrink: 0;
}

/* ===== Cards (work) ===== */
.cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.875rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: block;
  padding: 1.25rem;
  text-decoration: none;
  transition: border-color 0.2s;
}

.card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 0 20px rgba(0, 180, 216, 0.08);
  text-decoration: none;
}

.card h3 {
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.card p {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin: 0;
}

/* ===== Tags (interests) ===== */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tags li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 0.25rem 0.65rem;
  color: var(--text-muted);
}

.tags li::before {
  content: none;
}

/* ===== Contact form ===== */
form {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  max-width: 460px;
}

label {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: -0.2rem;
}

input,
textarea {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  padding: 0.55rem 0.75rem;
  width: 100%;
  transition: border-color 0.2s;
}

input:focus,
textarea:focus {
  border-color: var(--accent);
  outline: none;
}

textarea {
  min-height: 120px;
  resize: vertical;
}

form button {
  align-self: flex-start;
  background: var(--accent);
  border: none;
  border-radius: 6px;
  color: #fff;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.55rem 1.25rem;
  transition: opacity 0.2s;
}

form button:hover {
  opacity: 0.85;
}

.contact-alt {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-top: 1rem;
}

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

.social {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
}

.social a {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.social a:hover {
  color: var(--accent);
  text-decoration: none;
}

/* ===== Scroll fade-in ===== */
.fade-in {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== Responsive ===== */
@media (max-width: 540px) {
  .hero-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.25rem;
  }

  .hero h1 {
    font-size: 1.75rem;
  }

  .cards {
    grid-template-columns: 1fr;
  }

  .entry {
    flex-direction: column;
    gap: 0.2rem;
  }

  .year {
    min-width: unset;
  }
}
