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

:root {
  --accent: #4ea1ff;
  --bg: #0f141c;
  --card-bg: #171e28;
  --text: #e6edf3;
  --muted: #9aa7b8;
  --border: #2a3442;
  --radius: 8px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

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

a:hover {
  text-decoration: underline;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ── Header ───────────────────────────────────────────────── */
header {
  background: var(--accent);
  color: #fff;
  padding: 3rem 0 2rem;
  text-align: center;
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
}

.header-photo {
  width: 160px;
  height: 160px;
  object-fit: cover;
  object-position: center 22%;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, .55);
  box-shadow: 0 10px 24px rgba(0, 0, 0, .25);
}

header h1 {
  font-size: 2.5rem;
  font-weight: 700;
}

header .tagline {
  margin: .4rem 0 1.5rem;
  opacity: .9;
  font-size: 1.1rem;
}

header nav {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

header nav a {
  color: #fff;
  font-weight: 500;
  padding: .25rem .5rem;
  border-radius: var(--radius);
  transition: background .2s;
}

header nav a:hover {
  background: rgba(255, 255, 255, .14);
  text-decoration: none;
}

@media (max-width: 640px) {
  .header-content {
    flex-direction: column;
  }

  .header-photo {
    width: 120px;
    height: 120px;
  }
}

/* ── Sections ─────────────────────────────────────────────── */
main {
  padding: 3rem 0;
}

section {
  margin-bottom: 3rem;
}

section h2 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 1rem;
  padding-bottom: .5rem;
  border-bottom: 3px solid var(--accent);
  display: inline-block;
}

section p {
  margin-bottom: .75rem;
}

.section-note {
  color: var(--muted);
  font-size: .95rem;
  margin-bottom: 1.25rem;
}

/* ── About ───────────────────────────────────────────────── */
.about-content {
  display: flex;
  align-items: flex-start;
  gap: 2rem;
  flex-wrap: wrap;
}

.about-photo {
  width: 280px;
  height: 340px;
  object-fit: cover;
  object-position: center top;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
  flex-shrink: 0;
}

.about-text {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  flex: 1;
}

.about-family {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .75rem;
}

.about-family-photo {
  width: 90px;
  height: 110px;
  object-fit: cover;
  object-position: center top;
  border-radius: var(--radius);
  flex-shrink: 0;
}

.about-caption {
  color: var(--muted);
  font-style: italic;
  font-size: .9rem;
  line-height: 1.5;
}

@media (max-width: 640px) {
  .about-photo {
    width: 100%;
    height: 280px;
  }

  .about-family-photo {
    width: 70px;
    height: 86px;
  }
}

/* ── Resume ───────────────────────────────────────────────── */
.resume-block {
  margin-bottom: 2rem;
}

.resume-block h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: .75rem;
  color: var(--accent);
}

.skills {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  list-style: none;
}

.skills li {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: .3rem .9rem;
  font-size: .9rem;
}

.resume-entry {
  margin-bottom: 1rem;
}

.resume-entry-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: .3rem;
}

.resume-entry .role {
  font-weight: 600;
}

.resume-entry .period {
  color: var(--muted);
  font-size: .9rem;
}

/* ── Repo Grid ────────────────────────────────────────────── */
.repo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}

.repo-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  transition: box-shadow .2s, transform .2s;
}

.repo-card:hover {
  box-shadow: 0 10px 24px rgba(0, 0, 0, .35);
  transform: translateY(-2px);
}

.repo-card h3 {
  font-size: 1rem;
  font-weight: 600;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.repo-card h3 a {
  color: var(--accent);
  overflow-wrap: anywhere;
}

.repo-card .description {
  font-size: .9rem;
  color: var(--muted);
  flex: 1;
}

.repo-meta {
  display: flex;
  gap: 1rem;
  font-size: .8rem;
  color: var(--muted);
}

.repo-meta span {
  display: flex;
  align-items: center;
  gap: .3rem;
}

.language-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  background: var(--accent);
}

.loading {
  color: var(--muted);
}

.space-embed {
  margin-top: 1.75rem;
  width: min(1200px, calc(100vw - 2rem));
  margin-left: 50%;
  transform: translateX(-50%);
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
}

.space-embed-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: .5rem;
  flex-wrap: wrap;
}

.space-embed-header h3 {
  margin: 0;
  font-size: 1.05rem;
}

.space-embed iframe {
  width: 100%;
  height: 78vh;
  min-height: 820px;
  max-height: 1200px;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 2px);
  background: #fff;
}

@media (max-width: 640px) {
  .space-embed {
    width: 100%;
    margin-left: 0;
    transform: none;
  }

  .space-embed iframe {
    height: 74vh;
    min-height: 700px;
    max-height: none;
  }
}

/* ── Footer ───────────────────────────────────────────────── */
footer {
  background: var(--card-bg);
  border-top: 1px solid var(--border);
  padding: 1.5rem 0;
  text-align: center;
  color: var(--muted);
  font-size: .9rem;
}