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

:root {
  --bg: #f9f9f7;
  --surface: #ffffff;
  --text-primary: #1a1a1a;
  --text-secondary: #5a5a5a;
  --text-muted: #9a9a9a;
  --accent: #2563eb;
  --accent-light: #dbeafe;
  --border: #e8e8e4;
  --radius: 8px;
  --font: 'Inter', system-ui, -apple-system, sans-serif;
}

html {
  font-size: 15px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

/* ===========================
   LANGUAGE TOGGLE
   =========================== */
.lang-toggle {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  display: flex;
  gap: 2px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
}

.lang-btn {
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-decoration: none;
  color: var(--text-secondary);
  transition: all 0.2s;
}

.lang-btn:hover {
  color: var(--text-primary);
  background: var(--bg);
}

.lang-btn.active {
  background: var(--accent);
  color: #fff;
}

/* ===========================
   LAYOUT
   =========================== */
.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 4rem 2rem 2rem;
}

.grid-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 3rem;
  align-items: start;
}

/* ===========================
   HEADER
   =========================== */
.header {
  margin-bottom: 2.5rem;
}

.header-name {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.profile-photo {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
  border: 2px solid var(--border);
  flex-shrink: 0;
}

.header-name h1 {
  font-size: 2.8rem;
  font-weight: 300;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  line-height: 1.1;
}

.header-title {
  font-size: 1rem;
  font-weight: 400;
  color: var(--text-secondary);
  margin-top: 0.4rem;
  letter-spacing: 0.01em;
}

.header-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  margin-top: 1.2rem;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s;
}

.meta-item:hover {
  color: var(--accent);
}

.meta-item svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  opacity: 0.7;
}

/* ===========================
   DIVIDER
   =========================== */
.divider {
  height: 1px;
  background: var(--border);
  margin-bottom: 2.5rem;
}

/* ===========================
   SECTIONS
   =========================== */
.section {
  margin-bottom: 2.5rem;
}

.section-title {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1.2rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

/* ===========================
   ABOUT
   =========================== */
.about-text {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.75;
  margin-bottom: 0.8rem;
}

.about-text:last-child {
  margin-bottom: 0;
}

/* ===========================
   EXPERIENCE
   =========================== */
.job {
  margin-bottom: 1.8rem;
  padding-bottom: 1.8rem;
  border-bottom: 1px solid var(--border);
}

.job:last-child {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 0;
}

.job-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.7rem;
}

.job-header-left {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.job-title {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.3;
}

.job-company {
  display: block;
  font-size: 0.82rem;
  color: var(--accent);
  font-weight: 400;
  margin-top: 0.2rem;
}

.job-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.15rem;
  flex-shrink: 0;
}

.job-date, .job-location {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.job-bullets {
  list-style: none;
  padding: 0;
}

.job-bullets li {
  font-size: 0.85rem;
  color: var(--text-secondary);
  padding: 0.2rem 0 0.2rem 1rem;
  position: relative;
  line-height: 1.6;
}

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

/* ===========================
   EDUCATION
   =========================== */
.edu-item {
  margin-bottom: 1.2rem;
  padding-bottom: 1.2rem;
  border-bottom: 1px solid var(--border);
}

.edu-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.edu-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.edu-degree {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary);
}

.edu-school {
  display: block;
  font-size: 0.8rem;
  color: var(--accent);
  margin-top: 0.15rem;
}

.edu-date {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.edu-thesis {
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-style: italic;
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}

.edu-courses {
  list-style: none;
  margin-top: 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.edu-courses li {
  font-size: 0.8rem;
  color: var(--text-secondary);
  padding-left: 0.5rem;
  line-height: 1.5;
}

.course-code {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-family: monospace;
  margin-right: 0.4rem;
  letter-spacing: 0.02em;
}

/* ===========================
   LANGUAGES
   =========================== */
.lang-list {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.lang-item {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.lang-name {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
}

.lang-level {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.lang-bar {
  height: 2px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.lang-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.6s ease;
}

/* ===========================
   SKILLS
   =========================== */
.skills-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.skill-tag {
  font-size: 0.75rem;
  padding: 0.25rem 0.65rem;
  border-radius: 4px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-weight: 400;
  transition: all 0.2s;
}

.skill-tag:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}

/* ===========================
   CERTIFICATIONS
   =========================== */
.cert-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.cert-list li {
  font-size: 0.82rem;
  color: var(--text-secondary);
  padding-left: 1rem;
  position: relative;
  line-height: 1.5;
}

.cert-list li::before {
  content: '·';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.3;
}

/* ===========================
   INTERESTS
   =========================== */
.interests {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.interest-item {
  font-size: 0.82rem;
  color: var(--text-secondary);
  padding: 0.3rem 0.7rem;
  border-radius: 4px;
  background: var(--bg);
  border: 1px solid var(--border);
}

/* ===========================
   LOGOS
   =========================== */
.company-logo {
  height: 44px;
  width: auto;
  max-width: 160px;
  object-fit: contain;
  opacity: 0.85;
  display: block;
  margin-top: 0.3rem;
}

.edu-logo {
  height: 30px;
  width: auto;
  max-width: 160px;
  object-fit: contain;
  opacity: 0.85;
}

.cert-logo {
  height: 36px;
  width: auto;
  max-width: 130px;
  object-fit: contain;
  opacity: 0.85;
  display: block;
  flex-shrink: 0;
}


/* Element Logic logo has lots of whitespace — scale it up */
img[alt="Element Logic"] {
  height: 64px;
  max-width: 200px;
}

/* Hero Tolk is very wide — constrain width, let height follow */
img[alt="Hero Tolk"] {
  height: auto;
  width: 100px;
  max-width: 200px;
}

/* UiS logo is tall/portrait — cap height */
img[alt="University of Stavanger"],
img[alt="Universitetet i Stavanger"] {
  height: 70px;
  width: auto;
  max-width: 100px;
}

/* OsloMet logo is very large — cap it */
img[alt="OsloMet"] {
  height: 70px;
  width: auto;
  max-width: 120px;
}

/* ===========================
   PORTFOLIO
   =========================== */
.portfolio-link {
  font-size: 0.85rem;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid var(--accent-light);
  transition: border-color 0.2s;
}

.portfolio-link:hover {
  border-color: var(--accent);
}

/* ===========================
   FOOTER
   =========================== */
.footer {
  text-align: center;
  padding: 2rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  margin-top: 2rem;
}

/* ===========================
   RESPONSIVE
   =========================== */
@media (max-width: 720px) {
  html {
    font-size: 14px;
  }

  .container {
    padding: 3.5rem 1.25rem 1.5rem;
  }

  .grid-layout {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .header-name h1 {
    font-size: 2rem;
  }

  .header-meta {
    gap: 0.6rem 1.2rem;
  }

  .job-header {
    flex-direction: column;
    gap: 0.3rem;
  }

  .job-meta {
    align-items: flex-start;
    flex-direction: row;
    gap: 0.5rem;
  }

  .edu-header {
    flex-direction: column;
    gap: 0.3rem;
  }

  .lang-toggle {
    top: 1rem;
    right: 1rem;
  }
}

@media print {
  body {
    background: #fff;
    font-size: 11pt;
  }

  .lang-toggle {
    display: none;
  }

  .container {
    padding: 1rem;
  }

  .job, .edu-item {
    page-break-inside: avoid;
  }
}
