:root {
  --bg: #0d1117;
  --bg-alt: #10151c;
  --surface: #161b22;
  --surface-hover: #1c2330;
  --border: #232a34;
  --border-hover: #2f3947;
  --text: #e6edf3;
  --text-muted: #8b949e;
  --accent: #58a6ff;
  --accent-2: #a371f7;
  --accent-soft: rgba(88, 166, 255, 0.12);
  --radius: 10px;
  --max-width: 1080px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --shadow-lift: 0 16px 32px -12px rgba(0, 0, 0, 0.5);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(900px circle at 12% -10%, rgba(88, 166, 255, 0.14), transparent 45%),
    radial-gradient(800px circle at 92% 8%, rgba(163, 113, 247, 0.12), transparent 45%),
    var(--bg);
  background-attachment: fixed;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* Nav */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(13, 17, 23, 0.75);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.nav__brand {
  font-family: var(--font-mono);
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.nav__links {
  display: flex;
  gap: 24px;
}

.nav__links a {
  position: relative;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.15s ease;
}

.nav__links a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: -4px;
  height: 1px;
  background: var(--accent);
  transition: right 0.2s ease;
}

.nav__links a:hover {
  color: var(--text);
}

.nav__links a:hover::after {
  right: 0;
}

.nav__toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.nav__toggle span {
  width: 22px;
  height: 2px;
  background: var(--text);
  display: block;
}

/* Sections */
main {
  counter-reset: section;
}

.section {
  padding: 96px 0;
  position: relative;
}

.section:not(.hero) {
  counter-increment: section;
}

.section--alt {
  background: var(--bg-alt);
}

.section__title {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-size: 1.7rem;
  margin: 0 0 16px;
  font-family: var(--font-mono);
  letter-spacing: -0.01em;
}

.section:not(.hero) .section__title::before {
  content: "0" counter(section);
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 400;
  opacity: 0.7;
}

.section__lead {
  color: var(--text-muted);
  max-width: 640px;
  margin: 0 0 40px;
  font-size: 1.02rem;
}

/* Hero */
.hero {
  padding-top: 160px;
  padding-bottom: 130px;
  overflow: hidden;
}

.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  color: var(--accent);
  margin: 0 0 20px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.8rem;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
}

.hero__eyebrow::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.hero__name {
  font-size: clamp(2.6rem, 6vw, 4.2rem);
  line-height: 1.05;
  margin: 0 0 24px;
  letter-spacing: -0.02em;
  color: var(--text);
  background: linear-gradient(120deg, var(--text) 30%, var(--accent) 75%, var(--accent-2) 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

@supports (-webkit-background-clip: text) or (background-clip: text) {
  .hero__name {
    -webkit-text-fill-color: transparent;
    color: transparent;
  }
}

.hero__statement {
  font-size: 1.2rem;
  color: var(--text-muted);
  max-width: 620px;
  margin: 0 0 36px;
}

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

.accent {
  color: var(--text);
  font-weight: 600;
}

.btn {
  display: inline-block;
  padding: 13px 24px;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.btn--primary {
  background: var(--accent);
  color: #041325;
}

.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px -8px rgba(88, 166, 255, 0.5);
}

.btn--ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn--ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

/* Shared surface card treatment */
.recommendation-card,
.project-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  overflow: hidden;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.recommendation-card::before,
.project-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}

.recommendation-card:hover,
.project-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-hover);
  background: var(--surface-hover);
  box-shadow: var(--shadow-lift);
}

.recommendation-card:hover::before,
.project-card:hover::before {
  transform: scaleX(1);
}

/* Stack categories */
.stack-categories {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-bottom: 20px;
}

.stack-category__label {
  margin: 0 0 10px;
  font-size: 0.95rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stack-category .tag {
  font-size: 0.85rem;
  padding: 8px 16px;
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.stack-category .tag:hover {
  background: var(--accent);
  color: #041325;
  transform: translateY(-2px);
}

.stack-note {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-style: italic;
  margin: 0;
}

/* Recommendations */
.recommendations-carousel {
  display: flex;
  align-items: center;
  gap: 12px;
}

.recommendations-carousel__viewport {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.recommendations-grid {
  display: flex;
  gap: 20px;
  transition: transform 0.45s ease;
}

.recommendations-carousel__arrow {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--accent);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.recommendations-carousel__arrow:hover {
  border-color: var(--border-hover);
  background: var(--surface-hover);
}

.recommendation-card {
  margin: 0;
  flex: 0 0 calc(50% - 10px);
  min-width: 0;
}

@media (max-width: 720px) {
  .recommendation-card {
    flex-basis: 100%;
  }
}

.recommendation-card__quote {
  margin: 0 0 8px;
  color: var(--text);
  font-style: italic;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  overflow: hidden;
}

.recommendation-card__quote.is-expanded {
  -webkit-line-clamp: unset;
  display: block;
  overflow: visible;
}

.recommendation-card__toggle {
  display: inline-block;
  margin: 0 0 16px;
  padding: 0;
  border: none;
  background: none;
  color: var(--accent);
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}

.recommendation-card__toggle:hover {
  text-decoration: underline;
}

.recommendation-card__author {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.recommendation-card__avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

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

/* Projects */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.project-card {
  display: flex;
  flex-direction: column;
}

.project-card__title {
  margin: 0 0 8px;
  font-size: 1.15rem;
}

.project-card__desc {
  color: var(--text-muted);
  font-size: 0.94rem;
  margin: 0 0 16px;
  flex-grow: 1;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.tag {
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 3px 8px;
  border-radius: 999px;
}

.project-card__links {
  display: flex;
  gap: 16px;
}

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

.project-link:hover {
  text-decoration: underline;
}

/* Companies */
.companies-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.company-badge {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 14px 26px;
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 600;
}

.company-badge__icon {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  flex-shrink: 0;
}

.company-badge--muted {
  color: var(--text-muted);
  font-weight: 400;
  font-style: italic;
  background: transparent;
  border-style: dashed;
}

/* Contact */
.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.contact-link {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
  padding: 13px 22px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

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

.contact-link--cv {
  background: var(--accent);
  color: #041325;
  border-color: var(--accent);
}

.contact-link--cv:hover {
  color: #041325;
  box-shadow: 0 12px 24px -8px rgba(88, 166, 255, 0.5);
}

.contact-meta {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 20px 0 0;
}

.contact-meta__item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.contact-meta__icon {
  width: 17px;
  height: 17px;
  color: var(--accent);
  flex-shrink: 0;
}

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

.contact-meta__item a:hover {
  text-decoration: underline;
}

/* Footer */
.footer {
  padding: 32px 0;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Responsive */
@media (max-width: 720px) {
  .nav__toggle {
    display: flex;
  }

  .nav__links {
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 16px 24px;
    gap: 16px;
    display: none;
  }

  .nav__links.is-open {
    display: flex;
  }

  .section {
    padding: 64px 0;
  }

  .hero {
    padding-top: 110px;
  }
}
