/* =========================================================
   Mizar — warm & premium woodworking demo
   Palette: espresso, walnut, caramel, honey, cream
   Type: Fraunces (display) + Manrope (body)
   ========================================================= */

:root {
  --espresso: #1a130c;
  --bark:     #241a10;
  --coffee:   #2e2216;
  --walnut:   #6b4a2c;
  --caramel:  #c08a4b;
  --honey:    #d9a866;
  --sand:     #e7d8be;
  --cream:    #f4ecdd;
  --paper:    #faf5ea;
  --ink:      #221913;

  --txt-on-dark:  #efe3d0;
  --txt-on-dark-2:#b8a488;
  --txt-on-light: #2b2117;
  --txt-on-light-2:#6f6152;

  --maxw: 1280px;
  --pad: clamp(1.25rem, 5vw, 6rem);
  --radius: 4px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --serif: "Fraunces", Georgia, serif;
  --sans: "Manrope", system-ui, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }

body {
  font-family: var(--sans);
  background: var(--espresso);
  color: var(--txt-on-dark);
  font-weight: 400;
  line-height: 1.6;
  overflow-x: hidden;
}

img, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }

/* Lenis */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }

/* ---------- Shared type ---------- */
.h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-optical-sizing: auto;
  font-size: clamp(2.1rem, 5.2vw, 4.2rem);
  line-height: 1.02;
  letter-spacing: -0.01em;
}

.section-label {
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--caramel);
  margin-bottom: 1.1rem;
}

/* ---------- Grain ---------- */
.grain {
  position: fixed;
  inset: -50%;
  z-index: 9998;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 6s steps(6) infinite;
}
@keyframes grain {
  0%,100% { transform: translate(0,0); }
  20% { transform: translate(-4%, 3%); }
  40% { transform: translate(3%, -5%); }
  60% { transform: translate(-3%, 4%); }
  80% { transform: translate(4%, -2%); }
}

/* ---------- Scroll progress ---------- */
.scroll-progress {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 2px;
  z-index: 9999;
  background: rgba(255,255,255,0.06);
}
.scroll-progress span {
  display: block; height: 100%;
  width: var(--p, 0%);
  background: linear-gradient(90deg, var(--caramel), var(--honey));
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 0.5rem;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.01em;
  padding: 0.95rem 1.7rem;
  border-radius: 100px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.5s var(--ease), background 0.4s var(--ease), color 0.4s var(--ease), border-color 0.4s var(--ease);
  will-change: transform;
}
.btn--primary { background: var(--caramel); color: #1c1409; }
.btn--primary:hover { background: var(--honey); transform: translateY(-2px); }
.btn--ghost { border-color: rgba(239,227,208,0.35); color: var(--txt-on-dark); }
.btn--ghost:hover { border-color: var(--honey); color: var(--honey); transform: translateY(-2px); }
.btn--nav { padding: 0.6rem 1.2rem; background: rgba(244,236,221,0.1); color: var(--txt-on-dark); border: 1px solid rgba(244,236,221,0.2); backdrop-filter: blur(6px); }
.btn--nav:hover { background: var(--caramel); color: #1c1409; }
.btn--block { width: 100%; }

/* ---------- Nav ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.4rem var(--pad);
  transition: background 0.5s var(--ease), padding 0.5s var(--ease), box-shadow 0.5s var(--ease);
}
.nav.is-scrolled {
  background: rgba(18,13,8,0.82);
  backdrop-filter: blur(14px);
  padding: 0.9rem var(--pad);
  box-shadow: 0 1px 0 rgba(255,255,255,0.06);
}
.nav__logo { display: flex; align-items: center; gap: 0.6rem; font-family: var(--serif); font-size: 1.4rem; letter-spacing: -0.01em; }
.nav__mark {
  display: grid; place-items: center;
  width: 34px; height: 34px;
  border: 1px solid var(--caramel);
  border-radius: 50%;
  color: var(--honey);
  font-family: var(--serif);
  font-size: 1rem;
}
.nav__name { font-weight: 500; }
.nav__links { display: flex; gap: 2rem; font-size: 0.9rem; font-weight: 500; }
.nav__links a { position: relative; color: var(--txt-on-dark); opacity: 0.85; transition: opacity 0.3s; }
.nav__links a::after {
  content: ""; position: absolute; left: 0; bottom: -4px;
  width: 0; height: 1px; background: var(--honey); transition: width 0.4s var(--ease);
}
.nav__links a:hover { opacity: 1; }
.nav__links a:hover::after { width: 100%; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 0 var(--pad) clamp(3rem, 8vh, 6rem);
  overflow: hidden;
}
.hero__media { position: absolute; inset: 0; z-index: -2; }
.hero__video {
  width: 100%; height: 100%; object-fit: cover;
  transform: scale(1.08);
  will-change: transform;
}
/* Fallback gradient behind video (shows before hero.mp4 exists) */
.hero__media::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(120% 90% at 75% 15%, rgba(217,168,102,0.35), transparent 55%),
    radial-gradient(100% 80% at 20% 90%, rgba(107,74,44,0.6), transparent 60%),
    linear-gradient(160deg, #2a1d11 0%, #1a130c 60%, #120c07 100%);
}
.hero__scrim {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(18,12,7,0.55) 0%, rgba(18,12,7,0.12) 30%, rgba(18,12,7,0.35) 65%, rgba(18,12,7,0.9) 100%);
}
.hero__inner { position: relative; max-width: 62rem; }
.hero__eyebrow {
  font-size: 0.78rem; letter-spacing: 0.3em; text-transform: uppercase;
  color: var(--honey); margin-bottom: 1.5rem; font-weight: 600;
}
.hero__title {
  font-family: var(--serif);
  font-weight: 400;
  font-optical-sizing: auto;
  font-size: clamp(3rem, 11vw, 9rem);
  line-height: 0.92;
  letter-spacing: -0.02em;
  margin-bottom: 1.8rem;
}
.hero__title .line { display: block; overflow: hidden; }
.hero__title .line > span { display: block; }
.hero__title .line:nth-child(2) { color: var(--honey); font-style: italic; font-weight: 300; }
.hero__sub {
  font-size: clamp(1rem, 1.5vw, 1.2rem);
  max-width: 34rem; color: var(--txt-on-dark);
  opacity: 0.9; margin-bottom: 2.4rem;
}
.hero__cta { display: flex; gap: 1rem; flex-wrap: wrap; }
.hero__meta {
  position: absolute; top: 45%; right: var(--pad);
  display: flex; flex-direction: column; gap: 0.6rem; align-items: flex-end;
  font-size: 0.7rem; letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--txt-on-dark-2);
  writing-mode: vertical-rl;
}
.hero__meta span { writing-mode: horizontal-tb; }
.hero__scroll {
  position: absolute; bottom: 2rem; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 0.5rem;
  font-size: 0.65rem; letter-spacing: 0.25em; text-transform: uppercase; color: var(--txt-on-dark-2);
}
.hero__scroll-line { width: 1px; height: 44px; background: linear-gradient(var(--honey), transparent); animation: scrollpulse 2.2s var(--ease) infinite; }
@keyframes scrollpulse { 0% { transform: scaleY(0); transform-origin: top; } 50% { transform: scaleY(1); transform-origin: top; } 51% { transform-origin: bottom; } 100% { transform: scaleY(0); transform-origin: bottom; } }

/* ---------- Marquee ---------- */
.marquee {
  background: var(--caramel); color: #1c1409;
  padding: 1.1rem 0; overflow: hidden; white-space: nowrap;
  border-top: 1px solid rgba(0,0,0,0.1); border-bottom: 1px solid rgba(0,0,0,0.1);
}
.marquee__track { display: inline-flex; gap: 2.5rem; align-items: center; will-change: transform; }
.marquee__track span {
  font-family: var(--serif); font-size: clamp(1.3rem, 3vw, 2.1rem); font-weight: 400; font-style: italic;
}

/* ---------- Manifest ---------- */
.manifest {
  padding: clamp(6rem, 16vh, 12rem) var(--pad);
  max-width: var(--maxw); margin-inline: auto;
}
.manifest__text {
  font-family: var(--serif);
  font-weight: 400; font-optical-sizing: auto;
  font-size: clamp(1.9rem, 4.4vw, 3.6rem);
  line-height: 1.18; letter-spacing: -0.01em;
  max-width: 30ch;
}
.manifest__text .word { display: inline-block; }
.manifest__text .muted { color: var(--txt-on-dark-2); }

/* ---------- Services ---------- */
.services {
  background: var(--cream); color: var(--txt-on-light);
  padding: clamp(5rem, 12vh, 9rem) var(--pad);
  border-radius: 32px 32px 0 0;
}
.services__head { max-width: var(--maxw); margin: 0 auto 3.5rem; }
.services__head .h2 { color: var(--ink); }
.services__list { max-width: var(--maxw); margin-inline: auto; }
.service {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 2rem;
  padding: 2.2rem 0; border-top: 1px solid rgba(43,33,23,0.16);
  transition: padding 0.5s var(--ease);
}
.service:last-child { border-bottom: 1px solid rgba(43,33,23,0.16); }
.service__num { font-family: var(--serif); font-size: 1rem; color: var(--caramel); }
.service__body h3 { font-family: var(--serif); font-weight: 400; font-size: clamp(1.6rem, 3.4vw, 2.6rem); color: var(--ink); line-height: 1; margin-bottom: 0.5rem; transition: transform 0.5s var(--ease); }
.service__body p { color: var(--txt-on-light-2); max-width: 46ch; font-size: 0.98rem; }
.service__plus { font-size: 1.6rem; color: var(--caramel); opacity: 0; transform: translateX(-8px); transition: all 0.5s var(--ease); }
.service:hover { padding-left: 1.2rem; }
.service:hover .service__body h3 { transform: translateX(6px); color: var(--walnut); }
.service:hover .service__plus { opacity: 1; transform: translateX(0) rotate(90deg); }

/* ---------- Work / Gallery ---------- */
.work { background: var(--cream); color: var(--txt-on-light); padding: clamp(2rem,6vh,4rem) var(--pad) clamp(5rem,12vh,9rem); }
.work__head { max-width: var(--maxw); margin: 0 auto 3rem; }
.work__head .h2 { color: var(--ink); }
.gallery {
  max-width: var(--maxw); margin-inline: auto;
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 1.2rem;
}
.gallery__item { position: relative; overflow: hidden; border-radius: var(--radius); grid-column: span 2; }
.gallery__item--tall { grid-column: span 3; grid-row: span 2; }
.gallery__item--wide { grid-column: span 4; }
.gallery__img {
  width: 100%; height: 100%; min-height: 240px;
  background-size: cover; background-position: center;
  transform: scale(1.05); transition: transform 0.9s var(--ease);
  will-change: transform;
}
.gallery__item--tall .gallery__img { min-height: 500px; }
/* Real image on top, gradient as fallback if the file is missing */
.gallery__img[data-img="kuhinja"]  { background-image: url("assets/kuhinja.webp"),  linear-gradient(150deg, #3a2817, #6b4a2c 55%, #b0763b); }
.gallery__img[data-img="miza"]     { background-image: url("assets/miza.webp"),     linear-gradient(150deg, #2e2115, #7a5734 60%, #c79a5d); }
.gallery__img[data-img="omara"]    { background-image: url("assets/omara.webp"),    linear-gradient(150deg, #241a11, #4f3720 55%, #96693a); }
.gallery__img[data-img="stopnice"] { background-image: url("assets/stopnice.webp"), linear-gradient(150deg, #3a2a1a, #8a613a 60%, #d9a866); }
.gallery__img[data-img="detajl"]   { background-image: url("assets/detajl.webp"),   linear-gradient(150deg, #201711, #5e4127 55%, #a97a44); }
.gallery__item:hover .gallery__img { transform: scale(1.12); }
.gallery__item figcaption {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; justify-content: space-between; gap: 1rem;
  padding: 1.1rem 1.2rem;
  background: linear-gradient(transparent, rgba(18,12,7,0.85));
  color: var(--cream); font-size: 0.82rem; letter-spacing: 0.02em;
  transform: translateY(8px); opacity: 0; transition: all 0.5s var(--ease);
}
.gallery__item figcaption span:last-child { color: var(--honey); }
.gallery__item:hover figcaption { transform: translateY(0); opacity: 1; }

/* ---------- Process ---------- */
.process { background: var(--espresso); padding: clamp(5rem,12vh,9rem) 0; overflow: hidden; }
.process__intro { max-width: var(--maxw); margin: 0 auto 3.5rem; padding-inline: var(--pad); }
.process__lead { color: var(--txt-on-dark-2); margin-top: 1rem; }
.process__track {
  display: flex; gap: 1.5rem; padding-inline: var(--pad); width: max-content;
}
.step {
  flex: 0 0 clamp(260px, 34vw, 400px);
  background: var(--bark); border: 1px solid rgba(217,168,102,0.14);
  border-radius: 10px; padding: 2.4rem 2rem; min-height: 300px;
  display: flex; flex-direction: column;
  transition: border-color 0.5s var(--ease), transform 0.5s var(--ease);
}
.step:hover { border-color: rgba(217,168,102,0.5); transform: translateY(-6px); }
.step__num {
  font-family: var(--serif); font-size: 3.4rem; color: var(--caramel);
  line-height: 1; margin-bottom: auto;
}
.step h3 { font-family: var(--serif); font-weight: 400; font-size: 1.9rem; margin: 1.5rem 0 0.7rem; }
.step p { color: var(--txt-on-dark-2); font-size: 0.95rem; }

/* ---------- Material ---------- */
.material {
  display: grid; grid-template-columns: 1fr 1fr; align-items: stretch;
  min-height: 90vh;
}
.material__media { overflow: hidden; }
.material__img {
  width: 100%; height: 100%; min-height: 60vh;
  background-image: url("assets/material.webp"), linear-gradient(140deg, #1f1509, #6b4a2c 55%, #d9a866);
  background-size: cover; background-position: center;
  transform: scale(1.1); will-change: transform;
}
.material__text {
  background: var(--coffee);
  padding: clamp(3rem, 8vw, 7rem) var(--pad);
  display: flex; flex-direction: column; justify-content: center;
}
.material__text p { color: var(--txt-on-dark-2); max-width: 40ch; margin-top: 1.2rem; }
.stats { display: flex; gap: 2.5rem; margin-top: 3rem; flex-wrap: wrap; }
.stat { display: flex; flex-direction: column; }
.stat__num { font-family: var(--serif); font-size: clamp(2.4rem, 5vw, 3.6rem); color: var(--honey); line-height: 1; }
.stat__label { font-size: 0.8rem; letter-spacing: 0.05em; color: var(--txt-on-dark-2); margin-top: 0.4rem; }

/* ---------- Quotes ---------- */
.quotes { padding: clamp(5rem,12vh,9rem) var(--pad); max-width: var(--maxw); margin-inline: auto; }
.quotes__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; margin-top: 2.5rem; }
.quote {
  border: 1px solid rgba(217,168,102,0.16); border-radius: 10px;
  padding: 2rem; background: linear-gradient(180deg, rgba(46,34,22,0.5), rgba(26,19,12,0.2));
}
.quote p { font-family: var(--serif); font-size: 1.25rem; line-height: 1.4; font-style: italic; color: var(--cream); }
.quote cite { display: block; margin-top: 1.4rem; font-style: normal; font-size: 0.82rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--caramel); }

/* ---------- Contact ---------- */
.contact {
  background: var(--paper); color: var(--txt-on-light);
  padding: clamp(5rem,12vh,9rem) var(--pad);
  display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 6vw, 5rem);
  align-items: center; border-radius: 32px 32px 0 0;
}
.contact__title { font-family: var(--serif); font-weight: 400; font-size: clamp(2rem, 4.6vw, 3.4rem); line-height: 1.05; color: var(--ink); margin: 0.5rem 0 1.2rem; }
.contact__lead { color: var(--txt-on-light-2); max-width: 36ch; }
.contact__details { margin-top: 2.4rem; display: flex; flex-direction: column; gap: 0.7rem; font-size: 1.05rem; }
.contact__details a { color: var(--walnut); transition: color 0.3s; width: fit-content; }
.contact__details a:hover { color: var(--caramel); }
.contact__details span { color: var(--txt-on-light-2); font-size: 0.9rem; }
.contact__form { display: flex; flex-direction: column; gap: 1.1rem; }
.field { display: flex; flex-direction: column; gap: 0.4rem; }
.field label { font-size: 0.8rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--txt-on-light-2); font-weight: 600; }
.field input, .field textarea {
  font-family: var(--sans); font-size: 1rem; color: var(--ink);
  background: #fff; border: 1px solid rgba(43,33,23,0.16);
  border-radius: var(--radius); padding: 0.9rem 1rem; resize: vertical;
  transition: border-color 0.3s;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--caramel); }
.contact__note { font-size: 0.85rem; color: var(--txt-on-light-2); text-align: center; }

/* ---------- Footer ---------- */
.footer {
  background: var(--espresso); padding: 3rem var(--pad);
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap;
}
.footer__brand { display: flex; align-items: center; gap: 0.6rem; font-family: var(--serif); font-size: 1.3rem; }
.footer__links { display: flex; gap: 1.6rem; font-size: 0.9rem; }
.footer__links a { color: var(--txt-on-dark-2); transition: color 0.3s; }
.footer__links a:hover { color: var(--honey); }
.footer__legal { color: var(--txt-on-dark-2); font-size: 0.8rem; }

/* ---------- Reveal (JS-driven) ---------- */
.reveal { opacity: 0; transform: translateY(28px); }
.is-in .reveal, .reveal.is-in { }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .nav__links { display: none; }
  .material { grid-template-columns: 1fr; }
  .material__media { min-height: 46vh; }
  .quotes__grid { grid-template-columns: 1fr; }
  .contact { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: repeat(2, 1fr); }
  .gallery__item, .gallery__item--tall, .gallery__item--wide { grid-column: span 2; grid-row: auto; }
  .gallery__item--tall .gallery__img { min-height: 320px; }
  .hero__meta { display: none; }
}
@media (max-width: 540px) {
  .service { grid-template-columns: auto 1fr; }
  .service__plus { display: none; }
  .hero__cta { flex-direction: column; align-items: stretch; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  .reveal { opacity: 1 !important; transform: none !important; }
}
