/* ===========================
   VARIABLES
=========================== */
:root {
  --bg-dark: #2a2a2e;
  --bg-light: #f2f2f2;
  --text-dark: #1e1e1e;
  --text-light: #f0f0f0;
  --accent: #ff9900;
  --box-dark: #383841;
  --box-light: #ffffff;

  /* Journey timeline tuning */
  --tl-line: 4px;          /* tykkelse på senterlinja */
  --tl-connector: 2.2rem;  /* avstand fra kortkant til senterlinje */
  --tl-dot: 14px;          /* diameter på prikk */
}

/* ===========================
   COLOR MODES
=========================== */
body.dark-mode { background: var(--bg-dark); color: var(--text-light); }
body.light-mode { background: var(--bg-light); color: var(--text-dark); }

body.light-mode nav,
body.light-mode footer { background: #e0e0e0; color: var(--text-dark); }

body.light-mode .nav-links a { color: var(--text-dark); }

body.dark-mode .skills-grid div,
body.dark-mode .project-card { background: var(--box-dark); }

body.light-mode .skills-grid div,
body.light-mode .project-card { background: var(--box-light); }

/* ===========================
   BASE / LAYOUT
=========================== */
body {
  margin: 0;
  font-family: 'Segoe UI', sans-serif;
  transition: background 0.3s, color 0.3s;
}

section { padding: 60px 20px; max-width: 1000px; margin: auto; }

/* ===========================
   NAV
=========================== */
nav {
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px 40px; background-color: #111;
}
.logo { font-size: 1.5rem; font-weight: bold; }
.nav-links { list-style: none; display: flex; gap: 20px; }
.nav-links a { color: var(--text-light); text-decoration: none; font-weight: 500; }

/* ===========================
   HERO
=========================== */
.hero { text-align: center; padding: 100px 20px; background: linear-gradient(#111, #2a2a2e); }
.hero-content h1 { font-size: 3rem; }
.hero-content span { color: var(--accent); }

/* ===========================
   BUTTONS / LINKS
=========================== */
.btn, button {
  background: var(--accent); color: #111; font-weight: bold;
  padding: 10px 25px; border: none; border-radius: 5px;
  cursor: pointer; text-decoration: none;
}
a { color: var(--accent); }

/* ===========================
   LEARNING ROADMAP (cards list)
   (HTML: .roadmap + .roadmap-container + .roadmap-item)
=========================== */
.roadmap { padding: 60px 20px; max-width: 800px; margin: auto; }
.roadmap h2 { text-align: center; font-size: 2rem; margin-bottom: 40px; }

.roadmap-container {
  display: flex; flex-direction: column; gap: 20px; margin-top: 30px;
}

.roadmap-item {
  border-left: 4px solid var(--accent);
  padding: 15px 20px 15px 20px;
  background: var(--box-dark); color: var(--text-light);
  border-radius: 6px;
}
body.light-mode .roadmap-item { background: var(--box-light); color: var(--text-dark); }

.roadmap-item.current {
  border-color: #00c853;
  box-shadow: 0 0 10px rgba(0, 200, 83, 0.5);
}

/* ===========================
   SKILLS
=========================== */
.skills-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 15px; margin-top: 20px;
}
.skills-grid div { padding: 15px; text-align: center; border-radius: 8px; }

/* ===========================
   PORTFOLIO
=========================== */
.portfolio-grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.project-card { padding: 10px; border-radius: 10px; text-align: center; }
.project-card img { width: 100%; border-radius: 8px; }

/* ===========================
   MODAL
=========================== */
.modal {
  display: none; position: fixed; z-index: 1000; padding-top: 60px;
  left: 0; top: 0; width: 100%; height: 100%; overflow: auto;
  background-color: rgba(0,0,0,0.8);
}
.modal-content {
  background-color: var(--box-dark); margin: auto; padding: 20px;
  border: 1px solid var(--accent); width: 80%; border-radius: 10px; color: var(--text-light);
}
body.light-mode .modal-content { background-color: var(--box-light); color: var(--text-dark); }
.modal-content h3 { margin-top: 0; }
.close { color: var(--accent); float: right; font-size: 28px; font-weight: bold; cursor: pointer; }

/* ===========================
   FORMS
=========================== */
form { display: flex; flex-direction: column; gap: 15px; max-width: 500px; margin: auto; }
input, textarea { padding: 10px; border: none; border-radius: 4px; }

/* ===========================
   FOOTER
=========================== */
footer { background: #111; text-align: center; padding: 20px; }
.socials a { color: var(--accent); text-decoration: none; margin: 0 5px; }

/* ===========================
   EXPERIENCE (simple list)
   (HTML: section.experience > .timeline > .timeline-item)
   Bevisst minimal stil for å ikke kollidere med Journey.
=========================== */
.experience .timeline { margin-top: 20px; }
.experience .timeline-item { 
  background: var(--box-dark); color: var(--text-light);
  border-left: 4px solid var(--accent); padding: 16px 20px; border-radius: 8px;
}
body.light-mode .experience .timeline-item { background: var(--box-light); color: var(--text-dark); }
.experience .timeline-item span { color: var(--accent); font-weight: bold; }

/* ===========================
   MY JOURNEY (centered alternating timeline)
   (HTML: section.roadmap.journey > .timeline > .timeline-item.left|right > .timeline-content)
=========================== */
/* ===== MY JOURNEY – presis geometri ===== */
:root{
  --tl-line: 4px;          /* tykkelse på senterlinja */
  --tl-gap: 2.6rem;        /* HOVEDKNAPPEN: avstand fra kortkant til senterlinje */
  --tl-dot: 14px;          /* diameter på prikk */
}

/* Container + senterlinje */
.journey .timeline{
  position: relative;
  max-width: 1000px;
  margin: auto;
  padding: 40px 0;
}
.journey .timeline::before{
  content:"";
  position:absolute; top:0; bottom:0;
  left:50%;
  width: var(--tl-line);
  background: var(--accent);
  transform: translateX(-50%);
}

/* Kortbredde og -plassering styres av samme gap på begge sider */
.journey .timeline-item{
  position: relative;
  /* 50% minus gap til linja minus halv linjetykkelse */
  width: calc(50% - var(--tl-gap) - (var(--tl-line) / 2));
  margin: 2rem 0;
}
.journey .timeline-item.left{  left: 0;  margin-right:auto; text-align: right; }
.journey .timeline-item.right{
  /* start like langt fra midten som venstre */
  left: calc(50% + var(--tl-gap) + (var(--tl-line) / 2));
  margin-left:auto; text-align: left;
}

/* Selve kortet */
.journey .timeline-item .timeline-content{
  position: relative;
  padding: 20px;
  border-radius: 8px;
  background: var(--box-dark);
  box-shadow: 0 10px 24px rgba(0,0,0,.25);
}
body.light-mode .journey .timeline-item .timeline-content{ background: var(--box-light); color: var(--text-dark); }
body.dark-mode  .journey .timeline-item .timeline-content{ background: var(--box-dark);  color: var(--text-light); }
.journey .timeline-content h3{ margin-top:0; color:var(--accent); text-align:center; }

/* Vannrett kobler fra kortkant til linje – alltid midt på kortet */
.journey .timeline-item.left::before,
.journey .timeline-item.right::before{
  content:"";
  position:absolute; top:50%; transform: translateY(-50%);
  height:3px; width: var(--tl-gap);
  background: var(--accent);
}
.journey .timeline-item.left::before{  right: calc(-1 * var(--tl-gap)); }
.journey .timeline-item.right::before{ left:  calc(-1 * var(--tl-gap)); }

/* Prikken – senteret treffer senterlinja nøyaktig */
.journey .timeline-item::after{
  content:"";
  position:absolute; top:50%; transform: translateY(-50%);
  width: var(--tl-dot); height: var(--tl-dot); border-radius:50%;
  background: var(--bg-dark); border:3px solid var(--accent); z-index:2;
}
body.light-mode .journey .timeline-item::after{ background: var(--bg-light); }

/* offset = gap + halv linjetykkelse + halv dot-diameter */
.journey .timeline-item.left::after{
  right: calc(-1 * (var(--tl-gap) + (var(--tl-line)/2) + (var(--tl-dot)/2)));
}
.journey .timeline-item.right::after{
  left:  calc(-1 * (var(--tl-gap) + (var(--tl-line)/2) + (var(--tl-dot)/2)));
}

/* Mobil: stack til én kolonne, behold korrekt prikkplassering */
@media (max-width: 768px){
  .journey .timeline::before{ left:30px; transform:none; }
  .journey .timeline-item{
    width:auto; left:0 !important; margin-left:3.5rem; text-align:left;
  }
  .journey .timeline-item.left::before,
  .journey .timeline-item.right::before{
    left:-1.5rem; right:auto; width:1.5rem;
  }
  .journey .timeline-item::after{
    left: calc(-1.5rem - (var(--tl-dot)/2) - (var(--tl-line)/2));
    right:auto;
  }
}
