/* Andreas Tallqvist - Compact CV */

:root {
  --bg: #f8fafc;
  --surface: #fff;
  --text: #0f172a;
  --text-muted: #475569;
  --border: #e2e8f0;
  --accent: #2563eb;
  --accent-2: #3b82f6;
  --accent-light: #dbeafe;
}

.dark {
  --bg: #0b1220;
  --surface: #111827;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --border: #1f2937;
  --accent: #3b82f6;
  --accent-2: #60a5fa;
  --accent-light: #1e3a5f;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

.container { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.tight { max-width: 1000px; }

/* Slim Nav */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 1080px; margin: 0 auto; padding: 0 20px;
  height: 60px; display: flex; align-items: center; justify-content: space-between;
}

.logo {
  font-weight: 700; font-size: 1.15rem; letter-spacing: -0.5px;
  color: var(--text); text-decoration: none;
  white-space: nowrap;
  text-transform: uppercase;
}

.nav-links {
  display: flex; gap: 26px;
}
.nav-links a {
  color: var(--text-muted); text-decoration: none; font-weight: 500; font-size: 0.9rem;
}
.nav-links a:hover { color: var(--text); }

.nav-actions { display: flex; align-items: center; gap: 10px; }

.nav-actions .dropdown-toggle {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.5);
  color: var(--text);
  transition: all 0.15s ease;
}

.dark .nav-actions .dropdown-toggle {
  border-color: rgba(255, 255, 255, 0.4);
}

.nav-actions .dropdown-toggle:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.75);
}

.dark .nav-actions .dropdown-toggle:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.65);
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 9px 18px; font-size: 0.9rem; font-weight: 600;
  border-radius: 8px; text-decoration: none; cursor: pointer;
  transition: all 0.15s ease; border: 1px solid transparent;
}
.btn-primary {
  background: var(--accent); color: white; border-color: var(--accent);
}
.btn-primary:hover { background: #1e40af; }
.dark .btn-primary:hover { background: #2563eb; }

.btn-outline {
  background: transparent; color: var(--text); border-color: var(--border);
}
.btn-outline:hover { background: var(--accent-light); border-color: var(--accent); color: var(--accent); }

.icon-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.5);
  color: var(--text-muted);
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.dark .icon-btn {
  border-color: rgba(255, 255, 255, 0.4);
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.75);
  color: var(--text);
}

.dark .icon-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.65);
}

.sun { display: none; }
.dark .sun { display: block; }
.dark .moon { display: none; }

/* Dropdown for CV language selection */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-toggle {
  cursor: pointer;
}

.dropdown-menu {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 140px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
  z-index: 300;
  overflow: hidden;
}

.dropdown.open .dropdown-menu {
  display: block;
}

.dropdown-item {
  display: block;
  padding: 10px 16px;
  font-size: 0.9rem;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}

.dropdown-item:hover {
  background: var(--accent-light);
  color: var(--accent);
}

.dark .dropdown-item:hover {
  background: #1e3a5f;
}

/* Dropdown toggle base */
.dropdown-toggle {
  cursor: pointer;
}

/* Hero + Animation */
.hero {
  position: relative; min-height: 460px; display: flex; align-items: center;
  justify-content: center;
  padding: 40px 0 30px; overflow: hidden;
  background: linear-gradient(to bottom, var(--surface), var(--bg));
}

.hero-bg {
  position: absolute; inset: 0; pointer-events: none; z-index: 0;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(68px);
  opacity: 0.48;
  animation: blob-lava 38s ease-in-out infinite;
}

.blob-1 {
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, var(--accent) 0%, transparent 68%);
  top: -85px;
  right: -155px;
  animation-duration: 41s;
}

.blob-2 {
  width: 380px;
  height: 380px;
  background: radial-gradient(circle, #60a5fa 0%, transparent 68%);
  top: -95px;
  left: -105px;
  animation-duration: 47s;
  animation-delay: -12s;
}

@keyframes blob-lava {
  0% {
    transform: translate(0, 0) scale(1, 1);
    opacity: 0.42;
  }
  20% {
    transform: translate(38px, -28px) scale(1.12, 0.94);
    opacity: 0.58;
  }
  42% {
    transform: translate(-22px, 41px) scale(0.94, 1.13);
    opacity: 0.51;
  }
  65% {
    transform: translate(52px, 18px) scale(1.07, 0.91);
    opacity: 0.61;
  }
  83% {
    transform: translate(-31px, -35px) scale(0.97, 1.08);
    opacity: 0.47;
  }
  100% {
    transform: translate(0, 0) scale(1, 1);
    opacity: 0.42;
  }
}

.hero-content {
  position: relative; z-index: 1;
  width: 100%; max-width: 1000px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  padding: 0 20px;
}

/* Desktop: photo on the side */
@media (min-width: 900px) {
  .hero-content {
    flex-direction: row;
    align-items: flex-start;
    gap: 48px;
  }
}

.hero-text {
  flex: 1;
  min-width: 0;
  max-width: 560px;
}

@media (min-width: 900px) {
  .hero-text {
    text-align: left;
    padding-top: 12px;
  }
}

.hero h1 {
  font-size: 3.1rem; line-height: 1.05; letter-spacing: -2.5px; margin-bottom: 6px;
}

@media (min-width: 900px) {
  .hero h1 {
    text-align: left;
  }
}

.subtitle {
  font-size: 1.75rem; color: var(--accent); font-weight: 500; margin-bottom: 18px;
}

.typewriter-cursor {
  color: var(--accent);
  animation: typewriter-blink 1.1s step-end infinite;
}

@keyframes typewriter-blink {
  50% { opacity: 0; }
}

@media (min-width: 900px) {
  .subtitle {
    text-align: left;
  }
}



.tagline {
  font-size: 1.05rem; color: var(--text-muted); max-width: 480px; margin-bottom: 22px;
}

@media (min-width: 900px) {
  .tagline {
    margin-left: 0;
  }
}

.meta {
  display: flex; flex-wrap: wrap; gap: 14px 24px; margin-bottom: 26px;
  font-size: 0.9rem; color: var(--text-muted);
}

@media (min-width: 900px) {
  .meta {
    justify-content: flex-start;
  }
}

.meta a { color: var(--text-muted); text-decoration: none; }
.meta a:hover { color: var(--accent); }

.dot {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: #22c55e; margin-right: 6px; vertical-align: middle;
}

.hero-actions {
  display: flex; gap: 12px; flex-wrap: wrap;
}

@media (min-width: 900px) {
  .hero-actions {
    justify-content: flex-start;
  }
}

/* Mobile hero: center content + image first */
@media (max-width: 899px) {
  .hero-content {
    flex-direction: column-reverse;
    align-items: center;
    gap: 24px;
  }

  .hero-text {
    text-align: center;
    max-width: 100%;
    padding-top: 0;
  }

  .hero h1,
  .subtitle {
    text-align: center;
  }

  .meta {
    justify-content: center;
  }

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

/* Make Learn more and View CV buttons consistent in the hero */
.hero-actions .btn,
.hero-actions .dropdown-toggle {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.5);
  color: white;
  padding: 9px 18px;
  font-size: 0.9rem;
  border-radius: 8px;
  transition: all 0.15s ease;
  height: 38px;
  line-height: 1;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.hero-actions .btn:hover,
.hero-actions .dropdown-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: white;
  color: white;
}

/* Hero Photo */
.hero-photo {
  flex-shrink: 0;
  width: 240px;
  height: 240px;
  border-radius: 999px;
  overflow: hidden;
  border: 7px solid var(--surface);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.22);
  background: var(--surface);
}

@media (min-width: 900px) {
  .hero-photo {
    width: 340px;
    height: 340px;
    border-width: 9px;
  }
}

.hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 38%;
  display: block;
}

/* Sections */
.section { padding: 52px 0; }

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

.section-head {
  margin-bottom: 18px;
}
.section-head h2 {
  font-size: 1.25rem; font-weight: 600; display: inline-block;
  padding-bottom: 6px; border-bottom: 3px solid var(--accent);
}
.section-head.small { margin-bottom: 12px; }
.section-head.small h2 { font-size: 1.05rem; border-bottom-width: 2px; }

/* Tabs */
.tabs { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }

.tab-buttons {
  display: flex; background: var(--bg); border-bottom: 1px solid var(--border);
}
.tab-btn {
  flex: 1; padding: 12px 16px; background: none; border: none; cursor: pointer;
  font-weight: 600; font-size: 0.9rem; color: var(--text-muted);
  transition: all 0.15s;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active {
  background: var(--surface); color: var(--accent); border-bottom: 3px solid var(--accent);
}

.tab-panels { padding: 22px 24px; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

.tab-panel p { color: var(--text-muted); margin-bottom: 12px; }
.tab-panel ul {
  list-style: none; padding-left: 4px;
}
.tab-panel li {
  padding: 4px 0 4px 20px; position: relative; color: var(--text-muted);
}
.tab-panel li::before {
  content: "→"; position: absolute; left: 0; color: var(--accent);
}

/* Experience - compact cards */
.exp-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px;
}

.exp-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 20px; display: flex; flex-direction: column;
}

.exp-header {
  display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; gap: 12px;
}
.exp-header h3 { font-size: 1.05rem; margin-bottom: 2px; }
.company { color: var(--text-muted); font-weight: 500; font-size: 0.9rem; }
.date { font-size: 0.8rem; color: var(--accent); font-weight: 600; white-space: nowrap; }

.exp-card ul {
  flex: 1; margin-bottom: 14px; padding-left: 0; list-style: none;
}
.exp-card li {
  font-size: 0.9rem; color: var(--text-muted); margin-bottom: 5px; padding-left: 18px; position: relative;
}
.exp-card li::before {
  content: "•"; position: absolute; left: 0; color: var(--accent);
}

.pills {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.pills span {
  font-size: 0.75rem; padding: 3px 9px; background: var(--accent-light);
  color: var(--accent); border-radius: 999px; font-weight: 500;
  transition: background 0.15s ease, color 0.15s ease;
  cursor: default;
}

.pills span:hover {
  background: var(--accent);
  color: white;
}

/* Two column layout */
.two-col {
  display: grid; grid-template-columns: 1fr 1.35fr; gap: 48px;
}

/* Education */
.edu-list { display: flex; flex-direction: column; gap: 14px; }
.edu-item { font-size: 0.9rem; }
.edu-year { font-weight: 600; color: var(--accent); font-size: 0.8rem; }
.edu-title { font-weight: 500; }
.edu-school { color: var(--text-muted); }

/* Skills compact */
.skills-compact { display: flex; flex-direction: column; gap: 14px; }
.skill-group { font-size: 0.85rem; }
.skill-group .label {
  display: block; font-weight: 600; color: var(--text-muted); margin-bottom: 5px; font-size: 0.75rem;
  text-transform: uppercase; letter-spacing: 0.5px;
}

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

.footer p {
  margin: 0;
}

.back-to-top {
  display: inline-block;
  margin-top: 10px;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-decoration: none;
  opacity: 0.6;
  transition: opacity 0.2s ease, color 0.2s ease;
}

.back-to-top:hover {
  opacity: 1;
  color: var(--accent);
}

/* Print */
@media print {
  .nav, .hero-actions, .blob { display: none !important; }
  .hero { min-height: auto; padding: 20px 0; }
  .section { padding: 24px 0; }
  .exp-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
}

/* Responsive */
@media (max-width: 820px) {
  .hero h1 { font-size: 2.5rem; }
  .two-col { grid-template-columns: 1fr; gap: 36px; }
  .nav-links { display: none; }
  .exp-grid { grid-template-columns: 1fr; }

  .logo {
    font-size: 1rem;
    margin-right: 16px;
  }

  .nav-actions {
    gap: 12px;
  }
}

@media (max-width: 480px) {
  .hero { min-height: 360px; }
  .hero h1 { font-size: 2.15rem; }
  .subtitle { font-size: 1.4rem; }
  .blob { display: none; }
}
