@font-face {
  font-family: "Favorit";
  src: url("/assets/fonts/FavoritPro-Book.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Favorit";
  src: url("/assets/fonts/FavoritPro-BookItalic.otf") format("opentype");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Favorit";
  src: url("/assets/fonts/FavoritPro-Medium.otf") format("opentype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root{
  --bg:#f6f5f0;
  --fg:#111111;
  --muted:#6b7280;
  --link:#111111;
  --border:rgba(0,0,0,.08);
  --gap:4rem;
  --ff-body:"Favorit",system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial,sans-serif;
  --ff-title:"Favorit",system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial,sans-serif;
  --ff-brand:"Favorit",system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial,sans-serif;
}
.theme-dark{
  --bg:#090808;
  --fg:#f3f4f6;
  --muted:#9ca3af;
  --link:#f3f4f6;
  --border:rgba(255,255,255,.12);
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family:var(--ff-body);
  font-weight:400;
  background:var(--bg);
  color:var(--fg);
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
}
h1,h2,h3{font-family:var(--ff-title);font-weight:600}
.brand{font-family:var(--ff-brand);font-weight:600}
strong,b{font-weight:600}
a{color:var(--link);text-decoration:none}
img{max-width:100%;display:block}
em,i{font-style:italic}

/* Header */
.site-header{
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  background: var(--bg);
  will-change: transform;
}

.site-main{
  padding-top: 55px;
}

.nav{
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto 1fr; /* left | center | right */
  align-items: center;
  gap: 1rem; /* optional */
  padding: 16px;
}
.nav-left  { 
  justify-self: start;   
  display: flex;
  align-items: baseline;   /* key */
  gap: .5rem;              /* optional */ 
}
.nav-center{ justify-self: center; text-align: center; }
.nav-right { justify-self: end; }

.nav-hover{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
  font-size: 1.2rem;}
.brand{letter-spacing:.8px;
  text-transform: uppercase;
  font-size: 1.2rem;
  line-height: 1;}
.about-link{letter-spacing:.8px;
  text-transform: uppercase;
  font-size: 1.2rem;
  font-weight: 600;}
.theme-toggle{background:transparent;border:none;border-radius:999px;cursor:pointer}

.theme-toggle {   
  display: inline-flex;    /* prevents weird inline baseline gaps */
  align-items: center;
  padding: 0;
  border: 0;
  background: none;
  line-height: 1;          /* important if the button inherits a taller line-height */ 
  color:var(--fg) }
.theme-toggle .icon { width:28px; height:28px; line-height:0; display:inline-block }
.theme-toggle .icon svg { width:100%; height:100%; display:block; fill:currentColor }

.theme-toggle svg{
  display: block;          /* removes descender/inline whitespace weirdness */
  width: 1em;
  height: 1em;
  transform: translateY(2px);
}

.pf-topbar .theme-toggle svg{
  transform: translateY(0px); 
}

.theme-toggle .icon-circle { display:none }
.theme-dark .theme-toggle .icon-moon { display:none }
.theme-dark .theme-toggle .icon-circle { display:inline-block }

/* Filters */
.filters{width:100%;margin-bottom:1rem;padding:0 1rem;display:flex;gap:.5rem;flex-wrap:wrap;justify-content:center}
.filter-btn{background:transparent;border:0;padding:.4rem .7rem;border-radius:999px;cursor:pointer;transition:transform .08s ease}
.filter-btn:active{transform:scale(.98)}
.filter-btn.is-active{text-decoration:underline}

.filter-btn {
  appearance:none; -webkit-appearance:none;
  color:var(--fg);
  -webkit-tap-highlight-color: transparent;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}
.theme-dark .filter-btn { color:var(--fg) }
.filters a.filter-btn { color:var(--fg); text-decoration:none }
.filters a.filter-btn.is-active,
.filter-btn.is-active { text-decoration: underline }

/* Grid */
.grid{
  width:100%;
  margin:0 0 3rem;
  padding:0 4rem;
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:var(--gap);
  grid-auto-flow:row dense;
}
@media (max-width:1000px){.grid{grid-template-columns:repeat(3,1fr)}}
@media (max-width:700px){.grid{grid-template-columns:repeat(2,1fr);padding:0 1rem}}
@media (max-width:460px){.grid{grid-template-columns:1fr}}
.project-card{position:relative;background:transparent;border:0;border-radius:0}
.project-card.span-2{grid-column:span 2}
@media (max-width:700px){.project-card.span-2{grid-column:span 1}}
.card-link{display:block;color:inherit}
.card-img{width:100%;height:auto;object-fit:contain;display:block;background:transparent;border:0;border-radius:0}

/* Footer */
.site-footer{padding:2rem 1rem;background:var(--bg)}
.footer-inner{width:100%;}
.about h2{margin:0 0 .5rem}
.contact{list-style:none;padding:0;margin:1rem 0 0;display:grid;gap:.25rem}

/* Project viewer – desktop */
.project-full{position:fixed;inset:0;display:grid;grid-template-columns:420px 1fr}
@media (max-width:900px){.project-full{grid-template-columns:1fr}}
.pf-left{
  position:relative;
  padding:24px;
  background:var(--bg);
  display:flex;
  flex-direction:column;
}
.pf-topbar{
  position: absolute;
  top: 16px;
  left: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.pf-left-content{margin-top:auto}
.pf-back{
  position: relative; /* override older absolute if present */
  background: transparent;
  border: none;
  padding: 0;
  color: inherit;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
  font-size: 1.2rem;
}
.pf-title{margin:2.5rem 0 .5rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
  font-size: 1.2rem;}
.pf-meta{list-style:none;padding:0;margin:0 0 1rem;color:var(--fg);line-height:1.4;
  font-size: .95rem;}
.pf-meta li{margin-bottom:.25rem}
.pf-meta-line{margin:0 0 1rem}
.pf-text,.pf-credits{line-height:1.4;
  font-size: .95rem;}
.pf-count{margin:0;font-size:.95rem;color:var(--fg)}
.pf-bottom{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:12px}
.slider-nav{position:static;display:flex;align-items:center;gap:8px;pointer-events:auto;padding:0}
.nav-btn{color: var(--fg);border:0;background:transparent;padding:0;border-radius:0;cursor:pointer;font-size:18px;line-height:1}
.nav-btn[disabled]{opacity:.4;cursor:default}

.pf-right{position:relative;background:var(--bg);overflow:hidden;padding:0}
.slider{position:absolute;inset:0;display:flex;width:100%;height:100%;transition:none;will-change:transform}
.slide{
  flex:0 0 100%;
  display:flex;
  align-items:center;
  justify-content:flex-end;
  box-sizing:border-box;
  padding:16px 16px 16px 0;
  overflow:hidden;
  margin:0;
}
.pf-right .slide img{
  width:100%;
  height:100%;
  max-width:none;
  max-height:none;
  object-fit:contain;
  object-position:right bottom;
}

/* Project viewer – mobile */
@media (max-width:900px){
  html,body{height:auto}
  .nav-hover{display:none}
  .project-full{position:static;min-height:auto}
  .pf-left{padding:16px}
  .pf-topbar {top:0; left:0;}
  .pf-back{position:static;display:inline-block;padding:16px}
  .pf-left-content {padding-top:55px;}
  .pf-title{margin-top:16px}
  .pf-bottom{margin-top:10px}
  .slider-nav{display:none}
  .pf-right{padding:0 16px 24px;overflow:visible}
  .slider{position:static;inset:auto;display:block;width:auto;height:auto;transform:none!important}
  .slide{display:block;padding:16px 0;margin:0;overflow:visible}
  .pf-right .slide img{width:100%;height:auto;max-width:100%;max-height:none;object-fit:contain;display:block}
  .pf-back-bottom{display:block;margin:12px 0 0;text-align:right;text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
  font-size: 1.2rem;};
  .nav {
      grid-template-columns: 2fr auto 1fr;
  }
}
@media (min-width:901px){.pf-back-bottom{display:none}}

.pf-bottom{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:12px}
.pf-nav{display:flex;align-items:center;gap:12px}
.pf-count{margin:0;font-size:.95rem;color:var(--fg)}
.theme-toggle{display:inline-flex;align-items:center;justify-content:center;gap:.4rem;color:var(--fg)}
.theme-toggle .icon{width:18px;height:18px;line-height:0;display:inline-block}
.theme-toggle .icon svg{width:100%;height:100%;display:block;fill:currentColor}
.theme-toggle .icon-circle{display:none}
.theme-dark .theme-toggle .icon-moon{display:none}
.theme-dark .theme-toggle .icon-circle{display:inline-block}

@media (max-width:900px){
  .pf-nav .nav-btn{display:none}
}
.footer-inner{width:100%}
.footer-grid{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:6rem;
}
.footer-section h3{margin:.25rem 0 .5rem}
.footer-text{line-height:1.4}

.footer-bottom{
  display:flex;
  justify-content:flex-end;
  padding: 16px;
}
.back-to-top{color:var(--link);
  letter-spacing: .8px;
  text-transform: uppercase;
  font-size: 1.2rem;
  font-weight: 600;}

@media (max-width:900px){
  .footer-grid{grid-template-columns:1fr; gap:1.25rem}
  .footer-bottom{justify-content:flex-start}
}
