/* ===== Portfolio - Studio Berliner ===== */
/* Light theme matching Adobe Portfolio style */
/* Font loaded via <link> in HTML — do not duplicate with @import */

:root {
  --bg-color: #ffffff;
  --text-primary: #333333;
  --text-secondary: #666666;
  --text-heading: #191919;
  --accent-color: #0769e0;
  --border-color: #e5e5e5;
  --nav-height: 80px;
  --content-max-width: 1100px;
  --font-family: 'Source Sans 3', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-color);
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--text-primary);
  text-decoration: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ===== NAVIGATION ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: 0 2rem;
  height: var(--nav-height);
  position: relative;
}

.nav-left a,
.nav-right a {
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: opacity 0.2s;
}

.nav-left a:hover,
.nav-right a:hover {
  opacity: 0.6;
}

.nav-logo {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.nav-logo img {
  height: 40px;
  width: auto;
}

/* ===== HOME PAGE ===== */
.masthead {
  text-align: center;
  padding: 5rem 2rem 3rem;
  max-width: var(--content-max-width);
  margin: 0 auto;
}

.masthead h1 {
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-heading);
  margin-bottom: 0.25rem;
}

.masthead p {
  font-size: 1.1rem;
  color: var(--text-secondary);
  font-weight: 300;
}

/* ===== PROJECT GRID ===== */
.project-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2% 4rem;
}

.project-card {
  display: flex;
  text-decoration: none;
  cursor: pointer;
  height: 450px;
  overflow: hidden;
}

/* Image side (left 60%) */
.project-card .card-image-wrap {
  position: relative;
  width: 60.1%;
  flex-shrink: 0;
  overflow: hidden;
}

.project-card .card-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.project-card .card-image-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  background-color: #191919;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.project-card:hover .card-image-wrap::after {
  opacity: 0.5;
}

/* Details side (right 40%) */
.project-card .card-details {
  width: 40%;
  flex-shrink: 0;
  background: #f2f2f2;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6% 8%;
  transition: background 0.2s ease;
}

.project-card:hover .card-details {
  background: #2a353d;
}

.card-details-inner {
  text-align: center;
}

.card-details-inner h3 {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: 0.5rem;
  transition: color 0.2s ease;
}

.project-card:hover .card-details-inner h3 {
  color: #fff;
}

.card-details-inner p {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 14px;
  font-weight: 400;
  color: var(--text-secondary);
  line-height: 1.5;
  transition: color 0.2s ease;
}

.project-card:hover .card-details-inner p {
  color: #999;
}

/* ===== PROJECT DETAIL PAGE ===== */
.page-header {
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: 4rem 2rem 2rem;
}

.page-header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: 0.75rem;
}

.page-header .description {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 700px;
}

.page-content {
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: 0 2rem 4rem;
}

/* Two-column "tree" layout: heading left, content right */
.module-tree {
  display: flex;
  gap: 2rem;
  margin-bottom: 2.5rem;
  align-items: flex-start;
}

.module-tree .tree-left {
  flex: 0 0 28%;
  min-width: 0;
}

.module-tree .tree-right {
  flex: 1;
  min-width: 0;
}

.module-tree .tree-left h2,
.module-tree .tree-left h3 {
  font-size: 1.25rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--text-heading);
  margin: 0;
  line-height: 1.4;
}

.module-tree .tree-left h3 {
  font-size: 1.1rem;
}

.module-tree .tree-right p,
.module-tree .tree-right div {
  font-size: 1rem;
  color: var(--text-primary);
  line-height: 1.65;
}

.module-tree .tree-right strong {
  font-weight: 600;
}

/* Button / tag row */
.module-buttons {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
  margin-left: calc(28% + 2rem);
}

.module-buttons .btn-tag {
  display: inline-block;
  padding: 0.4rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 2px;
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--text-primary);
  background: transparent;
  cursor: default;
}

/* Text module */
.module-text {
  margin-bottom: 2rem;
  max-width: 800px;
}

.module-text h2 {
  font-size: 1.25rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--text-heading);
  margin-bottom: 0.75rem;
}

.module-text .section-label {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.module-text p {
  margin-bottom: 0.75rem;
}

.module-text strong {
  font-weight: 600;
}

.module-text em {
  font-style: italic;
}

/* Single image module */
.module-image {
  margin-bottom: 4px;
}

/* Restore larger spacing when image is followed by non-image content */
.module-image + .module-text,
.module-image + .module-tree,
.module-image + .module-buttons,
.module-image + .module-video {
  margin-top: 2rem;
}

/* Grid modules also get tight spacing */
.module-grid {
  margin-bottom: 4px;
}

.module-grid + .module-text,
.module-grid + .module-tree,
.module-grid + .module-buttons,
.module-grid + .module-video {
  margin-top: 2rem;
}

.module-image img {
  width: 100%;
  display: block;
}

.module-image.constrained {
  max-width: 600px;
}

.module-image .caption {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 0.5rem;
  text-align: center;
}

/* Video embed module */
.module-video {
  margin-bottom: 2rem;
}

.module-video .video-wrapper {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  max-width: 100%;
}

.module-video .video-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.module-video .video-wrapper--local {
  padding-bottom: 0;
  height: auto;
}

.module-video .video-wrapper--local video {
  width: 100%;
  height: auto;
  display: block;
}

.module-video .video-wrapper--local video::-webkit-media-controls {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.module-video .video-wrapper--local:hover video::-webkit-media-controls {
  opacity: 1;
}

.module-video .caption {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 0.5rem;
  text-align: center;
}

/* Image grid — justified gallery layout */

.grid-layout {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.grid-item {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  line-height: 0;
  height: var(--grid-row-height, 280px);
}

.grid-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s;
}

.grid-item:hover img {
  transform: scale(1.02);
}

.grid-item .grid-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1rem;
  background: linear-gradient(0deg, rgba(0,0,0,0.7) 0%, transparent 100%);
  color: #fff;
  font-size: 0.8rem;
  opacity: 0;
  transition: opacity 0.3s;
}

.grid-item:hover .grid-caption {
  opacity: 1;
}

/* "You may also like" section */
.other-projects {
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: 3rem 2rem;
  border-top: 1px solid var(--border-color);
}

.other-projects h3 {
  font-size: 1rem;
  font-weight: 400;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 2rem;
}

.other-projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.other-project-card {
  text-decoration: none;
  color: var(--text-primary);
}

.other-project-card .cover-wrap {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  margin-bottom: 0.5rem;
  background: #f5f5f5;
}

.other-project-card .cover-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.other-project-card:hover .cover-wrap img {
  transform: scale(1.03);
}

.other-project-card .title {
  font-size: 0.95rem;
  font-weight: 600;
}

/* ===== CONTACT PAGE ===== */
.contact-page {
  max-width: 600px;
  margin: 0 auto;
  padding: 4rem 2rem;
}

.contact-page h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 2rem;
  color: var(--text-heading);
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.contact-form label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

.contact-form input,
.contact-form textarea {
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 0;
  font-family: var(--font-family);
  font-size: 1rem;
  color: var(--text-primary);
  background: #fff;
  transition: border-color 0.2s;
  outline: none;
}

.contact-form input:focus,
.contact-form textarea:focus {
  border-color: var(--accent-color);
}

.contact-form textarea {
  min-height: 150px;
  resize: vertical;
}

.contact-form button {
  align-self: flex-start;
  padding: 0.75rem 2rem;
  background: var(--text-heading);
  color: #fff;
  border: none;
  font-family: var(--font-family);
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: opacity 0.2s;
}

.contact-form button:hover {
  opacity: 0.8;
}

/* ===== FOOTER ===== */
.site-footer {
  padding: 2rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-secondary);
  border-top: 1px solid var(--border-color);
}

/* ===== BACK TO TOP ===== */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 40px;
  height: 40px;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
  cursor: pointer;
  z-index: 50;
}

.back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
}

.back-to-top svg {
  width: 18px;
  height: 18px;
  fill: #fff;
}

/* ===== LIGHTBOX ===== */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
  cursor: pointer;
}

.lightbox-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-overlay img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
}

.lightbox-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  width: 36px;
  height: 36px;
  background: rgba(255,255,255,0.1);
  border: none;
  border-radius: 50%;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 932px) {
  .project-card {
    height: 360px;
  }
}

@media (max-width: 900px) {
  .other-projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .module-tree {
    flex-direction: column;
    gap: 0.5rem;
  }

  .module-tree .tree-left {
    flex: none;
  }

  .module-buttons {
    margin-left: 0;
  }

  .masthead h1 {
    font-size: 2rem;
  }

  .page-header h1 {
    font-size: 2rem;
  }
}

@media (max-width: 600px) {
  .nav-container {
    padding: 0 1rem;
  }

  .nav-logo img {
    height: 30px;
  }

  .masthead {
    padding: 3rem 1rem 2rem;
  }

  .page-header {
    padding: 3rem 1rem 1.5rem;
  }

  .page-content {
    padding: 0 1rem 3rem;
  }

  .other-projects-grid {
    grid-template-columns: 1fr;
  }

  .grid-layout {
    flex-direction: column;
  }

  .grid-item {
    height: auto !important;
    flex-basis: auto !important;
    flex-grow: 0 !important;
  }

  .grid-item img {
    height: auto;
  }
}

@media (max-width: 540px) {
  .project-card {
    flex-direction: column;
    height: auto;
  }

  .project-card .card-image-wrap {
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
  }

  .project-card .card-details {
    width: 100%;
    padding: 8% 6%;
  }

  .card-details-inner h3 {
    font-size: 14px;
  }

  .card-details-inner p {
    font-size: 14px;
  }
}
