@font-face {
  font-family: "fraunces";
  src: url("fonts/Fraunces-VariableFont_SOFT\,WONK\,opsz\,wght[1].woff2") format("woff");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
    font-family: "inter, san-serif";
    src: url(fonts/Inter-VariableFont_opsz\,wght.woff) format("woff");
}

:root{
  /* Backgrounds */
  --color-bg: #F3E3CE;
  --color-surface: #7A8F6A;
  --bg-image: url(images/background.jpg);

  /* Text */
  --color-text-primary: #2E2A26;
  --color-text-secondary: #3F6A45;
  --color-text-on-green: #F3E3CE;

  /* Accent */
  --color-accent: #3F6A45;

  /* Borders */
  --color-border: #ffffffd4;

  /*card*/
  --color-card: #f7eadb;
}

body.dark{
    /*background*/
    --color-bg: #2e2a26;
    --bg-image: url(images/background-dark.jpg);

    /* text*/
    --color-text-primary: #f3e3ce;
    --color-text-secondary: #7a8f6a;
    --color-text-on-green: #2e2a26;

    --color-accent: #7a8f6a;

    /*border */
     --color-border: #6e5f4cd4;

    /*card*/
    --color-card: #36312d;
}

*{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition: background-color 0.4s ease, color 0.4s ease, border-color 0.4s ease;
}
html {
  scroll-behavior: smooth;
}


body{
    background-color: var(--color-bg);
    color: var(--color-text-primary);
    transition: background-color 0.4s ease, color 0.4s ease;
}

html, body {
    overflow-x: clip;
}

.scroll-watcher{
    height: 5px;
    position: fixed;
    top: 0;
    z-index: 1000;
    background-color: var(--color-accent);
    width: 100%;
    scale: 0 1;
    transform-origin: left;

    animation: scrollWatcher linear;
    animation-timeline: scroll();
}

@keyframes scrollWatcher {
    to { scale: 1 1;}
}

/*Kode til typerwriter effekt -------------------*/
 .typewriter-container{
    width: fit-content;
    z-index: 10;
}

.typewriter {
  opacity: 0;
  overflow: hidden;
  white-space: nowrap;
  border-right: 2px solid var(--color-text-primary);
}

.typewriter.animate {
  opacity: 1;
  animation: typing 2s steps(20, end) forwards, blink .7s step-end infinite;
}

@keyframes typing {
  from { width: 0 }
  to { width: 100% }
}

@keyframes blink {
  50% { border-color: transparent }
}


/*-----------------------------------------------------*/

h1{
    font-size: clamp(2rem, calc(7vw + 1rem), 5rem);
    color: var(--color-text-primary);
    margin-bottom: 2rem;
    margin-top: 6rem;
}

.heading{
    width: 100%;
    margin: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

h1, h2{
    font-family: "fraunces", serif;
    width: 100%;
    font-weight: 500;
}

h2{
    font-size: clamp(1.5rem, 3vw, 2.2rem);
    color: var(--color-text-primary);
}

h3, p, a{
    font-family: "inter, san-serif";
}

p{
    font-size: clamp(1rem, 1.8vw, 1.3rem);
    line-height: 1.6;;
}

.btn{
    display: flex;
    justify-content: center;
    width: fit-content;
    padding: 1rem 1.5rem;
    background-color: #5B7CA4;
    color: #ffffff;
    text-decoration: none;
    font-weight: 400;
    font-size: 1.2rem;
    border-radius: 50px;
    margin: 3rem auto 0;
    transition: 0.3s ease-in-out;
    box-shadow: 4px 4px 8px #00000033;
}
.btn:hover{
    background-color: #A2B7CF;
    color: #2E2A26;
    transform: scale(1.05);
    cursor: pointer;
}

.line{
    width: 100%;
    height: 22px;
    background-color: #1E1406;
    z-index: 20;
    display: flex;
    position: relative;
}

/*header sektion*/

header{
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: auto;
    z-index: 100;

    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem clamp(1rem, 4vw, 2rem);
    flex-direction: row;
    
    background-color: #f3e3ce1b;
    backdrop-filter: blur(5px);
    border-bottom: 1px solid var(--color-border);
    box-shadow: 3px 3px 3px #00000012;
}



header img {
    height: clamp(2.6rem, 6vw, 4rem);
    width: auto;
    transition: 0.5s ease-in-out;
}
#logo img:hover{
    transform: scale(1.1);
    cursor: pointer;
}

.header-nav{
    display: flex;
    gap: 20px;
    align-items: center;
}
.header-nav ul{
    list-style: none;
    display: flex;
    gap: 2em;
    justify-content: space-evenly;
}
.header-nav ul li a{
    text-decoration: none;
    color: var(--color-text-primary);
    font-weight: 500;
    font-size: 1.5rem;
    transition: 0.3s ease-in-out;
    font-family: "fraunces", serif;
}

.theme-toggle{
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 0.4rem;
}

.theme-toggle svg{
  width: 26px;
  height: 26px;
  fill: var(--color-text-primary);
  transition: transform 0.4s ease, fill 0.3s ease;
}

.theme-toggle:hover svg{
  transform: rotate(15deg);
}

#burger, #burger-close{
    fill: var(--color-text-primary)
}

/*--------mobile menu toggle-----------*/
.mobile-nav{
    display: none;
}

.mobile-nav img{
    width: 100%;
    height: auto;
}


.mobil-menu{
    position: fixed;
    z-index: 900;
    top: 0;
    right: 0;
    width: min(360px, 80vw);
    height: 100vh;
    padding: 3rem 2rem 2rem;

    background-color: var(--color-bg);
    backdrop-filter: blur(5px);
    border-left: 1px solid var(--color-border);
    box-shadow: -3px 3px 3px #00000012;
    box-sizing: border-box;

    display: flex;
    justify-content: center;
    align-items: center;
    overflow: visible;

    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
}

.mobil-menu ul{
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 2em;
    justify-content: space-evenly;
}

.mobil-menu ul li a{
    text-decoration: none;
    color: var(--color-text-primary);
    font-weight: 500;
    font-size: 1.5rem;
    transition: 0.3s ease-in-out;
    font-family: "fraunces", serif;
}

.mobil-menu.is-open{
    transform: translateX(0);
}

.close-menu{
    position: absolute;
    top: 0;
    right: 0;
    background: none;
    border: none;
    z-index: 1001;

    background: none;
    border: none;
    padding: 0.5rem;
    display: flex;
    align-items: center;
}

.close-menu img{
    width: 30px;
    height: 30px;
    display: block;
}


/*animation for projects sektion*/

#m-leaf-right-back, #m-leaf-left, #t-leaf, #t-leaf-8{
    animation: sway 5s ease-in-out infinite;
    transform-origin: 50% 90%;
}
#m-leaf-right-front, #m-leaf-front, #t-leaf-2, #t-leaf-1{
    animation: sway2 5s ease-in-out infinite;
    transform-origin: 50% 90%;
}
#m-leaf-back-left, #m-leaf-right, #m-leaf-back, #t-leaf-3{
    animation: sway3 5s ease-in-out infinite;
    transform-origin: 50% 90%;
}
#m-leaf-mid, #t-leaf-6, #t-leaf-7{
    animation: sway4 5s ease-in-out infinite;
    transform-origin: 50% 90%;
}
#right-branch{
    animation: sway 5s ease-in-out infinite;
    transform-origin: 80% 50%;
}
#left-branch{
    animation: sway2 5s ease-in-out infinite;
    transform-origin: 10% 50%;
}
#top-branch{
    animation: sway3 5s ease-in-out infinite;
    transform-origin: 70% 20%;
}

@keyframes sway {
  0%   { transform: rotate(0deg); }
  50%  { transform: rotate(2deg); }
  100% { transform: rotate(0deg); }
}
@keyframes sway2 {
  0%   { transform: rotate(0deg); }
  50%  { transform: rotate(-2deg); }
  100% { transform: rotate(0deg); }
}
@keyframes sway3 {
  0%   { transform: rotate(0deg); }
  50%  { transform: rotate(1.5deg); }
  100% { transform: rotate(0deg); }
}
@keyframes sway4 {
    0%   { transform: rotate(0deg); }
    50%  { transform: rotate(-0.5deg); }
    100% { transform: rotate(0deg); }
}


/*slider til indhold/billeder-----------------*/
.indholds-heading{
    display: flex;
    width: 80%;
    margin: auto;
}

.indholds-slider-wrap{
  position: relative;
  width: 80%;
  margin: 2rem auto;
}

/* din slider */
.indholds-slider{
  display: flex;
  gap: 4rem;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth; /* lækker desktop scroll på klik */
  padding: 0 3rem;         /* plads til pile */
}

/* skjul scrollbar (Chrome/Safari/Edge) */
.indholds-slider::-webkit-scrollbar{
  display: none;
}

/* skjul scrollbar (Firefox) */
.indholds-slider{
  scrollbar-width: none;
}

/* billeder */
.indholds-slider img{
  width: 40%;
  aspect-ratio: 8/9;
  object-fit: cover;
}

/* Pile */
.slider-btn{
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  cursor: pointer;
  display: grid;
  background: none;
  color: var(--color-text-primary);
  z-index: 2;
}
.slider-btn svg{
    fill: var(--color-text-primary);
}

.slider-btn.prev{ 
    left: -5px; }
.slider-btn.next{ 
    right: -5px; }

.slider-btn svg:hover{
  fill: var(--color-text-secondary);
  
}


@media screen and (max-width: 600px){
    .indholds-slider-wrap{
        width: 90%;
    }

    .indholds-slider{
        gap: 1rem;
        padding: 0;
        scroll-snap-type: x mandatory;
    }

    .indholds-slider img{
        flex: 0 0 80%;
        width: 20%;
        scroll-snap-align: start;
    }
    .slider-btn{
        display: none;
    }

    #logo img:hover{
        transform: none;
    }

    .header-nav{
        display: none;
    }
    .mobile-nav{
        display: flex;
        align-items: center;
        margin-left: auto;
    }
    .mobile-nav img{
        width: 26px;
        height: 26px;
        display: block;
    }
    .mobile-actions{
        display: flex;
        align-items: center;
        gap: 0.75rem;
    }
    .burger-btn, .theme-toggle{
        background: none;
        border: none;
        padding: 0.4rem;
        display: flex;
        align-items: center;
    }

    .btn{
        margin: 1rem auto 0;
    }
    .btn:hover{
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior: auto; }

  *, *::before, *::after{
    animation: none;
    transition: none;
  }

  /* scroll-watcher skal bare være statisk */
  .scroll-watcher{
    scale: 1 1;
  }

  /* typewriter: vis teksten uden cursor */
  .typewriter{
    opacity: 1;
    width: auto;
    border-right: 0;
    white-space: normal;
    overflow: visible;
  }
}

@supports not (animation-timeline: scroll()){
  .scroll-watcher{ display: none; }
}
