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

:root {
  --bg: #141412;
  --surface: #1c1b18;
  --surface-2: #242320;
  --text-primary: #f0ead6;
  --text-secondary: #a89f88;
  --text-muted: #5c5648;
  --accent: #c9a84c;
  --accent-dim: rgba(201, 168, 76, 0.12);
  --accent-glow: rgba(201, 168, 76, 0.25);
  --border: #2a2820;
  --border-subtle: #201f1c;
  --radius: 4px;
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'DM Sans', system-ui, sans-serif;
  --font-mono: 'DM Mono', 'Fira Code', monospace;
}

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

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

/* Page load stagger animations */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.anim-1 { animation: fadeUp 0.6s cubic-bezier(0.22, 1, 0.36, 1) both; animation-delay: 0.05s; }
.anim-2 { animation: fadeUp 0.6s cubic-bezier(0.22, 1, 0.36, 1) both; animation-delay: 0.15s; }
.anim-3 { animation: fadeUp 0.6s cubic-bezier(0.22, 1, 0.36, 1) both; animation-delay: 0.25s; }
.anim-4 { animation: fadeUp 0.6s cubic-bezier(0.22, 1, 0.36, 1) both; animation-delay: 0.35s; }
.anim-5 { animation: fadeUp 0.6s cubic-bezier(0.22, 1, 0.36, 1) both; animation-delay: 0.45s; }

/* ===========================
   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: 4px;
  padding: 3px;
  z-index: 100;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

.lang-btn {
  padding: 4px 12px;
  border-radius: 3px;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-decoration: none;
  color: var(--text-muted);
  font-family: var(--font-mono);
  transition: all 0.2s;
}

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

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

/* ===========================
   LAYOUT
   =========================== */
.container {
  max-width: 980px;
  margin: 0 auto;
  padding: 5rem 2.5rem 3rem;
}

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

/* ===========================
   HEADER
   =========================== */
.header {
  margin-bottom: 3.5rem;
  position: relative;
}

/* Decorative vertical rule */
.header::before {
  content: '';
  position: absolute;
  left: -2.5rem;
  top: 0;
  width: 2px;
  height: 100%;
  background: linear-gradient(to bottom, var(--accent), transparent);
  opacity: 0.5;
}

.header-name {
  display: flex;
  align-items: flex-start;
  gap: 2rem;
  margin-bottom: 1.5rem;
}

.profile-photo {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
  border: 1px solid var(--border);
  flex-shrink: 0;
  filter: grayscale(20%) contrast(1.05);
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  margin-top: 0.3rem;
}

.header-name h1 {
  font-family: var(--font-display);
  font-size: 4rem;
  font-weight: 300;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  line-height: 0.95;
  margin-bottom: 0.6rem;
}

.header-title {
  font-size: 0.8rem;
  font-weight: 400;
  font-family: var(--font-mono);
  color: var(--accent);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.header-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.8rem;
  margin-top: 0;
  padding-left: calc(88px + 2rem);
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.8rem;
  font-family: var(--font-mono);
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s;
  letter-spacing: 0.01em;
}

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

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

/* ===========================
   DIVIDER
   =========================== */
.divider {
  height: 1px;
  background: linear-gradient(to right, var(--accent), transparent 60%);
  margin-bottom: 3rem;
  opacity: 0.4;
}

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

.section-title {
  font-size: 0.65rem;
  font-weight: 500;
  font-family: var(--font-mono);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.4rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

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

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

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

.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.8rem;
}

.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.75rem;
  font-family: var(--font-mono);
  color: var(--accent);
  font-weight: 400;
  letter-spacing: 0.04em;
  margin-top: 0.25rem;
}

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

.job-date, .job-location {
  font-size: 0.73rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

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

.job-bullets li {
  font-size: 0.84rem;
  color: var(--text-secondary);
  padding: 0.22rem 0 0.22rem 1.1rem;
  position: relative;
  line-height: 1.65;
}

.job-bullets li::before {
  content: '›';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: 1rem;
  line-height: 1.4;
  opacity: 0.7;
}

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

.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.73rem;
  font-family: var(--font-mono);
  color: var(--accent);
  margin-top: 0.2rem;
  letter-spacing: 0.04em;
}

.edu-date {
  font-size: 0.73rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: 0.02em;
}

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

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

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

.course-code {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  margin-right: 0.5rem;
  letter-spacing: 0.03em;
}

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

.lang-item {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  gap: 0.1rem 0.5rem;
  align-items: center;
}

.lang-name {
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--text-primary);
  grid-column: 1;
  grid-row: 1;
}

.lang-level {
  font-size: 0.68rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  grid-column: 2;
  grid-row: 1;
}

.lang-bar {
  height: 1px;
  background: var(--border);
  overflow: hidden;
  grid-column: 1 / -1;
  grid-row: 2;
}

.lang-fill {
  height: 100%;
  background: linear-gradient(to right, var(--accent), var(--accent-glow));
  transition: width 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

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

.skill-tag {
  font-size: 0.68rem;
  font-family: var(--font-mono);
  padding: 0.28rem 0.6rem;
  border-radius: 2px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  letter-spacing: 0.04em;
  transition: all 0.2s;
  cursor: default;
}

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

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

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

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

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

.interest-item {
  font-size: 0.8rem;
  color: var(--text-secondary);
  padding: 0.3rem 0.75rem;
  border-radius: 2px;
  background: transparent;
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.03em;
}

/* ===========================
   LOGOS
   =========================== */
.company-logo {
  height: 40px;
  width: auto;
  max-width: 140px;
  object-fit: contain;
  opacity: 0.9;
  display: block;
  margin-top: 0.2rem;
  filter: invert(1) hue-rotate(180deg);
  transition: opacity 0.2s;
}

.company-logo:hover {
  opacity: 1;
}

.edu-logo {
  height: 28px;
  width: auto;
  max-width: 140px;
  object-fit: contain;
  opacity: 0.85;
  filter: invert(1) hue-rotate(180deg);
}

.cert-logo {
  height: 34px;
  width: auto;
  max-width: 120px;
  object-fit: contain;
  opacity: 0.9;
  display: block;
  flex-shrink: 0;
  filter: invert(1) hue-rotate(180deg);
}

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

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

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

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

/* ===========================
   PORTFOLIO
   =========================== */
.portfolio-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  letter-spacing: 0.06em;
  color: var(--accent);
  text-decoration: none;
  border: 1px solid var(--accent);
  padding: 0.45rem 1rem;
  border-radius: 2px;
  transition: all 0.2s;
  text-transform: uppercase;
}

.portfolio-link:hover {
  background: var(--accent-dim);
  box-shadow: 0 0 16px var(--accent-glow);
}

/* ===========================
   FOOTER
   =========================== */
.footer {
  text-align: center;
  padding: 2rem;
  font-size: 0.68rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  border-top: 1px solid var(--border-subtle);
  margin-top: 2rem;
  letter-spacing: 0.06em;
}

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

  .container {
    padding: 3.5rem 1.4rem 2rem;
  }

  .header::before {
    display: none;
  }

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

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

  .header-meta {
    padding-left: 0;
    margin-top: 1rem;
    gap: 0.5rem 1.2rem;
  }

  .header-name {
    gap: 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;
    color: #111;
    font-size: 11pt;
  }

  :root {
    --bg: #fff;
    --surface: #fff;
    --text-primary: #111;
    --text-secondary: #444;
    --text-muted: #888;
    --accent: #996600;
    --border: #ddd;
    --border-subtle: #eee;
  }

  .lang-toggle,
  .header::before {
    display: none;
  }

  .container {
    padding: 1rem;
    max-width: 100%;
  }

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

  .company-logo,
  .edu-logo {
    opacity: 0.85;
  }
}
