*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Färgtema */
:root {
  --black: #000000;
  --blue: #336699; /* lite ljusare blå */
  --white: #ffffff;
  --accent: #ffffff; /* vit markeringsfärg */
}

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  font-family: Arial, sans-serif;
  background-color: var(--white);
  color: var(--black);
}

header {
  background-color: var(--black);
  color: var(--blue);
  padding: 0 1rem;
  height: 80px; /* längre header */
  line-height: 80px;
  text-align: center;
  font-family: 'Permanent Marker', cursive;
  font-size: 2.5rem;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
  width: 100%;
  position: relative; /* utgångsläge */
  transition: box-shadow 0.3s ease;
}

nav {
  background-color: var(--blue);
  display: flex;
  justify-content: center;
  gap: 2rem;
  padding: 0.75rem 0;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  width: 100%;
  position: relative;
  transition: box-shadow 0.3s ease;
  flex-wrap: wrap; /* så länkarna kan radbrytas på små skärmar */
}

nav a {
  color: var(--white);
  text-decoration: none;
  font-weight: bold;
  font-size: 1.1rem;
  padding: 0.25rem 0.5rem;
  transition: background-color 0.3s, color 0.3s;
}

nav a.active,
nav a:hover {
  background-color: var(--accent);
  border-radius: 5px;
  color: var(--black);
}

main {
  flex: 1 0 auto; /* gör main flexibel så den fyller kvarvarande utrymme */
  max-width: 800px;
  margin: 2rem auto;
  padding: 1rem 2rem;
  line-height: 1.6;
  /* background removed */
  /* border-radius removed */
}

/* Rundad ruta runt välkomsttexten */
main section p {
  border: 3px solid var(--blue);
  border-radius: 20px;
  padding: 1.5rem 2rem;
  background-color: #f0f0f0; /* ljus offwhite */
  max-width: 700px;
  margin: 0 auto 2rem auto; /* centrera och ge margin under */
  font-size: 1.1rem;
  line-height: 1.7;
  box-shadow: 0 6px 15px rgba(0,0,0,0.15);
}

footer {
  background-color: var(--black);
  color: var(--white);
  text-align: center;
  padding: 1rem;
  margin-top: 3rem;
  font-size: 0.9rem;
  box-shadow: 0 -4px 6px rgba(0, 0, 0, 0.2);
  flex-shrink: 0; /* så att footern inte krymper */
}

footer a {
  color: var(--accent);
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

.paolo-img {
  width: 100%;
  max-width: 635px;
  height: auto;
  display: block;
  margin: 2rem auto;
  border-radius: 10px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  object-fit: cover;
}

/* Responsiv */
@media (max-width: 600px) {
  nav {
    flex-direction: column;
    gap: 1rem;
  }

  header {
    font-size: 2rem;
    height: 60px;
    line-height: 60px;
  }

  main {
    padding: 1rem;
    padding-top: 110px; /* justera efter header/nav höjd */
    margin: 0 auto;
    max-width: 95%; /* gör main smalare och centrerad */
  }

  .paolo-img {
    max-width: 100%;
    height: auto;
  }

  #main-nav.sticky {
    top: 60px; /* justera sticky nav under header på små skärmar */
  }
}

/* Sticky-klasser */
.sticky {
  position: fixed;
  width: 100%;
  left: 0;
  z-index: 999;
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

#main-header.sticky {
  top: 0;
}

#main-nav.sticky {
  top: 80px; /* samma som headerns höjd */
}

/* Teknisk sektion */
.tech-section {
  background-color: #e7e7e7; /* mer offwhite för kontrast */
  margin: 2rem auto;
  max-width: 800px;
  padding: 1.5rem 2rem;
  border-radius: 10px;
  box-shadow: 0 6px 15px rgba(0,0,0,0.15);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.5rem;
}

.tech-section h2 {
  flex-basis: 100%;
  font-family: 'Permanent Marker', cursive;
  margin-bottom: 0.5rem;
  font-size: 2rem;
  color: var(--blue);
}

.tech-section p {
  flex: 1 1 300px;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--black);
}

.tech-section img {
  flex: 1 1 300px;
  max-width: 300px;
  border-radius: 10px;
  box-shadow: 0 6px 15px rgba(0,0,0,0.2);
  object-fit: cover;
}

@media (max-width: 700px) {
  .tech-section {
    flex-direction: column;
  }

  .tech-section p,
  .tech-section img {
    flex-basis: 100%;
    max-width: 100%;
  }
}

/* Projekt-sektion */
.project-section {
  background-color: #e7e7e7; /* mer offwhite för kontrast */
  margin: 2rem auto;
  max-width: 800px;
  padding: 1.5rem 2rem;
  border-radius: 10px;
  box-shadow: 0 6px 15px rgba(0,0,0,0.15);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.5rem;
}

.project-section h2 {
  flex-basis: 100%;
  font-family: 'Permanent Marker', cursive;
  margin-bottom: 0.5rem;
  font-size: 2rem;
  color: var(--blue);
}

.project-section p {
  flex: 1 1 300px;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--black);
}

.project-section img {
  flex: 1 1 300px;
  max-width: 300px;
  border-radius: 10px;
  box-shadow: 0 6px 15px rgba(0,0,0,0.2);
  object-fit: cover;
}

@media (max-width: 700px) {
  .project-section {
    flex-direction: column;
  }

  .project-section p,
  .project-section img {
    flex-basis: 100%;
    max-width: 100%;
  }
}

/* Kontakt */
.kontakt {
  margin-top: 2rem;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

.kontakt table {
  width: 100%;
  border-collapse: collapse;
  background-color: var(--white);
  box-shadow: 0 6px 15px rgba(0,0,0,0.15);
  border-radius: 8px;
  overflow: hidden;
}

.kontakt th,
.kontakt td {
  text-align: left;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #ddd;
  font-size: 1rem;
  color: var(--black);
}

.kontakt th {
  background-color: var(--blue);
  color: var(--white);
  width: 35%;
}

.kontakt tr:last-child td {
  border-bottom: none;
}

.kontakt a {
  color: var(--blue);
  text-decoration: none;
  font-weight: 600;
}

.kontakt a:hover {
  text-decoration: underline;
}
