/* ==========================================================================
   Tokens
   ========================================================================== */
:root {
  /* Monochrome palette — everything derived from the required background */
  --bg:          hsl(0, 0%, 15%);
  --bg-raised:   hsl(0, 0%, 18%);
  --bg-card:     hsl(0, 0%, 20%);
  --border:      hsl(0, 0%, 32%);
  --border-soft: hsl(0, 0%, 24%);

  --text-primary:   hsl(0, 0%, 96%);
  --text-secondary: hsl(0, 0%, 70%);
  --text-muted:     hsl(0, 0%, 48%);
  --accent:         hsl(0, 0%, 100%);
  --success:        hsl(0, 0%, 85%);

  --font-mono: 'JetBrains Mono', 'SFMono-Regular', Consolas, monospace;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  --max-width: 920px;
  --radius: 6px;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--font-body);
  font-weight: 700;
  margin: 0;
  color: var(--text-primary);
}

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

a { color: inherit; text-decoration: none; }

ol, dl, ul { margin: 0; padding: 0; }

section { scroll-margin-top: 90px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ==========================================================================
   Layout helpers
   ========================================================================== */
.section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 88px 24px;
  border-bottom: 1px solid var(--border-soft);
}

.section__label {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-secondary);
  margin: 0 0 32px;
}

/* ==========================================================================
   Nav
   ========================================================================== */
.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: hsla(0, 0%, 15%, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-soft);
}

.nav__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.nav__logo {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-primary);
  flex-shrink: 0;
}

.nav__links {
  display: flex;
  gap: 28px;
  overflow-x: auto;
  font-size: 0.9rem;
  color: var(--text-secondary);
  flex-grow: 1;
  justify-content: center;
}

.nav__links a { white-space: nowrap; transition: color 0.15s ease; }

.nav__links a:hover,
.nav__links a:focus-visible { color: var(--text-primary); }

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  padding: 100px 24px 88px;
  border-bottom: 1px solid var(--border-soft);
}

.hero__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 48px;
}

.hero__text { min-width: 0; }

.hero__photo {
  width: 260px;
  height: 260px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--border);
  flex-shrink: 0;
  background: var(--bg-raised);
  justify-self: end;
}

.hero__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  display: block;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin: 0 0 12px;
}

.hero__name {
  font-size: clamp(2.4rem, 5.5vw, 3.6rem);
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin-bottom: 20px;
}

.hero__tagline {
  max-width: 56ch;
  color: var(--text-secondary);
  font-size: 1.1rem;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-top: 24px;
  padding: 8px 16px;
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 3px hsla(0, 0%, 85%, 0.15);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 36px;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  font-weight: 600;
  font-size: 0.92rem;
  padding: 13px 22px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

.btn--small {
  padding: 9px 16px;
  font-size: 0.85rem;
}

.btn--primary {
  background: var(--text-primary);
  color: var(--bg);
  border-color: var(--text-primary);
}

.btn--primary:hover,
.btn--primary:focus-visible {
  background: var(--text-secondary);
  border-color: var(--text-secondary);
}

.btn--ghost {
  color: var(--text-primary);
  background: transparent;
}

.btn--ghost:hover,
.btn--ghost:focus-visible {
  border-color: var(--text-primary);
  background: var(--bg-raised);
}

.btn:active { transform: translateY(1px); }

/* ==========================================================================
   About
   ========================================================================== */
.about__grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 56px;
}

.about__text {
  color: var(--text-secondary);
  font-size: 1.03rem;
}

.meta-list__row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-soft);
  font-size: 0.92rem;
}

.meta-list__row:last-child { border-bottom: none; }

.meta-list dt { color: var(--text-muted); }
.meta-list dd { margin: 0; color: var(--text-primary); font-weight: 500; text-align: right; }

.inline-link {
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--border);
  transition: border-color 0.15s ease;
}

.inline-link:hover,
.inline-link:focus-visible { border-color: var(--text-primary); }

/* ==========================================================================
   Education / Timeline
   ========================================================================== */
.timeline {
  list-style: none;
  position: relative;
  padding-left: 28px;
  border-left: 1px solid var(--border-soft);
}

.timeline__item { position: relative; padding-bottom: 40px; }
.timeline__item:last-child { padding-bottom: 0; }

.timeline__marker {
  position: absolute;
  left: -33px;
  top: 6px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--text-primary);
}

.timeline__top {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 16px;
  margin-bottom: 6px;
}

.timeline__top h3 { font-size: 1.1rem; }

.timeline__date {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.timeline__place {
  color: var(--text-secondary);
  font-weight: 500;
  margin-bottom: 8px;
}

.timeline__desc {
  color: var(--text-secondary);
  font-size: 0.95rem;
  max-width: 62ch;
}

/* ==========================================================================
   Skills
   ========================================================================== */
.skills__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 36px;
}

.skill-group__title {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.tag-list { display: flex; flex-wrap: wrap; gap: 10px; }

.tag {
  font-size: 0.85rem;
  font-weight: 500;
  padding: 7px 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  background: var(--bg-raised);
}

.tag--muted {
  color: var(--text-muted);
  border-style: dashed;
  background: transparent;
}

/* ==========================================================================
   Projects
   ========================================================================== */
.projects__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
}

.project-card {
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 28px;
  background: var(--bg-raised);
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.project-card:hover { border-color: var(--border); transform: translateY(-2px); }

.project-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.project-card__head h3 { font-size: 1.05rem; line-height: 1.3; }

.project-card__lang {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  border: 1px solid var(--border-soft);
  padding: 4px 9px;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
}

.project-card__desc { color: var(--text-secondary); font-size: 0.94rem; }

.project-card__points {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-grow: 1;
}

.project-card__points li {
  position: relative;
  padding-left: 16px;
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.project-card__points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--text-muted);
}

.project-card__links {
  display: flex;
  gap: 18px;
  padding-top: 4px;
  border-top: 1px solid var(--border-soft);
  margin-top: 4px;
  padding-top: 14px;
}

/* ==========================================================================
   Contact
   ========================================================================== */
.section--contact { border-bottom: none; }

.contact__heading {
  font-size: clamp(1.7rem, 4vw, 2.3rem);
  margin-bottom: 16px;
}

.contact__text {
  color: var(--text-secondary);
  max-width: 52ch;
  margin-bottom: 32px;
}

.contact__links { display: flex; flex-wrap: wrap; gap: 14px; }

/* ==========================================================================
   Footer
   ========================================================================== */
.footer {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 32px 24px 64px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 720px) {
  .about__grid { grid-template-columns: 1fr; }
  .skills__grid { grid-template-columns: 1fr; }
  .nav__links { gap: 16px; font-size: 0.82rem; justify-content: flex-start; }
  .nav__inner { flex-wrap: nowrap; }
  .section { padding: 64px 20px; }
  .hero { padding: 80px 20px 64px; }

  .hero__inner {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
    gap: 28px;
  }

  .hero__photo {
    order: -1;
    justify-self: center;
    width: 200px;
    height: 200px;
  }

  .hero__actions { justify-content: center; }
  .status-badge { justify-self: center; }
}
