/* ==========================================================================
   Max Andersen Frisk — Personlig Hemsida & CV
   Tidlös, skandinavisk och professionell design
   ========================================================================== */

:root {
  /* Färgpalett - Ljust läge (Standard, ren papperskänsla) */
  --bg-page: #fafaf9;
  --bg-surface: #ffffff;
  --bg-subtle: #f4f4f5;
  --bg-muted: #e4e4e7;
  
  --text-main: #18181b;
  --text-secondary: #52525b;
  --text-muted: #71717a;
  --text-faint: #a1a1aa;

  --border-color: #e4e4e7;
  --border-light: #f4f4f5;
  --border-dark: #d4d4d8;

  /* Chalmersblå / Klassisk marin accent */
  --accent: #005596;
  --accent-hover: #003e6e;
  --accent-soft: #e0effe;

  --shadow-subtle: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
  --shadow-card: 0 2px 8px -2px rgba(0, 0, 0, 0.05), 0 1px 4px -1px rgba(0, 0, 0, 0.03);
  --shadow-hover: 0 12px 24px -6px rgba(0, 0, 0, 0.07), 0 4px 8px -2px rgba(0, 0, 0, 0.03);

  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-full: 9999px;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: Georgia, Cambria, "Times New Roman", Times, serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  --transition-smooth: 200ms ease;
}

/* Mörkt läge (Subtil grafit / kolgrå, inte rymd-neon) */
[data-theme="dark"] {
  --bg-page: #0f1115;
  --bg-surface: #16181d;
  --bg-subtle: #1e2127;
  --bg-muted: #2a2e36;

  --text-main: #f4f4f5;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --text-faint: #52525b;

  --border-color: #262930;
  --border-light: #1e2127;
  --border-dark: #3a3f4a;

  --accent: #38bdf8;
  --accent-hover: #7dd3fc;
  --accent-soft: rgba(56, 189, 248, 0.12);

  --shadow-subtle: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-card: 0 4px 12px rgba(0, 0, 0, 0.25);
  --shadow-hover: 0 12px 28px rgba(0, 0, 0, 0.35);
}

/* ==========================================================================
   Bas & Typografi
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.65;
  font-size: 16px;
  transition: background-color var(--transition-smooth), color var(--transition-smooth);
}

/* Tillgänglighet skip-link */
.skip-link {
  position: absolute;
  top: -60px;
  left: 20px;
  background: var(--text-main);
  color: var(--bg-page);
  padding: 10px 18px;
  z-index: 1000;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 500;
  transition: top 0.2s;
}
.skip-link:focus { top: 20px; }

.container {
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  padding: 0 24px;
}

h1, h2, h3, h4 {
  color: var(--text-main);
  line-height: 1.25;
  font-weight: 600;
  letter-spacing: -0.02em;
}

p {
  color: var(--text-secondary);
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition-smooth);
}
a:hover {
  text-decoration: underline;
}

/* ==========================================================================
   Navigationsfält
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 250, 249, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-color);
  transition: background-color var(--transition-smooth), border-color var(--transition-smooth);
}

[data-theme="dark"] .site-header {
  background: rgba(15, 17, 21, 0.92);
}

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

.logo {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-main);
  text-decoration: none;
  letter-spacing: -0.01em;
}
.logo:hover {
  text-decoration: none;
  color: var(--accent);
}

.nav-list {
  display: flex;
  list-style: none;
  gap: 24px;
}

.nav-link {
  color: var(--text-secondary);
  font-size: 0.925rem;
  font-weight: 400;
  text-decoration: none;
  padding: 4px 0;
  position: relative;
  transition: color var(--transition-smooth);
}

.nav-link:hover, .nav-link.active {
  color: var(--text-main);
  text-decoration: none;
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--text-main);
  border-radius: var(--radius-full);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-smooth);
}
.icon-btn:hover {
  background: var(--bg-subtle);
  color: var(--text-main);
  border-color: var(--border-dark);
}

/* Temaväxlare ikoner */
.sun-icon { display: none; }
.moon-icon { display: block; }
[data-theme="dark"] .sun-icon { display: block; }
[data-theme="dark"] .moon-icon { display: none; }

.mobile-menu-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  padding: 8px;
  position: relative;
}
.hamburger-line {
  width: 18px;
  height: 2px;
  background: currentColor;
  transition: transform 0.2s ease, opacity 0.2s ease;
  transform-origin: center;
}
.mobile-menu-btn[aria-expanded="true"] .hamburger-line:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}
.mobile-menu-btn[aria-expanded="true"] .hamburger-line:nth-child(2) {
  opacity: 0;
}
.mobile-menu-btn[aria-expanded="true"] .hamburger-line:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero-section {
  padding: 70px 0 50px;
  border-bottom: 1px solid var(--border-color);
}

.hero-container {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 48px;
  align-items: start;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.825rem;
  color: var(--text-secondary);
  margin-bottom: 20px;
  font-weight: 500;
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #10b981;
}

.hero-title {
  font-size: 2.75rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 8px;
  color: var(--text-main);
}

.hero-subtitle {
  font-size: 1.15rem;
  font-weight: 400;
  color: var(--text-muted);
  margin-bottom: 22px;
  line-height: 1.4;
}

.hero-description {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 640px;
  margin-bottom: 28px;
}

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

/* Knappar */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  font-size: 0.925rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none !important;
  transition: all var(--transition-smooth);
}

.btn-primary {
  background: var(--text-main);
  color: var(--bg-surface);
}
.btn-primary:hover {
  opacity: 0.88;
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-main);
  border-color: var(--border-color);
}
.btn-secondary:hover {
  background: var(--bg-subtle);
  border-color: var(--border-dark);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}
.btn-ghost:hover {
  color: var(--text-main);
  background: var(--bg-subtle);
}

.hero-meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  border-top: 1px solid var(--border-light);
  padding-top: 20px;
}

.meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.meta-row svg {
  color: var(--text-muted);
  flex-shrink: 0;
}

.copy-btn {
  background: none;
  border: none;
  font-family: inherit;
  font-size: inherit;
  color: var(--text-main);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  transition: background-color var(--transition-smooth);
}
.copy-btn:hover {
  background: var(--bg-subtle);
  color: var(--accent);
}

.copy-tag {
  font-size: 0.725rem;
  color: var(--text-muted);
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  padding: 1px 5px;
  border-radius: 3px;
}

/* Porträtt / Profilbild */
.hero-photo-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.photo-frame {
  width: 190px;
  height: 220px;
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.portrait-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 16px;
  color: var(--text-muted);
}
.portrait-initials {
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
}
.portrait-subtext {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.photo-caption {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
}

/* ==========================================================================
   Sektioner gemensamt
   ========================================================================== */
.section {
  padding: 60px 0;
  border-bottom: 1px solid var(--border-color);
}

.section-title-wrap {
  margin-bottom: 32px;
}

.section-label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin-bottom: 4px;
}

.section-title {
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* ==========================================================================
   Om mig
   ========================================================================== */
.about-layout {
  display: grid;
  grid-template-columns: 1.4fr 0.9fr;
  gap: 40px;
}

.about-prose p {
  font-size: 1.025rem;
  line-height: 1.75;
  margin-bottom: 18px;
}

.facts-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-subtle);
}

.facts-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text-main);
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 8px;
}

.facts-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.facts-list li {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
}
.facts-key {
  color: var(--text-muted);
}
.facts-val {
  font-weight: 500;
  color: var(--text-main);
  text-align: right;
}

.personal-traits {
  margin-top: 24px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.trait-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 16px;
}

.trait-box h4 {
  font-size: 0.95rem;
  margin-bottom: 6px;
}
.trait-box p {
  font-size: 0.875rem;
  line-height: 1.5;
  margin-bottom: 0;
}

/* ==========================================================================
   Utbildning
   ========================================================================== */
.edu-stack {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.edu-entry {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 28px;
  box-shadow: var(--shadow-subtle);
  transition: border-color var(--transition-smooth);
}
.edu-entry:hover {
  border-color: var(--border-dark);
}

.edu-entry-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.edu-degree {
  font-size: 1.25rem;
}

.edu-school {
  color: var(--accent);
  font-weight: 500;
  font-size: 0.95rem;
}

.edu-time {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
}

.edu-desc {
  font-size: 0.95rem;
  line-height: 1.65;
  margin-bottom: 16px;
}

.courses-label {
  font-size: 0.825rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}

.courses-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.course-pill {
  font-size: 0.825rem;
  background: var(--bg-subtle);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  padding: 4px 10px;
  border-radius: var(--radius-xs);
}

/* ==========================================================================
   Arbetslivserfarenhet
   ========================================================================== */
.experience-list {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.exp-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 28px;
  box-shadow: var(--shadow-subtle);
  transition: border-color var(--transition-smooth);
}
.exp-card:hover {
  border-color: var(--border-dark);
}

.exp-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.exp-role {
  font-size: 1.2rem;
}

.exp-company {
  font-weight: 600;
  color: var(--text-main);
  font-size: 1rem;
}

.exp-period {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
}

.exp-points {
  list-style: none;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.exp-points li {
  position: relative;
  padding-left: 18px;
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.exp-points li::before {
  content: '–';
  position: absolute;
  left: 0;
  color: var(--text-muted);
}

.exp-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.exp-tag {
  font-size: 0.775rem;
  background: var(--bg-subtle);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  padding: 2px 8px;
  border-radius: var(--radius-xs);
}

/* Tidigare korta meriter */
.earlier-exp-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 18px 22px;
}
.earlier-exp-title {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  margin-bottom: 10px;
}
.earlier-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--text-secondary);
}
.earlier-list strong {
  color: var(--text-main);
}

/* ==========================================================================
   Färdigheter
   ========================================================================== */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

.skills-group {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 22px;
  box-shadow: var(--shadow-subtle);
}

.skills-group-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 14px;
  color: var(--text-main);
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 8px;
}

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

.clean-tag {
  font-size: 0.85rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  padding: 4px 10px;
  border-radius: var(--radius-xs);
  color: var(--text-secondary);
}

/* ==========================================================================
   Projekt
   ========================================================================== */
.projects-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.project-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 26px;
  box-shadow: var(--shadow-subtle);
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-smooth), border-color var(--transition-smooth);
}
.project-item:hover {
  border-color: var(--border-dark);
  transform: translateY(-2px);
}

.project-category {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--accent);
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.project-item-title {
  font-size: 1.2rem;
  margin-bottom: 8px;
}

.project-item-desc {
  font-size: 0.925rem;
  line-height: 1.6;
  margin-bottom: 18px;
  flex-grow: 1;
}

.project-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  border-top: 1px solid var(--border-light);
  padding-top: 12px;
}

.project-tools span {
  font-size: 0.775rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

/* ==========================================================================
   Kontakt
   ========================================================================== */
.contact-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 36px 40px;
  box-shadow: var(--shadow-card);
  max-width: 820px;
  margin: 0 auto;
  transition: border-color var(--transition-smooth);
}

.contact-box-header {
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 18px;
}

.contact-box-title {
  font-size: 1.35rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-main);
}

.contact-box-desc {
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text-secondary);
  margin-bottom: 0;
}

.contact-methods {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.contact-method-card {
  background: var(--bg-page);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 18px;
  transition: border-color var(--transition-smooth), transform var(--transition-smooth), box-shadow var(--transition-smooth);
}

.contact-method-card:hover {
  border-color: var(--border-dark);
  box-shadow: var(--shadow-subtle);
}

.method-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.method-info {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  min-width: 0;
}

.method-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.method-value {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-main);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

a.method-value:hover {
  color: var(--accent);
  text-decoration: underline;
}

.method-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.btn-sm {
  padding: 8px 14px;
  font-size: 0.85rem;
  border-radius: var(--radius-xs);
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
  cursor: pointer;
}

.method-badge {
  font-size: 0.8rem;
  color: var(--text-muted);
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  padding: 6px 12px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  padding: 40px 0;
  background: var(--bg-page);
  color: var(--text-muted);
  font-size: 0.85rem;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.visitor-tag-clean {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.clean-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--text-main);
  color: var(--bg-surface);
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  z-index: 1000;
  transform: translateY(80px);
  opacity: 0;
  transition: all 0.25s ease;
  box-shadow: var(--shadow-hover);
}
.toast.show {
  transform: translateY(0);
  opacity: 1;
}

/* ==========================================================================
   Responsivitet & Mobiloptimering
   ========================================================================== */
html {
  -webkit-tap-highlight-color: transparent;
}

button:active, .btn:active, .nav-link:active {
  transform: scale(0.98);
}

@media (max-width: 820px) {
  .hero-container {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .hero-photo-wrapper {
    order: -1;
    align-items: flex-start;
  }
  .about-layout {
    grid-template-columns: 1fr;
    gap: 30px;
  }
}

@media (max-width: 640px) {
  html {
    scroll-padding-top: 66px;
  }

  body {
    overflow-x: hidden;
  }

  /* Kompaktare behållare och marginaler för små skärmar */
  .container {
    padding: 0 18px;
  }

  .section {
    padding: 48px 0;
  }

  .section-title-wrap {
    margin-bottom: 24px;
  }

  .section-title {
    font-size: 1.65rem;
  }

  /* Header & Mobilmeny */
  .site-header {
    height: 58px;
  }

  .header-container {
    height: 58px;
  }

  .logo {
    font-size: 1rem;
  }

  .mobile-menu-btn {
    display: flex;
  }

  .main-nav {
    position: fixed;
    top: 58px;
    left: 0;
    right: 0;
    width: 100%;
    background: rgba(250, 250, 249, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    padding: 16px 18px 22px;
    transform: translateY(-160%);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.12);
    z-index: 99;
  }

  [data-theme="dark"] .main-nav {
    background: rgba(22, 24, 29, 0.98);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.4);
  }

  .main-nav.open {
    transform: translateY(0);
  }

  .nav-list {
    flex-direction: column;
    gap: 4px;
  }

  .nav-link {
    display: block;
    padding: 12px 14px;
    font-size: 1.05rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
  }

  .nav-link.active {
    background: var(--bg-subtle);
    color: var(--text-main);
  }
  .nav-link.active::after {
    display: none;
  }

  /* Hero sektion på mobil */
  .hero-section {
    padding: 32px 0 36px;
  }

  .hero-container {
    gap: 24px;
  }

  .hero-photo-wrapper {
    flex-direction: row;
    align-items: center;
    gap: 16px;
  }

  .photo-frame {
    width: 84px;
    height: 96px;
    border-radius: var(--radius-md);
    flex-shrink: 0;
  }

  .portrait-initials {
    font-size: 1.5rem;
  }

  .portrait-subtext {
    display: none;
  }

  .photo-caption {
    text-align: left;
    font-size: 0.85rem;
    font-weight: 500;
  }

  .hero-badge {
    font-size: 0.775rem;
    padding: 4px 10px;
    margin-bottom: 14px;
  }

  .hero-title {
    font-size: 2.15rem;
    line-height: 1.15;
    margin-bottom: 6px;
  }

  .hero-subtitle {
    font-size: 1.025rem;
    line-height: 1.45;
    margin-bottom: 16px;
  }

  .hero-description {
    font-size: 0.975rem;
    line-height: 1.65;
    margin-bottom: 22px;
  }

  .hero-actions {
    flex-direction: column;
    gap: 10px;
    margin-bottom: 24px;
  }

  .hero-actions .btn {
    width: 100%;
    min-height: 46px;
    justify-content: center;
    font-size: 0.95rem;
  }

  .hero-meta {
    gap: 8px;
    padding-top: 16px;
  }

  .meta-row {
    padding: 10px 12px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    justify-content: flex-start;
  }

  /* Kort och innehåll på mobil */
  .about-prose p {
    font-size: 0.975rem;
    line-height: 1.7;
    margin-bottom: 14px;
  }

  .personal-traits {
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 20px;
  }

  .trait-box {
    padding: 14px;
  }

  .facts-card {
    padding: 18px;
  }

  .facts-list li {
    font-size: 0.85rem;
  }

  .edu-entry,
  .exp-card,
  .project-item {
    padding: 20px 16px;
    border-radius: var(--radius-md);
  }

  .edu-entry-header,
  .exp-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    margin-bottom: 10px;
  }

  .edu-degree {
    font-size: 1.15rem;
  }

  .edu-time,
  .exp-period {
    font-size: 0.8rem;
    color: var(--accent);
    font-weight: 600;
  }

  .edu-desc,
  .exp-points li,
  .project-item-desc {
    font-size: 0.9rem;
    line-height: 1.6;
  }

  .skills-grid,
  .projects-list {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .skills-group {
    padding: 16px;
  }

  /* Kontaktsektion på mobil */
  .contact-box {
    padding: 22px 16px;
    border-radius: var(--radius-md);
  }

  .contact-box-title {
    font-size: 1.2rem;
  }

  .contact-box-desc {
    font-size: 0.925rem;
  }

  .contact-method-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 14px;
  }

  .method-info {
    width: 100%;
  }

  .method-value {
    white-space: normal;
    word-break: break-all;
    font-size: 0.95rem;
  }

  .method-actions {
    width: 100%;
    display: flex;
    gap: 8px;
  }

  .method-actions .btn {
    flex: 1;
    justify-content: center;
  }

  .method-badge {
    width: 100%;
    text-align: center;
    border-radius: var(--radius-xs);
    font-size: 0.775rem;
  }

  /* Footer på mobil */
  .site-footer {
    padding: 32px 0;
  }

  .footer-inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
  }
}

@media (max-width: 400px) {
  .container {
    padding: 0 14px;
  }

  .hero-title {
    font-size: 1.9rem;
  }

  .edu-entry,
  .exp-card,
  .project-item {
    padding: 16px 14px;
  }
}

/* ==========================================================================
   Utskriftsanpassning (@media print)
   ========================================================================== */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
    font-size: 10pt;
    line-height: 1.35;
  }

  .site-header,
  .hero-actions,
  .toast,
  .site-footer,
  .skip-link,
  .copy-tag {
    display: none !important;
  }

  .container {
    max-width: 100% !important;
    padding: 0 !important;
  }

  .section {
    padding: 14px 0 !important;
    border-bottom: 1px solid #ddd !important;
    page-break-inside: avoid;
  }

  .hero-section {
    padding: 0 0 16px !important;
    border-bottom: 2px solid #000 !important;
  }

  .hero-title {
    font-size: 22pt !important;
  }

  .hero-photo-wrapper {
    display: none !important;
  }

  .edu-entry,
  .exp-card,
  .project-item,
  .facts-card,
  .trait-box,
  .skills-group,
  .contact-box,
  .contact-method-card {
    border: none !important;
    padding: 6px 0 !important;
    box-shadow: none !important;
    page-break-inside: avoid;
  }

  .course-pill, .clean-tag, .exp-tag {
    background: transparent !important;
    border: 1px solid #bbb !important;
    color: #000 !important;
  }
}
