/* ─── Language toggle ─────────────────────────────────────── */
.lang-toggle {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 100;
  background: var(--color-accent);
  border: 1px solid transparent;
  color: #fff;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  cursor: pointer;
  transition:
    color var(--transition-base),
    border-color var(--transition-base),
    background var(--transition-base);
}

.lang-toggle:hover {
  color: #fff;
  border-color: transparent;
  background: #8b84ff;
}

/* ─── Custom Properties ───────────────────────────────── */
:root {
  --color-bg:          #0d0f14;
  --color-surface:     #161b27;
  --color-surface-2:   #1e2535;
  --color-border:      rgba(255, 255, 255, 0.07);
  --color-text:        #e8eaf0;
  --color-text-muted:  #7c86a2;
  --color-accent:      #6c63ff;
  --color-accent-glow: rgba(108, 99, 255, 0.35);
  --color-tag-bg:      rgba(108, 99, 255, 0.12);
  --color-tag-text:    #a09bff;

  --radius-card:  16px;
  --radius-btn:   10px;
  --radius-tag:   6px;

  --shadow-card:  0 4px 24px rgba(0, 0, 0, 0.35);
  --shadow-hover: 0 12px 40px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(108, 99, 255, 0.2);

  --transition-base: 0.22s cubic-bezier(0.4, 0, 0.2, 1);

  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;

  --max-width: 1100px;
}

/* ─── Reset ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { display: block; }

a { color: inherit; text-decoration: none; }

/* ─── Hero ────────────────────────────────────────────── */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 6rem 1.5rem;
  text-align: center;
}

.hero__inner {
  position: relative;
  z-index: 1;
  max-width: 680px;
  animation: fadeUp 0.7s ease both;
}

.hero__eyebrow {
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 0.75rem;
}

.hero__name {
  font-size: clamp(3rem, 8vw, 5.5rem);
  font-weight: 800;
  line-height: 1.05;
  background: linear-gradient(135deg, #ffffff 30%, var(--color-accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 1.25rem;
}

.hero__tagline {
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  color: var(--color-text-muted);
  line-height: 1.75;
  margin-bottom: 2.5rem;
}

/* ─── Buttons ─────────────────────────────────────────── */
.btn {
  display: inline-block;
  padding: 0.85rem 2rem;
  border-radius: var(--radius-btn);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.btn--primary {
  background: var(--color-accent);
  color: #fff;
  box-shadow: 0 4px 20px var(--color-accent-glow);
}

.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px var(--color-accent-glow);
}

/* ─── Background blobs ────────────────────────────────── */
.hero__bg-blobs { position: absolute; inset: 0; pointer-events: none; }

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.18;
}

.blob--1 {
  width: 520px;
  height: 520px;
  background: var(--color-accent);
  top: -120px;
  left: -100px;
  animation: blobFloat 10s ease-in-out infinite alternate;
}

.blob--2 {
  width: 380px;
  height: 380px;
  background: #ff6b9d;
  bottom: -80px;
  right: -60px;
  animation: blobFloat 13s ease-in-out infinite alternate-reverse;
}

/* ─── Projects section ────────────────────────────────── */
.projects {
  padding: 6rem 1.5rem 8rem;
}

.projects__inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.section-title {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 700;
  margin-bottom: 2.5rem;
  color: var(--color-text);
}

/* ─── Card Grid ───────────────────────────────────────── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

/* ─── Card ────────────────────────────────────────────── */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  box-shadow: var(--shadow-card);
  position: relative;
  transition:
    transform var(--transition-base),
    box-shadow var(--transition-base),
    border-color var(--transition-base),
    background var(--transition-base);
  animation: fadeUp 0.6s ease both;
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-hover);
  background: var(--color-surface-2);
  border-color: rgba(108, 99, 255, 0.3);
}

.card--placeholder {
  opacity: 0.55;
}

.card--placeholder:hover {
  transform: none;
  box-shadow: var(--shadow-card);
  background: var(--color-surface);
  border-color: var(--color-border);
  cursor: default;
}

/* stagger animation for grid items */
.card:nth-child(1) { animation-delay: 0.05s; }
.card:nth-child(2) { animation-delay: 0.12s; }
.card:nth-child(3) { animation-delay: 0.19s; }
.card:nth-child(4) { animation-delay: 0.26s; }
.card:nth-child(5) { animation-delay: 0.33s; }

/* ─── Card internals ──────────────────────────────────── */
.card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.25rem;
}

.card__favicon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  object-fit: contain;
}

.card__favicon--placeholder {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--color-surface-2);
  border: 1px dashed var(--color-border);
}

.card__tag {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-tag-text);
  background: var(--color-tag-bg);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-tag);
}

.card__title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.3;
}

.card__desc {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  line-height: 1.65;
  flex-grow: 1;
}

.card__link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.5rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--color-accent);
  transition: gap var(--transition-base), color var(--transition-base);
}

/* Stretched link — covers the entire card */
.card__link:not(.card__link--disabled)::after {
  content: '';
  position: absolute;
  inset: 0;
}

.card:hover .card__link {
  gap: 0.55rem;
}

.card__link--disabled {
  color: var(--color-text-muted);
  cursor: default;
  pointer-events: none;
}

/* ─── Footer ──────────────────────────────────────────── */
.footer {
  text-align: center;
  padding: 2rem 1.5rem;
  font-size: 0.82rem;
  color: var(--color-text-muted);
  border-top: 1px solid var(--color-border);
}

/* ─── Animations ──────────────────────────────────────── */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes blobFloat {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(30px, 20px) scale(1.06); }
}

/* ─── Responsive ──────────────────────────────────────── */
@media (max-width: 600px) {
  .card-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    padding: 5rem 1.25rem;
  }
}
