/* ==========================================================================
   MC Project — mcproject.lv
   Design tokens & styles recreated from the hi-fi prototype
   (design_handoff_mcproject_web/MC Project Web.dc.html)
   ========================================================================== */

:root {
  /* Colors */
  --bg: #faf7f1;
  --bg-alt: #f4eee3;
  --border: #e6ddcf;
  --border-placeholder: #dccfb8;
  --border-outline: #cdbfa8;
  --ink: #2b241d;
  --dark-ui: #3a3128;
  --body: #5c5245;
  --muted: #7a6f5f;
  --muted-2: #6b6152;
  --muted-3: #8a7c66;
  --accent: #a4693a;
  --accent-hover: #8a5730;
  --accent-hover-2: #7c4e28;
  --dark-bg: #2b241d;
  --dark-card: #352d24;
  --dark-border: #4a4033;
  --footer-bg: #241e18;
  --dark-text: #c4b8a4;
  --dark-muted: #a3937c;
  --dark-accent: #d9a878;
  --selection: #e8d9c4;
  --shine: #f6e3c8;

  /* Type */
  --font-heading: 'Archivo', sans-serif;
  --font-body: 'Manrope', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Layout */
  --max-width: 1200px;
  --pad-x: 24px;

  /* Gallery tile placeholder (shows through if an image fails to load) */
  --tile-placeholder: repeating-linear-gradient(45deg, #efe8dd, #efe8dd 10px, #e5dbc9 10px, #e5dbc9 20px);
}

/* ---------- Base ---------- */

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

::selection { background: var(--selection); }

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

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding-left: var(--pad-x);
  padding-right: var(--pad-x);
}

h1, h2, h3, h4 { font-family: var(--font-heading); color: var(--ink); }

h2 {
  margin: 0 0 10px;
  font-weight: 800;
  font-size: 36px;
  letter-spacing: -0.01em;
}

.section-sub {
  margin: 0;
  font-size: 17px;
  color: var(--body);
  max-width: 64ch;
  text-wrap: pretty;
}

.kicker {
  margin: 0 0 16px;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 16px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.btn-primary {
  background: var(--accent);
  color: var(--bg);
  padding: 15px 28px;
  border: none;
}
.btn-primary:hover { background: var(--accent-hover); color: #fff; }

.btn-outline {
  background: transparent;
  color: var(--dark-ui);
  padding: 14px 28px;
  border: 1.5px solid var(--border-outline);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }

.btn-block { display: block; width: 100%; text-align: center; }

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 247, 241, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  padding-top: 14px;
  padding-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.wordmark {
  font-family: var(--font-heading);
  font-style: italic;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0.02em;
  color: var(--dark-ui);
}

.site-nav {
  display: flex;
  gap: 20px;
  margin-left: auto;
  align-items: center;
  flex-wrap: wrap;
}

.site-nav a {
  color: #4d4336;
  font-size: 14px;
  font-weight: 600;
}
.site-nav a:hover { color: var(--accent); }

/* LV / EN segmented toggle */
.lang-toggle {
  display: flex;
  gap: 2px;
  background: #efe8dd;
  border-radius: 8px;
  padding: 3px;
  flex-shrink: 0;
}

.lang-btn {
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 12px;
  padding: 5px 10px;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
}

.lang-btn.active {
  background: var(--dark-ui);
  color: var(--bg);
}

/* Burger (hidden on desktop) */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 10px;
  background: transparent;
  border: 1.5px solid var(--border-outline);
  border-radius: 10px;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  height: 2px;
  border-radius: 2px;
  background: var(--dark-ui);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-open .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
.nav-open .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Hide the logo shine sweep for users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .logo-shine { display: none; }
}

/* ---------- Hero ---------- */

.hero {
  background: linear-gradient(180deg, var(--bg-alt) 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--border);
}

.hero-inner {
  padding-top: 88px;
  padding-bottom: 72px;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 56px;
  align-items: center;
}

.hero h1 {
  margin: 0 0 20px;
  font-weight: 800;
  font-size: 52px;
  line-height: 1.06;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.hero-sub {
  margin: 0 0 32px;
  font-size: 18px;
  line-height: 1.6;
  color: var(--body);
  max-width: 52ch;
  text-wrap: pretty;
}

.hero-ctas {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.hero-stats {
  display: flex;
  gap: 36px;
  margin-top: 44px;
  flex-wrap: wrap;
}

.stat-num {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 30px;
  color: var(--ink);
}

.stat-label {
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}

/* Framed photo panels (hero + about) */
.img-frame {
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border-placeholder);
  background: repeating-linear-gradient(45deg, #efe8dd, #efe8dd 12px, #e6dcca 12px, #e6dcca 24px);
}

.img-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-media { aspect-ratio: 4 / 3.4; }
.about-media { aspect-ratio: 4 / 3; }

/* ---------- Galleries ---------- */

.galleries { padding-top: 72px; }

.galleries-intro { padding-bottom: 8px; }

.gallery-cat { padding: 56px 0; }
.gallery-cat.bg-default { background: var(--bg); }
.gallery-cat.bg-alt { background: var(--bg-alt); }

.cat-head {
  display: flex;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.cat-num {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent);
}

.cat-head h3 {
  margin: 0;
  font-weight: 700;
  font-size: 28px;
}

.cat-desc {
  margin: 0 0 22px;
  font-size: 16px;
  color: var(--body);
  max-width: 66ch;
  text-wrap: pretty;
}

/* Subcategory filter tabs */
.cat-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.tab-btn {
  border: 1.5px solid var(--border-outline);
  cursor: pointer;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 13.5px;
  padding: 9px 18px;
  border-radius: 999px;
  background: transparent;
  color: var(--body);
  min-height: 44px;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.tab-btn:hover { border-color: var(--accent); color: var(--accent); }

.tab-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
}

/* Image grid */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.tile {
  margin: 0;
  aspect-ratio: 4 / 3;
  border-radius: 12px;
  overflow: hidden;
  background: var(--tile-placeholder); /* shows if the photo fails to load */
  border: 1px solid var(--border-placeholder);
  cursor: zoom-in;
  padding: 0;
  display: block;
  width: 100%;
}

.tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.25s ease;
}

.tile:hover img { transform: scale(1.03); }

.tile:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .tile img, .tile:hover img { transition: none; transform: none; }
}

/* ---------- Featured projects (dark) ---------- */

.projects {
  padding: 80px 0;
  background: var(--dark-bg);
}

.projects h2 { color: var(--bg); }

.dark-sub {
  color: var(--dark-text);
  max-width: 62ch;
  margin-bottom: 40px;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.project-card {
  background: var(--dark-card);
  border: 1px solid var(--dark-border);
  border-radius: 14px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.project-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.project-tag {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--dark-accent);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.project-days {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--dark-muted);
  background: var(--dark-bg);
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.project-card h3 {
  margin: 0;
  font-weight: 700;
  font-size: 19px;
  line-height: 1.25;
  color: var(--bg);
  text-wrap: balance;
}

.project-card p {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--dark-text);
  text-wrap: pretty;
}

/* ---------- Process ---------- */

.process {
  padding: 80px 0;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
}

.process h2 { margin-bottom: 40px; }

.process-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
}

.step-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px 18px;
}

.step-num {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 15px;
  color: var(--accent);
  margin-bottom: 10px;
}

.step-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 16.5px;
  color: var(--ink);
  margin-bottom: 6px;
}

.step-desc {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--muted-2);
}

/* ---------- About ---------- */

.about { padding: 80px 0; }

.about-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
}

.about h2 { margin-bottom: 18px; }

.about-p {
  margin: 0 0 16px;
  font-size: 16.5px;
  line-height: 1.7;
  color: var(--body);
  text-wrap: pretty;
}

.about-p.last { margin-bottom: 0; }

/* ---------- Contacts (dark) ---------- */

.contacts {
  padding: 80px 0;
  background: var(--dark-bg);
}

.contacts h2 {
  color: var(--bg);
  margin-bottom: 14px;
}

.contacts-sub {
  margin: 0 0 30px;
  font-size: 16.5px;
  line-height: 1.65;
  color: var(--dark-text);
  text-wrap: pretty;
}

.contacts-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
}

.contact-rows {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.contact-row {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.contact-label {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dark-muted);
}

.contact-value {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 22px;
  color: var(--bg);
}
.contact-value:hover { color: var(--dark-accent); }

.contact-hours {
  font-size: 15.5px;
  color: var(--border);
  font-weight: 600;
}

.contact-legal {
  margin-top: 8px;
  padding-top: 18px;
  border-top: 1px solid var(--dark-border);
  font-size: 14px;
  color: var(--dark-muted);
  line-height: 1.6;
}

/* Message form card */
.form-card {
  background: var(--dark-card);
  border: 1px solid var(--dark-border);
  border-radius: 16px;
  padding: 30px;
}

.form-card h3 {
  margin: 0 0 20px;
  font-weight: 700;
  font-size: 22px;
  color: var(--bg);
}

.form-card form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-card input,
.form-card textarea {
  width: 100%;
  background: var(--dark-bg);
  border: 1px solid var(--dark-border);
  border-radius: 10px;
  padding: 14px 16px;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--bg);
  outline: none;
  min-height: 44px;
}

.form-card textarea { resize: vertical; }

.form-card input::placeholder,
.form-card textarea::placeholder { color: var(--dark-muted); }

.form-card input:focus,
.form-card textarea:focus { border-color: var(--accent); }

.form-card input.invalid,
.form-card textarea.invalid { border-color: #c0563a; }

.form-error {
  margin: 0;
  font-size: 13.5px;
  font-weight: 600;
  color: #e8a58a;
}

/* Thank-you state (shown after a valid submit) */
.form-thanks { text-align: center; padding: 24px 8px; }

.form-thanks-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--accent);
  color: var(--bg);
  font-size: 24px;
  font-weight: 700;
}

.form-thanks h4 {
  margin: 0 0 8px;
  font-weight: 700;
  font-size: 20px;
  color: var(--bg);
}

.form-thanks p {
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
  color: var(--dark-text);
}

/* ---------- Footer ---------- */

.site-footer {
  background: var(--footer-bg);
  padding: 28px 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.footer-wordmark {
  font-family: var(--font-heading);
  font-style: italic;
  font-weight: 700;
  font-size: 14px;
  color: var(--muted-3);
}

.footer-copy {
  font-size: 13px;
  color: var(--muted-2);
}

/* ---------- Lightbox ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(30, 22, 12, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox[hidden] { display: none; }

.lb-stage {
  margin: 0;
  max-width: calc(100vw - 140px);
  max-height: 84vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lb-stage img {
  max-width: 100%;
  max-height: 84vh;
  object-fit: contain;
  border-radius: 6px;
}

.lb-close,
.lb-arrow {
  position: fixed;
  z-index: 101;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(250, 247, 241, 0.1);
  border: 1px solid rgba(250, 247, 241, 0.25);
  border-radius: 999px;
  color: #faf7f1;
  font-size: 20px;
  font-family: var(--font-body);
  cursor: pointer;
  transition: background 0.15s ease;
}

.lb-close:hover,
.lb-arrow:hover { background: rgba(250, 247, 241, 0.22); }

.lb-close { top: 20px; right: 20px; }

.lb-arrow { top: 50%; transform: translateY(-50%); }
.lb-prev { left: 20px; }
.lb-next { right: 20px; }

.lb-counter {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 13px;
  color: #faf7f1;
  background: rgba(250, 247, 241, 0.1);
  border: 1px solid rgba(250, 247, 241, 0.25);
  padding: 6px 14px;
  border-radius: 999px;
}

body.lb-open { overflow: hidden; }

/* ==========================================================================
   Responsive
   ========================================================================== */

/* Tablet */
@media (max-width: 1024px) {
  .hero-inner,
  .about-inner,
  .contacts-inner {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .hero h1 { font-size: 44px; }

  .cat-grid { grid-template-columns: repeat(2, 1fr); }
  .projects-grid { grid-template-columns: repeat(2, 1fr); }
  .process-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Mobile / burger breakpoint */
@media (max-width: 900px) {
  .header-inner { gap: 14px; }

  .nav-toggle { display: flex; }

  /* Collapsed nav: dropdown panel under the header */
  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 8px 24px 16px;
    box-shadow: 0 16px 32px rgba(43, 36, 29, 0.08);
  }

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

  .site-nav a {
    padding: 12px 4px;
    min-height: 44px;
    display: flex;
    align-items: center;
    font-size: 16px;
    border-bottom: 1px solid var(--border);
  }

  .site-nav a:last-child { border-bottom: none; }

  .lang-toggle { margin-left: auto; }

  .lang-btn { padding: 9px 12px; min-height: 38px; }

  .hero-inner { padding-top: 56px; padding-bottom: 48px; }
  .hero h1 { font-size: 36px; }

  h2 { font-size: 30px; }

  .process-grid { grid-template-columns: repeat(2, 1fr); }

  .hero-stats { gap: 24px; }

  .lb-stage { max-width: calc(100vw - 24px); }
  .lb-arrow { top: auto; bottom: 18px; transform: none; }
  .lb-prev { left: 18px; }
  .lb-next { right: 18px; }
  .lb-counter { bottom: 32px; }
}

/* Small mobile */
@media (max-width: 640px) {
  .cat-grid { grid-template-columns: 1fr; }
  .projects-grid { grid-template-columns: 1fr; }
  .process-grid { grid-template-columns: 1fr; }

  .hero h1 { font-size: 32px; }

  .hero-ctas .btn { width: 100%; text-align: center; }

  .form-card { padding: 22px; }

  .galleries { padding-top: 56px; }
  .gallery-cat { padding: 44px 0; }
  .projects, .process, .about, .contacts { padding: 56px 0; }
}
