/* =========================================================
   Liquid Glass CV — stylesheet
   ========================================================= */

/* ---------- Design tokens ---------- */
:root {
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* dark theme (default) — palette inspired by nibela.se */
  --bg-1: #0a1420;
  --bg-2: #132a3d;
  --text-primary: #eef6fb;
  --text-secondary: rgba(238, 246, 251, 0.68);
  --text-muted: rgba(238, 246, 251, 0.45);

  --glass-bg: rgba(255, 255, 255, 0.06);
  --glass-bg-strong: rgba(255, 255, 255, 0.1);
  --glass-border: rgba(170, 205, 213, 0.18);
  --glass-shadow: rgba(0, 0, 0, 0.35);

  --accent-1: #4aa6cc;
  --accent-2: #00bc7d;
  --accent-gradient: linear-gradient(135deg, var(--accent-1), var(--accent-2));

  --radius-lg: 28px;
  --radius-md: 20px;
  --radius-sm: 14px;

  --blur: 18px;
  --transition: 0.35s cubic-bezier(0.22, 1, 0.36, 1);

  --container-width: 1080px;
  --section-spacing: clamp(64px, 10vw, 120px);
}

[data-theme='light'] {
  --bg-1: #eaf5fa;
  --bg-2: #d3e9f2;
  --text-primary: #071a2a;
  --text-secondary: rgba(7, 26, 42, 0.7);
  --text-muted: rgba(7, 26, 42, 0.5);

  --glass-bg: rgba(255, 255, 255, 0.5);
  --glass-bg-strong: rgba(255, 255, 255, 0.72);
  --glass-border: rgba(255, 255, 255, 0.65);
  --glass-shadow: rgba(15, 40, 60, 0.14);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-main);
  color: var(--text-primary);
  background: radial-gradient(circle at 20% 0%, var(--bg-2), var(--bg-1) 60%);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
  transition: background var(--transition), color var(--transition);
}

img {
  max-width: 100%;
  display: block;
}

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

ul {
  list-style: none;
}

h1, h2, h3 {
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

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

/* ---------- Ambient background blobs ---------- */
.bg-blobs {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.55;
  animation: drift 22s ease-in-out infinite alternate;
}

.blob-1 {
  width: 42vw;
  height: 42vw;
  top: -10%;
  left: -10%;
  background: var(--accent-1);
}

.blob-2 {
  width: 36vw;
  height: 36vw;
  bottom: -12%;
  right: -8%;
  background: var(--accent-2);
  animation-delay: -6s;
}

.blob-3 {
  width: 26vw;
  height: 26vw;
  top: 40%;
  left: 55%;
  background: #aacdd5;
  opacity: 0.35;
  animation-delay: -12s;
}

@keyframes drift {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(4%, 6%) scale(1.08); }
}

/* ---------- Glass primitive ---------- */
.glass {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(var(--blur)) saturate(160%);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(160%);
  box-shadow: 0 8px 32px var(--glass-shadow);
  border-radius: var(--radius-md);
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
}

/* ---------- Layout helpers ---------- */
main {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: var(--section-spacing) 0;
}

.section-title {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  margin-bottom: 36px;
  text-align: center;
  position: relative;
}

.section-title::after {
  content: '';
  display: block;
  width: 56px;
  height: 4px;
  margin: 14px auto 0;
  border-radius: 4px;
  background: var(--accent-gradient);
}

.card {
  padding: 32px;
}

/* ---------- Navbar ---------- */
.navbar {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: min(92%, 980px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 22px;
  border-radius: 999px;
}

.logo {
  font-weight: 800;
  font-size: 1.15rem;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.nav-links {
  display: flex;
  gap: 26px;
  overflow-x: auto;
  scrollbar-width: none;
  margin: 0 16px;
}

.nav-links::-webkit-scrollbar {
  display: none;
}

.nav-links a {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  transition: color var(--transition);
}

.nav-links a:hover {
  color: var(--text-primary);
}

.theme-toggle {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border: 1px solid var(--glass-border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
}

.theme-toggle:hover {
  transform: scale(1.08);
}

/* ---------- Hero ---------- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 140px 24px 80px;
}

.hero-card {
  max-width: 780px;
  width: 100%;
  padding: clamp(28px, 5vw, 56px);
  display: flex;
  align-items: center;
  gap: 40px;
  border-radius: var(--radius-lg);
}

.avatar {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 3px solid var(--glass-border);
  box-shadow: 0 0 0 8px var(--glass-bg), 0 12px 30px var(--glass-shadow);
}

.hero-text h1 {
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  margin-bottom: 8px;
}

.tagline {
  font-size: 1.05rem;
  font-weight: 600;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 16px;
}

.hero-desc {
  color: var(--text-secondary);
  margin-bottom: 26px;
  max-width: 46ch;
}

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

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 26px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.92rem;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
  cursor: pointer;
}

.btn-primary {
  background: var(--accent-gradient);
  color: #fff;
  box-shadow: 0 8px 24px rgba(74, 166, 204, 0.35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(74, 166, 204, 0.45);
}

.btn-secondary {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  color: var(--text-primary);
}

.btn-secondary:hover {
  background: var(--glass-bg-strong);
  transform: translateY(-2px);
}

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

/* ---------- About ---------- */
#about .card p {
  color: var(--text-secondary);
  font-size: 1.02rem;
  max-width: 70ch;
  margin: 0 auto;
  text-align: center;
}

.about-facts {
  margin-top: 22px;
}

.about-facts .skill-card {
  text-align: center;
}

.fact-value {
  font-weight: 700;
  font-size: 1.05rem;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: 26px;
}

/* ---------- Skills ---------- */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 22px;
}

.skill-card {
  padding: 24px 26px;
}

.skill-card:hover {
  transform: translateY(-4px);
}

.skill-card h3 {
  font-size: 1rem;
  margin-bottom: 14px;
  font-weight: 600;
}

.skill-bar {
  height: 8px;
  border-radius: 999px;
  background: rgba(127, 127, 127, 0.18);
  overflow: hidden;
}

.skill-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--accent-gradient);
  transition: width 1s ease;
}

/* ---------- Timeline (Experience / Education) ---------- */
.timeline {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding-left: 28px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: linear-gradient(var(--accent-1), var(--accent-2));
  opacity: 0.5;
}

.timeline-item {
  position: relative;
  padding: 24px 28px;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -28px;
  top: 28px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent-gradient);
  box-shadow: 0 0 0 4px var(--bg-1);
}

.timeline-item:hover {
  transform: translateX(4px);
}

.timeline-date {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-1);
  margin-bottom: 8px;
}

.timeline-item h3 {
  font-size: 1.12rem;
  margin-bottom: 4px;
}

.timeline-company {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.92rem;
  margin-bottom: 10px;
}

.timeline-item p:last-child {
  color: var(--text-secondary);
}

/* ---------- Projects ---------- */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 380px));
  justify-content: center;
  gap: 26px;
}

.project-card {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 0 0 26px;
}

.project-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  margin-bottom: 20px;
}

.project-card h3,
.project-card p,
.project-card .btn {
  margin-left: 24px;
  margin-right: 24px;
}

.project-card h3 {
  font-size: 1.1rem;
  margin-bottom: 8px;
}

.project-card p {
  color: var(--text-secondary);
  font-size: 0.92rem;
  margin-bottom: 18px;
}

.project-card .btn {
  align-self: flex-start;
}

.project-card:hover {
  transform: translateY(-6px);
}

/* ---------- Contact ---------- */
.contact-card {
  text-align: center;
  max-width: 620px;
  margin: 0 auto;
}

.contact-card p {
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
}

/* ---------- Footer ---------- */
.footer {
  text-align: center;
  padding: 32px 24px 48px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .hero-card {
    flex-direction: column;
    text-align: center;
    gap: 24px;
  }

  .hero-desc {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-buttons {
    justify-content: center;
  }

  .navbar {
    top: 12px;
    padding: 10px 16px;
  }

  .nav-links {
    gap: 16px;
    margin: 0 10px;
  }

  .timeline {
    padding-left: 22px;
  }

  .timeline-item {
    padding: 18px 20px;
  }
}

@media (max-width: 480px) {
  .nav-links a {
    font-size: 0.82rem;
  }

  .logo {
    font-size: 1rem;
  }

  .avatar {
    width: 110px;
    height: 110px;
  }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .blob {
    animation: none;
  }

  * {
    scroll-behavior: auto !important;
  }
}
