/*
Theme Name: Tim Berger Portfolio
Theme URI: https://timtimtim.de/
Author: Tim Berger
Description: Custom portfolio theme with a native WordPress backend for projects, images, content and site settings.
Version: 3.0.18
Text Domain: tim-berger-portfolio
*/

:root{
  --ink:#232323;
  --gray-mid:#3f3f3f;
  --gray-light:#3f3f3f;
  --gray-hover:#232323;
  --bg:#f4efe9;
}

*{box-sizing:border-box;}
html,body{margin:0;padding:0;}
html{background:var(--bg);}
body{
  background:var(--bg);
  color:var(--ink);
  font-family:'Alte Haas Grotesk',Arial,sans-serif;
  min-height:100vh;
  overflow-x:hidden;
}

a,button,input,textarea{font-family:inherit;}
a,button{
  color:inherit;
  text-decoration:none;
}
button{
  background:none;
  border:0;
  padding:0;
  cursor:pointer;
}

.frame{
  position:relative;
  min-height:100vh;
  display:flex;
  flex-direction:column;
  padding:28px 40px 24px;
}

/* ==========================================================
   HEADER / NAVIGATION
   ========================================================== */
.site-header{
  position:relative;
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:24px;
  z-index:200;
}

.header-left{min-width:0;position:relative;}
.service-menu-zone{position:relative;max-width:calc(100vw - 80px);}
.brand-home{display:block;width:max-content;}
.logo{
  display:block;
  width:360px;
  max-width:42vw;
  height:54px;
  object-fit:contain;
  object-position:left center;
}

.service-nav{
  display:flex;
  align-items:baseline;
  gap:4px;
  margin-top:7px;
  font-size:15px;
  line-height:1.15;
  white-space:nowrap;
}
.service-link{
  color:var(--ink);
  font-size:inherit;
  line-height:inherit;
  font-weight:400;
  transition:color .15s ease, opacity .15s ease;
}
.service-link:hover,
.service-link.peek,
.service-link.active{font-weight:400;}

/* When a service is previewed, keep the selected service in the primary
   text colour and push the other two into the secondary grey. */
body.service-menu-open .service-link,
body.consulting-preview .service-link{
  color:var(--gray-mid);
  font-weight:400;
}
body.service-menu-open .service-link.active,
body.service-menu-open .service-link.peek,
body.consulting-preview .service-link.active,
body.consulting-preview .service-link.peek{
  color:var(--ink);
  font-weight:400;
}
.service-sep{color:var(--gray-mid);}

.top-right{
  display:flex;
  align-items:center;
  gap:1.15px;
  padding-top:6px;
  font-size:15px;
  font-weight:400;
  white-space:nowrap;
}
.top-right > a{width:auto;text-align:left;}
.top-right .sep,
.bottom-row .sep{color:var(--gray-light);margin:0 2.3px;}
.top-right a:hover,
.top-right a.active,
.bottom-row a:hover,
.bottom-row a.active{color:var(--gray-hover);}

.service-dropdown{
  display:flex;
  flex-direction:row;
  flex-wrap:nowrap;
  align-items:baseline;
  gap:0;
  --dropdown-offset:0px;
  width:min(1200px,calc(100vw - 80px - var(--dropdown-offset)));
  margin-left:var(--dropdown-offset);
  max-width:none;
  max-height:0;
  opacity:0;
  overflow-x:auto;
  overflow-y:hidden;
  scrollbar-width:none;
  pointer-events:none;
  margin-top:0;
  margin-right:0;
  margin-bottom:0;
  padding:0;
  font-size:15px;
  line-height:1.3;
  transition:max-height .18s ease, opacity .15s ease, margin .18s ease;
}
.service-dropdown::-webkit-scrollbar{display:none;}
.service-dropdown.visible:not(.consulting){
  max-height:34px;
  opacity:1;
  pointer-events:auto;
  margin-top:7px;
}
.service-project-link,
.service-empty{
  display:inline-flex;
  align-items:baseline;
  font-weight:400;
  color:var(--gray-mid);
  line-height:1.25;
  white-space:nowrap;
}
.service-project-link + .service-project-link::before{
  content:"|";
  display:inline-block;
  margin:0 6px;
  color:var(--gray-mid);
  font-weight:400;
}
.service-project-link:hover,
.service-project-link:focus-visible{color:var(--ink);font-weight:400;outline:none;}

.service-dropdown.consulting{
  position:absolute;
  left:0;
  top:84px;
  width:min(980px,calc(100vw - 80px));
  max-width:none;
  max-height:none;
  opacity:1;
  overflow:visible;
  pointer-events:auto;
  padding:10px 0 16px;
  margin:0;
  background:var(--bg);
  z-index:300;
}
.consulting-drop{
  display:block;
  width:100%;
  text-align:left;
  font-size:16px;
  line-height:1.35;
  font-weight:400;
  color:var(--ink);
  white-space:normal;
}

body.service-menu-open .content{
  opacity:1;
  pointer-events:auto;
}

/* Creative Consulting is a full content takeover on every portfolio view.
   The header/navigation and fixed legal/social row remain visible, while the
   page that was open underneath is fully hidden so nothing can bleed through. */
body.consulting-preview .content{
  opacity:0 !important;
  visibility:hidden;
  pointer-events:none;
}

/* On project / best-of pages the open service row gets 80% more space
   than in v3.0.11 before the heading and intro. */
body.is-project.service-menu-open .content{
  margin-top:129px;
}

/* About mockup intentionally removes the service line, matching page 10. */
body.is-about .service-nav,
body.is-about .service-dropdown{display:none;}

/* ==========================================================
   MAIN / MOODBOARD
   ========================================================== */
.content{
  position:relative;
  z-index:1;
  flex:1;
  margin-top:12px;
  transition:opacity .15s ease;
}

/* v3.0.16: All interior views start 200% farther below the header than before.
   Home keeps the original compact spacing. 12px -> 36px. */
body:not(.is-home) .content{
  margin-top:36px;
}

.moodboard{
  position:relative;
  width:100%;
  height:calc(100vh - 180px);
  min-height:535px;
  max-height:760px;
}

.print-card{
  background:var(--bg);
  border:0;
  outline:0;
  box-shadow:none;
}
.print-card img,
.moodboard-item img,
.bestof-image img,
.about-image img,
.selected-work-image img{
  border:0;
  outline:0;
  box-shadow:none;
}
.print-card::after{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  z-index:2;
  opacity:.16;
  mix-blend-mode:multiply;
  background-image:
    repeating-radial-gradient(circle at 15% 25%, rgba(35,35,35,.13) 0 .45px, transparent .55px 2.5px),
    repeating-linear-gradient(0deg, rgba(244,239,233,.08) 0 1px, rgba(35,35,35,.018) 1px 2px);
}

.moodboard-item{
  position:absolute;
  left:var(--x);
  top:var(--y);
  width:var(--w);
  z-index:var(--z);
  display:block;
  transform:rotate(var(--rot));
  transform-origin:center center;
  transition:transform .22s ease, filter .18s ease;
  cursor:pointer;
  outline:none;
}
.moodboard-item img{
  position:relative;
  z-index:1;
  display:block;
  width:100%;
  height:auto;
  max-height:39vh;
  object-fit:cover;
  filter:grayscale(0) saturate(1.02) contrast(1.03);
  transition:filter .18s ease, opacity .18s ease;
}

.moodboard-item:hover,
.moodboard-item:focus-visible{
  z-index:100 !important;
  transform:rotate(0deg) scale(1.12);
}
.moodboard-item:hover img,
.moodboard-item:focus-visible img{
  filter:grayscale(0) saturate(1.02) contrast(1.03);
}

.moodboard-intro{
  position:absolute;
  z-index:4;
  left:-1.5%;
  bottom:5%;
  width:103%;
  padding:7px 9px 8px;
  background:var(--bg);
  border:1px solid var(--ink);
  border-radius:6px;
  color:var(--ink);
  font-size:13px;
  line-height:1.24;
  font-weight:400;
  text-align:left;
  white-space:pre-line;
  opacity:0;
  transform:translateY(4px);
  transition:opacity .14s ease, transform .16s ease;
  pointer-events:none;
}
.moodboard-item:hover .moodboard-intro,
.moodboard-item:focus-visible .moodboard-intro{
  opacity:1;
  transform:translateY(0);
}

/* Hovering a service only colourises matching project images. */
.moodboard.service-peek .moodboard-item img{
  filter:grayscale(1) contrast(1.05) brightness(.97);
  opacity:.72;
}
.moodboard.service-peek .moodboard-item.service-match img{
  filter:grayscale(0) saturate(1.02) contrast(1.03);
  opacity:1;
}

/* ==========================================================
   BEST-OF PROJECT PAGE
   ========================================================== */
.bestof-page{
  display:grid;
  grid-template-columns:minmax(0,56%) minmax(340px,1fr);
  gap:5vw;
  align-items:start;
  width:100%;
  min-height:600px;
  padding-top:3px;
}
.bestof-copy{padding-left:24px;max-width:820px;}
.bestof-copy h1{
  margin:0 0 13px;
  font-size:17px;
  line-height:1.1;
  font-weight:700;
  text-transform:lowercase;
}
.bestof-intro{
  margin:0;
  max-width:760px;
  font-size:16px;
  line-height:1.34;
  font-weight:400;
  color:var(--ink);
  white-space:pre-line;
}
.bestof-collage{
  position:relative;
  min-height:620px;
  width:100%;
  margin-top:4px;
}
.bestof-image{
  position:absolute;
  overflow:hidden;
}
.bestof-image img{
  position:relative;
  z-index:1;
  display:block;
  width:100%;
  height:100%;
  object-fit:cover;
  filter:grayscale(0) saturate(1.02) contrast(1.02);
}
.bestof-image-1{left:2%;top:0;width:46%;height:330px;transform:rotate(-.5deg);z-index:2;}
.bestof-image-2{right:1%;top:8px;width:45%;height:400px;transform:rotate(.4deg);z-index:3;}
.bestof-image-3{left:31%;top:280px;width:49%;height:390px;transform:rotate(-.2deg);z-index:5;}

/* ==========================================================
   ABOUT
   ========================================================== */
.about-layout{
  display:grid;
  grid-template-columns:minmax(0,1fr) 300px;
  gap:7vw;
  align-items:start;
  width:100%;
  padding-top:12px;
}
.about-copy{max-width:1040px;}
.about-copy p{
  margin:0 0 2px;
  font-size:16px;
  line-height:1.31;
  font-weight:400;
  color:var(--ink);
}
.about-image{
  position:relative;
  width:100%;
  max-width:300px;
  justify-self:end;
  margin-top:4px;
}
.about-image img{
  position:relative;
  z-index:1;
  display:block;
  width:100%;
  height:auto;
  filter:grayscale(1) contrast(1.08);
}

.about-contact-link-wrap{
  width:100%;
  margin-top:22px;
  font-size:15px;
  line-height:1.2;
  font-weight:400;
}
.about-contact-link{
  color:var(--ink);
  font-weight:400;
}
.about-contact-link:hover{color:var(--gray-mid);}

/* ==========================================================
   TEXT / SELECTED WORK
   ========================================================== */
.text-page{max-width:560px;}
.text-page h1{
  font-size:26px;
  font-weight:700;
  line-height:1.05;
  margin:0 0 20px;
}
.text-page p{
  font-size:15px;
  line-height:1.7;
  font-weight:400;
  color:var(--ink);
  margin:0 0 14px;
}
.text-page a.inline-link{color:var(--ink);font-weight:700;border-bottom:1px solid var(--ink);}

.selected-work-page{max-width:1100px;}
.selected-work-page > h1{font-size:26px;line-height:1;font-weight:700;margin:0 0 24px;}
.selected-work-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:34px 24px;}
.selected-work-card{display:block;}
.selected-work-image{position:relative;overflow:hidden;aspect-ratio:4/5;}
.selected-work-image img{position:relative;z-index:1;width:100%;height:100%;display:block;object-fit:cover;}
.selected-work-caption{margin-top:8px;font-size:13px;line-height:1.35;}

/* ==========================================================
   CONTACT - kept from previous version
   ========================================================== */
.contact-form{
  max-width:560px;
  display:flex;
  flex-direction:column;
  gap:14px;
}
.contact-form input,
.contact-form textarea{
  width:100%;
  border:1px solid #d8d8d8;
  background:var(--bg);
  color:var(--ink);
  font-family:inherit;
  font-size:14px;
  padding:9px 10px;
  outline:none;
  text-transform:none;
}
.contact-form input[name="name"],
.contact-form input[name="email"]{text-transform:lowercase;}
.contact-form input:focus,
.contact-form textarea:focus{border-color:var(--ink);}
.contact-form textarea{min-height:180px;resize:vertical;}
.contact-form .submit-btn{
  align-self:flex-start;
  margin-top:4px;
  font-size:15px;
  font-weight:400;
}
.contact-form .submit-btn:hover{color:var(--gray-hover);}
.contact-form .submit-btn:disabled{cursor:default;color:var(--gray-mid);}
.contact-confirmation{
  max-width:560px;
  margin:0;
  font-size:15px;
  line-height:1.7;
  font-weight:400;
  color:var(--ink);
  text-transform:lowercase;
}
.contact-status{
  max-width:560px;
  margin-top:12px;
  font-size:13px;
  line-height:1.5;
  color:var(--gray-mid);
  white-space:pre-line;
}
.direct-email{
  margin:16px 0 0 !important;
  font-size:13px !important;
  color:var(--gray-mid) !important;
}
.direct-email a{color:var(--ink);border-bottom:1px solid transparent;}
.direct-email a:hover{border-color:var(--ink);}

/* ==========================================================
   LEGAL - kept from previous version
   ========================================================== */
.legal-section{margin-bottom:28px;}
.legal-section h2{font-size:18px;margin:0 0 10px;}

/* ==========================================================
   FOOTER / SOCIAL - kept from previous version
   ========================================================== */
.bottom-row{
  display:flex;
  justify-content:flex-end;
  align-items:center;
  gap:1.15px;
  padding-top:20px;
  font-size:15px;
  font-weight:400;
  position:relative;
  z-index:210;
}
.bottom-row > a,
.bottom-row .social-control{
  width:auto;
  text-align:left;
  justify-content:flex-start;
}
.social-control{
  position:relative;
  display:flex;
  align-items:center;
  min-width:0;
  justify-content:flex-start;
}
.social-label{transition:opacity .15s ease;}
.social-actions{
  display:flex;
  gap:10px;
  align-items:center;
  position:absolute;
  left:50%;
  transform:translateX(-50%);
  opacity:0;
  pointer-events:none;
  transition:opacity .15s ease;
}
.social-control:hover .social-label{opacity:0;}
.social-control:hover .social-actions{opacity:1;pointer-events:auto;}
.social-icon{
  width:18px;
  height:18px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  color:var(--ink);
}
.social-icon:hover{color:var(--gray-hover);}
.social-icon svg{
  width:18px;
  height:18px;
  display:block;
  fill:none;
  stroke:currentColor;
  stroke-width:1.7;
  stroke-linecap:round;
  stroke-linejoin:round;
}

/* ==========================================================
   MOBILE / TOUCH
   ========================================================== */
@media (max-width:900px){
  .frame{padding:18px 16px 20px;}
  .site-header{
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
    gap:0 12px;
  }
  .header-left{min-width:0;position:relative;}
.service-menu-zone{position:relative;max-width:calc(100vw - 80px);}
  .logo{
    width:238px;
    max-width:62vw;
    height:42px;
  }
  .top-right{
    padding-top:3px;
    font-size:13px;
  }
  .top-right > a{width:auto;min-width:0;}
  .top-right .sep{margin:0 2px;}

  .service-nav{
    width:calc(100vw - 32px);
    max-width:none;
    overflow-x:auto;
    overflow-y:hidden;
    scrollbar-width:none;
    -webkit-overflow-scrolling:touch;
    margin-top:9px;
    padding-bottom:2px;
    font-size:12.5px;
    gap:3px;
  }
  .service-nav::-webkit-scrollbar{display:none;}
  .service-link:hover{font-weight:400;}
  .service-link.active{font-weight:400;}

  .service-dropdown{
    --dropdown-offset:0px !important;
    margin-left:0 !important;
    width:100%;
    max-width:none;
    padding-left:0;
    font-size:13px;
  }
  .service-dropdown.visible:not(.consulting){margin-top:6px;max-height:110px;}
  .service-project-link{line-height:1.35;padding:1px 0;}
  .service-project-link + .service-project-link::before{margin:0 5px;}
  .service-project-link:hover{font-weight:400;}
  .service-project-link:active{color:var(--ink);font-weight:400;}

  .service-dropdown.consulting{
    position:static;
    width:calc(100vw - 32px);
    max-width:none;
    padding:10px 0 8px;
    margin:0;
    background:var(--bg);
  }
  .consulting-drop{font-size:14px;line-height:1.45;}

  body.is-about .service-nav{display:none;}
  .content{margin-top:12px;}
  body:not(.is-home) .content{margin-top:36px;}
  /* v3.0.16: Open Best-of service rows also move the content 200% farther down. */
  body.is-project.service-menu-open .content{margin-top:123px;}

  .moodboard{
    height:212vw;
    min-height:0;
    max-height:none;
  }
  .moodboard-item{
    left:var(--mx);
    top:var(--my);
    width:var(--mw);
    transform:rotate(var(--mrot));
  }
  .moodboard-item img{max-height:none;filter:grayscale(0) saturate(1.02) contrast(1.03);}
  .moodboard-item:hover,
  .moodboard-item:focus-visible{transform:rotate(var(--mrot));z-index:var(--z) !important;}
  .moodboard-item:hover img,
  .moodboard-item:focus-visible img{filter:grayscale(0) saturate(1.02) contrast(1.03);}
  .moodboard-intro{display:none;}
  .moodboard.service-peek .moodboard-item img{filter:grayscale(1) contrast(1.05) brightness(.97);opacity:.72;}
  .moodboard.service-peek .moodboard-item.service-match img{filter:grayscale(0) saturate(1.02) contrast(1.03);opacity:1;}

  .bestof-page{
    display:block;
    min-height:0;
    padding-top:2px;
  }
  .bestof-copy{padding-left:0;max-width:100%;}
  .bestof-copy h1{font-size:16px;margin-bottom:10px;}
  .bestof-intro{font-size:14px;line-height:1.45;max-width:100%;}
  .bestof-collage{
    width:100%;
    min-height:124vw;
    margin-top:26px;
  }
  .bestof-image-1{left:0;top:0;width:54%;height:64vw;}
  .bestof-image-2{right:0;top:8vw;width:48%;height:72vw;}
  .bestof-image-3{left:23%;top:53vw;width:58%;height:69vw;}

  .about-layout{
    display:flex;
    flex-direction:column;
    gap:26px;
    padding-top:4px;
  }
  .about-copy{max-width:100%;}
  .about-copy p{font-size:14px;line-height:1.45;}
  .about-image{width:64%;max-width:280px;align-self:flex-end;margin-top:0;}

  .text-page{max-width:100%;}
  .text-page h1{font-size:24px;margin-bottom:18px;}
  .text-page p{font-size:14px;line-height:1.65;}
  .selected-work-grid{grid-template-columns:1fr;gap:24px;}

  .contact-form input,
  .contact-form textarea{font-size:16px;}

  .bottom-row{
    grid-template-columns:56px auto 56px;
    padding-top:22px;
    font-size:13px;
  }
  .bottom-row > a,
  .bottom-row .social-control{width:auto;}

  .social-control:hover .social-label{opacity:1;}
  .social-control:hover .social-actions{opacity:0;pointer-events:none;}
  .social-control.open .social-label{opacity:0;}
  .social-control.open .social-actions{opacity:1;pointer-events:auto;}
}

@media (max-width:520px){
  .logo{width:218px;max-width:59vw;}
  .service-nav{font-size:11.8px;}
  .top-right{font-size:12px;}
  .moodboard{height:220vw;}
}


/* v3.0.9 — moodboard images are pure visual teasers, never named/captioned. */
.moodboard .moodboard-intro{display:none!important;}
.moodboard-item.moodboard-unassigned{cursor:default;}
