
:root {
  --background: #e9eaec;
  --surface: #f6f6f7;          
  --text: #0f1012;
  --text-soft: #5d6068;        
  --line: #cfd1d5;             
  --accent: #3a54f0;           
  --accent-text: #ffffff;      
  color-scheme: light;
}

/* Dark theme colors */
:root[data-theme="dark"] {
  --background: #0c0d0f;
  --surface: #15171a;
  --text: #f0f0ee;
  --text-soft: #9a9da5;
  --line: #272a2f;
  --accent: #8a99ff;
  --accent-text: #0c0d0f;
  color-scheme: dark;
}


html[lang="en"] [lang="bs"],
html[lang="bs"] [lang="en"] {
  display: none;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;      
  scroll-padding-top: 90px;      
}

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: "Instrument Sans", system-ui, sans-serif;   
  font-size: 17px;
  line-height: 1.6;
  transition: background 0.25s, color 0.25s;
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 56px);
}

a {
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

h1,
h2,
.logo,
.email-link {
  font-family: Syne, "Instrument Sans", system-ui, sans-serif;
}

h2 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

section {
  padding: 88px 0;
}

.button {
  display: inline-block;
  padding: 13px 26px;
  border-radius: 99px;
  background: var(--accent);
  color: var(--accent-text);
  font-weight: 600;
  text-decoration: none;
}

.button:hover {
  filter: brightness(1.1);
}

.pill-group {
  display: inline-flex;
  flex-wrap: wrap;
  border: 1px solid var(--line);
  border-radius: 99px;
  overflow: hidden;
}

.pill-group button {
  padding: 6px 14px;
  border: 0;
  background: none;
  color: var(--text-soft);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

.pill-group button[aria-pressed="true"] {
  background: var(--text);
  color: var(--background);
}

#scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 70;
  width: 100%;
  height: 3px;
  background: var(--accent);
  transform: scaleX(0);          
  transform-origin: left;
}

[hidden] {
  display: none !important;
}


/* HEADER */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--background);
  border-bottom: 1px solid var(--line);
}

.header-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding-top: 12px;
  padding-bottom: 12px;
}

.logo {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.menu {
  display: flex;
  gap: 6px;
  margin-left: auto;          
}

.menu a {
  padding: 5px 14px;
  border-radius: 99px;
  color: var(--text-soft);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
}

.menu a:hover {
  color: var(--text);
}

.menu a.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--line);
}

.controls {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 12px;
}

.theme-button {
  padding: 6px 11px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: none;
  color: var(--text);
  font: inherit;
  cursor: pointer;
}


/* HERO */
.hero {
  padding: 96px 0 72px;
}

.hero-role {
  margin: 0 0 12px;
  color: var(--text-soft);
  font-weight: 600;
}

#hero-name {
  margin: 0 0 40px;
  font-size: clamp(3.4rem, 13vw, 10.5rem);    
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 0.92;
}

#hero-name .word {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
  padding-bottom: 0.08em;
}

#hero-name .word span {
  display: inline-block;
  transform: translateY(105%);
  animation: slide-up 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
  animation-delay: calc(var(--word-index) * 0.12s);  
}

@keyframes slide-up {
  to { transform: none; }
}

.hero-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.hero-tagline {
  max-width: 22em;
  margin: 0;
  font-size: 1.3rem;
}


/* GALLERY */
.work-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 32px;
}

.gallery {
  columns: 3;
  column-gap: 16px;
}

.item {
  position: relative;
  display: block;
  width: 100%;
  margin: 0 0 16px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: var(--surface);
  overflow: hidden;
  cursor: zoom-in;
  break-inside: avoid;
}

.item img,
.item .placeholder {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;            
}

.item .caption {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  padding: 36px 16px 14px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
  color: #ffffff;
  text-align: left;
  opacity: 0;
  transition: opacity 0.2s;
}

.item:hover .caption,
.item:focus-visible .caption {
  opacity: 1;
}

@media (hover: none) {
  .item .caption {
    opacity: 1;
  }
}

.item .description {
  display: none;
}

.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: linear-gradient(135deg,
              hsl(var(--hue, 220) 30% 32%),
              hsl(calc(var(--hue, 220) + 40) 35% 20%));
  color: #ffffff;
  font-size: 0.85rem;
  text-align: center;
}


/* ABOUT */
.about-layout {
  display: grid;
  grid-template-columns: 5fr 7fr;     
  gap: 64px;
  align-items: start;
}

.portrait {
  aspect-ratio: 4 / 5;
  border-radius: 6px;
  overflow: hidden;
}

.portrait img,
.portrait .placeholder {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.about-text {
  max-width: 32em;
  margin: 20px 0 28px;
  font-size: 1.25rem;
}

.services {
  margin: 0;
  padding: 0;
  list-style: none;
}

.services li {
  padding: 14px 0;
  border-top: 1px solid var(--line);
  font-weight: 600;
}


/* CONTACT */
#contact {
  border-top: 1px solid var(--line);
}

.contact-text {
  margin: 16px 0 28px;
  color: var(--text-soft);
}

.email-link {
  display: inline-block;
  border-bottom: 3px solid var(--accent);
  font-size: clamp(1.5rem, 5.5vw, 3.6rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  text-decoration: none;
  word-break: break-all;
}

.email-link:hover {
  color: var(--accent);
}

.social-links {
  display: flex;
  gap: 24px;
  margin: 28px 0 0;
}

.social-links a {
  font-weight: 600;
}


/* FOOTER */
.site-footer {
  padding: 28px 0;
  border-top: 1px solid var(--line);
  color: var(--text-soft);
  font-size: 0.95rem;
}


/* LIGHTBOX */
dialog#lightbox {
  width: 100%;
  height: 100%;
  max-width: 100vw;
  max-height: 100vh;
  padding: 0;
  border: 0;
  background: transparent;
  color: #ffffff;
}

dialog#lightbox[open] {
  display: flex;
  align-items: center;
  justify-content: center;
}

dialog#lightbox::backdrop {
  background: rgba(6, 7, 9, 0.94);      
}

#lightbox-content {
  max-width: min(88vw, 1200px);
  margin: 0;
  text-align: center;
}

#lightbox-content img {
  max-width: 100%;
  max-height: 80vh;
  border-radius: 4px;
}

#lightbox-content .placeholder {
  width: min(80vw, 720px);
  aspect-ratio: 4 / 3;
}

#lightbox-content figcaption {
  margin-top: 14px;
  color: #c9ccd2;
}

#lightbox-content .title {
  color: #ffffff;
}

.lightbox-button {
  position: absolute;
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  font-size: 1.5rem;
  cursor: pointer;
}

.lightbox-close    { top: 18px; right: 18px; }
.lightbox-previous { top: 50%; left: 14px;  transform: translateY(-50%); }
.lightbox-next     { top: 50%; right: 14px; transform: translateY(-50%); }


/* SMALL SCREENS */
@media (max-width: 900px) {
  .gallery { columns: 2; }               
}

@media (max-width: 860px) {
  html { scroll-padding-top: 110px; }
  section { padding: 64px 0; }

  .logo { margin-right: auto; }

  .menu {
    order: 3;
    flex-basis: 100%;
    margin: 0;
    overflow-x: auto;
  }
  .controls { margin-left: 0; }

  .about-layout {
    grid-template-columns: 1fr;
    gap: 32px;
  }
}

@media (max-width: 560px) {
  .gallery { columns: 1; }               
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  #hero-name .word span {
    animation: none;
    transform: none;
  }
}

/* ---------------------------------------------------------------
   PROJECT VIEW (extra text and photos inside the lightbox)
--------------------------------------------------------------- */

/* Hidden in the gallery, shown only inside the lightbox */
.item .project-text,
.item .project-photos {
  display: none;
}

/* The lightbox content can scroll when the project is long */
#lightbox-content {
  max-height: 92vh;
  overflow-y: auto;
}

/* The longer text under the main photo */
#lightbox-content .project-text {
  display: block;
  max-width: 40em;
  margin: 24px auto 0;
  color: #c9ccd2;
  line-height: 1.7;
  text-align: left;
}

/* The extra photos: 2 columns */
#lightbox-content .more-photos {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  align-items: start;
  margin-top: 28px;
}

#lightbox-content .more-photos img {
  width: 100%;
  height: auto;
  max-height: none;
}

#lightbox-content .more-photos .placeholder {
  width: 100%;
  aspect-ratio: 4 / 3;
}

/* On phones: 1 column */
@media (max-width: 560px) {
  #lightbox-content .more-photos {
    grid-template-columns: 1fr;
  }
}

/* ---------------------------------------------------------------
   PAGE-TO-PAGE ANIMATION
   Lets the browser morph the gallery photo into the project cover.
   (If the browser doesn't support it, nothing breaks.)
--------------------------------------------------------------- */
@view-transition {
  navigation: auto;
}

/* Gallery items are links now, not buttons */
.item {
  text-decoration: none;
  cursor: pointer;
}


/* ---------------------------------------------------------------
   PROJECT PAGE
--------------------------------------------------------------- */
.project-page {
  padding: 64px 0 88px;
}

/* Text slides up softly when the page opens */
.project-page .container > * {
  animation: fade-up 0.7s ease both;
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}

.project-category {
  margin: 0 0 12px;
  color: var(--text-soft);
  font-weight: 600;
}

.project-title {
  margin: 0 0 28px;
  font-size: clamp(2.4rem, 7vw, 5rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
}

.project-intro {
  max-width: 40em;
  margin: 0 0 24px;
  font-size: 1.25rem;
}

.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0 0 56px;
}

/* The photos: one big photo under the other */
.project-images {
  display: grid;
  gap: 20px;
  max-width: 1000px;
}

.project-images img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 6px;
}

.project-images .placeholder {
  width: 100%;
  aspect-ratio: 4 / 5;
}

/* Optional: two photos next to each other */
.project-images.two-columns {
  grid-template-columns: repeat(2, 1fr);
  max-width: none;
}

@media (max-width: 700px) {
  .project-images.two-columns {
    grid-template-columns: 1fr;
  }
}

/* "All work" and "Next project" links at the bottom */
.project-nav {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 72px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.project-nav a {
  font-family: Syne, "Instrument Sans", system-ui, sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  text-decoration: none;
}

.project-nav a:hover {
  color: var(--accent);
}

/* Less motion for visitors who prefer it */
@media (prefers-reduced-motion: reduce) {
  .project-page .container > * {
    animation: none;
  }
}

/* ---------------------------------------------------------------
   GALLERY GRID (replaces the old column layout)
   Every thumbnail has the same shape, rows line up neatly.
--------------------------------------------------------------- */
.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);    /* 3 equal columns on desktop */
  gap: 16px;
}

.gallery .item {
  aspect-ratio: 4 / 5 !important;           /* ✏️ EDIT: thumbnail shape (width / height). 1 / 1 = square, 3 / 4 = a bit taller */
  margin: 0;                                /* the gap above handles the spacing */
}

/* Tablet: 2 columns */
@media (max-width: 900px) {
  .gallery {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Phone: 1 column */
@media (max-width: 560px) {
  .gallery {
    grid-template-columns: 1fr;
  }
}