/* CEDRO clone: layout and motion measured from the reference, written from scratch. */
:root {
  --ink: #484747;
  --black: #000;
  --line: #ccc;
  --bg: #efefef;
  --gutter: 50px;
  --ease: ease-out;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: #fff; color: var(--ink); font-family: "Cormorant Garamond", Georgia, serif; font-size: 20px; line-height: 1.5; }
@media (min-width: 768px) and (max-width: 1024px) { body { font-size: 17px; } }
h1, h2, h3 { margin: 0; font-weight: 400; color: var(--black); font-family: inherit; }
h2 { font-size: 30px; line-height: 1.3; }
p { margin: 0 0 20px; hyphens: auto; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sr-anchor { display: block; height: 0; }
.menu-open { overflow: hidden; }

@keyframes fadeUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } }
/* Owl adds these classes for animateIn/animateOut. */
.owl-carousel .animated { animation-duration: 1000ms; animation-fill-mode: both; }
.owl-carousel .fadeIn { animation-name: fadeIn; }
.owl-carousel .fadeOut { animation-name: fadeOut; }

/* ---------- Header ---------- */
.site-header { position: fixed; top: 0; left: 0; z-index: 999; width: 100%; height: 150px; padding: 50px var(--gutter) 0; display: flex; justify-content: space-between; align-items: center; pointer-events: none; }
.site-header > * { pointer-events: auto; }
.site-header__logo { color: var(--black); transition: all .6s var(--ease); }
.logo-svg { width: 350px; height: auto; display: block; transition: color .6s var(--ease); }
.on-visual .site-header__logo { color: #fff; }
.menu-open .site-header__logo { color: var(--black); }
[data-scroll="down"] .site-header__logo { transform: translateY(-150px); }
.menu-toggle { width: 30px; height: 16px; display: flex; flex-direction: column; justify-content: space-between; }
.menu-toggle span { display: block; width: 30px; height: 2px; background: var(--black); transition: all .6s var(--ease); }
.on-visual .menu-toggle span { background: #fff; }
.scrolled .menu-toggle span, .menu-open .menu-toggle span { background: var(--black); }
.menu-open .menu-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-open .menu-toggle span:nth-child(2) { opacity: 0; }
.menu-open .menu-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Menu panel: image left, list right; items rise in one by one ---------- */
.menu-panel { position: fixed; inset: 0; z-index: 100; display: flex; background: #fff; opacity: 0; visibility: hidden; transition: all .6s var(--ease); }
.menu-open .menu-panel { opacity: 1; visibility: visible; }
.menu-panel__image { width: 50%; }
.menu-panel__image img { width: 100%; height: 100%; object-fit: cover; }
.menu-panel__nav { width: 50%; height: 100vh; padding: 150px; display: flex; justify-content: center; align-content: center; flex-wrap: wrap; }
.menu-list { position: relative; left: 5%; width: 50%; display: flex; flex-direction: column; align-items: flex-start; transition: all .6s var(--ease); }
.menu-list.sub-open { left: 0; }
.menu-list > li { width: 100%; font-size: 30px; opacity: 0; }
.menu-open .menu-list > li { animation: fadeUp 1s forwards; }
.menu-open .menu-list > li:nth-child(1) { animation-delay: .15s; }
.menu-open .menu-list > li:nth-child(2) { animation-delay: .3s; }
.menu-open .menu-list > li:nth-child(3) { animation-delay: .45s; }
.menu-open .menu-list > li:nth-child(4) { animation-delay: .6s; }
.menu-open .menu-list > li:nth-child(5) { animation-delay: .75s; }
.menu-list a { color: var(--black); white-space: nowrap; transition: opacity .6s var(--ease); }
.menu-list a:hover, .menu-list > li.is-active > a { opacity: .5; }
.menu-list .sub li { font-size: 25px; margin-bottom: 10px; }
.menu-list .sub a { opacity: .5; }
.menu-list .sub a:hover { opacity: 1; }
@media (min-width: 1025px) {
  .menu-list .sub { position: absolute; top: 0; left: 75%; width: 100%; opacity: 0; transform: translateX(20px); transition: all .6s var(--ease); pointer-events: none; }
  .menu-list > li:hover .sub { opacity: 1; transform: translateX(0); pointer-events: auto; z-index: 100; }
}
@media (max-width: 1024px) {
  .menu-panel__image { display: none; }
  .menu-panel__nav { width: 100%; height: 100%; overflow: auto; padding: 150px 0; align-items: center; }
  .menu-list { left: 0; width: 100%; align-items: center; text-align: center; }
  .menu-list .sub { max-height: 0; overflow: hidden; transition: max-height .6s var(--ease), margin .6s var(--ease); }
  .menu-list > li.is-active .sub { max-height: 600px; margin: 30px auto; }
  .menu-list > li.is-active > a { opacity: .5; }
}

/* ---------- Blocks ---------- */
.block { position: relative; margin-bottom: 50px; }

/* Hero slideshow: fades in once the page has loaded, then crossfades every 7 s. */
.hero-slides { position: relative; width: 100%; height: 100vh; margin-bottom: 50px; background: var(--bg); }
.hero-slides__carousel { opacity: 0; transition: opacity .6s var(--ease); }
.is-loaded .hero-slides__carousel { opacity: 1; }
.hero-slides__slide { width: 100vw; height: 100vh; }
.hero-slides__slide img { width: 100%; height: 100%; object-fit: cover; }
.hero-slides .owl-nav .owl-prev, .hero-slides .owl-nav .owl-next { position: absolute; top: 0; width: 20%; height: 100%; display: flex; align-items: center; color: #fff; }
.hero-slides .owl-nav .owl-prev { left: 20px; justify-content: flex-start; }
.hero-slides .owl-nav .owl-next { right: 20px; justify-content: flex-end; }
.hero-slides .owl-nav svg { width: 30px; height: 30px; }
.hero-slides .owl-dots { position: absolute; bottom: 50px; left: 0; width: 100%; display: flex; justify-content: center; align-items: center; }
.hero-slides .owl-dot { width: 8px; height: 8px; border-radius: 100%; background: #fff !important; margin: 0 8px; }
.hero-slides .owl-dot.active { background: var(--line) !important; }

/* Text + image */
.text-image__inner { display: flex; flex-wrap: wrap; align-items: center; max-width: 1600px; margin: 0 auto; }
.text-image__media { width: 50%; }
.text-image__media img { display: inline-block; width: 100%; height: auto; } /* inline, like the reference: keeps the 9 px baseline gap */
.text-image__text { width: 50%; padding: 50px; }
.text-image__text h2 { font-size: 40px; margin-bottom: 100px; }
.text-image__body { width: 80%; }
.text-image--reverse .text-image__inner { flex-direction: row-reverse; }
.text-image__text h1 { font-size: 40px; margin-bottom: 100px; font-weight: inherit; }
.text-image__kicker { opacity: .5; }
.page-inner .text-image + .text-image { margin-top: 0; }
.text-image__link a { position: relative; }
.text-image__link a::before { content: ""; position: absolute; bottom: -10px; left: 0; width: 100%; height: 1px; background: var(--line); }

/* Feature video with sound toggle */
.feature-video { width: 100%; padding-top: 41.7%; overflow: hidden; background: #000; }
.feature-video video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.sound { position: absolute; z-index: 10; top: 50px; right: 50px; width: 60px; height: 60px; border-radius: 100%; color: #fff; display: none; align-items: center; justify-content: center; }
.sound svg { width: 20px; height: auto; }
.sound--on { background: rgba(0, 0, 0, .3); }
.sound--off { background: rgba(0, 0, 0, .6); opacity: .5; }
.sound.is-visible { display: flex; }

/* Tiles: items rise in on load, staggered .15 s */
.tiles { position: relative; width: 100%; display: flex; flex-wrap: wrap; padding: 0 calc(var(--gutter) - 20px); }
.tile { position: relative; width: 33.33%; padding: 20px; opacity: 0; animation: fadeUp 1s forwards; }
.tile:nth-child(1) { animation-delay: .15s; } .tile:nth-child(2) { animation-delay: .3s; } .tile:nth-child(3) { animation-delay: .45s; }
.tile:nth-child(4) { animation-delay: .6s; } .tile:nth-child(5) { animation-delay: .75s; } .tile:nth-child(6) { animation-delay: .9s; }
.tile:nth-child(7) { animation-delay: 1.05s; } .tile:nth-child(8) { animation-delay: 1.2s; } .tile:nth-child(9) { animation-delay: 1.35s; }
.tile:nth-child(10) { animation-delay: 1.5s; }
.tiles--two .tile { width: 50%; }
.tiles--one .tile { width: 100%; }
.tile__link { position: absolute; inset: 0; z-index: 2; }
.tile__cover { position: relative; padding-top: 80%; overflow: hidden; }
.tile__cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tiles--one .tile__cover { padding-top: 0; height: 90vh; }
.block.categories { margin-bottom: 0; }

/* Title over a darkened picture: slow push-in and a rising description on hover. */
.tile--overlay .tile__cover { background: #000; }
.tile--overlay .tile__cover img { opacity: .7; transform: scale(1); transition: all 6s var(--ease); }
.tile--overlay:hover .tile__cover img { transform: scale(1.1); }
.tile--overlay .tile__title { position: absolute; z-index: 1; top: 50%; left: 0; right: 0; transform: translateY(-50%); text-align: center; margin: auto; pointer-events: none; }
.tile--overlay .tile__title h2 { color: #fff; }
.tile--overlay .tile__desc { color: #fff; opacity: 0; transform: translateY(10px); transition: all .6s var(--ease); }
.tile--overlay:hover .tile__desc { opacity: 1; transform: translateY(0); }

/* ---------- Category pages ---------- */
.page-category .site-main { padding-top: 150px; }
.cat-nav { position: fixed; top: 150px; left: 0; z-index: 50; width: 100%; padding: 20px var(--gutter); background: #fff; transition: all .6s var(--ease); }
[data-scroll="down"] .cat-nav { opacity: 0; transform: translateY(-50px); }
[data-scroll="up"] .cat-nav { opacity: 1; transform: translateY(0); }
.cat-nav ul { display: flex; justify-content: center; flex-wrap: wrap; }
.cat-nav li { margin: 0 15px; font-size: 20px; line-height: 38px; }
.cat-nav li.is-current a { opacity: .4; }
.cat-nav a:hover { opacity: .5; transition: opacity .6s var(--ease); }
/* Masonry positions items absolutely, so their % widths resolve against the padding box: use margins instead. */
.projects { margin: 100px calc(var(--gutter) - 20px) 0; width: auto; padding: 0; }
.projects__sizer, .projects .tile { width: 33.33%; }
.project .tile__cover { padding-top: 130%; background: #f4f4f4; }
.project:nth-child(3n + 3) .tile__cover { padding-top: 150%; }
.project:nth-child(4n + 1) .tile__cover { padding-top: 120%; }
.project .lq { filter: blur(0); }
.project .hq { opacity: 0; z-index: 1; transition: opacity .6s var(--ease); }
.project .hq.is-loaded { opacity: 1; }
.project__title { margin-top: 10px; }
.project__location { opacity: .6; }

/* ---------- Footer ---------- */
.site-footer { position: relative; margin-top: 100px; padding-top: 50px; border-top: 1px solid var(--line); }
.site-footer__inner { display: flex; flex-direction: column; align-items: center; padding: 0 var(--gutter); }
.site-footer__logo { width: 200px; color: var(--ink); }
.site-footer__logo a, .footer-logo-svg { display: block; }
.footer-logo-svg { width: 200px; height: auto; }
.site-footer__menu { padding: 20px 0; text-align: center; }
.site-footer__menu a:hover { opacity: .5; transition: opacity .6s var(--ease); }
.site-footer__legal { margin: 100px 0 50px; padding: 0 var(--gutter); font-family: "Sen", sans-serif; font-size: 13px; color: #333; opacity: .6; text-align: center; }
.site-footer__legal a { text-decoration: underline; }
.to-top { position: absolute; top: 50px; right: 50px; width: 35px; height: 30px; color: var(--ink); opacity: 0; visibility: hidden; transition: all .6s var(--ease); }
.at-bottom .to-top { opacity: 1; visibility: visible; }

/* White curtain for data-url links (500 ms before the browser navigates). */
.page-curtain { position: fixed; inset: 0; z-index: 2000; background: #fff; opacity: 0; visibility: hidden; transition: opacity .5s var(--ease), visibility .5s var(--ease); }
.page-curtain.is-visible { opacity: 1; visibility: visible; }

/* ---------- Phones ---------- */
@media (max-width: 767px) {
  :root { --gutter: 20px; }
  .site-header { height: 100px; padding: 20px; }
  .site-header__logo { width: 70%; color: var(--black) !important; }
  .logo-svg { width: 100%; }
  .on-visual .menu-toggle span { background: var(--black); }
  .menu-open .site-header__logo { opacity: 0; visibility: hidden; }
  .hero-slides .owl-nav .owl-prev { left: 20px; }
  .hero-slides .owl-nav .owl-next { right: 20px; }
  .hero-slides .owl-nav svg { width: 40px; height: 40px; padding: 10px; border-radius: 100%; background: #000; }
  .text-image__media, .text-image__text, .text-image__body { width: 100%; }
  .text-image__text { padding: 20px; }
  .text-image__text h2 { margin-bottom: 50px; }
  .tiles { padding: 0; }
  .tile, .tiles--two .tile, .projects .tile, .projects__sizer { width: 100%; padding: 0; margin-bottom: 50px; }
  .categories .tile { margin-bottom: 0; }
  .categories .tile__cover { padding-top: 100vh; }
  /* No hover on phones: the push-in and description play when the tile scrolls into view. */
  .tile--overlay .tile__cover img { transform: scale(1); }
  .tile--overlay.in-view .tile__cover img { transform: scale(1.2); transition: transform 7s var(--ease); }
  .tile--overlay.in-view .tile__desc { opacity: 1; transform: none; }
  .tile--overlay .tile__desc { padding: 0 20px; }
  .project__title { padding: 0 20px; }
  .cat-nav { top: 100px; }
  .page-category .site-main { padding-top: 100px; }
  .to-top { position: relative; top: auto; right: auto; display: block; margin: 0 auto 50px; }
}
@media (min-width: 768px) and (max-width: 1024px) {
  .text-image__text h2 { margin-bottom: 50px; }
  .logo-svg { width: 300px; }
}
