/* ===== kleyn.ch — Light & Elegant Portfolio ===== */

/* --- Reset & Base --- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #faf9f7;
  --bg-alt: #f3f1ed;
  --text: #2c2c2c;
  --text-light: #6b6b6b;
  --text-muted: #999;
  --accent: #8b7355;
  --accent-hover: #6d5a43;
  --border: #e5e2dc;
  --white: #ffffff;
  --serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --max-width: 1100px;
  --transition: 0.3s ease;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-hover); }

img { max-width: 100%; height: auto; display: block; }

/* --- Typography --- */
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 400; line-height: 1.3; }
h1 { font-size: clamp(2.2rem, 5vw, 3.2rem); }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.2rem); }
h3 { font-size: clamp(1.1rem, 2vw, 1.4rem); }

/* --- Navigation --- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(250, 249, 247, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.nav-logo {
  font-family: var(--serif);
  font-size: 1.3rem;
  color: var(--text);
  letter-spacing: 0.02em;
}

.nav-links { display: flex; gap: 2rem; list-style: none; }

.nav-links a {
  color: var(--text-light);
  font-size: 0.9rem;
  letter-spacing: 0.03em;
  position: relative;
  padding-bottom: 2px;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width var(--transition);
}

.nav-links a:hover, .nav-links a.active {
  color: var(--text);
}

.nav-links a:hover::after, .nav-links a.active::after {
  width: 100%;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  margin: 5px 0;
  transition: var(--transition);
}

/* --- Layout --- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
}

.page-top { padding-top: 120px; }

section { padding: 5rem 0; }

/* --- Hero (Homepage) --- */
.hero {
  min-height: 90vh;
  display: flex;
  align-items: center;
  padding-top: 64px;
}

.hero-content {
  max-width: 680px;
}

.hero-tag {
  font-size: 0.85rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.2rem;
}

.hero h1 {
  margin-bottom: 1.5rem;
  color: var(--text);
}

.hero p {
  font-size: 1.1rem;
  color: var(--text-light);
  max-width: 540px;
  margin-bottom: 2.5rem;
}

.btn {
  display: inline-block;
  padding: 0.8rem 2rem;
  font-size: 0.9rem;
  letter-spacing: 0.06em;
  border: 1px solid var(--accent);
  color: var(--accent);
  border-radius: 2px;
  transition: all var(--transition);
}

.btn:hover {
  background: var(--accent);
  color: var(--white);
}

.btn-filled {
  background: var(--accent);
  color: var(--white);
}

.btn-filled:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: var(--white);
}

/* --- Section Headers --- */
.section-header {
  text-align: center;
  margin-bottom: 3.5rem;
}

.section-header h2 {
  margin-bottom: 0.8rem;
}

.section-header p {
  color: var(--text-light);
  max-width: 520px;
  margin: 0 auto;
}

.section-line {
  width: 40px;
  height: 1px;
  background: var(--accent);
  margin: 1rem auto 0;
}

/* --- Project Cards --- */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
}

.project-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.06);
}

.project-card-img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  background: var(--bg-alt);
}

.project-card-body {
  padding: 1.5rem;
}

.project-card-tag {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.6rem;
}

.project-card-body h3 {
  margin-bottom: 0.6rem;
}

.project-card-body p {
  color: var(--text-light);
  font-size: 0.92rem;
  margin-bottom: 1.2rem;
}

.project-card-link {
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  font-weight: 500;
}

.project-card-link::after {
  content: ' \2192';
  transition: margin-left var(--transition);
}

.project-card-link:hover::after {
  margin-left: 4px;
}

/* --- Gallery Grid --- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.2rem;
}

.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: 4px;
  aspect-ratio: 1;
  background: var(--bg-alt);
  cursor: pointer;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.gallery-item:hover img {
  transform: scale(1.05);
}

.gallery-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.6) 0%, transparent 50%);
  opacity: 0;
  transition: opacity var(--transition);
  display: flex;
  align-items: flex-end;
  padding: 1.2rem;
}

.gallery-item:hover .gallery-overlay {
  opacity: 1;
}

.gallery-overlay h4 {
  color: #fff;
  font-size: 1rem;
}

.gallery-overlay span {
  color: rgba(255,255,255,0.7);
  font-size: 0.82rem;
}

/* --- Featured Strip (Homepage) --- */
.featured-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 2rem;
}

.featured-strip-item {
  position: relative;
  aspect-ratio: 4/3;
  overflow: hidden;
  border-radius: 4px;
  background: var(--bg-alt);
}

.featured-strip-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.featured-strip-item:hover img {
  transform: scale(1.04);
}

/* --- Values Section --- */
.values-section {
  padding: 5rem 0;
  background: var(--bg);
}

.values-grid {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2.5rem;
  max-width: 720px;
  margin: 0 auto;
}

.values-item {
  width: 100%;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
  transition: transform var(--transition), box-shadow var(--transition);
}

.values-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

.values-item img {
  width: 100%;
  height: auto;
  display: block;
}

@media (max-width: 768px) {
  .values-grid {
    gap: 1.5rem;
  }
}

/* --- About Page --- */
.about-layout {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 4rem;
  align-items: start;
}

.about-photo {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
  border-radius: 4px;
  background: var(--bg-alt);
}

.about-text h2 { margin-bottom: 1.2rem; }
.about-text p { color: var(--text-light); margin-bottom: 1.2rem; }

.about-details {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.about-detail-item h4 {
  font-family: var(--sans);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
  font-weight: 500;
}

.about-detail-item p {
  color: var(--text);
  margin-bottom: 0;
  font-size: 0.95rem;
}

/* --- Contact Section --- */
.contact-section {
  background: var(--bg-alt);
  border-radius: 6px;
  padding: 3.5rem;
  text-align: center;
  margin-top: 3rem;
}

.contact-section h2 { margin-bottom: 0.8rem; }

.contact-section p {
  color: var(--text-light);
  margin-bottom: 2rem;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

.contact-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.contact-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.2rem;
  border: 1px solid var(--border);
  border-radius: 3px;
  font-size: 0.9rem;
  color: var(--text);
  transition: all var(--transition);
}

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

/* --- Footer --- */
.footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  margin-top: 4rem;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-text {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  gap: 1.2rem;
  list-style: none;
}

.footer-links a {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer-links a:hover { color: var(--accent); }

/* --- Lightbox --- */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,0.9);
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.lightbox.active { display: flex; }

.lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 4px;
}

.lightbox-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  color: #fff;
  font-size: 1.5rem;
  background: none;
  border: none;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity var(--transition);
}

.lightbox-close:hover { opacity: 1; }

/* --- Responsive --- */
@media (max-width: 768px) {
  .nav-toggle { display: block; }

  .nav-links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: rgba(250, 249, 247, 0.98);
    backdrop-filter: blur(12px);
    flex-direction: column;
    padding: 1.5rem 2rem;
    gap: 1rem;
    border-bottom: 1px solid var(--border);
  }

  .nav-links.open { display: flex; }

  .hero { min-height: 70vh; }
  .hero-content { max-width: 100%; }

  .about-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .about-details { grid-template-columns: 1fr; }

  .featured-strip {
    grid-template-columns: 1fr;
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }

  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }

  .contact-section { padding: 2rem 1.5rem; }

  .footer-inner {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
}

/* --- Page Transitions --- */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}
